@antv/g 6.0.15-alpha.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +8 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +51 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +11 -8
- package/{dist → types}/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -0
package/dist/index.umd.min.js
CHANGED
|
@@ -1,2 +1,52 @@
|
|
|
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";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+n+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=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},r.apply(this,arguments)};function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function o(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function a(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&i[3]>s[1])){a.label=s[1];break}if(6===s[0]&&i[1]>a.label){a.label=i[1],i=s;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function c(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;o>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var l={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(l);var h=l.exports,p=1e-6,f="undefined"!=typeof Float32Array?Float32Array:Array;function d(){var t=new f(9);return f!=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 y(){var t=new f(16);return f!=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 v(t){var e=new f(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 m(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 g(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,y,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=y,t[15]=v,t}function x(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 b(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function E(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],m=e[15],g=n*s-r*a,x=n*u-i*a,b=n*c-o*a,E=r*u-i*s,T=r*c-o*s,M=i*c-o*u,P=l*y-h*d,S=l*v-p*d,w=l*m-f*d,N=h*v-p*y,k=h*m-f*y,C=p*m-f*v,A=g*C-x*k+b*N+E*w-T*S+M*P;return A?(t[0]=(s*C-u*k+c*N)*(A=1/A),t[1]=(i*k-r*C-o*N)*A,t[2]=(y*M-v*T+m*E)*A,t[3]=(p*T-h*M-f*E)*A,t[4]=(u*w-a*C-c*S)*A,t[5]=(n*C-i*w+o*S)*A,t[6]=(v*b-d*M-m*x)*A,t[7]=(l*M-p*b+f*x)*A,t[8]=(a*k-s*w+c*P)*A,t[9]=(r*w-n*k-o*P)*A,t[10]=(d*T-y*b+m*g)*A,t[11]=(h*b-l*T-f*g)*A,t[12]=(s*S-a*N-u*P)*A,t[13]=(n*N-r*S+i*P)*A,t[14]=(y*x-d*E-v*g)*A,t[15]=(l*E-h*x+p*g)*A,t):null}function T(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];return(e*a-n*o)*(h*v-p*y)-(e*s-r*o)*(l*v-p*d)+(e*u-i*o)*(l*y-h*d)+(n*s-r*a)*(c*v-p*f)-(n*u-i*a)*(c*y-h*f)+(r*u-i*s)*(c*d-l*f)}function M(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],m=e[14],g=e[15],x=n[0],b=n[1],E=n[2],T=n[3];return t[0]=x*r+b*s+E*h+T*y,t[1]=x*i+b*u+E*p+T*v,t[2]=x*o+b*c+E*f+T*m,t[3]=x*a+b*l+E*d+T*g,t[4]=(x=n[4])*r+(b=n[5])*s+(E=n[6])*h+(T=n[7])*y,t[5]=x*i+b*u+E*p+T*v,t[6]=x*o+b*c+E*f+T*m,t[7]=x*a+b*l+E*d+T*g,t[8]=(x=n[8])*r+(b=n[9])*s+(E=n[10])*h+(T=n[11])*y,t[9]=x*i+b*u+E*p+T*v,t[10]=x*o+b*c+E*f+T*m,t[11]=x*a+b*l+E*d+T*g,t[12]=(x=n[12])*r+(b=n[13])*s+(E=n[14])*h+(T=n[15])*y,t[13]=x*i+b*u+E*p+T*v,t[14]=x*o+b*c+E*f+T*m,t[15]=x*a+b*l+E*d+T*g,t}function P(t,e,n){var r,i,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*m+e[12],t[13]=e[1]*y+e[5]*v+e[9]*m+e[13],t[14]=e[2]*y+e[6]*v+e[10]*m+e[14],t[15]=e[3]*y+e[7]*v+e[11]*m+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*m+e[12],t[13]=i*y+u*v+p*m+e[13],t[14]=o*y+c*v+f*m+e[14],t[15]=a*y+l*v+d*m+e[15]),t}function S(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}function w(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-p*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+p*i,t}function N(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 k(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}function C(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return p>c?null:(a*=c=1/c,s*=c,u*=c,r=Math.sin(e),t[0]=a*a*(o=1-(i=Math.cos(e)))+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function A(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}function R(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}function O(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}function L(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,p=r*c,f=i*u,d=i*c,y=o*c,v=a*s,m=a*u,g=a*c;return t[0]=1-(f+y),t[1]=h+g,t[2]=p-m,t[3]=0,t[4]=h-g,t[5]=1-(l+y),t[6]=d+v,t[7]=0,t[8]=p+m,t[9]=d-v,t[10]=1-(l+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function I(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function D(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function _(t,e){var n=new f(3);D(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,p=e[8]*r,d=e[9]*i,y=e[10]*o,v=a+l+y,m=0;return v>0?(t[3]=.25*(m=2*Math.sqrt(v+1)),t[0]=(h-d)/m,t[1]=(p-u)/m,t[2]=(s-c)/m):a>l&&a>y?(t[3]=(h-d)/(m=2*Math.sqrt(1+a-l-y)),t[0]=.25*m,t[1]=(s+c)/m,t[2]=(p+u)/m):l>y?(t[3]=(p-u)/(m=2*Math.sqrt(1+l-a-y)),t[0]=(s+c)/m,t[1]=.25*m,t[2]=(h+d)/m):(t[3]=(s-c)/(m=2*Math.sqrt(1+y-a-l)),t[0]=(p+u)/m,t[1]=(h+d)/m,t[2]=.25*m),t}function F(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,m=s*h,g=u*c,x=u*l,b=u*h,E=r[0],T=r[1],M=r[2],P=i[0],S=i[1],w=i[2],N=(1-(y+m))*E,k=(f+b)*E,C=(d-x)*E,A=(f-b)*T,R=(1-(p+m))*T,O=(v+g)*T,L=(d+x)*M,I=(v-g)*M,D=(1-(p+y))*M;return t[0]=N,t[1]=k,t[2]=C,t[3]=0,t[4]=A,t[5]=R,t[6]=O,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+P-(N*P+A*S+L*w),t[13]=n[1]+S-(k*P+R*S+I*w),t[14]=n[2]+w-(C*P+O*S+D*w),t[15]=1,t}function G(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,m=o*u;return t[0]=1-h-d,t[1]=l+m,t[2]=p-v,t[3]=0,t[4]=l-m,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function U(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function B(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=B;function j(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t}function Y(t,e,n,r){var i,o,a,s,u,c,l,h,f,d,y=e[0],v=e[1],m=e[2],g=r[0],b=r[1],E=r[2],T=n[0],M=n[1],P=n[2];return p>Math.abs(y-T)&&p>Math.abs(v-M)&&p>Math.abs(m-P)?x(t):(d=1/Math.hypot(l=y-T,h=v-M,f=m-P),(d=Math.hypot(i=b*(f*=d)-E*(h*=d),o=E*(l*=d)-g*f,a=g*h-b*l))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),(d=Math.hypot(s=h*a-f*o,u=f*i-l*a,c=l*o-h*i))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*y+o*v+a*m),t[13]=-(s*y+u*v+c*m),t[14]=-(l*y+h*v+f*m),t[15]=1,t)}function X(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 H=M,z=Object.freeze({__proto__:null,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},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],m=e[15];return t[0]=s*(p*m-f*v)-h*(u*m-c*v)+y*(u*f-c*p),t[1]=-(r*(p*m-f*v)-h*(i*m-o*v)+y*(i*f-o*p)),t[2]=r*(u*m-c*v)-s*(i*m-o*v)+y*(i*c-o*u),t[3]=-(r*(u*f-c*p)-s*(i*f-o*p)+h*(i*c-o*u)),t[4]=-(a*(p*m-f*v)-l*(u*m-c*v)+d*(u*f-c*p)),t[5]=n*(p*m-f*v)-l*(i*m-o*v)+d*(i*f-o*p),t[6]=-(n*(u*m-c*v)-a*(i*m-o*v)+d*(i*c-o*u)),t[7]=n*(u*f-c*p)-a*(i*f-o*p)+l*(i*c-o*u),t[8]=a*(h*m-f*y)-l*(s*m-c*y)+d*(s*f-c*h),t[9]=-(n*(h*m-f*y)-l*(r*m-o*y)+d*(r*f-o*h)),t[10]=n*(s*m-c*y)-a*(r*m-o*y)+d*(r*c-o*s),t[11]=-(n*(s*f-c*h)-a*(r*f-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*v-p*y)-l*(s*v-u*y)+d*(s*p-u*h)),t[13]=n*(h*v-p*y)-l*(r*v-i*y)+d*(r*p-i*h),t[14]=-(n*(s*v-u*y)-a*(r*v-i*y)+d*(r*u-i*s)),t[15]=n*(s*p-u*h)-a*(r*p-i*h)+l*(r*u-i*s),t},clone:v,copy:m,create:y,determinant:T,equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],d=t[11],y=t[12],v=t[13],m=t[14],g=t[15],x=e[0],b=e[1],E=e[2],T=e[3],M=e[4],P=e[5],S=e[6],w=e[7],N=e[8],k=e[9],C=e[10],A=e[11],R=e[12],O=e[13],L=e[14],I=e[15];return!(Math.abs(n-x)>p*Math.max(1,Math.abs(n),Math.abs(x))||Math.abs(r-b)>p*Math.max(1,Math.abs(r),Math.abs(b))||Math.abs(i-E)>p*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(o-T)>p*Math.max(1,Math.abs(o),Math.abs(T))||Math.abs(a-M)>p*Math.max(1,Math.abs(a),Math.abs(M))||Math.abs(s-P)>p*Math.max(1,Math.abs(s),Math.abs(P))||Math.abs(u-S)>p*Math.max(1,Math.abs(u),Math.abs(S))||Math.abs(c-w)>p*Math.max(1,Math.abs(c),Math.abs(w))||Math.abs(l-N)>p*Math.max(1,Math.abs(l),Math.abs(N))||Math.abs(h-k)>p*Math.max(1,Math.abs(h),Math.abs(k))||Math.abs(f-C)>p*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(d-A)>p*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(y-R)>p*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(v-O)>p*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(m-L)>p*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(g-I)>p*Math.max(1,Math.abs(g),Math.abs(I)))},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]},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])},fromQuat:G,fromQuat2:function(t,e){var n=new f(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+l*r+u*o-c*i)/h,n[1]=2*(u*a+l*i+c*r-s*o)/h,n[2]=2*(c*a+l*o+s*i-u*r)/h):(n[0]=2*(s*a+l*r+u*o-c*i),n[1]=2*(u*a+l*i+c*r-s*o),n[2]=2*(c*a+l*o+s*i-u*r)),L(t,e,n),t},fromRotation:C,fromRotationTranslation:L,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,p=i*c,f=i*l,d=o*c,y=o*l,v=a*l,m=s*u,g=s*c,x=s*l,b=r[0],E=r[1],T=r[2];return t[0]=(1-(d+v))*b,t[1]=(p+x)*b,t[2]=(f-g)*b,t[3]=0,t[4]=(p-x)*E,t[5]=(1-(h+v))*E,t[6]=(y+m)*E,t[7]=0,t[8]=(f+g)*T,t[9]=(y-m)*T,t[10]=(1-(h+d))*T,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:F,fromScaling:k,fromTranslation:N,fromValues:function(t,e,n,r,i,o,a,s,u,c,l,h,p,d,y,v){var m=new f(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=u,m[9]=c,m[10]=l,m[11]=h,m[12]=p,m[13]=d,m[14]=y,m[15]=v,m},fromXRotation:A,fromYRotation:R,fromZRotation:O,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},getRotation:_,getScaling:D,getTranslation:I,identity:x,invert:E,lookAt:Y,mul:H,multiply:M,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},ortho:V,orthoNO:B,orthoZO:j,perspective:U,perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},perspectiveNO:U,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},rotate:function(t,e,n,r){var i,o,a,s,u,c,l,h,f,d,y,v,m,g,x,b,E,T,M,P,S,w,N,k,C=r[0],A=r[1],R=r[2],O=Math.hypot(C,A,R);return p>O?null:(C*=O=1/O,A*=O,R*=O,i=Math.sin(n),u=e[1],c=e[2],l=e[3],f=e[5],d=e[6],y=e[7],m=e[9],g=e[10],x=e[11],M=C*A*(a=1-(o=Math.cos(n)))-R*i,P=A*A*a+o,S=R*A*a+C*i,w=C*R*a+A*i,N=A*R*a-C*i,k=R*R*a+o,t[0]=(s=e[0])*(b=C*C*a+o)+(h=e[4])*(E=A*C*a+R*i)+(v=e[8])*(T=R*C*a-A*i),t[1]=u*b+f*E+m*T,t[2]=c*b+d*E+g*T,t[3]=l*b+y*E+x*T,t[4]=s*M+h*P+v*S,t[5]=u*M+f*P+m*S,t[6]=c*M+d*P+g*S,t[7]=l*M+y*P+x*S,t[8]=s*w+h*N+v*k,t[9]=u*w+f*N+m*k,t[10]=c*w+d*N+g*k,t[11]=l*w+y*N+x*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:S,rotateY:w,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},scale:function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},set:g,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]+")"},sub:X,subtract:X,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],p=a-n[2],f=l*l+h*h+p*p;f>0&&(l*=f=1/Math.sqrt(f),h*=f,p*=f);var d=u*p-c*h,y=c*l-s*p,v=s*h-u*l;return(f=d*d+y*y+v*v)>0&&(d*=f=1/Math.sqrt(f),y*=f,v*=f),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=h*v-p*y,t[5]=p*d-l*v,t[6]=l*y-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},translate:P,transpose:b});function W(){var t=new f(3);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function q(t){var e=new f(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Z(t){return Math.hypot(t[0],t[1],t[2])}function K(t,e,n){var r=new f(3);return r[0]=t,r[1]=e,r[2]=n,r}function $(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Q(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function J(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function tt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function et(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function nt(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function rt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function it(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function ot(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function at(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function st(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return p*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&p*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&p*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var ut=tt,ct=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},lt=Z;function ht(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function pt(t,e,n,r){var i=new f(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ft(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function dt(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function yt(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 vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function mt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function gt(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}W(),function(){var t=ht()}();var xt=pt,bt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Et=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Tt=vt,Mt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};function Pt(){var t=new f(2);return f!=Float32Array&&(t[0]=0,t[1]=0),t}function St(t){return"function"==typeof t}function wt(t){return null==t}function Nt(t){return Array.isArray(t)}W(),K(1,0,0),K(0,1,0),dt(),dt(),d(),function(){var t=Pt()}();var kt={}.toString,Ct=function(t,e){return kt.call(t)==="[object "+e+"]"};function At(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;e>r;r++)n=Math.max(n,t[r]);return n}var Rt=function(t){if(Nt(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};function Ot(t){return"string"==typeof t}var Lt=function(t,e,n){return e>t?e:t>n?n:t};function It(t){return"number"==typeof t}var Dt=1e-5;function _t(t,e,n){return void 0===n&&(n=Dt),t===e||n>Math.abs(t-e)}var Ft=function(t,e){return(t%e+e)%e},Gt=function(t){return Ct(t,"Boolean")},Ut=function(t){return void 0===t},Bt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Vt(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 jt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Yt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return jt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Xt(t){return Yt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Ht(t){return Xt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function zt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=jt[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,jt[n]))),jt[n]););}function Wt(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 "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function qt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Zt(t){return t>=48&&57>=t}function Kt(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),Zt(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Zt(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;n>o&&Zt(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;Zt(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid float exponent'));if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Zt(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid integer exponent'));for(;n>o&&Zt(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" is not a number');else t.err="[path-util]: Invalid path value at index ".concat(o,', "pathValue" is missing param')}function $t(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 Qt(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=jt[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,$t(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Kt(t):Wt(t),t.err.length)return;t.data.push(t.param),$t(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,$t(t))}if(t.index>=t.max)break;if(!qt(n.charCodeAt(t.index)))break}zt(t)}else zt(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var Jt=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 te(t){if(Xt(t))return[].concat(t);var e=function(t){if(Yt(t))return[].concat(t);var e=new Jt(t);for($t(e);e.max>e.index&&!e.err.length;)Qt(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function ee(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,p=2*i-e.qy;e.qx=h,e.qy=p,u=["Q",h,p].concat(s)}else if("Q"===n){var f=s[1];e.qx=s[0],e.qy=f}return u}function ne(t){if(Ht(t))return[].concat(t);for(var e=te(t),n=r({},Bt),i=0;e.length>i;i+=1){e[i]=ee(e[i],n);var o=e[i],a=o.length;n.x1=+o[a-2],n.y1=+o[a-1],n.x2=+o[a-4]||n.x1,n.y2=+o[a-3]||n.y1}return e}function re(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function ie(t,e,n,r,i,o,a,s,u,c){var l,h,p,f,d,y=t,v=e,m=n,g=r,x=s,b=u,E=120*Math.PI/180,T=Math.PI/180*(+i||0),M=[];if(c)h=c[0],p=c[1],f=c[2],d=c[3];else{v=(l=re(y,v,-T)).y;var P=((y=l.x)-(x=(l=re(x,b,-T)).x))/2,S=(v-(b=l.y))/2,w=P*P/(m*m)+S*S/(g*g);w>1&&(m*=w=Math.sqrt(w),g*=w);var N=m*m,k=g*g,C=(o===a?-1:1)*Math.sqrt(Math.abs((N*k-N*S*S-k*P*P)/(N*S*S+k*P*P)));f=C*m*S/g+(y+x)/2,h=Math.asin(((v-(d=C*-g*P/m+(v+b)/2))/g*1e9>>0)/1e9),p=Math.asin(((b-d)/g*1e9>>0)/1e9),0>(h=f>y?Math.PI-h:h)&&(h=2*Math.PI+h),0>(p=f>x?Math.PI-p:p)&&(p=2*Math.PI+p),a&&h>p&&(h-=2*Math.PI),!a&&p>h&&(p-=2*Math.PI)}var A=p-h;if(Math.abs(A)>E){var R=p,O=x,L=b;M=ie(x=f+m*Math.cos(p=h+E*(a&&p>h?1:-1)),b=d+g*Math.sin(p),m,g,i,0,a,O,L,[p,R,f,d])}A=p-h;var I=Math.cos(h),D=Math.sin(h),_=Math.cos(p),F=Math.sin(p),G=Math.tan(A/4),U=4/3*m*G,B=4/3*g*G,V=[y,v],j=[y+U*D,v-B*I],Y=[x+U*F,b-B*_],X=[x,b];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],c)return j.concat(Y,X,M);for(var H=[],z=0,W=(M=j.concat(Y,X,M)).length;W>z;z+=1)H[z]=z%2?re(M[z-1],M[z],T).y:re(M[z],M[z+1],T).x;return H}function oe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var ae=function(t,e,n,r){return c(c([],oe([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function se(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],p=l[1],f=e.x1,d=e.y1,y=e.x,v=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=p,t;case"A":return n=[f,d].concat(l),["C"].concat(ie(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=p,n=[f,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(ae(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(ae(f,d,y,v))}return t}function ue(t,e){if(void 0===e&&(e=!1),function(t){return Ht(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var i,o,a=ne(t),s=r({},Bt),u=[],c="",l=a.length,h=[],p=0;l>p;p+=1){a[p]&&(c=a[p][0]),u[p]=c;var f=se(a[p],s);a[p]=f,Vt(a,u,p),l=a.length,"Z"===c&&h.push(p),s.x1=+(i=a[p])[(o=i.length)-2],s.y1=+i[o-1],s.x2=+i[o-4]||s.x1,s.y2=+i[o-3]||s.y1}return e?[a,h]:a}function ce(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function le(t,e,n,r,i){var o=ce([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=oe([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function he(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function pe(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,p=Math.cos,f=Math.sqrt,d=Math.PI,y=l(n),v=l(r),m=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return le(t,e,s,u,c).point;var g=(t-s)/2,x=(e-u)/2,b={x:p(m)*g+h(m)*x,y:-h(m)*g+p(m)*x},E=Math.pow(b.x,2)/Math.pow(y,2)+Math.pow(b.y,2)/Math.pow(v,2);E>1&&(y*=f(E),v*=f(E));var T=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(b.y,2)-Math.pow(v,2)*Math.pow(b.x,2))/(Math.pow(y,2)*Math.pow(b.y,2)+Math.pow(v,2)*Math.pow(b.x,2)),M=(o!==a?1:-1)*f(T=0>T?0:T),P=M*(y*b.y/v),S=M*(-v*b.x/y),w=p(m)*P-h(m)*S+(t+s)/2,N=h(m)*P+p(m)*S+(e+u)/2,k={x:(b.x-P)/y,y:(b.y-S)/v},C=he({x:1,y:0},k),A=he(k,{x:(-b.x-P)/y,y:(-b.y-S)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var R=C+(A%=2*d)*c,O=y*p(R),L=v*h(R);return{x:p(m)*O-h(m)*L+w,y:h(m)*O+p(m)*L+N}}function fe(t,e,n,r,i,o,a,s,u,c,l){var h,p=l.bbox,f=void 0===p||p,d=l.length,y=void 0===d||d,v=l.sampleSize,m=void 0===v?30:v,g="number"==typeof c,x=t,b=e,E=0,T=[x,b,E],M=[x,b],P={x:0,y:0},S=[{x:x,y:b}];g&&0>=c&&(P={x:x,y:b});for(var w=0;m>=w;w+=1){if(x=(h=pe(t,e,n,r,i,o,a,s,u,w/m)).x,b=h.y,f&&S.push({x:x,y:b}),y&&(E+=ce(M,[x,b])),M=[x,b],g&&E>=c&&c>T[2]){var N=(E-c)/(E-T[2]);P={x:M[0]*(1-N)+T[0]*N,y:M[1]*(1-N)+T[1]*N}}T=[x,b,E]}return g&&c>=E&&(P={x:s,y:u}),{length:E,point:P,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 de(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function ye(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,p=void 0===h||h,f=c.length,d=void 0===f||f,y=c.sampleSize,v=void 0===y?10:y,m="number"==typeof u,g=t,x=e,b=0,E=[g,x,b],T=[g,x],M={x:0,y:0},P=[{x:g,y:x}];m&&0>=u&&(M={x:g,y:x});for(var S=0;v>=S;S+=1){if(g=(l=de(t,e,n,r,i,o,a,s,S/v)).x,x=l.y,p&&P.push({x:g,y:x}),d&&(b+=ce(T,[g,x])),T=[g,x],m&&b>=u&&u>E[2]){var w=(b-u)/(b-E[2]);M={x:T[0]*(1-w)+E[0]*w,y:T[1]*(1-w)+E[1]*w}}E=[g,x,b]}return m&&u>=b&&(M={x:a,y:s}),{length:b,point:M,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 ve(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function me(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,p=void 0===h||h,f=s.sampleSize,d=void 0===f?10:f,y="number"==typeof a,v=t,m=e,g=0,x=[v,m,g],b=[v,m],E={x:0,y:0},T=[{x:v,y:m}];y&&0>=a&&(E={x:v,y:m});for(var M=0;d>=M;M+=1){if(v=(u=ve(t,e,n,r,i,o,M/d)).x,m=u.y,l&&T.push({x:v,y:m}),p&&(g+=ce(b,[v,m])),b=[v,m],y&&g>=a&&a>x[2]){var P=(g-a)/(g-x[2]);E={x:b[0]*(1-P)+x[0]*P,y:b[1]*(1-P)+x[1]*P}}x=[v,m,g]}return y&&a>=g&&(E={x:i,y:o}),{length:g,point:E,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 ge(t,e,n){for(var r,i,o,a,s,u,c,l,h,p=ne(t),f="number"==typeof e,d=[],y=0,v=0,m=0,g=0,x=[],b=[],E=0,T={x:0,y:0},M=T,P=T,S=T,w=0,N=0,k=p.length;k>N;N+=1)d=(c="M"===(l=(h=p[N])[0]))?d:[y,v].concat(h.slice(1)),c?(M=T={x:m=h[1],y:g=h[2]},E=0,f&&.001>e&&(S=T)):"L"===l?(E=(r=le(d[0],d[1],d[2],d[3],(e||0)-w)).length,T=r.min,M=r.max,P=r.point):"A"===l?(E=(i=fe(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-w,n||{})).length,T=i.min,M=i.max,P=i.point):"C"===l?(E=(o=ye(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-w,n||{})).length,T=o.min,M=o.max,P=o.point):"Q"===l?(E=(a=me(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-w,n||{})).length,T=a.min,M=a.max,P=a.point):"Z"===l&&(E=(s=le((d=[y,v,m,g])[0],d[1],d[2],d[3],(e||0)-w)).length,T=s.min,M=s.max,P=s.point),f&&e>w&&w+E>=e&&(S=P),b.push(M),x.push(T),w+=E,y=(u="Z"!==l?h.slice(-2):[m,g])[0],v=u[1];return f&&e>=w&&(S={x:y,y:v}),{length:w,point:S,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,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}function xe(t){return function(t){var e=0,n=0,r=0;return ue(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,p,f=t.slice(1);return r=3*(((p=f[5])-(a=n))*((s=f[0])+(c=f[2]))-((h=f[4])-(o=e))*((u=f[1])+(l=f[3]))+u*(o-c)-s*(a-l)+p*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function be(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?ye(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=oe(n,r,e),s=oe(r,i,e),u=oe(i,o,e),c=oe(a,s,e),l=oe(s,u,e),h=oe(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Ee(t,e,n){var r=be(t),i=be(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:Ee(y[0],y[1],h)}function Te(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Me(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pe(){}var Se=.7,we=1/Se,Ne="\\s*([+-]?\\d+)\\s*",ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ce="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ae=/^#([0-9a-f]{3,8})$/,Re=RegExp(`^rgb\\(${Ne},${Ne},${Ne}\\)$`),Oe=RegExp(`^rgb\\(${Ce},${Ce},${Ce}\\)$`),Le=RegExp(`^rgba\\(${Ne},${Ne},${Ne},${ke}\\)$`),Ie=RegExp(`^rgba\\(${Ce},${Ce},${Ce},${ke}\\)$`),De=RegExp(`^hsl\\(${ke},${Ce},${Ce}\\)$`),_e=RegExp(`^hsla\\(${ke},${Ce},${Ce},${ke}\\)$`),Fe={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 Ge(){return this.rgb().formatHex()}function Ue(){return this.rgb().formatRgb()}function Be(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ae.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ve(e):3===n?new Ye(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?je(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?je(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Re.exec(t))?new Ye(e[1],e[2],e[3],1):(e=Oe.exec(t))?new Ye(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Le.exec(t))?je(e[1],e[2],e[3],e[4]):(e=Ie.exec(t))?je(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=De.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=_e.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Fe.hasOwnProperty(t)?Ve(Fe[t]):"transparent"===t?new Ye(NaN,NaN,NaN,0):null}function Ve(t){return new Ye(t>>16&255,t>>8&255,255&t,1)}function je(t,e,n,r){return r>0||(t=e=n=NaN),new Ye(t,e,n,r)}function Ye(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Xe(){return`#${qe(this.r)}${qe(this.g)}${qe(this.b)}`}function He(){const t=ze(this.opacity);return`${1===t?"rgb(":"rgba("}${We(this.r)}, ${We(this.g)}, ${We(this.b)}${1===t?")":`, ${t})`}`}function ze(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function We(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function qe(t){return(16>(t=We(t))?"0":"")+t.toString(16)}function Ze(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new $e(t,e,n,r)}function Ke(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof Pe||(t=Be(t)),!t)return new $e;if(t instanceof $e)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new $e(a,s,u,t.opacity)}function $e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Qe(t){return 0>(t=(t||0)%360)?t+360:t}function Je(t){return Math.max(0,Math.min(1,t||0))}function tn(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function en(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function nn(t,e){var n=Math.min.apply(Math,c([],u(t),!1)),r=Math.min.apply(Math,c([],u(e),!1));return{x:n,y:r,width:Math.max.apply(Math,c([],u(t),!1))-n,height:Math.max.apply(Math,c([],u(e),!1))-r}}function rn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function on(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function an(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var p=s+h;a>o?p>o&&a>p&&l.push(p):p>a&&o>p&&l.push(p)}for(h=0;l.length>h;h++){var f=rn(t,0,n,r,i,l[h]);u>f&&(u=f),f>c&&(c=f)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,v=-1/0,m=[o,a];for(h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var g=d+h;a>o?g>o&&a>g&&m.push(g):g>a&&o>g&&m.push(g)}for(h=0;m.length>h;h++){var x=on(0,e,n,r,i,m[h]);y>x&&(y=x),x>v&&(v=x)}return{x:u,y:y,width:c-u,height:v-y}}function sn(t,e,n,r){return en(t,e,n,r)}function un(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function cn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function ln(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(_t(s,0))_t(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;_t(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function hn(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=ln(t,n,i,a),h=ln(e,r,o,s),p=0;l.length>p;p++)u.push(cn(t,n,i,a,l[p]));for(p=0;h.length>p;p++)c.push(cn(e,r,o,s,h[p]));return nn(u,c)}function pn(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=en(r[0],r[1],i[0],i[1])}return e}(t)}function fn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function dn(t,e,n){var r=t+n-2*e;if(_t(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function yn(t,e,n,r,i,o){var a=dn(t,n,i)[0],s=dn(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(fn(t,n,i,a)),void 0!==s&&c.push(fn(e,r,o,s)),nn(u,c)}Te(Pe,Be,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ge,formatHex:Ge,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ke(this).formatHsl()},formatRgb:Ue,toString:Ue}),Te(Ye,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Pe||(i=Be(i)),i?new Ye((i=i.rgb()).r,i.g,i.b,i.opacity):new Ye):new Ye(t,e,n,null==r?1:r);var i}),Me(Pe,{brighter(t){return new Ye(this.r*(t=null==t?we:Math.pow(we,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new Ye(this.r*(t=null==t?Se:Math.pow(Se,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ye(We(this.r),We(this.g),We(this.b),ze(this.opacity))},displayable(){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:Xe,formatHex:Xe,formatHex8:function(){return`#${qe(this.r)}${qe(this.g)}${qe(this.b)}${qe(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:He,toString:He})),Te($e,(function(t,e,n,r){return 1===arguments.length?Ke(t):new $e(t,e,n,null==r?1:r)}),Me(Pe,{brighter(t){return new $e(this.h,this.s,this.l*(t=null==t?we:Math.pow(we,t)),this.opacity)},darker(t){return new $e(this.h,this.s,this.l*(t=null==t?Se:Math.pow(Se,t)),this.opacity)},rgb(){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 Ye(tn(240>t?t+120:t-240,r,n),tn(t,r,n),tn(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new $e(Qe(this.h),Je(this.s),Je(this.l),ze(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=ze(this.opacity);return`${1===t?"hsl(":"hsla("}${Qe(this.h)}, ${100*Je(this.s)}%, ${100*Je(this.l)}%${1===t?")":`, ${t})`}`}}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var vn={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var p=t[r],f=i,d=o;for(n(t,i,r),a(t[o],p)>0&&n(t,i,o);d>f;){for(n(t,f,d),f++,d--;0>a(t[f],p);)f++;for(;a(t[d],p)>0;)d--}0===a(t[i],p)?n(t,i,d):n(t,++d,o),d>r||(i=d+1),r>d||(o=d-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 o(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 a(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 o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}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 c(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(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 d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function v(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,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.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(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):y(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||y(t,o))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,a=this.data,s=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),a.leaf){var l=o(t,a.children,e);if(-1!==l)return a.children.splice(l,1),u.push(a),this._condense(u),this}i||a.leaf||!y(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.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,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=m(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=m([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),c=u*Math.ceil(Math.sqrt(s));g(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);g(t,l,h,u,this.compareMinY);for(var p=l;h>=p;p+=u)i.children.push(this._build(t,p,Math.min(p+u-1,h),r-1))}return a(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,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],c=h(u),l=f(t,u)-c;o>l?(o=l,i=i>c?c:i,a=u):l===o&&i>c&&(i=c,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,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 o=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(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,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),c=s(t,a,n,this.toBBox),l=d(u,c),p=h(u)+h(c);i>l?(i=l,r=a,o=o>p?p:o):l===i&&o>p&&(o=p,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),c=p(o)+p(a),l=e;n-e>l;l++){var h=t.children[l];u(o,t.leaf?i(h):h),c+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];u(a,t.leaf?i(d):d),c+=p(a)}return c},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():a(t[e],this.toBBox)},i}()}(vn);var mn,gn,xn=vn.exports;t.Shape=void 0,(mn=t.Shape||(t.Shape={})).GROUP="g",mn.FRAGMENT="fragment",mn.CIRCLE="circle",mn.ELLIPSE="ellipse",mn.IMAGE="image",mn.RECT="rect",mn.LINE="line",mn.POLYLINE="polyline",mn.POLYGON="polygon",mn.TEXT="text",mn.PATH="path",mn.HTML="html",mn.MESH="mesh",t.ClipSpaceNearZ=void 0,(gn=t.ClipSpaceNearZ||(t.ClipSpaceNearZ={}))[gn.ZERO=0]="ZERO",gn[gn.NEGATIVE_ONE=1]="NEGATIVE_ONE";var bn,En=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.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}(),Tn=function(){function e(e){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.plugins=[],this.config=r({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},e)}return e.prototype.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}(),Mn=J,Pn=$,Sn=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},wn=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},Nn=et,kn=ut,Cn=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){Pn(this.center,t),Pn(this.halfExtents,e),kn(this.min,this.center,this.halfExtents),Mn(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Mn(this.center,e,t),Nn(this.center,this.center,.5),kn(this.halfExtents,e,t),Nn(this.halfExtents,this.halfExtents,.5),Pn(this.min,t),Pn(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,p=i-u,f=i+u,d=o-c,y=o+c,v=e.center,m=v[0],g=v[1],x=v[2],b=e.halfExtents,E=b[0],T=b[1],M=b[2],P=m-E,S=m+E,w=g-T,N=g+T,k=x-M,C=x+M;l>P&&(l=P),S>h&&(h=S),p>w&&(p=w),N>f&&(f=N),d>k&&(d=k),C>y&&(y=C),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),m=Math.abs(u),g=Math.abs(c),x=Math.abs(l),b=Math.abs(h),E=Math.abs(p),T=Math.abs(f),M=Math.abs(d);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+c*i[0]+l*i[1]+h*i[2],n[2]=e[14]+p*i[0]+f*i[1]+d*i[2],r[0]=y*o[0]+v*o[1]+m*o[2],r[1]=g*o[0]+x*o[1]+b*o[2],r[2]=E*o[0]+T*o[1]+M*o[2],kn(this.min,n,r),Mn(this.max,n,r)},t.prototype.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])},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=Sn([0,0,0],this.getMin(),e.getMin()),i=wn([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Pn([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]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Pn([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}(),An=function(){function t(t,e){this.distance=t||0,this.normal=e||K(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return rt(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/lt(this.normal);et(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&ot(n,t,e,i),o},t}();t.Mask=void 0,(bn=t.Mask||(t.Mask={}))[bn.OUTSIDE=4294967295]="OUTSIDE",bn[bn.INSIDE=0]="INSIDE",bn[bn.INDETERMINATE=2147483647]="INDETERMINATE";var Rn=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new An)}return t.prototype.extractFromVPMatrix=function(t){var e=u(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],m=e[14],g=e[15];Q(this.planes[0].normal,o-n,l-a,d-h),this.planes[0].distance=g-y,Q(this.planes[1].normal,o+n,l+a,d+h),this.planes[1].distance=g+y,Q(this.planes[2].normal,o+r,l+s,d+p),this.planes[2].distance=g+v,Q(this.planes[3].normal,o-r,l-s,d-p),this.planes[3].distance=g-v,Q(this.planes[4].normal,o-i,l-c,d-f),this.planes[4].distance=g-m,Q(this.planes[5].normal,o+i,l+c,d+f),this.planes[5].distance=g+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),On=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}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Ln=function(){function t(t,e,n,r){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.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.applyTransform=function(e,n){var r=pt(e.x,e.y,0,1),i=pt(e.x+e.width,e.y,0,1),o=pt(e.x,e.y+e.height,0,1),a=pt(e.x+e.width,e.y+e.height,0,1),s=ht(),u=ht(),c=ht(),l=ht();ft(s,r,n),ft(u,i,n),ft(c,o,n),ft(l,a,n);var h=Math.min(s[0],u[0],c[0],l[0]),p=Math.min(s[1],u[1],c[1],l[1]);return t.fromRect({x:h,y:p,width:Math.max(s[0],u[0],c[0],l[0])-h,height:Math.max(s[1],u[1],c[1],l[1])-p})},t.prototype.toJSON=function(){},t}(),In="Method not implemented.",Dn="Use document.documentElement instead.";function _n(t){return void 0===t?0:t>360||-360>t?t%360:t}var Fn=W();function Gn(t,e,n,r){return void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=!0),Array.isArray(t)&&3===t.length?r?q(t):$(Fn,t):It(t)?r?K(t,e,n):Q(Fn,t,e,n):r?K(t[0],t[1]||e,t[2]||n):Q(Fn,t[0],t[1]||e,t[2]||n)}var Un=Math.PI/180;function Bn(t){return t*Un}var Vn=180/Math.PI;function jn(t){return t*Vn}function Yn(t){return 360*t}var Xn=Math.PI/2;function Hn(t,e){return 16===e.length?function(t,e){var n,r,i=u(D(W(),e),3),o=i[0],a=i[1],s=i[2],c=Math.asin(-e[2]/o);return Xn>c?c>-Xn?(n=Math.atan2(e[6]/a,e[10]/s),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/a,e[5]/a)):(r=0,n=Math.atan2(e[4]/a,e[5]/a)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Xn,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Xn,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function zn(t,e,n,r,i){var o,a,s,u,c,l,h,p,d,y,v=Math.cos(t),m=Math.sin(t);return o=r*v,a=i*m,s=0,u=-r*m,c=i*v,l=0,h=e,p=n,d=1,(y=new f(9))[0]=o,y[1]=a,y[2]=s,y[3]=u,y[4]=c,y[5]=l,y[6]=h,y[7]=p,y[8]=d,y}function Wn(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?o=-o:a=-a),o){var s=1/o;e*=s,n*=s}if(a){var u=1/a;r*=u,i*=u}var c=jn(Math.atan2(n,e));return[t[6],t[7],o,a,c]}var qn,Zn,Kn,$n=y(),Qn=y(),Jn=ht(),tr=[W(),W(),W()],er=W();function nr(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}t.CameraType=void 0,(qn=t.CameraType||(t.CameraType={}))[qn.ORBITING=0]="ORBITING",qn[qn.EXPLORING=1]="EXPLORING",qn[qn.TRACKING=2]="TRACKING",t.CameraTrackingMode=void 0,(Zn=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Zn.DEFAULT=0]="DEFAULT",Zn[Zn.ROTATIONAL=1]="ROTATIONAL",Zn[Zn.TRANSLATIONAL=2]="TRANSLATIONAL",Zn[Zn.CINEMATIC=3]="CINEMATIC",t.CameraProjectionMode=void 0,(Kn=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Kn.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Kn[Kn.PERSPECTIVE=1]="PERSPECTIVE";var rr,ir,or={UPDATED:"updated"},ar=2e-4,sr=function(){function e(){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.eventEmitter=new h,this.matrix=y(),this.right=K(1,0,0),this.up=K(0,1,0),this.forward=K(0,0,1),this.position=K(0,0,1),this.focalPoint=K(0,0,0),this.distanceVector=K(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=y(),this.projectionMatrixInverse=y(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Rn,this.orthoMatrix=y()}return e.prototype.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.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},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.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},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return E(y(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,e){var n=N(y(),[t,e,0]);this.jitteredProjectionMatrix=M(y(),n,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setProjectionMatrix=function(t){this.projectionMatrix=t},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.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},e.prototype.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},e.prototype.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.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},e.prototype.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},e.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=K(a.x-r,a.y-i,0),c=rt(s,this.right)/Z(this.right),l=rt(s,this.up)/Z(this.up),h=u(this.getPosition(),2),p=h[0],f=h[1],d=u(this.getFocalPoint(),2),y=d[0],v=d[1];return this.setPosition(p-c,f-l),this.setFocalPoint(y-c,v-l),this},e.prototype.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(Bn(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var u,c,l=2*o,h=n-e,p=r-i,f=l/p,d=(n+e)/h,y=(r+i)/p,v=a-o,m=a*o;s?(u=-a/v,c=-m/v):(u=-(a+o)/v,c=-2*m/v),t[0]=l/h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=y,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+u,a-s,a,e,this.far,this.clipSpaceNearZ===t.ClipSpaceNearZ.ZERO),E(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,f=l+u,d=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(p+=v*this.view.offsetX)+v*this.view.width,y=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===t.ClipSpaceNearZ.NEGATIVE_ONE?V(this.projectionMatrix,p,f,d,y,o,a):j(this.projectionMatrix,p,f,d,y,o,a),E(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Gn(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=K(0,1,0);if(this.focalPoint=Gn(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=tt(W(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=Z(o),s=jn(Math.asin(n/a)),u=90+jn(Math.atan2(r,e)),c=y();w(c,c,Bn(u)),S(c,c,Bn(s)),i=at(W(),[0,1,0],c)}return E(this.matrix,Y(y(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,ar>this.distance&&(this.distance=ar),this.dollyingStep=this.distance/100;var e=W(),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},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.setAzimuth=function(e){return this.azimuth=_n(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},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(e){return this.elevation=_n(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},e.prototype.getElevation=function(){return this.elevation},e.prototype.setRoll=function(e){return this.roll=_n(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},e.prototype.getRoll=function(){return this.roll},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.prototype.computeMatrix=function(){var e=yt(dt(),[0,0,1],Bn(this.roll));x(this.matrix);var n=yt(dt(),[1,0,0],Bn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=yt(dt(),[0,1,0],Bn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=vt(dt(),r,n);i=vt(dt(),i,e);var o=G(y(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(P(this.matrix,this.matrix,this.focalPoint),M(this.matrix,this.matrix,o),P(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(P(this.matrix,this.matrix,this.position),M(this.matrix,this.matrix,o))},e.prototype._setPosition=function(t,e,n){this.position=Gn(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()},e.prototype._getAxes=function(){$(this.right,Gn(ft(ht(),[1,0,0,0],this.matrix))),$(this.up,Gn(ft(ht(),[0,1,0,0],this.matrix))),$(this.forward,Gn(ft(ht(),[0,0,1,0],this.matrix))),nt(this.right,this.right),nt(this.up,this.up),nt(this.forward,this.forward)},e.prototype._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=Z(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=jn(Math.asin(n/i)),this.azimuth=jn(Math.atan2(-e,-r))):(this.elevation=-jn(Math.asin(n/i)),this.azimuth=-jn(Math.atan2(-e,-r)))},e.prototype._getPosition=function(){$(this.position,Gn(ft(ht(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=d(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),J(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=tt(W(),this.focalPoint,this.position),this.distance=Z(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=yt(dt(),[0,0,1],-this.roll*Math.PI/180);F(this.orthoMatrix,n,K((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),K(this.zoom,this.zoom,1),e)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=M(y(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(or.UPDATED)}},e.prototype.rotate=function(t,e,n){throw Error(In)},e.prototype.pan=function(t,e){throw Error(In)},e.prototype.dolly=function(t){throw Error(In)},e.prototype.createLandmark=function(t,e){throw Error(In)},e.prototype.gotoLandmark=function(t,e){throw Error(In)},e.prototype.cancelLandmarkAnimation=function(){throw Error(In)},e}();t.Strategy=void 0,(rr=t.Strategy||(t.Strategy={}))[rr.Standard=0]="Standard",t.SortReason=void 0,(ir=t.SortReason||(t.SortReason={}))[ir.ADDED=0]="ADDED",ir[ir.REMOVED=1]="REMOVED",ir[ir.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED";var ur,cr,lr,hr,pr,fr={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ln(0,0,0,0)};function dr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(dr.Cache||Map),n}t.PropertySyntax=void 0,(ur=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",ur.COLOR="<color>",ur.PAINT="<paint>",ur.NUMBER="<number>",ur.ANGLE="<angle>",ur.OPACITY_VALUE="<opacity-value>",ur.SHADOW_BLUR="<shadow-blur>",ur.LENGTH="<length>",ur.PERCENTAGE="<percentage>",ur.LENGTH_PERCENTAGE="<length> | <percentage>",ur.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",ur.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",ur.LIST_OF_POINTS="<list-of-points>",ur.PATH="<path>",ur.FILTER="<filter>",ur.Z_INDEX="<z-index>",ur.OFFSET_DISTANCE="<offset-distance>",ur.DEFINED_PATH="<defined-path>",ur.MARKER="<marker>",ur.TRANSFORM="<transform>",ur.TRANSFORM_ORIGIN="<transform-origin>",ur.TEXT="<text>",ur.TEXT_TRANSFORM="<text-transform>",dr.Cache=Map,t.UnitType=void 0,(cr=t.UnitType||(t.UnitType={}))[cr.kUnknown=0]="kUnknown",cr[cr.kNumber=1]="kNumber",cr[cr.kPercentage=2]="kPercentage",cr[cr.kEms=3]="kEms",cr[cr.kPixels=4]="kPixels",cr[cr.kRems=5]="kRems",cr[cr.kDegrees=6]="kDegrees",cr[cr.kRadians=7]="kRadians",cr[cr.kGradians=8]="kGradians",cr[cr.kTurns=9]="kTurns",cr[cr.kMilliseconds=10]="kMilliseconds",cr[cr.kSeconds=11]="kSeconds",cr[cr.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"}(lr||(lr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(hr||(hr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(pr||(pr={}));var yr,vr=[{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"}(yr||(yr={}));var mr,gr=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return vr.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},xr=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},br=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""},Er=function(){function e(){}return 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},e.prototype.toString=function(){return this.buildCSSText(hr.kNo,pr.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=yr.kUnitType&&this.getType()<=yr.kClampType},e}(),Tr=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return n(e,t),e.prototype.getType=function(){return yr.kColorType},e.prototype.to=function(t){return this},e}(Er);t.GradientType=void 0,(mr=t.GradientType||(t.GradientType={}))[mr.Constant=0]="Constant",mr[mr.LinearGradient=1]="LinearGradient",mr[mr.RadialGradient=2]="RadialGradient";var Mr=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return n(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return yr.kColorType},e}(Er),Pr=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return n(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return yr.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Er),Sr=function(e){return function(e){switch(e){case lr.kUNumber:return t.UnitType.kNumber;case lr.kULength:return t.UnitType.kPixels;case lr.kUPercent:return t.UnitType.kPercentage;case lr.kUTime:return t.UnitType.kSeconds;case lr.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return lr.kUNumber;case t.UnitType.kPercentage:return lr.kUPercent;case t.UnitType.kPixels:return lr.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return lr.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return lr.kUAngle;default:return lr.kUOther}}(e))},wr=function(e){function r(n,r){void 0===r&&(r=t.UnitType.kNumber);var i,o=e.call(this)||this;return i="string"==typeof r?gr(r):r,o.unit=i,o.value=n,o}return n(r,e),r.prototype.clone=function(){return new r(this.value,this.unit)},r.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.prototype.getType=function(){return yr.kUnitType},r.prototype.convertTo=function(e){if(this.unit===e)return new r(this.value,this.unit);var n=Sr(this.unit);if(n!==Sr(e)||n===t.UnitType.kUnknown)return null;var i=xr(this.unit)/xr(e);return new r(this.value*i,e)},r.prototype.buildCSSText=function(e,n,r){var i,o,a;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 s=this.value,u=br(this.unit);if(-999999>s||s>999999){var c=br(this.unit);!Number.isFinite(s)||Number.isNaN(s)?(void 0===(a=c)&&(a=""),i=(Number.isFinite(o=s)?"NaN":o>0?"infinity":"-infinity")+a):i=s+(c||"")}else i="".concat(s).concat(u)}return r+=i},r}(Er),Nr=new wr(0,"px");new wr(1,"px");var kr=new wr(0,"deg"),Cr=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return n(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(Tr),Ar=new Pr("unset"),Rr={"":Ar,unset:Ar,initial:new Pr("initial"),inherit:new Pr("inherit")},Or=new Cr(0,0,0,0,!0),Lr=new Cr(0,0,0,0),Ir=dr((function(t,e,n,r){return new Cr(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Dr=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new wr(e,n)};function _r(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(","),")")}new wr(50,"%");var Fr=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=f(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,u)||o("repeating-radial-gradient",t.repeatingRadialGradient,u)||o("conic-gradient",t.conicGradient,u)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:f(d)}}))}function a(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var o=r(i);return x(t.endCall)||n("Missing )"),o}}function s(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function u(){var n,r,i=c();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=c())?n.push(i):e=r)),n}function c(){var t=function(){var t=g("shape",/^(circle)/i,0);t&&(t.style=m()||l());return t}()||function(){var t=g("shape",/^(ellipse)/i,0);t&&(t.style=v()||l());return t}();if(t)t.at=h();else{var e=l();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=p();r&&(t={type:"default-radial",at:r})}}return t}function l(){return g("extent-keyword",t.extentKeywords,1)}function h(){if(g("position",/^at/,0)){var t=p();return t||n("Missing positioning value"),t}}function p(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function f(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 d(){var e=g("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:f(y)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:f(y)}}))||g("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=v(),e}function y(){return x(t.number)[1]}function v(){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=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&b(n[0].length);var r=t.exec(e);return r&&b(r[0].length),r}function b(t){e=e.substring(t)}return function(t){return e=t,r()}}();var Gr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ur=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Br=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Vr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var jr={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},Yr=dr((function(t){return Dr("angular"===t.type?Number(t.value):jr[t.value]||0,"deg")})),Xr=dr((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Dr(e,r),cy:Dr(n,i)}})),Hr=dr((function(e){var n;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Fr(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;i>s;s++){var u=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!wt(u)&&!wt(a)){for(var c=1;s-o>c;c++)t[o+c].length={type:"%",value:"".concat(a+(Number(u)-a)*c/(s-o))};o=s,a=Number(u)}}}(i);var o,a=i.map((function(t){return{offset:Dr(Number(t.length.value),"%"),color:_r(t)}}));if("linear-gradient"===n)return new Mr(t.GradientType.LinearGradient,{angle:r?Yr(r):kr,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var s=Xr(r[0].at),u=s.cx,c=s.cy,l=void 0;if(r[0].style){var h=r[0].style,p=h.type,f=h.value;"extent-keyword"===p?(Rr[o=f]||(Rr[o]=new Pr(o)),l=Rr[o]):l=Dr(f,p)}return new Mr(t.GradientType.RadialGradient,{cx:u,cy:c,size:l,steps:a})}}));var r=e[0];if("("===e[1]||"("===e[2])if("l"===r){var i=Gr.exec(e);if(i){var o=(null===(n=i[2].match(Vr))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return[new Mr(t.GradientType.LinearGradient,{angle:Dr(parseFloat(i[1]),"deg"),steps:o.map((function(t){var e=u(t,2),n=e[1];return{offset:Dr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===r){var a=function(t){var e,n=Ur.exec(t);if(n){var r=(null===(e=n[4].match(Vr))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Dr(50,"%"),cy:Dr(50,"%"),steps:r.map((function(t){var e=u(t,2),n=e[1];return{offset:Dr(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(a){if(!Ot(a))return[new Mr(t.GradientType.RadialGradient,a)];e=a}}else if("p"===r)return function(t){var e=Br.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 zr(t){return t&&!!t.image}function Wr(t){return t&&!wt(t.r)&&!wt(t.g)&&!wt(t.b)}var qr=dr((function(t){if(zr(t))return r({repetition:"repeat"},t);if(wt(t)&&(t=""),"transparent"===t)return Lr;if("currentColor"===t)t="black";else if("none"===t)return Or;var e=Hr(t);if(e)return e;var n=Be(t),i=[0,0,0,0];return null!==n&&(i[0]=n.r||0,i[1]=n.g||0,i[2]=n.b||0,i[3]=n.opacity),Ir.apply(void 0,c([],u(i),!1))}));function Zr(t,e){if(Wr(t)&&Wr(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(Lt(e[n],0,255));return e[3]=Lt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Kr(t,e){if(wt(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 $r=function(t){return Kr(/px/g,t)},Qr=dr($r);dr((function(t){return Kr(RegExp("%","g"),t)}));var Jr=function(t){return It(t)||isFinite(Number(t))?Dr(Number(t)||0,"px"):Kr(RegExp("px|%|em|rem","g"),t)},ti=dr(Jr),ei=function(t){return Kr(/deg|rad|grad|turn/g,t)},ni=dr(ei);function ri(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=Sr(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=br(t.unit)):(wr.isLength(t.unit)||wr.isLength(e.unit))&&(a=ai(t,i,n),s=ai(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function ii(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=jn(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=Yn(Number(e.value))),n}function oi(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):Ot(t)?n=t.split(" ").map((function(t){return Number(t)})):It(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 ai(e,n,r,i){if(void 0===i&&(i=!1),e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var o=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds();return(i?o.min[n]:0)+e.value/100*o.halfExtents[n]*2}return 0}var si=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ui(t){return""+t}var ci=function(t){return Dr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},li=dr(ci);function hi(t,e){return[t,e,ui]}function pi(t,e){return function(n,r){return[n,r,function(n){return ui(Lt(n,t,e))}]}}function fi(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function di(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=ge(t.parsedStyle.d.absolutePath,void 0,r(r({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function yi(t,e){return t[0]===e[0]&&t[1]===e[1]}function vi(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((o+a-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(o)*Math.sqrt(a)));if(!s||0===Math.sin(s)||_t(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),c=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(c-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function mi(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}dr((function(t){return Ot(t)?t.split(" ").map(li):t.map(li)}));var gi=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))))},xi=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=Bn(r=Ft(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,l=(t.y-a.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},p=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);p>1&&(e*=Math.sqrt(p),n*=Math.sqrt(p));var f=(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)),d=(i!==o?1:-1)*Math.sqrt(f=0>f?0:f),y=d*(e*h.y/n),v=d*(-n*h.x/e),m={x:Math.cos(u)*y-Math.sin(u)*v+(t.x+a.x)/2,y:Math.sin(u)*y+Math.cos(u)*v+(t.y+a.y)/2},g={x:(h.x-y)/e,y:(h.y-v)/n},x=gi({x:1,y:0},g),b=gi(g,{x:(-h.x-y)/e,y:(-h.y-v)/n});!o&&b>0?b-=2*Math.PI:o&&0>b&&(b+=2*Math.PI);var E=x+(b%=2*Math.PI)*s,T=e*Math.cos(E),M=n*Math.sin(E);return{x:Math.cos(u)*T-Math.sin(u)*M+m.x,y:Math.sin(u)*T+Math.cos(u)*M+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+b,ellipticalArcAngle:E,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function bi(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,h=xi({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=xi({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=p.x-h.x,d=p.y-h.y,y=Math.sqrt(f*f+d*d);return{x:-f/y,y:-d/y}}function Ei(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ti(t,e){return Ei(t)*Ei(e)?(t[0]*e[0]+t[1]*e[1])/(Ei(t)*Ei(e)):1}function Mi(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Ti(t,e))}function Pi(t,e){var n=e[1],r=e[2],i=Ft(Bn(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,p=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,f=h*h/(n*n)+p*p/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var d=n*n*(p*p)+r*r*(h*h),y=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*n*p/r:0,m=n?y*-r*h/n:0,g=(s+c)/2+Math.cos(i)*v-Math.sin(i)*m,x=(u+l)/2+Math.sin(i)*v+Math.cos(i)*m,b=[(h-v)/n,(p-m)/r],E=[(-1*h-v)/n,(-1*p-m)/r],T=Mi([1,0],b),M=Mi(b,E);return Ti(b,E)>-1||(M=Math.PI),1>Ti(b,E)||(M=0),0===a&&M>0&&(M-=2*Math.PI),1===a&&0>M&&(M+=2*Math.PI),{cx:g,cy:x,rx:yi(t,[c,l])?0:n,ry:yi(t,[c,l])?0:r,startAngle:T,endAngle:T+M,xRotation:i,arcFlag:o,sweepFlag:a}}function Si(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var wi=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=ne(t)}catch(n){e=ne(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&yi([r[1],r[2]],o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=Pi(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&yi(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c)l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("T"===c){var d=mi((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(m=[u[1],u[2]])[0],f[1]-m[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[m[0]-y[0],m[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===c){var v,m=mi((v=e[s-1]).currentPoint,f);y=[u[1],u[2]],"C"===v.command?(l.command="C",l.startTangent=[f[0]-m[0],f[1]-m[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var g=bi(l,0),x=g.x,b=g.y,E=bi(l,1,!1),T=E.x,M=E.y;l.startTangent=[x,b],l.endTangent=[T,M]}e.push(l)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=(y=t[o]).currentPoint,s=y.params,u=y.prePoint,c=void 0;switch(y.command){case"Q":c=yn(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=hn(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=y.arcParams;c=an(l.cx,l.cy,l.rx,l.ry,l.xRotation,l.startAngle,l.endAngle);break;default:n.push(a[0]),r.push(a[1])}c&&(y.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}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 h=Rt(n),p=Rt(r),f=At(n),d=At(r);if(0===i.length)return{x:h,y:p,width:f-h,height:d-p};for(o=0;i.length>o;o++){var y;(a=(y=i[o]).currentPoint)[0]===h?h-=vi(y,e).xExtra:a[0]===f&&(f+=vi(y,e).xExtra),a[1]===p?p-=vi(y,e).yExtra:a[1]===d&&(d+=vi(y,e).yExtra)}return{x:h,y:p,width:f-h,height:d-p}}(a,0),u=s.x,c=s.y,l=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},Ni=dr(wi);function ki(t){return Ot(t)?Ni(t):wi(t)}function Ci(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=ue(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=ue(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=Ee(r,i));var a,s,u,c,l,h,p,f,d=xe(o[0])!==xe(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[d,(u=o[1],c=d,l=u.length-1,h=[],p=0,f=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),f.forEach((function(t,e){u.slice(1).forEach((function(t,n){p+=ce(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=p,p=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Ai(t,e){return[t.points,e.points,function(t){return t}]}var Ri=null,Oi=/\s*(\w+)\(([^)]*)\)/g;function Li(t){return function(e){var n=0;return t.map((function(t){return t===Ri?e[n++]:t}))}}function Ii(t){return t}var Di={matrix:["NNNNNN",[Ri,Ri,0,0,Ri,Ri,0,0,0,0,1,0,Ri,Ri,0,1],Ii],matrix3d:["NNNNNNNNNNNNNNNN",Ii],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Li([Ri,Ri,new wr(1)]),Ii],scaleX:["N",Li([Ri,new wr(1),new wr(1)]),Li([Ri,new wr(1)])],scaleY:["N",Li([new wr(1),Ri,new wr(1)]),Li([new wr(1),Ri])],scaleZ:["N",Li([new wr(1),new wr(1),Ri])],scale3d:["NNN",Ii],skew:["Aa",null,Ii],skewX:["A",null,Li([Ri,kr])],skewY:["A",null,Li([kr,Ri])],translate:["Tt",Li([Ri,Ri,Nr]),Ii],translateX:["T",Li([Ri,Nr,Nr]),Li([Ri,Nr])],translateY:["T",Li([Nr,Ri,Nr]),Li([Nr,Ri])],translateZ:["L",Li([Nr,Nr,Ri])],translate3d:["TTL",Ii]};function _i(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],o=i[0],a=i.slice(1);if("translate"===o||"skew"===o?1===a.length&&a.push(0):"scale"===o&&1===a.length&&a.push(a[0]),!Di[o])return[];var s=a.map((function(t){return Dr(t)}));e.push({t:o,d:s})}return e}function Fi(t){if(Array.isArray(t))return _i(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Oi.lastIndex=0;e=Oi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Di[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?kr:ni(t)},N:li,T:ti,L:Qr}[h.toUpperCase()](l):{a:kr,n:u[0],t:Nr}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),Oi.lastIndex===t.length)return n}return[]}function Gi(t){if(Array.isArray(t))return _i(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Oi.lastIndex=0;e=Oi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Di[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?kr:ei(t)},N:ci,T:Jr,L:$r}[h.toUpperCase()](l):{a:kr,n:u[0],t:Nr}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),Oi.lastIndex===t.length)return n}return[]}function Ui(t){var e,n,r,i;switch(t.t){case"rotateX":return i=Bn(ii(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=Bn(ii(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=Bn(ii(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=Bn(ii(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=Bn(ii(t.d[0])),h=Bn(ii(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Bn(ii(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=Bn(ii(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=ai(t.d[0],0,null)||0,n=ai(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ai(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=ai(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=ai(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ai(t.d[0],0,null)||0,n=ai(t.d[1],0,null)||0,r=ai(t.d[2],0,null)||0,1];case"perspective":var p=ai(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,p?-1/p: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 Bi(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 Vi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}($n,t))return!1;if(m(Qn,$n),Qn[3]=0,Qn[7]=0,Qn[11]=0,Qn[15]=1,1e-8>Math.abs(T(Qn)))return!1;var a,s,u=$n[3],c=$n[7],l=$n[11],h=$n[12],p=$n[13],f=$n[14],d=$n[15];if(0!==u||0!==c||0!==l){if(Jn[0]=u,Jn[1]=c,Jn[2]=l,Jn[3]=d,!E(Qn,Qn))return!1;b(Qn,Qn),ft(i,Jn,Qn)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=p,e[2]=f,(a=tr)[0][0]=(s=$n)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=Z(tr[0]),nt(tr[0],tr[0]),r[0]=rt(tr[0],tr[1]),nr(tr[1],tr[1],tr[0],1,-r[0]),n[1]=Z(tr[1]),nt(tr[1],tr[1]),r[0]/=n[1],r[1]=rt(tr[0],tr[2]),nr(tr[2],tr[2],tr[0],1,-r[1]),r[2]=rt(tr[1],tr[2]),nr(tr[2],tr[2],tr[1],1,-r[2]),n[2]=Z(tr[2]),nt(tr[2],tr[2]),r[1]/=n[2],r[2]/=n[2],it(er,tr[1],tr[2]),0>rt(tr[0],er))for(var y=0;3>y;y++)n[y]*=-1,tr[y][0]*=-1,tr[y][1]*=-1,tr[y][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+tr[0][0]-tr[1][1]-tr[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-tr[0][0]+tr[1][1]-tr[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-tr[0][0]-tr[1][1]+tr[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+tr[0][0]+tr[1][1]+tr[2][2],0)),tr[2][1]>tr[1][2]&&(o[0]=-o[0]),tr[0][2]>tr[2][0]&&(o[1]=-o[1]),tr[1][0]>tr[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ui).reduce(Bi)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var ji=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=e[u]*a[u][s];var c=i[0],l=i[1],h=i[2],p=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(l*l+h*h),f[0][1]=2*(c*l-h*p),f[0][2]=2*(c*h+l*p),f[1][0]=2*(c*l+h*p),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(l*h-c*p),f[2][0]=2*(c*h-l*p),f[2][1]=2*(l*h+c*p),f[2][2]=1-2*(c*c+l*l),a=t(a,f);var d,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y)),s=0;3>s;s++)for(u=0;3>u;u++)a[s][u]*=n[s];return 0==(d=a)[0][2]&&0==d[0][3]&&0==d[1][2]&&0==d[1][3]&&0==d[2][0]&&0==d[2][1]&&1==d[2][2]&&0==d[2][3]&&0==d[3][2]&&1==d[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Yi(t){return t.toFixed(6).replace(".000000","")}function Xi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Vi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Vi(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=Lt(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return ji(t[0],t[1],t[2],e,t[4]).map(Yi).join(",")}])}function Hi(t){return t.replace(/[XY]/,"")}function zi(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function Wi(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?Dr(a):Dr(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length)u=[(g=Xi(t,e))[0]],c=[g[1]],l=[["matrix",[g[2]]]];else for(o=0;t.length>o;o++){var h=t[o].t,p=e[o].t,f=t[o].d,d=e[o].d,y=Di[h],v=Di[p],m=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var g=Xi([t[o]],[e[o]]);u.push(g[0]),c.push(g[1]),l.push(["matrix",[g[2]]])}else{if(h===p)m=h;else if(y[2]&&v[2]&&Hi(h)===Hi(p))m=Hi(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||zi(h)!==zi(p)){u=[(g=Xi(t,e))[0]],c=[g[1]],l=[["matrix",[g[2]]]];break}m=zi(h),f=y[1](f),d=v[1](d)}for(var x=[],b=[],E=[],T=0;f.length>T;T++){g=ri(f[T],d[T],n,!1,T);x[T]=g[0],b[T]=g[1],E.push(g[2])}u.push(x),c.push(b),l.push([m,E])}}if(r){var M=u;u=c,c=M}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var qi=dr((function(t){if(Ot(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:[ti(Zi(e[0])),ti(Zi(e[1]))]}return[Dr(t[0]||0,"px"),Dr(t[1]||0,"px")]}));function Zi(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Ki=[{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:"0 0",l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cz",int:!0,l:!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,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,l:!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:"d",int:!0,l:!0,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"}],$i=Ki.filter((function(t){return!!t.l})).map((function(t){return t.n})),Qi={},Ji=function(){function e(t){var e=this;this.runtime=t,Ki.forEach((function(t){e.registerMetadata(t)}))}return e.prototype.registerMetadata=function(t){c([t.n],u(t.a||[]),!1).forEach((function(e){Qi[e]=t}))},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(e,n,i){void 0===i&&(i={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),Object.assign(e.attributes,n);var o=e.parsedStyle.clipPath,a=e.parsedStyle.offsetPath;Object.assign(e.parsedStyle,n);var s,c=!!i.forceUpdateGeometry;!c&&$i.some((function(t){return t in n}))&&(c=!0),n.fill&&(e.parsedStyle.fill=qr(n.fill)),n.stroke&&(e.parsedStyle.stroke=qr(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=qr(n.shadowColor)),n.filter&&(e.parsedStyle.filter=function(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,si.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Kr(/deg|rad|grad|turn|px|%/g,t)||qr(t)}))}),n.lastIndex===t.length)return r}return[]}(n.filter)),wt(n.radius)||(e.parsedStyle.radius=oi(n.radius,4)),wt(n.lineDash)||(e.parsedStyle.lineDash=oi(n.lineDash,2)),n.points&&(e.parsedStyle.points={points:Ot(s=n.points)?s.split(" ").map((function(t){var e=u(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):s,totalLength:0,segments:[]}),""===n.d&&(e.parsedStyle.d=r({},fr)),n.d&&(e.parsedStyle.d=ki(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},e,null),Ut(n.clipPath)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("clipPath",o,n.clipPath,e,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("offsetPath",a,n.offsetPath,e,this.runtime),n.transform&&(e.parsedStyle.transform=Fi(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=qi(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),wt(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.Z_INDEX].postProcessor(e),wt(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.OFFSET_DISTANCE].postProcessor(e),n.transform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM].postProcessor(e),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM_ORIGIN].postProcessor(e),c&&(e.geometry.dirty=!0,e.renderable.boundsDirty=!0,e.renderable.renderBoundsDirty=!0,i.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(e))},e.prototype.updateGeometry=function(e){var n=e.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Cn),i.renderBounds||(i.renderBounds=new Cn);var o=e.parsedStyle,a=r.update(o,e),s=a.cx,u=void 0===s?0:s,c=a.cy,l=void 0===c?0:c,h=a.cz,p=void 0===h?0:h,f=a.hwidth,d=void 0===f?0:f,y=a.hheight,v=void 0===y?0:y,m=a.hdepth,g=void 0===m?0:m,x=[Math.abs(d),Math.abs(v),g],b=o.stroke,E=o.lineWidth,T=void 0===E?1:E,M=o.increasedLineWidthForHitTesting,P=void 0===M?0:M,S=o.shadowType,w=void 0===S?"outer":S,N=o.shadowColor,k=o.filter,C=void 0===k?[]:k,A=o.transformOrigin,R=[u,l,p];if(i.contentBounds.update(R,x),b&&!b.isNone){var O=((T||0)+(P||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);x[0]+=O,x[1]+=O}if(i.renderBounds.update(R,x),N&&w&&"inner"!==w){var L=i.renderBounds,I=L.min,D=L.max,_=o.shadowBlur||0,F=o.shadowOffsetX||0,G=o.shadowOffsetY||0,U=D[0]+_+F,B=I[1]-_+G,V=D[1]+_+G;I[0]=Math.min(I[0],I[0]-_+F),D[0]=Math.max(D[0],U),I[1]=Math.min(I[1],B),D[1]=Math.max(D[1],V),i.renderBounds.setMinMax(I,D)}C.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,J(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),i.renderBounds.setMinMax(c,l)}})),e.geometry.dirty=!1;var j=0>v,Y=(0>d?-1:1)*(A?ai(A[0],0,e,!0):0),X=(j?-1:1)*(A?ai(A[1],1,e,!0):0);(Y||X)&&e.setOrigin(Y,X)}},e.prototype.updateSizeAttenuation=function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/n,e.nodeName===t.Shape.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===t.Shape.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))},e}(),to=function(){function t(){this.mixer=hi}return t.prototype.calculator=function(t,e,n,r){return ii(n)},t}(),eo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Pr&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),no=function(){function t(){this.parser=qr,this.mixer=Zr}return t.prototype.calculator=function(t,e,n,r){return n instanceof Pr?"none"===n.value?Or:Lr:n},t}(),ro=function(){function t(){}return t.prototype.calculator=function(t,e,n){return n instanceof Pr?[]:n},t}();function io(t){var e=t.parsedStyle.fontSize;return wt(e)?null:e}var oo=function(){function e(){this.mixer=hi}return e.prototype.calculator=function(e,n,r,i,o){var a;if(It(r))return r;if(!wr.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode)if(s=io(i.parentNode))return s*=r.value;return 0}if(r.unit===t.UnitType.kRems){var s;if(null===(a=null==i?void 0:i.ownerDocument)||void 0===a?void 0:a.documentElement)if(s=io(i.ownerDocument.documentElement))return s*=r.value;return 0}},e}(),ao=function(){function t(){this.mixer=fi}return t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),so=function(){function t(){this.mixer=fi}return t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),uo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Pr&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),co=function(){function t(){this.mixer=hi}return t.prototype.calculator=function(t,e,n){return n.value},t}(),lo=function(){function e(){this.mixer=pi(0,1)}return e.prototype.calculator=function(t,e,n){return n.value},e.prototype.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&e.setLocalPosition(o.x,o.y)}}},e}(),ho=function(){function t(){this.mixer=pi(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),po=function(){function t(){this.parser=ki,this.mixer=Ci}return t.prototype.calculator=function(t,e,n){return n instanceof Pr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ln(0,0,0,0)}:n},t}(),fo=function(){this.mixer=Ai},yo=function(t){function e(){var e=t.apply(this,c([],u(arguments),!1))||this;return e.mixer=pi(0,1/0),e}return n(e,t),e}(oo),vo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Pr?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),mo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),go=new WeakMap;function xo(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;go.has(r)?go.get(r).destroy(n):go.set(r,e)}}var bo="undefined"!=typeof window&&void 0!==window.document;function Eo(t){return!!t.getAttribute}function To(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Mo(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function Po(t,e){if(bo)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var So={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},wo="object"==typeof performance&&performance.now?performance:Date;function No(e){return e.nodeName===t.Shape.FRAGMENT||e.getRootNode().nodeName===t.Shape.FRAGMENT}var ko=1,Co="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Ao=Date.now(),Ro={},Oo=Date.now(),Lo=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Oo,r=n>16?0:16-n,i=ko++;return Ro[i]=t,Object.keys(Ro).length>1||setTimeout((function(){Oo=e;var t=Ro;Ro={},Object.keys(t).forEach((function(e){return t[e](Co.performance&&"function"==typeof Co.performance.now?Co.performance.now():Date.now()-Ao)}))}),r),i},Io=function(t){delete Ro[t]},Do=function(t){return"string"!=typeof t?Lo:""===t?Co.requestAnimationFrame:Co[t+"RequestAnimationFrame"]},_o=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!!Do(t)})),Fo=Do(_o),Go=function(t){return"string"!=typeof t?Io:""===t?Co.cancelAnimationFrame:Co[t+"CancelAnimationFrame"]||Co[t+"CancelRequestAnimationFrame"]}(_o);Co.requestAnimationFrame=Fo,Co.cancelAnimationFrame=Go;var Uo=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,c([],u(t),!1))})))},t}(),Bo=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return o(this,void 0,void 0,(function(){var e,n,r;return a(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,c([],u(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return this.callbacks.length-1>n?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),Vo=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),jo=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;this.callbacks.length-1>e;e++){t=(0,this.callbacks[e])(t)}return t}return null},t}(),Yo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Xo=/([\"\'])[^\'\"]+\1/;function Ho(t,e,n){return x(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var zo=y(),Wo=y(),qo={scale:function(t){k(zo,[t[0].value,t[1].value,1])},scaleX:function(t){k(zo,[t[0].value,1,1])},scaleY:function(t){k(zo,[1,t[0].value,1])},scaleZ:function(t){k(zo,[1,1,t[0].value])},scale3d:function(t){k(zo,[t[0].value,t[1].value,t[2].value])},translate:function(t){N(zo,[t[0].value,t[1].value,0])},translateX:function(t){N(zo,[t[0].value,0,0])},translateY:function(t){N(zo,[0,t[0].value,0])},translateZ:function(t){N(zo,[0,0,t[0].value])},translate3d:function(t){N(zo,[t[0].value,t[1].value,t[2].value])},rotate:function(t){O(zo,Bn(ii(t[0])))},rotateX:function(t){A(zo,Bn(ii(t[0])))},rotateY:function(t){R(zo,Bn(ii(t[0])))},rotateZ:function(t){O(zo,Bn(ii(t[0])))},rotate3d:function(t){C(zo,Bn(ii(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Ho(zo,Bn(t[0].value),Bn(t[1].value))},skewX:function(t){Ho(zo,Bn(t[0].value),0)},skewY:function(t){Ho(zo,0,Bn(t[0].value))},matrix:function(t){g(zo,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){g.apply(z,c([zo],u(t.map((function(t){return t.value}))),!1))}},Zo={translate:function(t,e){t.setLocalPosition([e[0].value,e[1].value])},translate3d:function(t,e){t.setLocalPosition([e[0].value,e[1].value,e[2].value])}};function Ko(t,e){if(t.length){if(1===t.length&&Zo[t[0].t])return void Zo[t[0].t](e,t[0].d);for(var n=x(Wo),r=0;t.length>r;r++){var i=t[r],o=qo[i.t];o&&(o(i.d),H(n,n,zo))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var $o=function(){function t(){this.parser=Gi,this.mixer=Wi}return t.prototype.calculator=function(t,e,n,r){return n instanceof Pr?[]:n},t.prototype.postProcessor=function(t){Ko(t.parsedStyle.transform,t)},t}(),Qo=function(){function e(){}return e.prototype.postProcessor=function(e){var n=e.parsedStyle.transformOrigin;n[0].unit===t.UnitType.kPixels&&n[1].unit===t.UnitType.kPixels?e.setOrigin(n[0].value,n[1].value):e.getGeometryBounds()},e}(),Jo=function(){function e(){}return e.prototype.calculator=function(t,e,n,r){return n.value},e.prototype.postProcessor=function(e){if(e.parentNode){var n=e.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=t.SortReason.Z_INDEX_CHANGED)}},e}(),ta=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.r,o=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:o,hheight:o}},t}(),ea=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.rx,o=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===o?0:o}},t}(),na=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i),u=(a-o)/2,c=(Math.max(n,i)-s)/2;return{cx:o+u,cy:s+c,hwidth:u,hheight:c}},t}(),ra=function(){function t(){}return t.prototype.update=function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}},t}(),ia=function(){function t(){}return t.prototype.update=function(t){if(t.points&&Nt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,c([],u(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,c([],u(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,c([],u(e.map((function(t){return t[1]}))),!1)),o=(r-n)/2,a=(Math.max.apply(Math,c([],u(e.map((function(t){return t[1]}))),!1))-i)/2;return{cx:n+o,cy:i+a,hwidth:o,hheight:a}}return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),oa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.src,s=t.width,u=t.height,c=void 0===s?0:s,l=void 0===u?0:u;return a&&!Ot(a)&&(c||(t.width=c=a.width),l||(t.height=l=a.height)),{cx:r+c/2,cy:o+l/2,hwidth:c/2,hheight:l/2}},t}(),aa=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){return t.text},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=void 0===o?"start":o,s=t.lineWidth,u=void 0===s?1:s,c=t.textBaseline,l=void 0===c?"alphabetic":c,h=t.dx,p=void 0===h?0:h,f=t.dy,d=void 0===f?0:f,y=t.x,v=void 0===y?0:y,m=t.y,g=void 0===m?0:m;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:[]},{hwidth:0,hheight:0,cx:0,cy:0};var x=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(i,t,x);t.metrics=b;var E=b.width/2,T=b.height/2,M=v+E;"center"===a||"middle"===a?M+=u/2-E:"right"!==a&&"end"!==a||(M+=u-2*E);var P=g-T;return"middle"===l?P+=T:"top"===l||"hanging"===l?P+=2*T:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(P+=0),p&&(M+=p),d&&(P+=d),{cx:M,cy:P,hwidth:E,hheight:T}},t}(),sa=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),ua=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=t.y,i=t.width,o=void 0===i?0:i,a=t.height,s=void 0===a?0:a;return{cx:(void 0===n?0:n)+o/2,cy:(void 0===r?0:r)+s/2,hwidth:o/2,hheight:s/2}},t}();var ca,la=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new On,this.page=new On,this.canvas=new On,this.viewport=new On,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw Error(In)},t}(),ha=function(t){function e(){var e=t.apply(this,c([],u(arguments),!1))||this;return e.client=new On,e.movement=new On,e.offset=new On,e.global=new On,e.screen=new On,e}return n(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw Error(In)},e}(la),pa=function(t){function e(){var e=t.apply(this,c([],u(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return n(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(ha),fa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(ha),da=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return n(e,t),e}(la),ya=new WeakMap,va=function(){function t(){this.emitter=new h}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r,i,o=!1,a=!1;Gt(n)?o=n:n&&(o=void 0!==(r=n.capture)&&r,a=void 0!==(i=n.once)&&i),o&&(t+="capture"),e=St(e)?e:e.handleEvent;var s=St(e)?void 0:e;return a?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){if(!this.emitter)return this;(Gt(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=St(e)?e:null==e?void 0:e.handleEvent;var r=St(e)?void 0:e;return this.emitter.off(t,e,r),this},t.prototype.emit=function(t,e){this.dispatchEvent(new da(t,e))},t.prototype.dispatchEvent=function(t,e){var n;void 0===e&&(e=!1);var r=ya.get(this);if(r||(r=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&ya.set(this,r),r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],e||(t.target=this),t.manager.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),ma=function(e){function r(){var t=e.call(this)||this;return t.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 n(r,e),r.isNode=function(t){return!!t.childNodes},Object.defineProperty(r.prototype,"textContent",{get:function(){var e,n,r="";this.nodeName===t.Shape.TEXT&&(r+=this.style.text);try{for(var i=s(this.childNodes),o=i.next();!o.done;o=i.next()){var a=o.value;r+=a.nodeName===t.Shape.TEXT?a.nodeValue:a.textContent}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},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))},enumerable:!1,configurable:!0}),r.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.prototype.hasChildNodes=function(){return this.childNodes.length>0},r.prototype.isDefaultNamespace=function(t){throw Error(In)},r.prototype.lookupNamespaceURI=function(t){throw Error(In)},r.prototype.lookupPrefix=function(t){throw Error(In)},r.prototype.normalize=function(){throw Error(In)},r.prototype.isEqualNode=function(t){return this===t},r.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(r.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),r.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var n=t,i=this,o=[n],a=[i];null!==(e=n.parentNode)&&void 0!==e?e:i.parentNode;)n=n.parentNode?(o.push(n.parentNode),n.parentNode):n,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(n!==i)return r.DOCUMENT_POSITION_DISCONNECTED|r.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|r.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,u=s===o?a:o;if(s[s.length-u.length]===u[0])return s===o?r.DOCUMENT_POSITION_CONTAINED_BY|r.DOCUMENT_POSITION_FOLLOWING:r.DOCUMENT_POSITION_CONTAINS|r.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===o?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING:s===o?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING}}return r.DOCUMENT_POSITION_FOLLOWING},r.prototype.contain=function(t){return this.contains(t)},r.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.prototype.forEach=function(t){if(!1!==t(this))for(var e=this.childNodes,n=e.length,r=0;n>r;r++)e[r].forEach(t)},r.DOCUMENT_POSITION_DISCONNECTED=1,r.DOCUMENT_POSITION_PRECEDING=2,r.DOCUMENT_POSITION_FOLLOWING=4,r.DOCUMENT_POSITION_CONTAINS=8,r.DOCUMENT_POSITION_CONTAINED_BY=16,r.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,r}(va),ga=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new h,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=y(),this.tmpVec3=W(),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,r=wo.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.dispatchEvent(i,2===i.button?"rightup":"mouseup")}var o=n.trackingData(t.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!i.composedPath().includes(a)){for(var u=a;u&&!i.composedPath().includes(u);){if(i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside")}ma.isNode(u)&&(u=u.parentNode)}delete o.pressTargetsByButton[t.button],s=u}if(s){var c=n.clonePointerEvent(i,"click");c.target=s,c.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:r});var l=o.clicksByButton[t.button];l.target===c.target&&n.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==c.pointerType&&"touch"!==c.pointerType||n.dispatchEvent(c,"click"),n.dispatchEvent(c,"pointertap")),n.freeEvent(c)}n.freeEvent(i)},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),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",o||void 0);if(n.dispatchEvent(a,"pointerout"),r&&n.dispatchEvent(a,"mouseout"),!e.composedPath().includes(o)){var s=n.createPointerEvent(t,"pointerleave",o||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"),ma.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(a)}if(o!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var c=o&&ma.isNode(o)&&o.parentNode;c&&c!==(ma.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(ma.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var l=n.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==o&&l.target!==(ma.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),r&&n.notifyTarget(l,"mouseenter"),ma.isNode(l.target)&&(l.target=l.target.parentNode);n.freeEvent(l)}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),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(ma.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),ma.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}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 o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(ma.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),ma.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},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 o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),ma.isNode(o)&&(o=o.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)}}return t.prototype.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)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.getScale=function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}},t.prototype.client2Viewport=function(t){var e=this.getScale(),n=e.bbox;return new On((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)},t.prototype.viewport2Client=function(t){var e=this.getScale(),n=e.bbox;return new On((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=M(this.tmpMatrix,u,s),l=Q(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return at(l,l,c),new On(l[0],l[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=M(this.tmpMatrix,n,r),o=Q(this.tmpVec3,t.x,t.y,0);at(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new On((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.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}))},t.prototype.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 ".concat(t.type))}},t.prototype.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)},t.prototype.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(r=i+1;n.length>r;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.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++)ma.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.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:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t,e){var n=null==e?void 0:e.target;if((null==n?void 0:n.shadowRoot)&&(n=e.composedPath()[0]),n){if(n===t)return!0;if(t&&t.contains)return t.contains(n)}return!!(null==e?void 0:e.composedPath)&&e.composedPath().indexOf(t)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=s(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=this.nativeHTMLMap.get(i.value);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(pa);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i),a=this.context.contextService.getDomElement();return i.target=null!=n?n:o||this.isNativeEventFromCanvas(a,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(fa);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(fa);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},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(pa);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},t.prototype.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},t.prototype.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)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=wo.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.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},t.prototype.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)},t.prototype.notifyTarget=function(t,e){e=null!=e?e: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)},t.prototype.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)},t.prototype.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||ma.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Eo(e)&&e.getAttribute("cursor");if(n)return n;e=ma.isNode(e)&&e.parentNode}},t}(),xa=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||ts.offscreenCanvas)this.canvas=t||ts.offscreenCanvas,this.context=this.canvas.getContext("2d",r({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",r({willReadFrequently:!0},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",r({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();t.RenderReason=void 0,(ca=t.RenderReason||(t.RenderReason={}))[ca.CAMERA_CHANGED=0]="CAMERA_CHANGED",ca[ca.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",ca[ca.NONE=2]="NONE";var ba,Ea=function(){function e(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Vo,initAsync:new Uo,dirtycheck:new jo,cull:new jo,beginFrame:new Vo,beforeRender:new Vo,render:new Vo,afterRender:new Vo,endFrame:new Vo,destroy:new Vo,pick:new Bo,pickSync:new jo,pointerDown:new Vo,pointerUp:new Vo,pointerMove:new Vo,pointerOut:new Vo,pointerOver:new Vo,pointerWheel:new Vo,pointerCancel:new Vo,click:new Vo}}return e.prototype.init=function(t){var e=this,n=r(r({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},e.prototype.render=function(e,n,r){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var o=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(o.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),o.renderReasons.size&&this.inited){o.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===o.renderReasons.size&&o.renderReasons.has(t.RenderReason.CAMERA_CHANGED),s=!e.disableRenderHooks||!(e.disableRenderHooks&&a);s&&this.renderDisplayObject(o.root,e,o),this.hooks.beginFrame.call(n),s&&o.renderListCurrentFrame.forEach((function(t){i.hooks.beforeRender.call(t),i.hooks.render.call(t),i.hooks.afterRender.call(t)})),this.hooks.endFrame.call(n),o.renderListCurrentFrame=[],o.renderReasons.clear(),r()}},e.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(o){var a=i.enableCulling?this.hooks.cull.call(o,this.context.camera):o;a&&(this.stats.rendered++,n.renderListCurrentFrame.push(a))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var s=t.sortable;s.dirty&&(this.sort(t,s),s.dirty=!1,s.dirtyChildren=[],s.dirtyReason=void 0),(s.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},e.prototype.sort=function(e,n){n.sorted&&n.dirtyReason!==t.SortReason.Z_INDEX_CHANGED?n.dirtyChildren.forEach((function(t){if(-1===e.childNodes.indexOf(t)){var r=n.sorted.indexOf(t);0>r||n.sorted.splice(r,1)}else if(0===n.sorted.length)n.sorted.push(t);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>To(t[i],e)?n=i+1:r=i}return n}(n.sorted,t);n.sorted.splice(i,0,t)}})):n.sorted=e.childNodes.slice().sort(To)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Ta=/\[\s*(.*)=(.*)\s*\]/,Ma=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.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},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(Ta),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return wt(n)?"":n.toString?""+n:""},t}();t.ElementEvent=void 0,(ba=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",ba.DESTROY="destroy",ba.ATTR_MODIFIED="DOMAttrModified",ba.INSERTED="DOMNodeInserted",ba.REMOVED="removed",ba.MOUNTED="DOMNodeInsertedIntoDocument",ba.UNMOUNTED="DOMNodeRemovedFromDocument",ba.BOUNDS_CHANGED="bounds-changed",ba.CULLED="culled";var Pa=function(t){function e(e,n,r,i,o,a,s,u){var c=t.call(this,null)||this;return c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return n(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(la);function Sa(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var wa,Na,ka,Ca=new Pa(t.ElementEvent.REPARENT,null,"","","",0,"",""),Aa=Pt(),Ra=W(),Oa=K(1,1,1),La=y(),Ia=Pt(),Da=W(),_a=y(),Fa=dt(),Ga=W(),Ua=dt(),Ba=W(),Va=W(),ja=W(),Ya=y(),Xa=dt(),Ha=dt(),za=dt(),Wa={affectChildren:!0},qa=function(){function e(e){this.runtime=e,this.pendingEvents=new Map,this.boundsChangedEvent=new da(t.ElementEvent.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap}return e.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},e.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},e.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},e.prototype.attach=function(e,n,r){var i,o=!1;e.parentNode&&(o=e.parentNode!==n,this.detach(e));var a=e.nodeName===t.Shape.FRAGMENT,s=No(n);e.parentNode=n;var u=a?e.childNodes:[e];It(r)?u.forEach((function(t){n.childNodes.splice(r,0,t),t.parentNode=n})):u.forEach((function(t){n.childNodes.push(t),t.parentNode=n}));var c=n.sortable;if(((null===(i=null==c?void 0:c.sorted)||void 0===i?void 0:i.length)||e.parsedStyle.zIndex)&&(-1===c.dirtyChildren.indexOf(e)&&c.dirtyChildren.push(e),c.dirty=!0,c.dirtyReason=t.SortReason.ADDED),!s){if(a)this.dirtifyFragment(e);else{var l=e.transformable;l&&this.dirtifyWorld(e,l)}o&&e.dispatchEvent(Ca)}},e.prototype.detach=function(e){var n,r;if(e.parentNode){var i=e.transformable,o=e.parentNode.sortable;((null===(n=null==o?void 0:o.sorted)||void 0===n?void 0:n.length)||(null===(r=e.style)||void 0===r?void 0:r.zIndex))&&(-1===o.dirtyChildren.indexOf(e)&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=t.SortReason.REMOVED);var a=e.parentNode.childNodes.indexOf(e);a>-1&&e.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(e,i),e.parentNode=null}},e.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},e.prototype.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 o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},e.prototype.rotate=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=Fa;gt(o,e[0],e[1],e[2]);var a=this.getRotation(t),s=this.getRotation(t.parentNode);bt(za,s),mt(za,za),vt(o,za,o),vt(i.localRotation,o,a),Mt(i.localRotation,i.localRotation),this.dirtifyLocal(t,i)}else this.rotateLocal(t,e)},e.prototype.rotateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var i=t.transformable;gt(Ha,e[0],e[1],e[2]),Tt(i.localRotation,i.localRotation,Ha),this.dirtifyLocal(t,i)},e.prototype.setEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){gt(i.localRotation,e[0],e[1],e[2]);var o=this.getRotation(t.parentNode);bt(Xa,mt(Fa,o)),Tt(i.localRotation,i.localRotation,Xa),this.dirtifyLocal(t,i)}else this.setLocalEulerAngles(t,e)},e.prototype.setLocalEulerAngles=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=K(e,n,r));var o=t.transformable;gt(o.localRotation,e[0],e[1],e[2]),i&&this.dirtifyLocal(t,o)},e.prototype.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var i=t.transformable;st(e,Ra)||(!function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,p=i*h-o*l,f=o*c-r*h,d=r*l-i*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,i.localRotation),J(i.localPosition,i.localPosition,e),this.dirtifyLocal(t,i))},e.prototype.setPosition=function(t,e){var n,r=t.transformable;if(ja[0]=e[0],ja[1]=e[1],ja[2]=null!==(n=e[2])&&void 0!==n?n:0,!st(this.getPosition(t),ja)){if($(r.position,ja),null!==t.parentNode&&t.parentNode.transformable)m(Ya,t.parentNode.transformable.worldTransform),E(Ya,Ya),at(r.localPosition,ja,Ya);else $(r.localPosition,ja);this.dirtifyLocal(t,r)}},e.prototype.setLocalPosition=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;Va[0]=e[0],Va[1]=e[1],Va[2]=null!==(r=e[2])&&void 0!==r?r:0,st(i.localPosition,Va)||($(i.localPosition,Va),n&&this.dirtifyLocal(t,i))},e.prototype.scaleLocal=function(t,e){var n,r,i,o,a=t.transformable;r=a.localScale,i=a.localScale,o=Q(Da,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*o[0],r[1]=i[1]*o[1],r[2]=i[2]*o[2],this.dirtifyLocal(t,a)},e.prototype.setLocalScale=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;Q(Da,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:i.localScale[2]),st(Da,i.localScale)||($(i.localScale,Da),n&&this.dirtifyLocal(t,i))},e.prototype.translate=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Q(Da,e,n,r)),st(e,Ra)||(J(Da,this.getPosition(t),e),this.setPosition(t,Da))},e.prototype.setRotation=function(t,e,n,r,i){var o=t.transformable;if("number"==typeof e&&(e=xt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var a=this.getRotation(t.parentNode);bt(Fa,a),mt(Fa,Fa),vt(o.localRotation,Fa,e),Mt(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}else this.setLocalRotation(t,e)},e.prototype.setLocalRotation=function(t,e,n,r,i,o){void 0===o&&(o=!0),"number"==typeof e&&(e=Et(Fa,e,n,r,i));var a=t.transformable;bt(a.localRotation,e),o&&this.dirtifyLocal(t,a)},e.prototype.setLocalSkew=function(t,e,n,r){void 0===r&&(r=!0),"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(Ia,e,n));var i,o,a=t.transformable;(i=a.localSkew)[0]=(o=e)[0],i[1]=o[1],r&&this.dirtifyLocal(t,a)},e.prototype.dirtifyLocal=function(t,e){No(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},e.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},e.prototype.dirtifyFragment=function(e){var n=e.transformable;n&&(n.frozen=!1,n.dirtyFlag=!0,n.localDirtyFlag=!0);var r=e.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0);for(var i=e.childNodes.length,o=0;i>o;o++)this.dirtifyFragment(e.childNodes[o]);e.nodeName===t.Shape.FRAGMENT&&this.pendingEvents.set(e,!1)},e.prototype.triggerPendingEvents=function(){var e=this,n=new Set,r=new Set;this.pendingEvents.forEach((function(e,n){n.nodeName===t.Shape.FRAGMENT&&n.forEach((function(t){t!==n&&r.add(t)}))}));var i=function(t,i){!t.isConnected||n.has(t)||r.has(t)||(e.boundsChangedEvent.detail=i,e.boundsChangedEvent.target=t,t.isMutationObserved?t.dispatchEvent(e.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0),n.add(t))};this.pendingEvents.forEach((function(t,e){Wa.affectChildren=t,t?e.forEach((function(t){i(t,Wa)})):i(e,Wa)})),n.clear(),r.clear(),this.clearPendingEvents()},e.prototype.clearPendingEvents=function(){this.pendingEvents.clear()},e.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Sa(n),n=n.parentNode;e&&t.forEach((function(t){Sa(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)},e.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},e.prototype.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 Pa(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Pa.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},e.prototype.getPosition=function(t){var e=t.transformable;return I(e.position,this.getWorldTransform(t,e))},e.prototype.getRotation=function(t){var e=t.transformable;return _(e.rotation,this.getWorldTransform(t,e))},e.prototype.getScale=function(t){var e=t.transformable;return D(e.scaling,this.getWorldTransform(t,e))},e.prototype.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},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.calcLocalTransform=function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){F(t.localTransform,t.localRotation,t.localPosition,K(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(x(_a),_a[4]=Math.tan(t.localSkew[0]),_a[1]=Math.tan(t.localSkew[1]),M(t.localTransform,t.localTransform,_a));var e=F(_a,Et(Fa,0,0,0,1),Q(Da,1,1,1),t.localScale,t.origin);M(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==o[0]||1!==o[1]||1!==o[2])||(0!==a[0]||0!==a[1]||0!==a[2])?F(n,i,r,o,a):s?N(n,r):x(n)}},e.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},e.prototype.setLocalTransform=function(t,e){var n=I(Ga,e),r=_(Ua,e),i=D(Ba,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,Oa,!1),this.setLocalPosition(t,Ra,!1),this.setLocalEulerAngles(t,Ra,void 0,void 0,!1),this.setLocalSkew(t,Aa,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Cn.isEmpty(r))return null;var i=n||new Cn;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},e.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return n.dirty&&ts.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Cn},e.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Cn).update(r.center,r.halfExtents))})),o||(o=new Cn),e){var a=Mo(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return e?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o},e.prototype.getLocalBounds=function(t){if(t.parentNode){var e=La;t.parentNode.transformable&&(e=E(_a,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Cn.isEmpty(n)){var r=new Cn;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Cn.isEmpty(i)||(r=new Cn).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=u(r.getMin(),2),s=a[0],c=a[1],l=u(r.getMax(),2);return new Ln(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),l[0]-s,l[1]-c)}return new Ln((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},e.prototype.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)}},e.prototype.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])}},e.prototype.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?M(e.worldTransform,r.worldTransform,e.localTransform):m(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},e.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),Za={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]},Ka=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,$a=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Qa=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ja=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Qa.exec(n)&&!$a.exec(t))},this.trimByKinsokuShorui=function(t){var e=c([],u(t),!1),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}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=Za.MetricsString+Za.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Za.BaselineSymbol).width),u=Za.HeightMultiplier*s;s=s*Za.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,o=e.wordWrap,a=void 0!==o&&o,s=e.lineHeight,u=e.lineWidth,c=void 0===u?1:u,l=e.textBaseline,h=void 0===l?"alphabetic":l,p=e.textAlign,f=void 0===p?"start":p,d=e.letterSpacing,y=void 0===d?0:d,v=e.textPath,m=e.leading,g=void 0===m?0:m,x=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,u=void 0===s?"normal":s,c=t.fontWeight,l=void 0===c?"normal":c,h=It(n)&&"".concat(n,"px")||"16px",p=i.split(","),f=p.length-1;f>=0;f--){var d=p[f].trim();!Xo.test(d)&&0>Yo.indexOf(d)&&(d='"'.concat(d,'"')),p[f]=d}return"".concat(a," ").concat(u," ").concat(l," ").concat(h," ").concat(p.join(","))}(e),b=this.measureFont(x,n);0===b.fontSize&&(b.fontSize=i,b.ascent=i);var E=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);E.font=x,e.isOverflowing=!1;var T=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=Array(T.length),P=0;if(!v){for(C=0;T.length>C;C++){var S=E.measureText(T[C]).width+(T[C].length-1)*y;M[C]=S,P=Math.max(P,S)}A=P+c;var w=s||b.fontSize+c,N=Math.max(w,b.fontSize+c)+(T.length-1)*(w+g),k=0;return"middle"===h?k=-N/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?k=-N:"top"!==h&&"hanging"!==h||(k=0),{font:x,width:A,height:N,lines:T,lineWidths:M,lineHeight:w+=g,maxLineWidth:P,fontProperties:b,lineMetrics:M.map((function(t,e){var n=0;return"center"===f||"middle"===f?n-=t/2:"right"!==f&&"end"!==f||(n-=t),new Ln(n-c/2,k+e*w,t+c,w)}))}}v.getTotalLength();for(var C=0;T.length>C;C++)var A=E.measureText(T[C]).width+(T[C].length-1)*y},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,u=e.maxLines,c=void 0===u?1/0:u,l=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),p=o+s,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var d=[],y=0,v=0,m={},g=function(t){return r.getFromCache(t,s,m,h)},x=Array.from(f).reduce((function(t,e){return t+g(e)}),0),b=Array.from(t),E=0;b.length>E;E++){var T=b[E],M=t[E-1],P=t[E+1],S=g(T);if(this.isNewline(T)){if(++y>=c){e.isOverflowing=!0;break}v=0,d[y]=""}else{if(v>0&&v+S>p){if(y+1>=c){if(e.isOverflowing=!0,x>0&&p>=x){for(var w=d[y].length,N=0,k=w,C=0;w>C;C++){var A=g(d[y][C]);if(N+A+x>p){k=C;break}N+=A}d[y]=(d[y]||"").slice(0,k)+f}break}if(v=0,d[++y]="",this.isBreakingSpace(T))continue;this.canBreakInLastChar(T)||(d=this.trimToBreakable(d),v=this.sumTextWidthByCache(d[y]||"",m)),this.shouldBreakByKinsokuShorui(T,P)&&(d=this.trimByKinsokuShorui(d),v+=g(M||""))}v+=S,d[y]=(d[y]||"")+T}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&Za.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&Za.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=c([],u(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},t.prototype.canBreakInLastChar=function(t){return!t||!Ka.test(t)},t.prototype.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)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Ka.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),ts={},es=(Na=new oa,ka=new ia,(wa={})[t.Shape.CIRCLE]=new ta,wa[t.Shape.ELLIPSE]=new ea,wa[t.Shape.RECT]=Na,wa[t.Shape.IMAGE]=Na,wa[t.Shape.GROUP]=new sa,wa[t.Shape.LINE]=new na,wa[t.Shape.TEXT]=new aa(ts),wa[t.Shape.POLYLINE]=ka,wa[t.Shape.POLYGON]=ka,wa[t.Shape.PATH]=new ra,wa[t.Shape.HTML]=new ua,wa[t.Shape.MESH]=null,wa),ns=function(){var e,n=new no,r=new oo;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new co,e[t.PropertySyntax.ANGLE]=new to,e[t.PropertySyntax.DEFINED_PATH]=new eo,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new ro,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new ao,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new so,e[t.PropertySyntax.COORDINATE]=new oo,e[t.PropertySyntax.OFFSET_DISTANCE]=new lo,e[t.PropertySyntax.OPACITY_VALUE]=new ho,e[t.PropertySyntax.PATH]=new po,e[t.PropertySyntax.LIST_OF_POINTS]=new fo,e[t.PropertySyntax.SHADOW_BLUR]=new yo,e[t.PropertySyntax.TEXT]=new vo,e[t.PropertySyntax.TEXT_TRANSFORM]=new mo,e[t.PropertySyntax.TRANSFORM]=new $o,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new Qo,e[t.PropertySyntax.Z_INDEX]=new Jo,e[t.PropertySyntax.MARKER]=new uo,e}();ts.CameraContribution=sr,ts.AnimationTimeline=null,ts.EasingFunction=null,ts.offscreenCanvasCreator=new xa,ts.sceneGraphSelector=new Ma,ts.sceneGraphService=new qa(ts),ts.textService=new Ja(ts),ts.geometryUpdaterFactory=es,ts.CSSPropertySyntaxFactory=ns,ts.styleValueRegistry=new Ji(ts),ts.layoutRegistry=null,ts.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ts.enableStyleSyntax=!0,ts.enableSizeAttenuation=!1;var rs=0;var is=new Pa(t.ElementEvent.INSERTED,null,"","","",0,"",""),os=new Pa(t.ElementEvent.REMOVED,null,"","","",0,"",""),as=new da(t.ElementEvent.DESTROY),ss=function(e){function r(){var n=e.call(this)||this;return n.entity=rs++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},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,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle={},n.parsedStyle={},n.attributes={},n}return n(r,e),Object.defineProperty(r.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),r.prototype.cloneNode=function(t){throw Error(In)},r.prototype.appendChild=function(e,n){var r;if(e.destroyed)throw Error("Cannot append a destroyed element.");return ts.sceneGraphService.attach(e,this,n),(null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView)&&(No(this)||e.nodeName!==t.Shape.FRAGMENT?this.ownerDocument.defaultView.mountChildren(e):this.ownerDocument.defaultView.mountFragment(e)),this.isMutationObserved&&(is.relatedNode=this,e.dispatchEvent(is)),e},r.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},r.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.prototype.removeChild=function(t){var e;return os.relatedNode=this,t.dispatchEvent(os),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),ts.sceneGraphService.detach(t),t},r.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},r.prototype.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.prototype.matches=function(t){return ts.sceneGraphService.matches(t,this)},r.prototype.getElementById=function(t){return ts.sceneGraphService.querySelector("#".concat(t),this)},r.prototype.getElementsByName=function(t){return ts.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},r.prototype.getElementsByClassName=function(t){return ts.sceneGraphService.querySelectorAll(".".concat(t),this)},r.prototype.getElementsByTagName=function(t){return ts.sceneGraphService.querySelectorAll(t,this)},r.prototype.querySelector=function(t){return ts.sceneGraphService.querySelector(t,this)},r.prototype.querySelectorAll=function(t){return ts.sceneGraphService.querySelectorAll(t,this)},r.prototype.closest=function(t){var e=this;do{if(ts.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n},r.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.prototype.after=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},r.prototype.before=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=u(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,c([],u(a),!1))}},r.prototype.replaceWith=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this.after.apply(this,c([],u(t),!1)),this.remove()},r.prototype.append=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},r.prototype.prepend=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},r.prototype.replaceChildren=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,c([],u(t),!1))},r.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},r.prototype.destroy=function(){this.dispatchEvent(as),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.prototype.getGeometryBounds=function(){return ts.sceneGraphService.getGeometryBounds(this)},r.prototype.getRenderBounds=function(){return ts.sceneGraphService.getBounds(this,!0)},r.prototype.getBounds=function(){return ts.sceneGraphService.getBounds(this)},r.prototype.getLocalBounds=function(){return ts.sceneGraphService.getLocalBounds(this)},r.prototype.getBoundingClientRect=function(){return ts.sceneGraphService.getBoundingClientRect(this)},r.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},r.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},r.prototype.getAttribute=function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}},r.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},r.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.prototype.setAttribute=function(t,e,n,r){this.attributes[t]=e},r.prototype.getAttributeNS=function(t,e){throw Error(In)},r.prototype.getAttributeNode=function(t){throw Error(In)},r.prototype.getAttributeNodeNS=function(t,e){throw Error(In)},r.prototype.hasAttributeNS=function(t,e){throw Error(In)},r.prototype.removeAttributeNS=function(t,e){throw Error(In)},r.prototype.removeAttributeNode=function(t){throw Error(In)},r.prototype.setAttributeNS=function(t,e,n){throw Error(In)},r.prototype.setAttributeNode=function(t){throw Error(In)},r.prototype.setAttributeNodeNS=function(t){throw Error(In)},r.prototype.toggleAttribute=function(t,e){throw Error(In)},r}(ma);function us(t){return!!(null==t?void 0:t.nodeName)}var cs,ls=ts.globalThis.Proxy?ts.globalThis.Proxy:function(){},hs=new Pa(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Pa.MODIFICATION,null,null),ps=W(),fs=dt(),ds=function(e){function i(n){var r=e.call(this)||this;return r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.config=n,r.id=n.id||"",r.name=n.name||"",(n.className||n.class)&&(r.className=n.className||n.class),r.nodeName=n.type||t.Shape.GROUP,n.initialParsedStyle&&Object.assign(r.parsedStyle,n.initialParsedStyle),r.initAttributes(n.style),ts.enableStyleSyntax&&(r.style=new ls({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return n(i,e),i.prototype.destroy=function(){e.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},i.prototype.cloneNode=function(t,e){var n=r({},this.attributes);for(var i in n){var o=n[i];us(o)&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(n[i]=o.cloneNode(t)),e&&(n[i]=e(i,o))}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},i.prototype.initAttributes=function(t){void 0===t&&(t={});ts.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.renderable.dirty=!0},i.prototype.setAttribute=function(t,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0),Ut(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),e.prototype.setAttribute.call(this,t,n))},i.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];ts.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(hs.relatedNode=this,hs.prevValue=o,hs.newValue=e,hs.attrName=t,hs.prevParsedValue=a,hs.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(hs):(hs.target=this,this.ownerDocument.defaultView.dispatchEvent(hs,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},i.prototype.getBBox=function(){var t=this.getBounds(),e=u(t.getMin(),2),n=e[0],r=e[1],i=u(t.getMax(),2);return new Ln(n,r,i[0]-n,i[1]-r)},i.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ts.sceneGraphService.setOrigin(this,Gn(t,e,n,!1)),this},i.prototype.getOrigin=function(){return ts.sceneGraphService.getOrigin(this)},i.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ts.sceneGraphService.setPosition(this,Gn(t,e,n,!1)),this},i.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ts.sceneGraphService.setLocalPosition(this,Gn(t,e,n,!1)),this},i.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ts.sceneGraphService.translate(this,Gn(t,e,n,!1)),this},i.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ts.sceneGraphService.translateLocal(this,Gn(t,e,n,!1)),this},i.prototype.getPosition=function(){return ts.sceneGraphService.getPosition(this)},i.prototype.getLocalPosition=function(){return ts.sceneGraphService.getLocalPosition(this)},i.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},i.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Gn(t,e=e||t,n=n||t,!1)),ts.sceneGraphService.scaleLocal(this,t),this},i.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Gn(t,e=e||t,n=n||t,!1)),ts.sceneGraphService.setLocalScale(this,t),this},i.prototype.getLocalScale=function(){return ts.sceneGraphService.getLocalScale(this)},i.prototype.getScale=function(){return ts.sceneGraphService.getScale(this)},i.prototype.getEulerAngles=function(){return jn(u(Hn(ps,ts.sceneGraphService.getWorldTransform(this)),3)[2])},i.prototype.getLocalEulerAngles=function(){return jn(u(Hn(ps,ts.sceneGraphService.getLocalRotation(this)),3)[2])},i.prototype.setEulerAngles=function(t){return ts.sceneGraphService.setEulerAngles(this,0,0,t),this},i.prototype.setLocalEulerAngles=function(t){return ts.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},i.prototype.rotateLocal=function(t,e,n){return wt(e)&&wt(n)?ts.sceneGraphService.rotateLocal(this,0,0,t):ts.sceneGraphService.rotateLocal(this,t,e,n),this},i.prototype.rotate=function(t,e,n){return wt(e)&&wt(n)?ts.sceneGraphService.rotate(this,0,0,t):ts.sceneGraphService.rotate(this,t,e,n),this},i.prototype.setRotation=function(t,e,n,r){return ts.sceneGraphService.setRotation(this,t,e,n,r),this},i.prototype.setLocalRotation=function(t,e,n,r){return ts.sceneGraphService.setLocalRotation(this,t,e,n,r),this},i.prototype.setLocalSkew=function(t,e){return ts.sceneGraphService.setLocalSkew(this,t,e),this},i.prototype.getRotation=function(){return ts.sceneGraphService.getRotation(this)},i.prototype.getLocalRotation=function(){return ts.sceneGraphService.getLocalRotation(this)},i.prototype.getLocalSkew=function(){return ts.sceneGraphService.getLocalSkew(this)},i.prototype.getLocalTransform=function(){return ts.sceneGraphService.getLocalTransform(this)},i.prototype.getWorldTransform=function(){return ts.sceneGraphService.getWorldTransform(this)},i.prototype.setLocalTransform=function(t){return ts.sceneGraphService.setLocalTransform(this,t),this},i.prototype.resetLocalTransform=function(){ts.sceneGraphService.resetLocalTransform(this)},i.prototype.getAnimations=function(){return this.activeAnimations},i.prototype.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},i.prototype.isVisible=function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(i.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),i.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},i.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},i.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,c([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},i.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,c([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},i.prototype.getConfig=function(){return this.config},i.prototype.attr=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=u(e,2),i=r[0],o=r[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},i.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=u(I(ps,e),2),r=n[0],i=n[1],o=u(D(ps,e),2),a=o[0],s=o[1],c=_(fs,e),l=u(Hn(ps,c),3);return zn(l[0]||l[2],r,i,a,s)},i.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},i.prototype.setMatrix=function(t){var e=u(Wn(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},i.prototype.setLocalMatrix=function(t){var e=u(Wn(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},i.prototype.show=function(){this.forEach((function(t){t.style.visibility="visible"}))},i.prototype.hide=function(){this.forEach((function(t){t.style.visibility="hidden"}))},i.prototype.getCount=function(){return this.childElementCount},i.prototype.getParent=function(){return this.parentElement},i.prototype.getChildren=function(){return this.children},i.prototype.getFirst=function(){return this.firstElementChild},i.prototype.getLast=function(){return this.lastElementChild},i.prototype.getChildByIndex=function(t){return this.children[t]||null},i.prototype.add=function(t,e){return this.appendChild(t,e)},i.prototype.set=function(t,e){this.config[t]=e},i.prototype.get=function(t){return this.config[t]},i.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},i.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},i.prototype.setZIndex=function(t){return this.style.zIndex=t,this},i}(ss),ys=function(e){function i(n){return void 0===n&&(n={}),e.call(this,r({type:t.Shape.CIRCLE},n))||this}return n(i,e),i}(ds),vs=function(t){function e(e){void 0===e&&(e={});var n=this,o=e.style,a=i(e,["style"]);return(n=t.call(this,r({style:o},a))||this).isCustomElement=!0,n}return n(e,t),e}(ds),ms=function(e){function i(n){return void 0===n&&(n={}),e.call(this,r({type:t.Shape.ELLIPSE},n))||this}return n(i,e),i}(ds),gs=function(e){function r(){return e.call(this,{type:t.Shape.FRAGMENT})||this}return n(r,e),r}(ds),xs=function(e){function i(n){return void 0===n&&(n={}),e.call(this,r({type:t.Shape.GROUP},n))||this}return n(i,e),i}(ds),bs=function(e){function o(n){void 0===n&&(n={});var o=this,a=n.style,s=i(n,["style"]);return(o=e.call(this,r({type:t.Shape.HTML,style:a},s))||this).cullable.enable=!1,o}return n(o,e),o.prototype.getDomElement=function(){return this.parsedStyle.$el},o.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},o.prototype.getLocalBounds=function(){if(this.parentNode){var t=E(y(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Cn.isEmpty(e)){var n=new Cn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},o}(ds),Es=function(e){function i(n){return void 0===n&&(n={}),e.call(this,r({type:t.Shape.IMAGE},n))||this}return n(i,e),i}(ds),Ts=function(e){function o(n){void 0===n&&(n={});var o=this,a=n.style,s=i(n,["style"]);(o=e.call(this,r({type:t.Shape.LINE,style:r({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},a)},s))||this).markerStartAngle=0,o.markerEndAngle=0;var u=o.parsedStyle,c=u.markerStart,l=u.markerEnd;return c&&us(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),l&&us(l)&&(o.markerEndAngle=l.getLocalEulerAngles(),o.appendChild(l)),o.transformMarker(!0),o.transformMarker(!1),o}return n(o,e),o.prototype.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&&us(r)&&(this.markerStartAngle=0,r.remove()),i&&us(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&us(r)&&(this.markerEndAngle=0,r.remove()),i&&us(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},o.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&us(u)){var c,l,h,p,f,d,y;t?(p=i,f=a,l=o-i,h=s-a,d=n||0,y=this.markerStartAngle):(p=o,f=s,l=i-o,h=a-s,d=r||0,y=this.markerEndAngle),u.setLocalEulerAngles(180*(c=Math.atan2(h,l))/Math.PI+y),u.setLocalPosition(p+Math.cos(c)*d,f+Math.sin(c)*d)}},o.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=un(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=at(W(),K(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new On(a[0],a[1])},o.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},o.prototype.getTotalLength=function(){var t=this.parsedStyle;return sn(t.x1,t.y1,t.x2,t.y2)},o}(ds),Ms=function(e){function o(n){void 0===n&&(n={});var o=this,a=n.style,s=i(n,["style"]);(o=e.call(this,r({type:t.Shape.PATH,style:a,initialParsedStyle:{miterLimit:4,d:r({},fr)}},s))||this).markerStartAngle=0,o.markerEndAngle=0,o.markerMidList=[];var u=o.parsedStyle,c=u.markerStart,l=u.markerEnd,h=u.markerMid;return c&&us(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),h&&us(h)&&o.placeMarkerMid(h),l&&us(l)&&(o.markerEndAngle=l.getLocalEulerAngles(),o.appendChild(l)),o.transformMarker(!0),o.transformMarker(!1),o}return n(o,e),o.prototype.attributeChangedCallback=function(t,e,n,r,i){"d"===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&&us(r)&&(this.markerStartAngle=0,r.remove()),i&&us(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&us(r)&&(this.markerEndAngle=0,r.remove()),i&&us(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},o.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&us(i)){var o,a,s,c,l,h,p;if(t){var f=u(this.getStartTangent(),2);c=(y=f[1])[0],l=y[1],a=(d=f[0])[0]-y[0],s=d[1]-y[1],h=n||0,p=this.markerStartAngle}else{var d,y,v=u(this.getEndTangent(),2);c=(y=v[1])[0],l=y[1],a=(d=v[0])[0]-y[0],s=d[1]-y[1],h=r||0,p=this.markerEndAngle}i.setLocalEulerAngles(180*(o=Math.atan2(s,a))/Math.PI+p),i.setLocalPosition(c+Math.cos(o)*h,l+Math.sin(o)*h)}},o.prototype.placeMarkerMid=function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&us(t))for(var n=1;e.length-1>n;n++){var r=u(e[n].currentPoint,2),i=r[0],o=r[1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,o)}},o.prototype.getTotalLength=function(){return di(this)},o.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return ge(t,e,r(r({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),i=n.x,o=n.y,a=at(W(),K(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new On(a[0],a[1])},o.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*di(this),e)},o.prototype.getStartTangent=function(){var t=this.parsedStyle.d.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},o.prototype.getEndTangent=function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},o}(ds),Ps=function(e){function o(n){void 0===n&&(n={});var o=this,a=n.style,s=i(n,["style"]);(o=e.call(this,r({type:t.Shape.POLYGON,style:a,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},s))||this).markerStartAngle=0,o.markerEndAngle=0,o.markerMidList=[];var u=o.parsedStyle,c=u.markerStart,l=u.markerEnd,h=u.markerMid;return c&&us(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),h&&us(h)&&o.placeMarkerMid(h),l&&us(l)&&(o.markerEndAngle=l.getLocalEulerAngles(),o.appendChild(l)),o.transformMarker(!0),o.transformMarker(!1),o}return n(o,e),o.prototype.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&&us(r)&&(this.markerStartAngle=0,r.remove()),i&&us(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&us(r)&&(this.markerEndAngle=0,r.remove()),i&&us(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},o.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,o=t?e.markerStart:e.markerEnd;if(o&&us(o)&&i){var a,s,u,c,l,h,p;if(c=i[0][0],l=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,p=this.markerStartAngle;else{var f=i.length;this.parsedStyle.isClosed?(s=i[f-1][0]-i[0][0],u=i[f-1][1]-i[0][1]):(c=i[f-1][0],l=i[f-1][1],s=i[f-2][0]-i[f-1][0],u=i[f-2][1]-i[f-1][1]),h=r||0,p=this.markerEndAngle}o.setLocalEulerAngles(180*(a=Math.atan2(u,s))/Math.PI+p),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},o.prototype.placeMarkerMid=function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&us(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}},o}(ds),Ss=function(e){function o(n){void 0===n&&(n={});var o=n.style,a=i(n,["style"]);return e.call(this,r({type:t.Shape.POLYLINE,style:o,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},a))||this}return n(o,e),o.prototype.getTotalLength=function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=pn(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t},o.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},o.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,o=[],a=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=sn(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))})),this.parsedStyle.points.segments=o}var u=0,c=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),c=n)}));var l=un(n[c][0],n[c][1],n[c+1][0],n[c+1][1],u),h=l.x,p=l.y,f=at(W(),K(h,p,0),e?this.getWorldTransform():this.getLocalTransform());return new On(f[0],f[1])},o.prototype.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},o.prototype.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},o}(Ps),ws=function(e){function i(n){return void 0===n&&(n={}),e.call(this,r({type:t.Shape.RECT},n))||this}return n(i,e),i}(ds),Ns=function(e){function o(n){void 0===n&&(n={});var o=n.style,a=i(n,["style"]);return e.call(this,r({type:t.Shape.TEXT,style:r({fill:"black"},o)},a))||this}return n(o,e),o.prototype.getComputedTextLength=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},o.prototype.getLineBoundingRects=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},o.prototype.isOverflowing=function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing},o}(ds),ks=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,ys),this.define(t.Shape.ELLIPSE,ms),this.define(t.Shape.RECT,ws),this.define(t.Shape.IMAGE,Es),this.define(t.Shape.LINE,Ts),this.define(t.Shape.GROUP,xs),this.define(t.Shape.PATH,Ms),this.define(t.Shape.POLYGON,Ps),this.define(t.Shape.POLYLINE,Ss),this.define(t.Shape.TEXT,Ns),this.define(t.Shape.HTML,bs)}return e.prototype.define=function(t,e){this.registry[t]=e},e.prototype.get=function(t){return this.registry[t]},e}(),Cs={number:function(t){return new wr(t)},percent:function(t){return new wr(t,"%")},px:function(t){return new wr(t,"px")},em:function(t){return new wr(t,"em")},rem:function(t){return new wr(t,"rem")},deg:function(t){return new wr(t,"deg")},grad:function(t){return new wr(t,"grad")},rad:function(t){return new wr(t,"rad")},turn:function(t){return new wr(t,"turn")},s:function(t){return new wr(t,"s")},ms:function(t){return new wr(t,"ms")},registerProperty:function(t){ts.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){ts.layoutRegistry.registerLayout(t,e)}},As=function(e){function r(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new ts.AnimationTimeline(n)}catch(t){}var r={};return Ki.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=St(n)?n(t.Shape.GROUP):n)})),n.documentElement=new xs({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return n(r,e),Object.defineProperty(r.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),r.prototype.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?Ns:xs);var r=new n(e);return r.ownerDocument=this,r},r.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},r.prototype.cloneNode=function(t){throw Error(In)},r.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},r.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},r.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.prototype.elementFromPoint=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,l,h,p;return a(this,(function(a){switch(a.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,0>r||0>i||r>s||i>u?[2,null]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,h=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:h},picked:[]})]);case 1:return[2,(p=a.sent().picked)&&p[0]||this.documentElement]}}))}))},r.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.prototype.elementsFromPoint=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,l,h,p;return a(this,(function(a){switch(a.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,0>r||0>i||r>s||i>u?[2,[]]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,h=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:h},picked:[]})]);case 1:return(p=a.sent().picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),[2,p]}}))}))},r.prototype.appendChild=function(t,e){throw Error(Dn)},r.prototype.insertBefore=function(t,e){throw Error(Dn)},r.prototype.removeChild=function(t,e){throw Error(Dn)},r.prototype.replaceChild=function(t,e,n){throw Error(Dn)},r.prototype.append=function(){throw Error(Dn)},r.prototype.prepend=function(){throw Error(Dn)},r.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},r.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},r.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.prototype.find=function(t){return this.documentElement.find(t)},r.prototype.findAll=function(t){return this.documentElement.findAll(t)},r}(ma),Rs=function(){function e(t){this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new da(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e.tag="Culling",e}(),Os=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new pa(null),this.rootWheelEvent=new fa(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var u=t.normalizeToPointerEvent(e,a);try{for(var c=s(u),l=c.next();!l.done;l=c.next()){var h=t.bootstrapEvent(t.rootPointerEvent,l.value,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,u=t.normalizeToPointerEvent(e,a);try{for(var c=s(u),l=c.next();!l.done;l=c.next()){var h=t.bootstrapEvent(t.rootPointerEvent,l.value,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.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){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var c=n.bootstrapEvent(n.rootPointerEvent,u.value,i,t);n.context.eventService.mapEvent(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(o,t)?"":"outside",u=n.normalizeToPointerEvent(t,i);try{for(var c=s(u),l=c.next();!l.done;l=c.next()){var h=n.bootstrapEvent(n.rootPointerEvent,l.value,i,t);h.type+=a,n.context.eventService.mapEvent(h)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}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.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var c=n.bootstrapEvent(n.rootPointerEvent,u.value,i,t);n.context.eventService.mapEvent(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.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.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.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=So[t.type]||t.type),t},t.prototype.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.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=wo.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},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];Ut(i.button)&&(i.button=0),Ut(i.buttons)&&(i.buttons=1),Ut(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ut(i.width)&&(i.width=i.radiusX||1),Ut(i.height)&&(i.height=i.radiusY||1),Ut(i.tiltX)&&(i.tiltX=0),Ut(i.tiltY)&&(i.tiltY=0),Ut(i.pointerType)&&(i.pointerType="touch"),Ut(i.pointerId)&&(i.pointerId=i.identifier||0),Ut(i.pressure)&&(i.pressure=i.force||.5),Ut(i.twist)&&(i.twist=0),Ut(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Ut(o.isPrimary)&&(o.isPrimary=!0),Ut(o.width)&&(o.width=1),Ut(o.height)&&(o.height=1),Ut(o.tiltX)&&(o.tiltX=0),Ut(o.tiltY)&&(o.tiltY=0),Ut(o.pointerType)&&(o.pointerType="mouse"),Ut(o.pointerId)&&(o.pointerId=1),Ut(o.pressure)&&(o.pressure=.5),Ut(o.twist)&&(o.twist=0),Ut(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),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(){}return e.prototype.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(Cn.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(i=null===(r=n.parentNode)||void 0===r?void 0:r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},e.prototype.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=Ls.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,p=l.distance;if(0>rt(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>rt(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}(),Ds=function(){function e(){this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return e.prototype.apply=function(n){var r,i=this,o=n.renderingService,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var s=function(t){t.target.renderable.dirty=!0,o.dirtify()},u=function(t){i.syncTasks.set(t.target,t.detail.affectChildren),o.dirtify()},c=function(t){ts.enableSizeAttenuation&&ts.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&i.rBush.remove(n.aabb),i.syncTasks.delete(e),ts.sceneGraphService.dirtifyToRoot(e),o.dirtify()};o.hooks.init.tap(e.tag,(function(){a.addEventListener(t.ElementEvent.MOUNTED,c),a.addEventListener(t.ElementEvent.UNMOUNTED,l),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,u)})),o.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,c),a.removeEventListener(t.ElementEvent.UNMOUNTED,l),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,u),i.syncTasks.clear()}));var h=null!==(r=ts.globalThis.requestIdleCallback)&&void 0!==r?r:Fo.bind(ts.globalThis);o.hooks.endFrame.tap(e.tag,(function(){i.isFirstTimeRendering?(i.isFirstTimeRendering=!1,i.syncing=!0,h((function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0}))):i.syncRTree()}))},e.prototype.syncNode=function(t,e){if(void 0===e&&(e=!1),t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new Cn),i.dirtyRenderBounds.update(r.center,r.halfExtents));var o=u(r.getMin(),2),a=o[0],s=o[1],c=u(r.getMax(),2),l=c[0],h=c[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=a,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=h}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}},e.prototype.syncRTree=function(t){var e=this;if(void 0===t&&(t=!1),t||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var o=e.syncNode(i,t);o&&(n.push(o),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}},e.tag="Prepare",e}();t.CanvasEvent=void 0,(cs=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",cs.BEFORE_RENDER="beforerender",cs.RERENDER="rerender",cs.AFTER_RENDER="afterrender",cs.BEFORE_DESTROY="beforedestroy",cs.AFTER_DESTROY="afterdestroy",cs.RESIZE="resize",cs.DIRTY_RECTANGLE="dirtyrectangle",cs.RENDERER_CHANGED="rendererchanged";var _s=new da(t.ElementEvent.MOUNTED),Fs=new da(t.ElementEvent.UNMOUNTED),Gs=new da(t.CanvasEvent.BEFORE_RENDER),Us=new da(t.CanvasEvent.RERENDER),Bs=new da(t.CanvasEvent.AFTER_RENDER),Vs=function(e){function i(t){var n=e.call(this)||this;n.Element=ds,n.inited=!1,n.destroyed=!1,n.context={},n.document=new As,n.document.defaultView=n,n.customElements=new ks;var r=t.container,i=t.canvas,o=t.offscreenCanvas,a=t.width,s=t.height,u=t.devicePixelRatio,c=t.renderer,l=t.background,h=t.cursor,p=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,y=t.createImage,v=t.supportsPointerEvents,m=t.supportsTouchEvents,g=t.supportsCSSTransform,x=t.cleanUpOnDestroy,b=void 0===x||x,E=t.useNativeClickEvent,T=t.alwaysTriggerPointerEventOnCanvas,M=t.isTouchEvent,P=t.isMouseEvent,S=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||xo(r,n,b);var w=a,N=s,k=u;return i&&(k=1>(k=u||bo&&window.devicePixelRatio||1)?1:Math.ceil(k),w=a||function(t){var e=Po(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/k,N=s||function(t){var e=Po(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/k),o&&(ts.offscreenCanvas=o),n.devicePixelRatio=k,n.requestAnimationFrame=null!=f?f:Fo.bind(ts.globalThis),n.cancelAnimationFrame=null!=d?d:Go.bind(ts.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in ts.globalThis,n.supportsPointerEvents=null!=v?v:!!ts.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof ts.globalThis.TouchEvent},n.isMouseEvent=null!=P?P:function(t){return!ts.globalThis.MouseEvent||t instanceof ts.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof ts.globalThis.PointerEvent))},n.dblClickSpeed=null!=S?S:200,n.initRenderingContext({container:r,canvas:i,width:w,height:N,renderer:c,offscreenCanvas:o,devicePixelRatio:k,cursor:h||"default",background:l||"transparent",createImage:y,document:p,supportsCSSTransform:g,useNativeClickEvent:E,cleanUpOnDestroy:b,alwaysTriggerPointerEventOnCanvas:T}),n.initDefaultCamera(w,N,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return n(i,e),i.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},i.prototype.initDefaultCamera=function(e,n,r){var i=this,o=new ts.CameraContribution;o.clipSpaceNearZ=r,o.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),o.canvas=this,o.eventEmitter.on(or.UPDATED,(function(){i.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED),ts.enableSizeAttenuation&&i.getConfig().renderer.getConfig().enableSizeAttenuation&&i.updateSizeAttenuation()})),this.context.camera=o},i.prototype.updateSizeAttenuation=function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){ts.styleValueRegistry.updateSizeAttenuation(e,t)}))},i.prototype.getConfig=function(){return this.context.config},i.prototype.getRoot=function(){return this.document.documentElement},i.prototype.getCamera=function(){return this.context.camera},i.prototype.getContextService=function(){return this.context.contextService},i.prototype.getEventService=function(){return this.context.eventService},i.prototype.getRenderingService=function(){return this.context.renderingService},i.prototype.getRenderingContext=function(){return this.context.renderingContext},i.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(i.prototype,"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},enumerable:!1,configurable:!0}),i.prototype.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=this.getConfig().fastCleanExistingCanvas),n||this.dispatchEvent(new da(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 da(t.CanvasEvent.AFTER_DESTROY));var i=function(t){t.currentTarget=null,t.manager=null,t.target=null};i(_s),i(Fs),i(Gs),i(Us),i(Bs),this.destroyed=!0},i.prototype.changeSize=function(t,e){this.resize(t,e)},i.prototype.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new da(t.CanvasEvent.RESIZE,{width:e,height:n}))},i.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},i.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},i.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},i.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},i.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},i.prototype.render=function(t){var e=this;t&&(Gs.detail=t,Bs.detail=t),this.dispatchEvent(Gs),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(Us)})),this.dispatchEvent(Bs)},i.prototype.run=function(){var t=this,e=function(n,r){if(t.destroyed)return t.cancelAnimationFrame(t.frameId);t.render(r),t.frameId=t.requestAnimationFrame(e)};e()},i.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new xn,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Os,new Ds,new Rs([new Is])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(r(r({},ts),this.context)),this.context.renderingService=new Ea(ts,this.context),this.context.eventService=new ga(ts,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},i.prototype.initRenderingService=function(e,n,r){var i=this;void 0===n&&(n=!1),void 0===r&&(r=!1),this.context.renderingService.init((function(){i.inited=!0,n?r?i.requestAnimationFrame((function(){i.dispatchEvent(new da(t.CanvasEvent.READY))})):i.dispatchEvent(new da(t.CanvasEvent.READY)):i.dispatchEvent(new da(t.CanvasEvent.RENDERER_CHANGED)),i.readyPromise&&i.resolveReadyPromise(),n||i.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),i.mountChildren(i.getRoot()),e.getConfig().enableAutoRendering&&i.run()}))},i.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(ts)}))},i.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),c([],u(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(ts)})),this.initRenderer(t)}},i.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},i.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(this.getConfig().cleanUpOnDestroy||(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()},i.prototype.mountChildren=function(t,e){var n=this;void 0===e&&(e=No(t)),this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,e||(t.isMutationObserved?t.dispatchEvent(_s):(_s.target=t,this.dispatchEvent(_s,!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){n.mountChildren(t,e)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},i.prototype.mountFragment=function(t){this.mountChildren(t,!1)},i.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},i.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},i.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},i.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},i.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},i.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},i}(va),js=function(e){function r(){var t=e.apply(this,c([],u(arguments),!1))||this;return t.landmarks=[],t}return n(r,e),r.prototype.rotate=function(e,n,r){if(this.relElevation=_n(n),this.relAzimuth=_n(e),this.relRoll=_n(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=yt(dt(),[1,0,0],Bn((this.rotateWorld?1:-1)*this.relElevation)),o=yt(dt(),[0,1,0],Bn((this.rotateWorld?1:-1)*this.relAzimuth)),a=yt(dt(),[0,0,1],Bn(this.relRoll)),s=vt(dt(),o,i);s=vt(dt(),s,a);var u=G(y(),s);P(this.matrix,this.matrix,[0,0,-this.distance]),M(this.matrix,this.matrix,u),P(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},r.prototype.pan=function(t,e){var n=Gn(t,e,0),r=q(this.position);return J(r,r,et(W(),this.right,n[0])),J(r,r,et(W(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},r.prototype.dolly=function(e){var n,r=this.forward,i=q(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&&J(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},r.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},r.prototype.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,s=void 0===a?this.position:a,u=e.focalPoint,c=void 0===u?this.focalPoint:u,l=e.roll,h=e.zoom,p=new ts.CameraContribution;p.setType(this.type,void 0),p.setPosition(s[0],null!==(n=s[1])&&void 0!==n?n:this.position[1],null!==(r=s[2])&&void 0!==r?r:this.position[2]),p.setFocalPoint(c[0],null!==(i=c[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=c[2])&&void 0!==o?o:this.focalPoint[2]),p.setRoll(null!=l?l:this.roll),p.setZoom(null!=h?h:this.zoom);var f={name:t,matrix:v(p.getWorldTransform()),right:q(p.right),up:q(p.up),forward:q(p.forward),position:q(p.getPosition()),focalPoint:q(p.getFocalPoint()),distanceVector:q(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(f),f},r.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=Ot(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=It(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,p=void 0===h?void 0:h,f=i.onframe,d=void 0===f?void 0:f;this.cancelLandmarkAnimation();var y,v=r.position,m=r.focalPoint,g=r.zoom,x=r.roll,b=l||ts.EasingFunction(a),E=function(){n.setFocalPoint(m),n.setPosition(v),n.setRoll(x),n.setZoom(g),n.computeMatrix(),n.triggerUpdate(),null==p||p()};if(0===u)return E();var T=function(t){void 0===y&&(y=t);var e=t-y;if(u>e){var r,i,o=b(e/u),a=W(),s=W();if(ot(a,n.focalPoint,m,o),ot(s,n.position,v,o),i=n.roll*(1-o)+x*o,r=n.zoom*(1-o)+g*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),.01>=ct(a,m)+ct(s,v)&&null==g&&null==x)return E();n.computeMatrix(),n.triggerUpdate(),u>e&&(null==d||d(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(T))}else E()};this.canvas.requestAnimationFrame(T)}},r}(sr);ts.CameraContribution=js;var Ys,Xs,Hs=function(){function t(t,e){this.type=t,this.target=e,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[]}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}(),zs=0,Ws=new WeakMap,qs=function(){function e(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}return e.prototype.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:Xs&&function(t){return t===Xs||t===Ys}(t)?Xs:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else Js.push(this.observer),Qs||(Qs=!0,void 0!==ts.globalThis?ts.globalThis.setTimeout(tu):tu());e[n]=t},e.prototype.addListeners=function(){this.addListeners_(this.target)},e.prototype.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)},e.prototype.removeListeners=function(){this.removeListeners_(this.target)},e.prototype.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)},e.prototype.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Ws.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},e.prototype.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=Ks("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===Pa.ADDITION?null:e.prevValue;$s(r,(function(t){var e;if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?(e=a,Xs||((Xs=Hs.copy(Ys)).oldValue=e,Xs)):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s=e.target,u=void 0,c=void 0;e.type===t.ElementEvent.INSERTED?(u=[s],c=[]):(u=[],c=[s]);var l=s.previousSibling,h=s.nextSibling;(n=Ks("childList",r=e.relatedNode)).addedNodes=u,n.removedNodes=c,n.previousSibling=l,n.nextSibling=h,$s(r,(function(t){if(t.childList)return n}))}Ys=Xs=void 0},e}(),Zs=function(){function t(t){this.callback=t,this.nodes=[],this.records=[],this.uid=zs++}return t.prototype.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=Ws.get(t);r||Ws.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 qs(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},t.prototype.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=Ws.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=[]},t.prototype.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function Ks(t,e){return Ys=new Hs(t,e)}function $s(t,e){for(var n=t;n;n=n.parentNode){var r=Ws.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var Qs=!1,Js=[];function tu(){Qs=!1;var t=Js;Js=[],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=Ws.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&tu()}var eu=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return n(e,t),e}(la),nu=0,ru=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(nu++),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()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"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},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"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},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;isNaN(t=Number(t))||(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)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"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()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"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()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.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},t.prototype.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()},t.prototype.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()},t.prototype.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())},t.prototype.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 eu(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.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))},t.prototype.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},t.prototype.persist=function(){throw Error(In)},t.prototype.addEventListener=function(t,e,n){throw Error(In)},t.prototype.removeEventListener=function(t,e,n){throw Error(In)},t.prototype.dispatchEvent=function(t){throw Error(In)},t.prototype.commitStyles=function(){throw Error(In)},t.prototype.ensureAlive=function(){var t,e;this._inEffect=0>this.playbackRate&&0===this.currentTime?!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):!!(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))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new eu(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 eu(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),iu=.1,ou="function"==typeof Float32Array,au=function(t,e){return 1-3*e+3*t},su=function(t,e){return 3*e-6*t},uu=function(t){return 3*t},cu=function(t,e,n){return((au(e,n)*t+su(e,n))*t+uu(e))*t},lu=function(t,e,n){return 3*au(e,n)*t*t+2*su(e,n)*t+uu(e)},hu=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=ou?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=cu(o*iu,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=iu;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*iu,s=lu(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=cu(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+iu,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=lu(e,n,r);if(0===o)return e;e-=(cu(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:cu(a(t),e,r)}},pu=function(t){return Math.pow(t,2)},fu=function(t){return Math.pow(t,3)},du=function(t){return Math.pow(t,4)},yu=function(t){return Math.pow(t,5)},vu=function(t){return Math.pow(t,6)},mu=function(t){return 1-Math.cos(t*Math.PI/2)},gu=function(t){return 1-Math.sqrt(1-t*t)},xu=function(t){return t*t*(3*t-2)},bu=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)},Eu=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=n[1],o=void 0===i?.5:i,a=Lt(Number(void 0===r?1:r),1,10),s=Lt(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-s/(2*Math.PI)*Math.asin(1/a))/s)},Tu=function(t,e,n){void 0===e&&(e=[]);var r=u(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,c=r[2],l=void 0===c?10:c,h=r[3],p=void 0===h?0:h;o=Lt(o,.1,1e3),s=Lt(s,.1,1e3),l=Lt(l,.1,1e3),p=Lt(p,.1,1e3);var f=Math.sqrt(s/o),d=l/(2*Math.sqrt(s*o)),y=1>d?f*Math.sqrt(1-d*d):0,v=1>d?(d*f-p)/y:-p+f,m=n?n*t/1e3:t;return m=1>d?Math.exp(-m*d*f)*(1*Math.cos(y*m)+v*Math.sin(y*m)):(1+v*m)*Math.exp(-m*f),0===t||1===t?t:1-m},Mu=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(Lt(t,0,1)*i)/i},Pu=function(t,e){void 0===e&&(e=[]);var n=u(e,4);return hu(n[0],n[1],n[2],n[3])(t)},Su=hu(.42,0,1,1),wu=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Nu=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}},ku=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}},Cu={steps:Mu,"step-start":function(t){return Mu(t,[1,"start"])},"step-end":function(t){return Mu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Pu,ease:function(t){return Pu(t,[.25,.1,.25,1])},in:Su,out:wu(Su),"in-out":Nu(Su),"out-in":ku(Su),"in-quad":pu,"out-quad":wu(pu),"in-out-quad":Nu(pu),"out-in-quad":ku(pu),"in-cubic":fu,"out-cubic":wu(fu),"in-out-cubic":Nu(fu),"out-in-cubic":ku(fu),"in-quart":du,"out-quart":wu(du),"in-out-quart":Nu(du),"out-in-quart":ku(du),"in-quint":yu,"out-quint":wu(yu),"in-out-quint":Nu(yu),"out-in-quint":ku(yu),"in-expo":vu,"out-expo":wu(vu),"in-out-expo":Nu(vu),"out-in-expo":ku(vu),"in-sine":mu,"out-sine":wu(mu),"in-out-sine":Nu(mu),"out-in-sine":ku(mu),"in-circ":gu,"out-circ":wu(gu),"in-out-circ":Nu(gu),"out-in-circ":ku(gu),"in-back":xu,"out-back":wu(xu),"in-out-back":Nu(xu),"out-in-back":ku(xu),"in-bounce":bu,"out-bounce":wu(bu),"in-out-bounce":Nu(bu),"out-in-bounce":ku(bu),"in-elastic":Eu,"out-elastic":wu(Eu),"in-out-elastic":Nu(Eu),"out-in-elastic":ku(Eu),spring:Tu,"spring-in":Tu,"spring-out":wu(Tu),"spring-in-out":Nu(Tu),"spring-out-in":ku(Tu)},Au=function(t){return Cu[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)]||Cu.linear},Ru=function(t){return t},Ou=1,Lu=.5,Iu=0;function Du(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var _u="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Fu=RegExp("cubic-bezier\\("+_u+","+_u+","+_u+","+_u+"\\)"),Gu=/steps\(\s*(\d+)\s*\)/,Uu=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Bu(t){var e=Fu.exec(t);if(e)return hu.apply(void 0,c([],u(e.slice(1).map(Number)),!1));var n=Gu.exec(t);if(n)return Du(Number(n[1]),Iu);var r=Uu.exec(t);return r?Du(Number(r[1]),{start:Ou,middle:Lu,end:Iu}[r[2]]):Au(t)}function Vu(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 ju=0,Yu=1,Xu=2,Hu=3;function zu(t,e,n){var r=function(t,e,n){if(null===e)return ju;var r=n.endTime;return Math.min(n.delay,r)>e?Yu:Math.min(n.delay+t+n.endDelay,r)>e?Hu:Xu}(t,e,n),i=function(t,e,n,r,i){switch(r){case Yu:return"backwards"===e||"both"===e?0:null;case Hu:return n-i;case Xu:return"forwards"===e||"both"===e?t:null;case ju:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?e!==Yu&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==Xu||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return t===Xu&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}function Wu(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(qu(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Bu(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Ku(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset;t.setAttribute(n.property,n.interpolation(0===r?0:(e-n.startOffset)/r),!1,!1)}));else for(var n in r)qu(n)&&t.setAttribute(n,null)}}function qu(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Zu=function(t,e,n){return function(r){var i=$u(t,e,r);return It(i)?i:n(i)}};function Ku(t,e,n,r){var i=Qi[t];if(i&&i.syntax&&i.int){var o=ts.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=o.parser,s=a?a(e,r):e,l=a?a(n,r):n,h=o.mixer(s,l,r);if(h){var p=Zu.apply(void 0,c([],u(h),!1));return function(t){return 0===t?e:1===t?n:p(t)}}}}return Zu(!1,!0,(function(t){return t?n:e}))}function $u(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,o=Math.max(r,i),a=[],s=0;o>s;s++)a.push($u(t[r>s?s:r-1],e[i>s?s:i-1],n));return a}throw Error("Mismatched interpolation arguments "+t+":"+e)}var Qu=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ru,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Bu(t),this._easing=t},enumerable:!1,configurable:!0}),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,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(!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,o=0;n.length>o;o++){var a=n[o].offset;if(wt(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!wt(s)&&!wt(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var tc="backwards|forwards|both|none".split("|"),ec="reverse|alternate|alternate-reverse".split("|");function nc(t,e){var n=new Qu;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===tc.indexOf(t[e]))return;if("direction"===e&&-1===ec.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function rc(t,e){return nc(t=ic(null!=t?t:{duration:"auto"}),e)}function ic(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var oc=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=rc(n,!1),this.timing.effect=this,this.timing.activeDuration=Vu(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=Wu(this.normalizedKeyframes,this.timing,this.target);var i=ts.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}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=zu(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=Ju(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function ac(t,e){return Number(t.id)-Number(e.id)}var sc=function(){function t(t){var e=this;this.document=t,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.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(ac),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new oc(t,e,n),i=new ru(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(ac),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()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.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},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],l=[],h=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?l.push(n):h.push(n)})),(r=this.pendingEffects).push.apply(r,c([],u(a),!1)),(i=this.pendingEffects).push.apply(i,c([],u(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[l,h]},t}();ts.EasingFunction=Bu,ts.AnimationTimeline=sc,t.AABB=Cn,t.AbstractRenderer=Tn,t.AbstractRendererPlugin=En,t.AdvancedCamera=js,t.Animation=ru,t.AnimationEvent=eu,t.AnimationTimeline=sc,t.BUILT_IN_PROPERTIES=Ki,t.CSS=Cs,t.CSSGradientValue=Mr,t.CSSKeywordValue=Pr,t.CSSRGB=Cr,t.CSSStyleValue=Er,t.CSSUnitValue=wr,t.Camera=sr,t.CameraEvent=or,t.Canvas=Vs,t.Circle=ys,t.CircleUpdater=ta,t.CustomElement=vs,t.CustomElementRegistry=ks,t.CustomEvent=da,t.DefaultSceneGraphSelector=Ma,t.DefaultSceneGraphService=qa,t.DisplayObject=ds,t.Document=As,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=In,t.EasingFunctions=Cu,t.Element=ss,t.Ellipse=ms,t.EllipseUpdater=ea,t.EventService=ga,t.EventTarget=va,t.FederatedEvent=la,t.FederatedMouseEvent=ha,t.FederatedPointerEvent=pa,t.FederatedWheelEvent=fa,t.Fragment=gs,t.Frustum=Rn,t.Group=xs,t.GroupUpdater=sa,t.HTML=bs,t.HTMLUpdater=ua,t.Image=Es,t.KeyframeEffect=oc,t.Line=Ts,t.LineUpdater=na,t.MutationEvent=Pa,t.MutationObserver=Zs,t.MutationRecord=Hs,t.Node=ma,t.OffscreenCanvasCreator=xa,t.Path=Ms,t.PathUpdater=ra,t.Plane=An,t.Point=On,t.Polygon=Ps,t.Polyline=Ss,t.PolylineUpdater=ia,t.RBush=xn,t.Rect=ws,t.RectUpdater=oa,t.Rectangle=Ln,t.Registration=qs,t.RenderingService=Ea,t.Text=Ns,t.TextService=Ja,t.TextUpdater=aa,t.compareAnimations=ac,t.computeLinearGradient=function(t,e,n,r){var i=Bn(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}},t.computeRadialGradient=function(e,n,r,i,o,a){var s=i.value,u=o.value;i.unit===t.UnitType.kPercentage&&(s=i.value/100*n),o.unit===t.UnitType.kPercentage&&(u=o.value/100*r);var c=Math.max(ce([0,0],[s,u]),ce([0,r],[s,u]),ce([n,r],[s,u]),ce([n,0],[s,u]));return a&&(a instanceof wr?c=a.value:a instanceof Pr&&("closest-side"===a.value?c=Math.min(s,n-s,u,r-u):"farthest-side"===a.value?c=Math.max(s,n-s,u,r-u):"closest-corner"===a.value&&(c=Math.min(ce([0,0],[s,u]),ce([0,r],[s,u]),ce([n,r],[s,u]),ce([n,0],[s,u]))))),{x:s+e[0],y:u+e[1],r:c}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle,o=i.x1,a=i.y1,s=i.x2,l=i.y2;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===o?0:o,void 0===a?0:a,void 0===s?0:s,void 0===l?0:l);break;case t.Shape.CIRCLE:var h=e.parsedStyle,p=h.r,f=void 0===p?0:p,d=h.cx,y=h.cy;r=Si(f,f,void 0===d?0:d,void 0===y?0:y);break;case t.Shape.ELLIPSE:var v=e.parsedStyle,m=v.rx,g=v.ry,x=v.cx,b=v.cy;r=Si(void 0===m?0:m,void 0===g?0:g,void 0===x?0:x,void 0===b?0:b);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 E=e.parsedStyle,T=E.width,M=void 0===T?0:T,P=E.height,S=void 0===P?0:P,w=E.x,N=void 0===w?0:w,k=E.y,C=void 0===k?0:k,A=E.radius,R=A&&A.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=u(i,4),a=o[0],s=o[1],c=o[2],l=o[3],h=t>0?1:-1,p=e>0?1:-1,f=h+p!==0?1:0;return[["M",h*a+n,r],["L",t-h*s+n,r],s?["A",s,s,0,0,f,t+n,p*s+r]:null,["L",t+n,e-p*c+r],c?["A",c,c,0,0,f,t+n-h*c,e+r]:null,["L",n+h*l,e+r],l?["A",l,l,0,0,f,n,e+r-p*l]:null,["L",n,p*a+r],a?["A",a,a,0,0,f,h*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"]]}(M,S,N,C,R&&A.map((function(t){return Lt(t,0,Math.min(Math.abs(M)/2,Math.abs(S)/2))})));break;case t.Shape.PATH:r=c([],u(e.parsedStyle.d.absolutePath),!1)}if(r.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=K(e[1],e[2],0);n&&at(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=K(e[1],e[2],0),a=K(e[3],e[4],0),s=K(e[5],e[6],0);n&&(at(o,o,n),at(a,a,n),at(s,s,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=K(e[6],e[7],0);n&&at(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(o=K(e[1],e[2],0),a=K(e[3],e[4],0),n&&(at(o,o,n),at(a,a,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(r,0,n)},t.createVec3=Gn,t.decompose=Wn,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==u(t,2)[1]})))},t.deg2rad=Bn,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Mo,t.fromRotationTranslationScale=zn,t.getAngle=_n,t.getEuler=Hn,t.getOrCalculatePathTotalLength=di,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.isBrowser=bo,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Wr,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=us,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(t,e,n){void 0===t&&(t="auto");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=zr,t.makeTiming=nc,t.mergeColors=Zr,t.normalizeKeyframes=Ju,t.normalizeTimingInput=rc,t.numericTimingToObject=ic,t.parseColor=qr,t.parseLength=Qr,t.parsePath=ki,t.parseTransform=Fi,t.parsedTransformToMat4=Ko,t.propertyMetadataCache=Qi,t.rad2deg=jn,t.resetEntityCounter=function(){rs=0},t.runtime=ts,t.setDOMSize=function(t,e,n){bo&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i){void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0);var o=t.map((function(o,a){var s=t[a+1],u=0===a&&(0!==e||0!==n),c=(a===t.length-1||s&&("M"===s[0]||"Z"===s[0]))&&0!==r&&0!==i;switch(o[0]){case"M":return u?"M ".concat(o[1]+e,",").concat(o[2]+n," L ").concat(o[1],",").concat(o[2]):"M ".concat(o[1],",").concat(o[2]);case"L":return"L ".concat(o[1]+(c?r:0),",").concat(o[2]+(c?i:0));case"Q":return"Q ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4])+(c?" L ".concat(o[3]+r,",").concat(o[4]+i):"");case"C":return"C ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4],",").concat(o[5]," ").concat(o[6])+(c?" L ".concat(o[5]+r,",").concat(o[6]+i):"");case"A":return"A ".concat(o[1]," ").concat(o[2]," ").concat(o[3]," ").concat(o[4]," ").concat(o[5]," ").concat(o[6]," ").concat(o[7])+(c?" L ".concat(o[6]+r,",").concat(o[7]+i):"");case"Z":return"Z"}})).join(" ");return~o.indexOf("NaN")?"":o},t.turn2deg=Yn}));
|
|
1
|
+
/*!
|
|
2
|
+
* @antv/g
|
|
3
|
+
* @description A core module for rendering engine implements DOM API.
|
|
4
|
+
* @version 6.1.1
|
|
5
|
+
* @date 10/23/2024, 7:14:42 AM
|
|
6
|
+
* @author AntVis
|
|
7
|
+
* @docs https://g.antv.antgroup.com/
|
|
8
|
+
*/
|
|
9
|
+
!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)}function r(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,r||"default");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}function i(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function a(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);e>r;r++)i[r]=t[r];return i}function o(t,e){if(t){if("string"==typeof t)return s(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var i,n,a,s,o=[],h=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;h=!1}else for(;!(h=(i=a.call(r)).done)&&(o.push(i.value),o.length!==e);h=!0);}catch(t){l=!0,n=t}finally{try{if(!h&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}(t,e)||o(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.")}()}var l={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,i,a,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new n(i,a||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),o.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=this._events[r?r+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var i=0,n=e.length,a=Array(n);n>i;i++)a[i]=e[i].fn;return a},o.prototype.listenerCount=function(t){var e=this._events[r?r+t:t];return e?e.fn?1:e.length:0},o.prototype.emit=function(t,e,i,n,a,s){var o=r?r+t:t;if(!this._events[o])return!1;var h,l,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){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,i),!0;case 4:return c.fn.call(c.context,e,i,n),!0;case 5:return c.fn.call(c.context,e,i,n,a),!0;case 6:return c.fn.call(c.context,e,i,n,a,s),!0}for(l=1,h=Array(u-1);u>l;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;p>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){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,i);break;case 4:c[l].fn.call(c[l].context,e,i,n);break;default:if(!h)for(d=1,h=Array(u-1);u>d;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},o.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},o.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},o.prototype.removeListener=function(t,e,i,n){var a=r?r+t:t;if(!this._events[a])return this;if(!e)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==e||n&&!o.once||i&&o.context!==i||s(this,a);else{for(var h=0,l=[],c=o.length;c>h;h++)(o[h].fn!==e||n&&!o[h].once||i&&o[h].context!==i)&&l.push(o[h]);l.length?this._events[a]=1===l.length?l[0]:l:s(this,a)}return this},o.prototype.removeAllListeners=function(t){var e;return t?this._events[e=r?r+t:t]&&s(this,e):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o}(l);var c=l.exports,u=1e-6,d="undefined"!=typeof Float32Array?Float32Array:Array;function p(){var t=new d(9);return d!=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 v(){var t=new d(16);return d!=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 f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function m(t,e,r,i,n,a,s,o,h,l,c,u,d,p,v,f,m){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=a,t[5]=s,t[6]=o,t[7]=h,t[8]=l,t[9]=c,t[10]=u,t[11]=d,t[12]=p,t[13]=v,t[14]=f,t[15]=m,t}function g(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 y(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],s=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],v=e[12],f=e[13],m=e[14],g=e[15],y=r*o-i*s,x=r*h-n*s,E=r*l-a*s,b=i*h-n*o,T=i*l-a*o,w=n*l-a*h,M=c*f-u*v,N=c*m-d*v,P=c*g-p*v,k=u*m-d*f,S=u*g-p*f,C=d*g-p*m,A=y*C-x*S+E*k+b*P-T*N+w*M;return A?(t[0]=(o*C-h*S+l*k)*(A=1/A),t[1]=(n*S-i*C-a*k)*A,t[2]=(f*w-m*T+g*b)*A,t[3]=(d*T-u*w-p*b)*A,t[4]=(h*P-s*C-l*N)*A,t[5]=(r*C-n*P+a*N)*A,t[6]=(m*E-v*w-g*x)*A,t[7]=(c*w-d*E+p*x)*A,t[8]=(s*S-o*P+l*M)*A,t[9]=(i*P-r*S-a*M)*A,t[10]=(v*T-f*E+g*y)*A,t[11]=(u*E-c*T-p*y)*A,t[12]=(o*N-s*k-h*M)*A,t[13]=(r*k-i*N+n*M)*A,t[14]=(f*x-v*b-m*y)*A,t[15]=(c*b-u*x+d*y)*A,t):null}function x(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],v=e[11],f=e[12],m=e[13],g=e[14],y=e[15],x=r[0],E=r[1],b=r[2],T=r[3];return t[0]=x*i+E*o+b*u+T*f,t[1]=x*n+E*h+b*d+T*m,t[2]=x*a+E*l+b*p+T*g,t[3]=x*s+E*c+b*v+T*y,t[4]=(x=r[4])*i+(E=r[5])*o+(b=r[6])*u+(T=r[7])*f,t[5]=x*n+E*h+b*d+T*m,t[6]=x*a+E*l+b*p+T*g,t[7]=x*s+E*c+b*v+T*y,t[8]=(x=r[8])*i+(E=r[9])*o+(b=r[10])*u+(T=r[11])*f,t[9]=x*n+E*h+b*d+T*m,t[10]=x*a+E*l+b*p+T*g,t[11]=x*s+E*c+b*v+T*y,t[12]=(x=r[12])*i+(E=r[13])*o+(b=r[14])*u+(T=r[15])*f,t[13]=x*n+E*h+b*d+T*m,t[14]=x*a+E*l+b*p+T*g,t[15]=x*s+E*c+b*v+T*y,t}function E(t,e,r){var i,n,a,s,o,h,l,c,u,d,p,v,f=r[0],m=r[1],g=r[2];return e===t?(t[12]=e[0]*f+e[4]*m+e[8]*g+e[12],t[13]=e[1]*f+e[5]*m+e[9]*g+e[13],t[14]=e[2]*f+e[6]*m+e[10]*g+e[14],t[15]=e[3]*f+e[7]*m+e[11]*g+e[15]):(n=e[1],a=e[2],s=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],v=e[11],t[0]=i=e[0],t[1]=n,t[2]=a,t[3]=s,t[4]=o,t[5]=h,t[6]=l,t[7]=c,t[8]=u,t[9]=d,t[10]=p,t[11]=v,t[12]=i*f+o*m+u*g+e[12],t[13]=n*f+h*m+d*g+e[13],t[14]=a*f+l*m+p*g+e[14],t[15]=s*f+c*m+v*g+e[15]),t}function b(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 T(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}function w(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=i,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 M(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function N(t,e){var r=e[4],i=e[5],n=e[6],a=e[8],s=e[9],o=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,i,n),t[2]=Math.hypot(a,s,o),t}function P(t,e){var r=new d(3);N(r,e);var i=1/r[0],n=1/r[1],a=1/r[2],s=e[0]*i,o=e[1]*n,h=e[2]*a,l=e[4]*i,c=e[5]*n,u=e[6]*a,p=e[8]*i,v=e[9]*n,f=e[10]*a,m=s+c+f,g=0;return m>0?(t[3]=.25*(g=2*Math.sqrt(m+1)),t[0]=(u-v)/g,t[1]=(p-h)/g,t[2]=(o-l)/g):s>c&&s>f?(t[3]=(u-v)/(g=2*Math.sqrt(1+s-c-f)),t[0]=.25*g,t[1]=(o+l)/g,t[2]=(p+h)/g):c>f?(t[3]=(p-h)/(g=2*Math.sqrt(1+c-s-f)),t[0]=(o+l)/g,t[1]=.25*g,t[2]=(u+v)/g):(t[3]=(o-l)/(g=2*Math.sqrt(1+f-s-c)),t[0]=(p+h)/g,t[1]=(u+v)/g,t[2]=.25*g),t}function k(t,e,r,i,n){var a=e[0],s=e[1],o=e[2],h=e[3],l=a+a,c=s+s,u=o+o,d=a*l,p=a*c,v=a*u,f=s*c,m=s*u,g=o*u,y=h*l,x=h*c,E=h*u,b=i[0],T=i[1],w=i[2],M=n[0],N=n[1],P=n[2],k=(1-(f+g))*b,S=(p+E)*b,C=(v-x)*b,A=(p-E)*T,R=(1-(d+g))*T,O=(m+y)*T,L=(v+x)*w,I=(m-y)*w,D=(1-(d+f))*w;return t[0]=k,t[1]=S,t[2]=C,t[3]=0,t[4]=A,t[5]=R,t[6]=O,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=r[0]+M-(k*M+A*N+L*P),t[13]=r[1]+N-(S*M+R*N+I*P),t[14]=r[2]+P-(C*M+O*N+D*P),t[15]=1,t}function S(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],s=r+r,o=i+i,h=n+n,l=r*s,c=i*s,u=i*o,d=n*s,p=n*o,v=n*h,f=a*s,m=a*o,g=a*h;return t[0]=1-u-v,t[1]=c+g,t[2]=d-m,t[3]=0,t[4]=c-g,t[5]=1-l-v,t[6]=p+f,t[7]=0,t[8]=d+m,t[9]=p-f,t[10]=1-l-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,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=function(t,e,r,i,n,a,s){var o=1/(e-r),h=1/(i-n),l=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*o,t[13]=(n+i)*h,t[14]=(s+a)*l,t[15]=1,t};var A=x;function R(){var t=new d(3);return d!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function O(t){var e=new d(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function L(t){return Math.hypot(t[0],t[1],t[2])}function I(t,e,r){var i=new d(3);return i[0]=t,i[1]=e,i[2]=r,i}function D(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function _(t,e,r,i){return t[0]=e,t[1]=r,t[2]=i,t}function F(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function G(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function B(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function V(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;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 U(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Y(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],h=r[2];return t[0]=n*h-a*o,t[1]=a*s-i*h,t[2]=i*o-n*s,t}function X(t,e,r,i){var n=e[0],a=e[1],s=e[2];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=s+i*(r[2]-s),t}function j(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[3]*i+r[7]*n+r[11]*a+r[15];return t[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/(s=s||1),t[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/s,t[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/s,t}function H(t,e){var r=t[0],i=t[1],n=t[2],a=e[0],s=e[1],o=e[2];return u*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&u*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)&&u*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)}var z=G,W=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},q=L;function Z(){var t=new d(4);return d!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function K(t,e,r,i){var n=new d(4);return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n}function $(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}function Q(){var t=new d(4);return d!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function J(t,e,r){var i=Math.sin(r*=.5);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r),t}function tt(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3],o=r[0],h=r[1],l=r[2],c=r[3];return t[0]=i*c+s*o+n*l-a*h,t[1]=n*c+s*h+a*o-i*l,t[2]=a*c+s*l+i*h-n*o,t[3]=s*c-i*o-n*h-a*l,t}function et(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],s=r*r+i*i+n*n+a*a,o=s?1/s:0;return t[0]=-r*o,t[1]=-i*o,t[2]=-n*o,t[3]=a*o,t}function rt(t,e,r,i){var n=.5*Math.PI/180;r*=n,i*=n;var a=Math.sin(e*=n),s=Math.cos(e),o=Math.sin(r),h=Math.cos(r),l=Math.sin(i),c=Math.cos(i);return t[0]=a*h*c-s*o*l,t[1]=s*o*c+a*h*l,t[2]=s*h*l-a*o*c,t[3]=s*h*c+a*o*l,t}R(),function(){var t=Z()}();var it=K,nt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},at=function(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t},st=tt,ot=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],s=r*r+i*i+n*n+a*a;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=a*s,t};function ht(){var t=new d(2);return d!=Float32Array&&(t[0]=0,t[1]=0),t}R(),I(1,0,0),I(0,1,0),Q(),Q(),p(),function(){var t=ht()}();var lt=function(t){return"function"==typeof t},ct=function(t){return null==t},ut={}.toString,dt=function(t,e){return ut.call(t)==="[object "+e+"]"},pt=function(t){return Array.isArray?Array.isArray(t):dt(t,"Array")},vt=function(t){if(pt(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ft=function(t){if(pt(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},mt=function(t){return dt(t,"String")},gt=function(t,e,r){return e>t?e:t>r?r:t},yt=function(t){return dt(t,"Number")},xt=1e-5;function Et(t,e,r){return void 0===r&&(r=xt),r>Math.abs(t-e)}var bt=function(t,e){return(t%e+e)%e},Tt=function(t){return dt(t,"Boolean")},wt=function(t){return void 0===t},Mt=function(){return Mt=Object.assign||function(t){for(var e,r=1,i=arguments.length;i>r;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},Mt.apply(this,arguments)};function Nt(t,e,r){if(r||2===arguments.length)for(var i,n=0,a=e.length;a>n;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var Pt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function kt(t,e,r){if(t[r].length>7){t[r].shift();for(var i=t[r],n=r;i.length;)e[r]="A",t.splice(n+=1,0,["C"].concat(i.splice(0,6)));t.splice(r,1)}}var St={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ct(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return St[e]===t.length-1&&"achlmqstvz".includes(e)}))}function At(t){return Ct(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Rt(t){return At(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Ot(t){for(var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),i=t.data;i.length>=St[r]&&("m"===r&&i.length>2?(t.segments.push([e].concat(i.splice(0,2))),r="l",e="m"===e?"l":"L"):t.segments.push([e].concat(i.splice(0,St[r]))),St[r]););}function Lt(t){var e=t.index,r=t.pathValue,i=r.charCodeAt(e);return 48===i?(t.param=0,void(t.index+=1)):49===i?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function It(t){return t>=48&&57>=t||43===t||45===t||46===t}function Dt(t){return t>=48&&57>=t}function _t(t){var e,r=t.max,i=t.pathValue,n=t.index,a=n,s=!1,o=!1,h=!1,l=!1;if(r>a)if(43!==(e=i.charCodeAt(a))&&45!==e||(e=i.charCodeAt(a+=1)),Dt(e)||46===e){if(46!==e){if(s=48===e,e=i.charCodeAt(a+=1),s&&r>a&&e&&Dt(e))return void(t.err="[path-util]: Invalid path value at index "+n+', "'+i[n]+'" illegal number');for(;r>a&&Dt(i.charCodeAt(a));)a+=1,o=!0;e=i.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Dt(i.charCodeAt(a));)a+=1,h=!0;e=i.charCodeAt(a)}if(101===e||69===e){if(l&&!o&&!h)return void(t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" invalid float exponent');if(43!==(e=i.charCodeAt(a+=1))&&45!==e||(a+=1),a>=r||!Dt(i.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" invalid integer exponent');for(;r>a&&Dt(i.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(n,a)}else t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+a+', "pathValue" is missing param'}function Ft(t){for(var e,r=t.pathValue,i=t.max;i>t.index&&(10===(e=r.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 Gt(t){var e=t.max,r=t.pathValue,i=t.index,n=r.charCodeAt(i),a=St[r[i].toLowerCase()];if(t.segmentStart=i,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}}(n))if(t.index+=1,Ft(t),t.data=[],a){for(;;){for(var s=a;s>0;s-=1){if(97!=(32|n)||3!==s&&4!==s?_t(t):Lt(t),t.err.length)return;t.data.push(t.param),Ft(t),e>t.index&&44===r.charCodeAt(t.index)&&(t.index+=1,Ft(t))}if(t.index>=t.max)break;if(!It(r.charCodeAt(t.index)))break}Ot(t)}else Ot(t);else t.err='[path-util]: Invalid path value "'+r[i]+'" is not a path command'}var Bt=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 Vt(t){if(At(t))return[].concat(t);var e=function(t){if(Ct(t))return[].concat(t);var e=new Bt(t);for(Ft(e);e.max>e.index&&!e.err.length;)Gt(e);return e.err?e.err:e.segments}(t),r=0,i=0,n=0,a=0;return e.map((function(t){var e,s=t.slice(1).map(Number),o=t[0],h=o.toUpperCase();if("M"===o)return n=r=s[0],a=i=s[1],["M",r,i];if(o!==h)switch(h){case"A":e=[h,s[0],s[1],s[2],s[3],s[4],s[5]+r,s[6]+i];break;case"V":e=[h,s[0]+i];break;case"H":e=[h,s[0]+r];break;default:var l=s.map((function(t,e){return t+(e%2?i:r)}));e=[h].concat(l)}else e=[h].concat(s);var c=e.length;switch(h){case"Z":r=n,i=a;break;case"H":r=e[1];break;case"V":i=e[1];break;default:r=e[c-2],i=e[c-1],"M"===h&&(n=r,a=i)}return e}))}function Ut(t,e){var r=t[0],i=e.x1,n=e.y1,a=e.x2,s=e.y2,o=t.slice(1).map(Number),h=t;if("TQ".includes(r)||(e.qx=null,e.qy=null),"H"===r)h=["L",t[1],n];else if("V"===r)h=["L",i,t[1]];else if("S"===r){var l=2*i-a,c=2*n-s;e.x1=l,e.y1=c,h=["C",l,c].concat(o)}else if("T"===r){var u=2*i-e.qx,d=2*n-e.qy;e.qx=u,e.qy=d,h=["Q",u,d].concat(o)}else if("Q"===r){var p=o[1];e.qx=o[0],e.qy=p}return h}function Yt(t){if(Rt(t))return[].concat(t);for(var e=Vt(t),r=Mt({},Pt),i=0;e.length>i;i+=1){e[i]=Ut(e[i],r);var n=e[i],a=n.length;r.x1=+n[a-2],r.y1=+n[a-1],r.x2=+n[a-4]||r.x1,r.y2=+n[a-3]||r.y1}return e}function Xt(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function jt(t,e,r,i,n,a,s,o,h,l){var c,u,d,p,v,f=t,m=e,g=r,y=i,x=o,E=h,b=120*Math.PI/180,T=Math.PI/180*(+n||0),w=[];if(l)u=l[0],d=l[1],p=l[2],v=l[3];else{m=(c=Xt(f,m,-T)).y;var M=((f=c.x)-(x=(c=Xt(x,E,-T)).x))/2,N=(m-(E=c.y))/2,P=M*M/(g*g)+N*N/(y*y);P>1&&(g*=P=Math.sqrt(P),y*=P);var k=g*g,S=y*y,C=(a===s?-1:1)*Math.sqrt(Math.abs((k*S-k*N*N-S*M*M)/(k*N*N+S*M*M)));p=C*g*N/y+(f+x)/2,u=Math.asin(((m-(v=C*-y*M/g+(m+E)/2))/y*1e9>>0)/1e9),d=Math.asin(((E-v)/y*1e9>>0)/1e9),0>(u=p>f?Math.PI-u:u)&&(u=2*Math.PI+u),0>(d=p>x?Math.PI-d:d)&&(d=2*Math.PI+d),s&&u>d&&(u-=2*Math.PI),!s&&d>u&&(d-=2*Math.PI)}var A=d-u;if(Math.abs(A)>b){var R=d,O=x,L=E;w=jt(x=p+g*Math.cos(d=u+b*(s&&d>u?1:-1)),E=v+y*Math.sin(d),g,y,n,0,s,O,L,[d,R,p,v])}A=d-u;var I=Math.cos(u),D=Math.sin(u),_=Math.cos(d),F=Math.sin(d),G=Math.tan(A/4),B=4/3*g*G,V=4/3*y*G,U=[f,m],Y=[f+B*D,m-V*I],X=[x+B*F,E-V*_],j=[x,E];if(Y[0]=2*U[0]-Y[0],Y[1]=2*U[1]-Y[1],l)return Y.concat(X,j,w);for(var H=[],z=0,W=(w=Y.concat(X,j,w)).length;W>z;z+=1)H[z]=z%2?Xt(w[z-1],w[z],T).y:Xt(w[z],w[z+1],T).x;return H}function Ht(t,e,r){var i=t[0],n=t[1];return[i+(e[0]-i)*r,n+(e[1]-n)*r]}var zt=function(t,e,r,i){return Nt(Nt([],Ht([t,e],[r,i],.5),!0),[r,i,r,i],!1)};function Wt(t,e){var r,i,n,a,s,o,h,l=t[0],c=t.slice(1).map(Number),u=c[0],d=c[1],p=e.x1,v=e.y1,f=e.x,m=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=d,t;case"A":return r=[p,v].concat(c),["C"].concat(jt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]));case"Q":return e.qx=u,e.qy=d,r=[p,v].concat(c),["C"].concat([(o=1/3)*r[0]+(h=2/3)*(i=r[2]),o*r[1]+h*(n=r[3]),o*(a=r[4])+h*i,o*(s=r[5])+h*n,a,s]);case"L":return["C"].concat(zt(p,v,u,d));case"Z":return p===f&&v===m?["C",p,v,f,m,f,m]:["C"].concat(zt(p,v,f,m))}return t}function qt(t,e){if(void 0===e&&(e=!1),function(t){return Rt(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var r=[].concat(t);return e?[r,[]]:r}for(var i,n,a=Yt(t),s=Mt({},Pt),o=[],h="",l=a.length,c=[],u=0;l>u;u+=1){a[u]&&(h=a[u][0]),o[u]=h;var d=Wt(a[u],s);a[u]=d,kt(a,o,u),l=a.length,"Z"===h&&c.push(u),s.x1=+(i=a[u])[(n=i.length)-2],s.y1=+i[n-1],s.x2=+i[n-4]||s.x1,s.y2=+i[n-3]||s.y1}return e?[a,c]:a}function Zt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Kt(t,e,r,i,n){var a=Zt([t,e],[r,i]),s={x:0,y:0};if("number"==typeof n)if(0<n)if(n<a){var o=Ht([t,e],[r,i],n/a);s={x:o[0],y:o[1]}}else s={x:r,y:i};else s={x:t,y:e};return{length:a,point:s,min:{x:Math.min(t,r),y:Math.min(e,i)},max:{x:Math.max(t,r),y:Math.max(e,i)}}}function $t(t,e){var r=t.x,i=t.y,n=e.x,a=e.y;return(0>r*a-i*n?-1:1)*Math.acos((r*n+i*a)/Math.sqrt((Math.pow(r,2)+Math.pow(i,2))*(Math.pow(n,2)+Math.pow(a,2))))}function Qt(t,e,r,i,n,a,s,o,h,l){var c=Math.abs,u=Math.sin,d=Math.cos,p=Math.sqrt,v=Math.PI,f=c(r),m=c(i),g=(n%360+360)%360*(v/180);if(t===o&&e===h)return{x:t,y:e};if(0===f||0===m)return Kt(t,e,o,h,l).point;var y=(t-o)/2,x=(e-h)/2,E={x:d(g)*y+u(g)*x,y:-u(g)*y+d(g)*x},b=Math.pow(E.x,2)/Math.pow(f,2)+Math.pow(E.y,2)/Math.pow(m,2);b>1&&(f*=p(b),m*=p(b));var T=(Math.pow(f,2)*Math.pow(m,2)-Math.pow(f,2)*Math.pow(E.y,2)-Math.pow(m,2)*Math.pow(E.x,2))/(Math.pow(f,2)*Math.pow(E.y,2)+Math.pow(m,2)*Math.pow(E.x,2)),w=(a!==s?1:-1)*p(T=0>T?0:T),M=w*(f*E.y/m),N=w*(-m*E.x/f),P=d(g)*M-u(g)*N+(t+o)/2,k=u(g)*M+d(g)*N+(e+h)/2,S={x:(E.x-M)/f,y:(E.y-N)/m},C=$t({x:1,y:0},S),A=$t(S,{x:(-E.x-M)/f,y:(-E.y-N)/m});!s&&A>0?A-=2*v:s&&0>A&&(A+=2*v);var R=C+(A%=2*v)*l,O=f*d(R),L=m*u(R);return{x:d(g)*O-u(g)*L+P,y:u(g)*O+d(g)*L+k}}function Jt(t,e,r,i,n,a,s,o,h,l,c){var u,d=c.bbox,p=void 0===d||d,v=c.length,f=void 0===v||v,m=c.sampleSize,g=void 0===m?30:m,y="number"==typeof l,x=t,E=e,b=0,T=[x,E,b],w=[x,E],M={x:0,y:0},N=[{x:x,y:E}];y&&0>=l&&(M={x:x,y:E});for(var P=0;g>=P;P+=1){if(x=(u=Qt(t,e,r,i,n,a,s,o,h,P/g)).x,E=u.y,p&&N.push({x:x,y:E}),f&&(b+=Zt(w,[x,E])),w=[x,E],y&&b>=l&&l>T[2]){var k=(b-l)/(b-T[2]);M={x:w[0]*(1-k)+T[0]*k,y:w[1]*(1-k)+T[1]*k}}T=[x,E,b]}return y&&l>=b&&(M={x:o,y:h}),{length:b,point:M,min:{x:Math.min.apply(null,N.map((function(t){return t.x}))),y:Math.min.apply(null,N.map((function(t){return t.y})))},max:{x:Math.max.apply(null,N.map((function(t){return t.x}))),y:Math.max.apply(null,N.map((function(t){return t.y})))}}}function te(t,e,r,i,n,a,s,o,h){var l=1-h;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*h*r+3*l*Math.pow(h,2)*n+Math.pow(h,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*h*i+3*l*Math.pow(h,2)*a+Math.pow(h,3)*o}}function ee(t,e,r,i,n,a,s,o,h,l){var c,u=l.bbox,d=void 0===u||u,p=l.length,v=void 0===p||p,f=l.sampleSize,m=void 0===f?10:f,g="number"==typeof h,y=t,x=e,E=0,b=[y,x,E],T=[y,x],w={x:0,y:0},M=[{x:y,y:x}];g&&0>=h&&(w={x:y,y:x});for(var N=0;m>=N;N+=1){if(y=(c=te(t,e,r,i,n,a,s,o,N/m)).x,x=c.y,d&&M.push({x:y,y:x}),v&&(E+=Zt(T,[y,x])),T=[y,x],g&&E>=h&&h>b[2]){var P=(E-h)/(E-b[2]);w={x:T[0]*(1-P)+b[0]*P,y:T[1]*(1-P)+b[1]*P}}b=[y,x,E]}return g&&h>=E&&(w={x:s,y:o}),{length:E,point:w,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function re(t,e,r,i,n,a,s){var o=1-s;return{x:Math.pow(o,2)*t+2*o*s*r+Math.pow(s,2)*n,y:Math.pow(o,2)*e+2*o*s*i+Math.pow(s,2)*a}}function ie(t,e,r,i,n,a,s,o){var h,l=o.bbox,c=void 0===l||l,u=o.length,d=void 0===u||u,p=o.sampleSize,v=void 0===p?10:p,f="number"==typeof s,m=t,g=e,y=0,x=[m,g,y],E=[m,g],b={x:0,y:0},T=[{x:m,y:g}];f&&0>=s&&(b={x:m,y:g});for(var w=0;v>=w;w+=1){if(m=(h=re(t,e,r,i,n,a,w/v)).x,g=h.y,c&&T.push({x:m,y:g}),d&&(y+=Zt(E,[m,g])),E=[m,g],f&&y>=s&&s>x[2]){var M=(y-s)/(y-x[2]);b={x:E[0]*(1-M)+x[0]*M,y:E[1]*(1-M)+x[1]*M}}x=[m,g,y]}return f&&s>=y&&(b={x:n,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 ne(t,e,r){for(var i,n,a,s,o,h,l,c,u,d=Yt(t),p="number"==typeof e,v=[],f=0,m=0,g=0,y=0,x=[],E=[],b=0,T={x:0,y:0},w=T,M=T,N=T,P=0,k=0,S=d.length;S>k;k+=1)v=(l="M"===(c=(u=d[k])[0]))?v:[f,m].concat(u.slice(1)),l?(w=T={x:g=u[1],y:y=u[2]},b=0,p&&.001>e&&(N=T)):"L"===c?(b=(i=Kt(v[0],v[1],v[2],v[3],(e||0)-P)).length,T=i.min,w=i.max,M=i.point):"A"===c?(b=(n=Jt(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],(e||0)-P,r||{})).length,T=n.min,w=n.max,M=n.point):"C"===c?(b=(a=ee(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-P,r||{})).length,T=a.min,w=a.max,M=a.point):"Q"===c?(b=(s=ie(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-P,r||{})).length,T=s.min,w=s.max,M=s.point):"Z"===c&&(b=(o=Kt((v=[f,m,g,y])[0],v[1],v[2],v[3],(e||0)-P)).length,T=o.min,w=o.max,M=o.point),p&&e>P&&P+b>=e&&(N=M),E.push(w),x.push(T),P+=b,f=(h="Z"!==c?u.slice(-2):[g,y])[0],m=h[1];return p&&e>=P&&(N={x:f,y:m}),{length:P,point:N,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 ae(t){return function(t){var e=0,r=0,i=0;return qt(t).map((function(t){var n;if("M"===t[0])return e=t[1],r=t[2],0;var a,s,o,h,l,c,u,d,p=t.slice(1);return i=3*(((d=p[5])-(s=r))*((o=p[0])+(l=p[2]))-((u=p[4])-(a=e))*((h=p[1])+(c=p[3]))+h*(a-l)-o*(s-c)+d*(l+a/3)-u*(c+s/3))/20,n=t.slice(-2),e=n[0],r=n[1],i})).reduce((function(t,e){return t+e}),0)}(t)>=0}function se(t){return t.map((function(t,e,r){var i=e&&r[e-1].slice(-2).concat(t.slice(1)),n=e?ee(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0;return{s:t,ss:e?n?function(t,e){void 0===e&&(e=.5);var r=t.slice(0,2),i=t.slice(2,4),n=t.slice(4,6),a=t.slice(6,8),s=Ht(r,i,e),o=Ht(i,n,e),h=Ht(n,a,e),l=Ht(s,o,e),c=Ht(o,h,e),u=Ht(l,c,e);return[["C"].concat(s,l,u),["C"].concat(c,h,a)]}(i):[t,t]:[t],l:n}}))}function oe(t,e,r){var i=se(t),n=se(e),a=i.length,s=n.length,o=i.filter((function(t){return t.l})).length,h=n.filter((function(t){return t.l})).length,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/o||0,c=n.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/h||0,u=r||Math.max(a,s),d=[l,c],p=[u-a,u-s],v=0,f=[i,n].map((function(t,e){return t.l===u?t.map((function(t){return t.s})):t.map((function(t,r){return p[e]-=(v=r&&p[e]&&t.l>=d[e])?1:0,v?t.ss:[t.s]})).flat()}));return f[0].length===f[1].length?f:oe(f[0],f[1],u)}function he(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var i in e)r[i]=e[i];return r}function ce(){}var ue=.7,de=1/ue,pe="\\s*([+-]?\\d+)\\s*",ve="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",me=/^#([0-9a-f]{3,8})$/,ge=RegExp(`^rgb\\(${pe},${pe},${pe}\\)$`),ye=RegExp(`^rgb\\(${fe},${fe},${fe}\\)$`),xe=RegExp(`^rgba\\(${pe},${pe},${pe},${ve}\\)$`),Ee=RegExp(`^rgba\\(${fe},${fe},${fe},${ve}\\)$`),be=RegExp(`^hsl\\(${ve},${fe},${fe}\\)$`),Te=RegExp(`^hsla\\(${ve},${fe},${fe},${ve}\\)$`),we={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 Me(){return this.rgb().formatHex()}function Ne(){return this.rgb().formatRgb()}function Pe(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=me.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?ke(e):3===r?new Ce(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Se(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Se(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=ge.exec(t))?new Ce(e[1],e[2],e[3],1):(e=ye.exec(t))?new Ce(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=xe.exec(t))?Se(e[1],e[2],e[3],e[4]):(e=Ee.exec(t))?Se(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=be.exec(t))?De(e[1],e[2]/100,e[3]/100,1):(e=Te.exec(t))?De(e[1],e[2]/100,e[3]/100,e[4]):we.hasOwnProperty(t)?ke(we[t]):"transparent"===t?new Ce(NaN,NaN,NaN,0):null}function ke(t){return new Ce(t>>16&255,t>>8&255,255&t,1)}function Se(t,e,r,i){return i>0||(t=e=r=NaN),new Ce(t,e,r,i)}function Ce(t,e,r,i){this.r=+t,this.g=+e,this.b=+r,this.opacity=+i}function Ae(){return`#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}`}function Re(){const t=Oe(this.opacity);return`${1===t?"rgb(":"rgba("}${Le(this.r)}, ${Le(this.g)}, ${Le(this.b)}${1===t?")":`, ${t})`}`}function Oe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Le(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ie(t){return(16>(t=Le(t))?"0":"")+t.toString(16)}function De(t,e,r,i){return i>0?r>0&&1>r?e>0||(t=NaN):t=e=NaN:t=e=r=NaN,new Fe(t,e,r,i)}function _e(t){if(t instanceof Fe)return new Fe(t.h,t.s,t.l,t.opacity);if(t instanceof ce||(t=Pe(t)),!t)return new Fe;if(t instanceof Fe)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,n=Math.min(e,r,i),a=Math.max(e,r,i),s=NaN,o=a-n,h=(a+n)/2;return o?(s=e===a?(r-i)/o+6*(i>r):r===a?(i-e)/o+2:(e-r)/o+4,o/=.5>h?a+n:2-a-n,s*=60):o=h>0&&1>h?0:s,new Fe(s,o,h,t.opacity)}function Fe(t,e,r,i){this.h=+t,this.s=+e,this.l=+r,this.opacity=+i}function Ge(t){return 0>(t=(t||0)%360)?t+360:t}function Be(t){return Math.max(0,Math.min(1,t||0))}function Ve(t,e,r){return 255*(60>t?e+(r-e)*t/60:180>t?r:240>t?e+(r-e)*(240-t)/60:e)}
|
|
10
|
+
/*!
|
|
11
|
+
* @antv/g-math
|
|
12
|
+
* @description Geometry util
|
|
13
|
+
* @version 3.0.0
|
|
14
|
+
* @date 10/23/2024, 7:12:37 AM
|
|
15
|
+
* @author AntVis
|
|
16
|
+
* @docs https://g.antv.antgroup.com/
|
|
17
|
+
*/function Ue(t,e,r,i){var n=t-r,a=e-i;return Math.sqrt(n*n+a*a)}function Ye(t,e){var r=Math.min(...t),i=Math.min(...e);return{x:r,y:i,width:Math.max(...t)-r,height:Math.max(...e)-i}}function Xe(t,e,r,i,n,a){return r*Math.cos(n)*Math.cos(a)-i*Math.sin(n)*Math.sin(a)+t}function je(t,e,r,i,n,a){return r*Math.sin(n)*Math.cos(a)+i*Math.cos(n)*Math.sin(a)+e}function He(t,e,r,i,n,a,s){for(var o=function(t,e,r){return Math.atan(-e/t*Math.tan(r))}(r,i,n),h=1/0,l=-1/0,c=[a,s],u=2*-Math.PI;2*Math.PI>=u;u+=Math.PI){var d=o+u;s>a?d>a&&s>d&&c.push(d):d>s&&a>d&&c.push(d)}for(var p=0;c.length>p;p++){var v=Xe(t,0,r,i,n,c[p]);h>v&&(h=v),v>l&&(l=v)}for(var f=function(t,e,r){return Math.atan(e/(t*Math.tan(r)))}(r,i,n),m=1/0,g=-1/0,y=[a,s],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var E=f+x;s>a?E>a&&s>E&&y.push(E):E>s&&a>E&&y.push(E)}for(var b=0;y.length>b;b++){var T=je(0,e,r,i,n,y[b]);m>T&&(m=T),T>g&&(g=T)}return{x:h,y:m,width:l-h,height:g-m}}function ze(t,e,r,i){return Ue(t,e,r,i)}function We(t,e,r,i,n){return{x:(1-n)*t+n*r,y:(1-n)*e+n*i}}function qe(t,e,r,i,n){var a=1-n;return a*a*a*t+3*e*n*a*a+3*r*n*n*a+i*n*n*n}function Ze(t,e,r,i){var n,a,s,o=-3*t+9*e-9*r+3*i,h=6*t-12*e+6*r,l=3*e-3*t,c=[];if(Et(o,0))Et(h,0)||0>(n=-l/h)||n>1||c.push(n);else{var u=h*h-4*o*l;Et(u,0)?c.push(-h/(2*o)):u>0&&(a=(-h-(s=Math.sqrt(u)))/(2*o),0>(n=(-h+s)/(2*o))||n>1||c.push(n),0>a||a>1||c.push(a))}return c}function Ke(t,e,r,i,n,a,s,o){for(var h=[t,s],l=[e,o],c=Ze(t,r,n,s),u=Ze(e,i,a,o),d=0;c.length>d;d++)h.push(qe(t,r,n,s,c[d]));for(var p=0;u.length>p;p++)l.push(qe(e,i,a,o,u[p]));return Ye(h,l)}function $e(t){return function(t){if(2>t.length)return 0;for(var e=0,r=0;t.length-1>r;r++){var i=t[r],n=t[r+1];e+=Ue(i[0],i[1],n[0],n[1])}return e}(t)}function Qe(t,e,r,i){var n=1-i;return n*n*t+2*i*n*e+i*i*r}function Je(t,e,r){var i=t+r-2*e;if(Et(i,0))return[.5];var n=(t-e)/i;return n>1||0>n?[]:[n]}function tr(t,e,r,i,n,a){var s=Je(t,r,n)[0],o=Je(e,i,a)[0],h=[t,n],l=[e,a];return void 0!==s&&h.push(Qe(t,r,n,s)),void 0!==o&&l.push(Qe(e,i,a,o)),Ye(h,l)}function er(){er=function(){return r};var t,r={},i=Object.prototype,n=i.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",h=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var n=Object.create((e&&e.prototype instanceof y?e:y).prototype),s=new R(i||[]);return a(n,"_invoke",{value:k(t,r,s)}),n}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=u;var p="suspendedStart",v="suspendedYield",f="executing",m="completed",g={};function y(){}function x(){}function E(){}var b={};c(b,o,(function(){return this}));var T=Object.getPrototypeOf,w=T&&T(T(O([])));w&&w!==i&&n.call(w,o)&&(b=w);var M=E.prototype=y.prototype=Object.create(b);function N(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,r){function i(a,s,o,h){var l=d(t[a],t,s);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==e(u)&&n.call(u,"__await")?r.resolve(u.__await).then((function(t){i("next",t,o,h)}),(function(t){i("throw",t,o,h)})):r.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return i("throw",t,o,h)}))}h(l.arg)}var s;a(this,"_invoke",{value:function(t,e){function n(){return new r((function(r,n){i(t,e,r,n)}))}return s=s?s.then(n,n):n()}})}function k(e,r,i){var n=p;return function(a,s){if(n===f)throw Error("Generator is already running");if(n===m){if("throw"===a)throw s;return{value:t,done:!0}}for(i.method=a,i.arg=s;;){var o=i.delegate;if(o){var h=S(o,i);if(h){if(h===g)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===p)throw n=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=f;var l=d(e,r,i);if("normal"===l.type){if(n=i.done?m:v,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=m,i.method="throw",i.arg=l.arg)}}}function S(e,r){var i=r.method,n=e.iterator[i];if(n===t)return r.delegate=null,"throw"===i&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),g;var a=d(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var s=a.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function C(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function O(r){if(r||""===r){var i=r[o];if(i)return i.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,s=function e(){for(;++a<r.length;)if(n.call(r,a))return e.value=r[a],e.done=!1,e;return e.value=t,e.done=!0,e};return s.next=s}}throw new TypeError(e(r)+" is not iterable")}return x.prototype=E,a(M,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:x,configurable:!0}),x.displayName=c(E,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,c(t,l,"GeneratorFunction")),t.prototype=Object.create(M),t},r.awrap=function(t){return{__await:t}},N(P.prototype),c(P.prototype,h,(function(){return this})),r.AsyncIterator=P,r.async=function(t,e,i,n,a){void 0===a&&(a=Promise);var s=new P(u(t,e,i,n),a);return r.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},N(M),c(M,l,"Generator"),c(M,o,(function(){return this})),c(M,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var i in e)r.push(i);return r.reverse(),function t(){for(;r.length;){var i=r.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},r.values=O,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(i,n){return o.type="throw",o.arg=e,r.next=i,n&&(r.method="next",r.arg=t),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return i("end");if(this.prev>=s.tryLoc){var h=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(h&&l){if(s.catchLoc>this.prev)return i(s.catchLoc,!0);if(s.finallyLoc>this.prev)return i(s.finallyLoc)}else if(h){if(s.catchLoc>this.prev)return i(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(s.finallyLoc>this.prev)return i(s.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 s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(s)},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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;A(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,i){return this.delegate={iterator:O(e),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=t),g}},r}function rr(t,e,r,i,n,a,s){try{var o=t[a](s),h=o.value}catch(t){return void r(t)}o.done?e(h):Promise.resolve(h).then(i,n)}function ir(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var a=t.apply(e,r);function s(t){rr(a,i,n,s,o,"next",t)}function o(t){rr(a,i,n,s,o,"throw",t)}s(void 0)}))}}function nr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=o(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return t.length>i?{done:!1,value:t[i++]}:{done:!0}},e:function(t){throw t},f:n}}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,s=!0,h=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){h=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(h)throw a}}}}function ar(t,e){if(null==t)return{};var r,i,n=function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;r[i]=t[i]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;a.length>i;i++)e.includes(r=a[i])||{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}
|
|
18
|
+
/*!
|
|
19
|
+
* @antv/g-lite
|
|
20
|
+
* @description A core module for rendering engine implements DOM API.
|
|
21
|
+
* @version 2.1.1
|
|
22
|
+
* @date 10/23/2024, 7:12:42 AM
|
|
23
|
+
* @author AntVis
|
|
24
|
+
* @docs https://g.antv.antgroup.com/
|
|
25
|
+
*/he(ce,Pe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Me,formatHex:Me,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return _e(this).formatHsl()},formatRgb:Ne,toString:Ne}),he(Ce,(function(t,e,r,i){return 1===arguments.length?((n=t)instanceof ce||(n=Pe(n)),n?new Ce((n=n.rgb()).r,n.g,n.b,n.opacity):new Ce):new Ce(t,e,r,null==i?1:i);var n}),le(ce,{brighter(t){return new Ce(this.r*(t=null==t?de:Math.pow(de,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new Ce(this.r*(t=null==t?ue:Math.pow(ue,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ce(Le(this.r),Le(this.g),Le(this.b),Oe(this.opacity))},displayable(){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:Ae,formatHex:Ae,formatHex8:function(){return`#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}${Ie(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Re,toString:Re})),he(Fe,(function(t,e,r,i){return 1===arguments.length?_e(t):new Fe(t,e,r,null==i?1:i)}),le(ce,{brighter(t){return new Fe(this.h,this.s,this.l*(t=null==t?de:Math.pow(de,t)),this.opacity)},darker(t){return new Fe(this.h,this.s,this.l*(t=null==t?ue:Math.pow(ue,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,r=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),i=2*e-r;return new Ce(Ve(240>t?t+120:t-240,i,r),Ve(t,i,r),Ve(120>t?t+240:t-120,i,r),this.opacity)},clamp(){return new Fe(Ge(this.h),Be(this.s),Be(this.l),Oe(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=Oe(this.opacity);return`${1===t?"hsl(":"hsla("}${Ge(this.h)}, ${100*Be(this.s)}%, ${100*Be(this.l)}%${1===t?")":`, ${t})`}`}}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var sr={exports:{}};!function(t,e){t.exports=function(){function t(t,r,n,a,s){e(t,r,n||0,a||t.length-1,s||i)}function e(t,i,n,a,s){for(;a>n;){if(a-n>600){var o=a-n+1,h=i-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(0>h-o/2?-1:1);e(t,i,Math.max(n,Math.floor(i-h*c/o+u)),Math.min(a,Math.floor(i+(o-h)*c/o+u)),s)}var d=t[i],p=n,v=a;for(r(t,n,i),s(t[a],d)>0&&r(t,n,a);v>p;){for(r(t,p,v),p++,v--;0>s(t[p],d);)p++;for(;s(t[v],d)>0;)v--}0===s(t[n],d)?r(t,n,v):r(t,++v,a),v>i||(n=v+1),i>v||(a=v-1)}}function r(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function i(t,e){return e>t?-1:t>e?1:0}var n=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,r){if(!r)return e.indexOf(t);for(var i=0;e.length>i;i++)if(r(t,e[i]))return i;return-1}function s(t,e){o(t,0,t.children.length,e,t)}function o(t,e,r,i,n){n||(n=g(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a=e;r>a;a++){var s=t.children[a];h(n,t.leaf?i(s):s)}return n}function h(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 u(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(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 r=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,n-r)*Math.max(0,a-i)}function f(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,r,i,n,a){for(var s=[r,i];s.length;)if((i=s.pop())-(r=s.pop())>n){var o=r+Math.ceil((i-r)/n/2)*n;t(e,o,r,i,a),s.push(r,o,o,i)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,r=[];if(!m(t,e))return r;for(var i=this.toBBox,n=[];e;){for(var a=0;e.children.length>a;a++){var s=e.children[a],o=e.leaf?i(s):s;m(t,o)&&(e.leaf?r.push(s):f(t,o)?this._all(s,r):n.push(s))}e=n.pop()}return r},n.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var r=[];e;){for(var i=0;e.children.length>i;i++){var n=e.children[i],a=e.leaf?this.toBBox(n):n;if(m(t,a)){if(e.leaf||f(t,a))return!0;r.push(n)}}e=r.pop()}return!1},n.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 r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(r.height>this.data.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=g([]),this},n.prototype.remove=function(t,e){if(!t)return this;for(var r,i,n,s=this.data,o=this.toBBox(t),h=[],l=[];s||h.length;){if(s||(s=h.pop(),i=h[h.length-1],r=l.pop(),n=!0),s.leaf){var c=a(t,s.children,e);if(-1!==c)return s.children.splice(c,1),h.push(s),this._condense(h),this}n||s.leaf||!f(s,o)?i?(r++,s=i.children[r],n=!1):s=null:(h.push(s),l.push(r),r=0,i=s,s=s.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,e){for(var r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},n.prototype._build=function(t,e,r,i){var n,a=r-e+1,o=this._maxEntries;if(o>=a)return s(n=g(t.slice(e,r+1)),this.toBBox),n;i||(o=Math.ceil(a/Math.pow(o,(i=Math.ceil(Math.log(a)/Math.log(o)))-1))),(n=g([])).leaf=!1,n.height=i;var h=Math.ceil(a/o),l=h*Math.ceil(Math.sqrt(o));y(t,e,r,l,this.compareMinX);for(var c=e;r>=c;c+=l){var u=Math.min(c+l-1,r);y(t,c,u,h,this.compareMinY);for(var d=c;u>=d;d+=h)n.children.push(this._build(t,d,Math.min(d+h-1,u),i-1))}return s(n,this.toBBox),n},n.prototype._chooseSubtree=function(t,e,r,i){for(;i.push(e),!e.leaf&&i.length-1!==r;){for(var n=1/0,a=1/0,s=void 0,o=0;e.children.length>o;o++){var h=e.children[o],l=u(h),c=p(t,h)-l;a>c?(a=c,n=n>l?l:n,s=h):c===a&&n>l&&(n=l,s=h)}e=s||e.children[0]}return e},n.prototype._insert=function(t,e,r){var i=r?t:this.toBBox(t),n=[],a=this._chooseSubtree(i,this.data,e,n);for(a.children.push(t),h(a,i);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(i,n,e)},n.prototype._split=function(t,e){var r=t[e],i=r.children.length,n=this._minEntries;this._chooseSplitAxis(r,n,i);var a=this._chooseSplitIndex(r,n,i),o=g(r.children.splice(a,r.children.length-a));o.height=r.height,o.leaf=r.leaf,s(r,this.toBBox),s(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(r,o)},n.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,r){for(var i,n=1/0,a=1/0,s=e;r-e>=s;s++){var h=o(t,0,s,this.toBBox),l=o(t,s,r,this.toBBox),c=v(h,l),d=u(h)+u(l);n>c?(n=c,i=s,a=a>d?d:a):c===n&&a>d&&(a=d,i=s)}return i||r-e},n.prototype._chooseSplitAxis=function(t,e,r){var i=t.leaf?this.compareMinX:l,n=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,r,i);this._allDistMargin(t,e,r,n)>a&&t.children.sort(i)},n.prototype._allDistMargin=function(t,e,r,i){t.children.sort(i);for(var n=this.toBBox,a=o(t,0,e,n),s=o(t,r-e,r,n),l=d(a)+d(s),c=e;r-e>c;c++){var u=t.children[c];h(a,t.leaf?n(u):u),l+=d(a)}for(var p=r-e-1;p>=e;p--){var v=t.children[p];h(s,t.leaf?n(v):v),l+=d(s)}return l},n.prototype._adjustParentBBoxes=function(t,e,r){for(var i=r;i>=0;i--)h(e[i],t)},n.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():s(t[e],this.toBBox)},n}()}(sr);var or=sr.exports,hr=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),lr=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({});var cr=F,ur=D,dr=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},pr=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},vr=B,fr=z;class mr{constructor(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}static isEmpty(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}update(t,e){ur(this.center,t),ur(this.halfExtents,e),fr(this.min,this.center,this.halfExtents),cr(this.max,this.center,this.halfExtents)}setMinMax(t,e){cr(this.center,e,t),vr(this.center,this.center,.5),fr(this.halfExtents,e,t),vr(this.halfExtents,this.halfExtents,.5),ur(this.min,t),ur(this.max,e)}getMin(){return this.min}getMax(){return this.max}add(t){if(!mr.isEmpty(t))if(mr.isEmpty(this))this.setMinMax(t.getMin(),t.getMax());else{var e=this.center,r=e[0],i=e[1],n=e[2],a=this.halfExtents,s=a[0],o=a[1],h=a[2],l=r-s,c=r+s,u=i-o,d=i+o,p=n-h,v=n+h,f=t.center,m=f[0],g=f[1],y=f[2],x=t.halfExtents,E=x[0],b=x[1],T=x[2],w=m-E,M=m+E,N=g-b,P=g+b,k=y-T,S=y+T;l>w&&(l=w),M>c&&(c=M),u>N&&(u=N),P>d&&(d=P),p>k&&(p=k),S>v&&(v=S),e[0]=.5*(l+c),e[1]=.5*(u+d),e[2]=.5*(p+v),a[0]=.5*(c-l),a[1]=.5*(d-u),a[2]=.5*(v-p),this.min[0]=l,this.min[1]=u,this.min[2]=p,this.max[0]=c,this.max[1]=d,this.max[2]=v}}setFromTransformedAABB(t,e){var r=this.center,i=this.halfExtents,n=t.center,a=t.halfExtents,s=e[0],o=e[4],h=e[8],l=e[1],c=e[5],u=e[9],d=e[2],p=e[6],v=e[10],f=Math.abs(s),m=Math.abs(o),g=Math.abs(h),y=Math.abs(l),x=Math.abs(c),E=Math.abs(u),b=Math.abs(d),T=Math.abs(p),w=Math.abs(v);r[0]=e[12]+s*n[0]+o*n[1]+h*n[2],r[1]=e[13]+l*n[0]+c*n[1]+u*n[2],r[2]=e[14]+d*n[0]+p*n[1]+v*n[2],i[0]=f*a[0]+m*a[1]+g*a[2],i[1]=y*a[0]+x*a[1]+E*a[2],i[2]=b*a[0]+T*a[1]+w*a[2],fr(this.min,r,i),cr(this.max,r,i)}intersects(t){var e=this.getMax(),r=this.getMin(),i=t.getMax(),n=t.getMin();return!(r[0]>i[0]||n[0]>e[0]||r[1]>i[1]||n[1]>e[1]||r[2]>i[2]||n[2]>e[2])}intersection(t){if(!this.intersects(t))return null;var e=new mr,r=dr([0,0,0],this.getMin(),t.getMin()),i=pr([0,0,0],this.getMax(),t.getMax());return e.setMinMax(r,i),e}getNegativeFarPoint(t){return 273===t.pnVertexFlag?ur([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]]}getPositiveFarPoint(t){return 273===t.pnVertexFlag?ur([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]]}}class gr{constructor(t,e){this.distance=t||0,this.normal=e||I(0,1,0),this.updatePNVertexFlag()}updatePNVertexFlag(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}distanceToPoint(t){return U(t,this.normal)-this.distance}normalize(){var t=1/q(this.normal);B(this.normal,this.normal,t),this.distance*=t}intersectsLine(t,e,r){var i=this.distanceToPoint(t),n=i/(i-this.distanceToPoint(e)),a=n>=0&&1>=n;return a&&r&&X(r,t,e,n),a}}var yr=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({});class xr{constructor(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new gr)}extractFromVPMatrix(t){var e=h(t,16),r=e[0],i=e[1],n=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],v=e[11],f=e[12],m=e[13],g=e[14],y=e[15];_(this.planes[0].normal,a-r,c-s,v-u),this.planes[0].distance=y-f,_(this.planes[1].normal,a+r,c+s,v+u),this.planes[1].distance=y+f,_(this.planes[2].normal,a+i,c+o,v+d),this.planes[2].distance=y+m,_(this.planes[3].normal,a-i,c-o,v-d),this.planes[3].distance=y-m,_(this.planes[4].normal,a-n,c-l,v-p),this.planes[4].distance=y-g,_(this.planes[5].normal,a+n,c+l,v+p),this.planes[5].distance=y+g,this.planes.forEach((t=>{t.normalize(),t.updatePNVertexFlag()}))}}class Er{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Er(this.x,this.y)}copyFrom(t){this.x=t.x,this.y=t.y}}class br{static fromRect(t){return new br(t.x,t.y,t.width,t.height)}static applyTransform(t,e){var r=K(t.x,t.y,0,1),i=K(t.x+t.width,t.y,0,1),n=K(t.x,t.y+t.height,0,1),a=K(t.x+t.width,t.y+t.height,0,1),s=Z(),o=Z(),h=Z(),l=Z();$(s,r,e),$(o,i,e),$(h,n,e),$(l,a,e);var c=Math.min(s[0],o[0],h[0],l[0]),u=Math.min(s[1],o[1],h[1],l[1]);return br.fromRect({x:c,y:u,width:Math.max(s[0],o[0],h[0],l[0])-c,height:Math.max(s[1],o[1],h[1],l[1])-u})}constructor(t,e,r,i){this.x=t,this.y=e,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=e,this.bottom=e+i}toJSON(){}}var Tr="Method not implemented.",wr="Use document.documentElement instead.";function Mr(t){return void 0===t?0:t>360||-360>t?t%360:t}var Nr=R();function Pr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?i?O(t):D(Nr,t):yt(t)?i?I(t,e,r):_(Nr,t,e,r):i?I(t[0],t[1]||e,t[2]||r):_(Nr,t[0],t[1]||e,t[2]||r)}var kr=Math.PI/180;function Sr(t){return t*kr}var Cr=180/Math.PI;function Ar(t){return t*Cr}function Rr(t){return 360*t}var Or=Math.PI/2;function Lr(t,e){return 16===e.length?function(t,e){var r,i,n=h(N(R(),e),3),a=n[0],s=n[1],o=n[2],l=Math.asin(-e[2]/a);return Or>l?l>-Or?(r=Math.atan2(e[6]/s,e[10]/o),i=Math.atan2(e[1]/a,e[0]/a)):(i=0,r=-Math.atan2(e[4]/s,e[5]/s)):(i=0,r=Math.atan2(e[4]/s,e[5]/s)),t[0]=r,t[1]=l,t[2]=i,t}(t,e):function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],s=i*i,o=n*n,h=a*a,l=r*r+s+o+h,c=r*a-i*n;return c>.499995*l?(t[0]=Or,t[1]=2*Math.atan2(i,r),t[2]=0):-.499995*l>c?(t[0]=-Or,t[1]=2*Math.atan2(i,r),t[2]=0):(t[0]=Math.asin(2*(r*n-a*i)),t[1]=Math.atan2(2*(r*a+i*n),1-2*(o+h)),t[2]=Math.atan2(2*(r*i+n*a),1-2*(s+o))),t}(t,e)}function Ir(t,e,r,i,n){var a,s,o,h,l,c,u,p,v,f,m=Math.cos(t),g=Math.sin(t);return a=i*m,s=n*g,o=0,h=-i*g,l=n*m,c=0,u=e,p=r,v=1,(f=new d(9))[0]=a,f[1]=s,f[2]=o,f[3]=h,f[4]=l,f[5]=c,f[6]=u,f[7]=p,f[8]=v,f}function Dr(t){var e=t[0],r=t[1],i=t[3],n=t[4],a=Math.sqrt(e*e+r*r),s=Math.sqrt(i*i+n*n);if(0>e*n-r*i&&(n>e?a=-a:s=-s),a){var o=1/a;e*=o,r*=o}if(s){var h=1/s;i*=h,n*=h}var l=Ar(Math.atan2(r,e));return[t[6],t[7],a,s,l]}var _r=v(),Fr=v(),Gr=Z(),Br=[R(),R(),R()],Vr=R();function Ur(t,e,r,i,n){t[0]=e[0]*i+r[0]*n,t[1]=e[1]*i+r[1]*n,t[2]=e[2]*i+r[2]*n}var Yr=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),Xr=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),jr=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Hr={UPDATED:"updated"},zr=2e-4;class Wr{constructor(){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.eventEmitter=new c,this.matrix=v(),this.right=I(1,0,0),this.up=I(0,1,0),this.forward=I(0,0,1),this.position=I(0,0,1),this.focalPoint=I(0,0,0),this.distanceVector=I(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.projectionMatrix=v(),this.projectionMatrixInverse=v(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Yr.EXPLORING,this.trackingMode=Xr.DEFAULT,this.projectionMode=jr.PERSPECTIVE,this.frustum=new xr,this.orthoMatrix=v()}isOrtho(){return this.projectionMode===jr.ORTHOGRAPHIC}getProjectionMode(){return this.projectionMode}getPerspective(){return this.jitteredProjectionMatrix||this.projectionMatrix}getPerspectiveInverse(){return this.projectionMatrixInverse}getFrustum(){return this.frustum}getPosition(){return this.position}getFocalPoint(){return this.focalPoint}getDollyingStep(){return this.dollyingStep}getNear(){return this.near}getFar(){return this.far}getZoom(){return this.zoom}getOrthoMatrix(){return this.orthoMatrix}getView(){return this.view}setEnableUpdate(t){this.enableUpdate=t}setType(t,e){return this.type=t,this.setWorldRotation(this.type===Yr.EXPLORING),this._getAngles(),this.type===Yr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}setProjectionMode(t){return this.projectionMode=t,this}setTrackingMode(t){if(this.type!==Yr.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}setWorldRotation(t){return this.rotateWorld=t,this._getAngles(),this}getViewTransform(){return y(v(),this.matrix)}getWorldTransform(){return this.matrix}jitterProjectionMatrix(t,e){var r=b(v(),[t,e,0]);this.jitteredProjectionMatrix=x(v(),r,this.projectionMatrix)}clearJitterProjectionMatrix(){this.jitteredProjectionMatrix=void 0}setMatrix(t){return this.matrix=t,this._update(),this}setProjectionMatrix(t){this.projectionMatrix=t}setFov(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}setAspect(t){return this.setPerspective(this.near,this.far,this.fov,t),this}setNear(t){return this.projectionMode===jr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}setFar(t){return this.projectionMode===jr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}setViewOffset(t,e,r,i,n,a){return this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=a,this.projectionMode===jr.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}clearViewOffset(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===jr.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}setZoom(t){return this.zoom=t,this.projectionMode===jr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===jr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}setZoomByViewportPoint(t,e){var r=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),i=r.x,n=r.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(i,n),this.setFocalPoint(i,n),this.setZoom(t),this.rotate(0,0,a);var s=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),o=I(s.x-i,s.y-n,0),l=U(o,this.right)/L(this.right),c=U(o,this.up)/L(this.up),u=h(this.getPosition(),2),d=u[0],p=u[1],v=h(this.getFocalPoint(),2),f=v[0],m=v[1];return this.setPosition(d-l,p-c),this.setFocalPoint(f-l,m-c),this}setPerspective(t,e,r,i){var n;this.projectionMode=jr.PERSPECTIVE,this.fov=r,this.near=t,this.far=e,this.aspect=i;var a=this.near*Math.tan(Sr(.5*this.fov))/this.zoom,s=2*a,o=this.aspect*s,h=-.5*o;if(null!==(n=this.view)&&void 0!==n&&n.enabled){var l=this.view.fullWidth,c=this.view.fullHeight;h+=this.view.offsetX*o/l,a-=this.view.offsetY*s/c,o*=this.view.width/l,s*=this.view.height/c}return function(t,e,r,i,n,a,s){var o,h,l=2*a,c=r-e,u=i-n,d=l/u,p=(r+e)/c,v=(i+n)/u,f=s-a,m=s*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(o=-s/f,h=-m/f):(o=-(s+a)/f,h=-2*m/f),t[0]=l/c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=d,t[6]=0,t[7]=0,t[8]=p,t[9]=v,t[10]=o,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,h,h+o,a-s,a,t,this.far,this.clipSpaceNearZ===lr.ZERO),y(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}setOrthographic(t,e,r,i,n,a){var s;this.projectionMode=jr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=r,this.bottom=i,this.near=n,this.far=a;var o=(this.rright-this.left)/(2*this.zoom),h=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,u=l-o,d=l+o,p=c+h,v=c-h;if(null!==(s=this.view)&&void 0!==s&&s.enabled){var f=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(u+=f*this.view.offsetX)+f*this.view.width,v=(p-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===lr.NEGATIVE_ONE?C(this.projectionMatrix,u,d,p,v,n,a):function(t,e,r,i,n,a,s){var o=1/(e-r),h=1/(i-n),l=1/(a-s);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+r)*o,t[13]=(n+i)*h,t[14]=a*l,t[15]=1}(this.projectionMatrix,u,d,p,v,n,a),y(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}setPosition(t){var e=Pr(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}setFocalPoint(t){var e,r,i,n,a,s,o,h,l,c,d,p,f,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],E=I(0,1,0);if(this.focalPoint=Pr(t,m,x),this.trackingMode===Xr.CINEMATIC){var b=G(R(),this.focalPoint,this.position);t=b[0],m=b[1],x=b[2];var T=L(b),w=Ar(Math.asin(m/T)),M=90+Ar(Math.atan2(x,t)),N=v();e=N,r=N,i=Sr(M),n=Math.sin(i),a=Math.cos(i),s=r[0],o=r[1],h=r[2],l=r[3],c=r[8],d=r[9],p=r[10],f=r[11],r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=s*a-c*n,e[1]=o*a-d*n,e[2]=h*a-p*n,e[3]=l*a-f*n,e[8]=s*n+c*a,e[9]=o*n+d*a,e[10]=h*n+p*a,e[11]=l*n+f*a,function(t,e,r){var i=Math.sin(r),n=Math.cos(r),a=e[4],s=e[5],o=e[6],h=e[7],l=e[8],c=e[9],u=e[10],d=e[11];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*n+l*i,t[5]=s*n+c*i,t[6]=o*n+u*i,t[7]=h*n+d*i,t[8]=l*n-a*i,t[9]=c*n-s*i,t[10]=u*n-o*i,t[11]=d*n-h*i}(N,N,Sr(w)),E=j(R(),[0,1,0],N)}return y(this.matrix,function(t,e,r,i){var n,a,s,o,h,l,c,d,p,v,f=e[0],m=e[1],y=e[2],x=i[0],E=i[1],b=i[2],T=r[0],w=r[1],M=r[2];return u>Math.abs(f-T)&&u>Math.abs(m-w)&&u>Math.abs(y-M)?g(t):(v=1/Math.hypot(c=f-T,d=m-w,p=y-M),(v=Math.hypot(n=E*(p*=v)-b*(d*=v),a=b*(c*=v)-x*p,s=x*d-E*c))?(n*=v=1/v,a*=v,s*=v):(n=0,a=0,s=0),(v=Math.hypot(o=d*s-p*a,h=p*n-c*s,l=c*a-d*n))?(o*=v=1/v,h*=v,l*=v):(o=0,h=0,l=0),t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=a,t[5]=h,t[6]=d,t[7]=0,t[8]=s,t[9]=l,t[10]=p,t[11]=0,t[12]=-(n*f+a*m+s*y),t[13]=-(o*f+h*m+l*y),t[14]=-(c*f+d*m+p*y),t[15]=1,t)}(v(),this.position,this.focalPoint,E)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}getDistance(){return this.distance}getDistanceVector(){return this.distanceVector}setDistance(t){if(this.distance===t||0>t)return this;this.distance=t,zr>this.distance&&(this.distance=zr),this.dollyingStep=this.distance/100;var e=R(),r=this.forward,i=this.focalPoint;return e[0]=(t=this.distance)*r[0]+i[0],e[1]=t*r[1]+i[1],e[2]=t*r[2]+i[2],this._setPosition(e),this.triggerUpdate(),this}setMaxDistance(t){return this.maxDistance=t,this}setMinDistance(t){return this.minDistance=t,this}setAzimuth(t){return this.azimuth=Mr(t),this.computeMatrix(),this._getAxes(),this.type===Yr.ORBITING||this.type===Yr.EXPLORING?this._getPosition():this.type===Yr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}getAzimuth(){return this.azimuth}setElevation(t){return this.elevation=Mr(t),this.computeMatrix(),this._getAxes(),this.type===Yr.ORBITING||this.type===Yr.EXPLORING?this._getPosition():this.type===Yr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}getElevation(){return this.elevation}setRoll(t){return this.roll=Mr(t),this.computeMatrix(),this._getAxes(),this.type===Yr.ORBITING||this.type===Yr.EXPLORING?this._getPosition():this.type===Yr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}getRoll(){return this.roll}_update(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}computeMatrix(){var t=J(Q(),[0,0,1],Sr(this.roll));g(this.matrix);var e=J(Q(),[1,0,0],Sr((this.rotateWorld&&this.type!==Yr.TRACKING||this.type===Yr.TRACKING?1:-1)*this.elevation)),r=J(Q(),[0,1,0],Sr((this.rotateWorld&&this.type!==Yr.TRACKING||this.type===Yr.TRACKING?1:-1)*this.azimuth)),i=tt(Q(),r,e);i=tt(Q(),i,t);var n=S(v(),i);this.type===Yr.ORBITING||this.type===Yr.EXPLORING?(E(this.matrix,this.matrix,this.focalPoint),x(this.matrix,this.matrix,n),E(this.matrix,this.matrix,[0,0,this.distance])):this.type===Yr.TRACKING&&(E(this.matrix,this.matrix,this.position),x(this.matrix,this.matrix,n))}_setPosition(t,e,r){this.position=Pr(t,e,r);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()}_getAxes(){D(this.right,Pr($(Z(),[1,0,0,0],this.matrix))),D(this.up,Pr($(Z(),[0,1,0,0],this.matrix))),D(this.forward,Pr($(Z(),[0,0,1,0],this.matrix))),V(this.right,this.right),V(this.up,this.up),V(this.forward,this.forward)}_getAngles(){var t=this.distanceVector[0],e=this.distanceVector[1],r=this.distanceVector[2],i=L(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===Yr.TRACKING||this.rotateWorld?(this.elevation=Ar(Math.asin(e/i)),this.azimuth=Ar(Math.atan2(-t,-r))):(this.elevation=-Ar(Math.asin(e/i)),this.azimuth=-Ar(Math.atan2(-t,-r)))}_getPosition(){D(this.position,Pr($(Z(),[0,0,0,1],this.matrix))),this._getDistance()}_getFocalPoint(){var t,e;!function(t,e,r){var i=e[0],n=e[1],a=e[2];t[0]=i*r[0]+n*r[3]+a*r[6],t[1]=i*r[1]+n*r[4]+a*r[7],t[2]=i*r[2]+n*r[5]+a*r[8]}(this.distanceVector,[0,0,-this.distance],(t=p(),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)),F(this.focalPoint,this.position,this.distanceVector),this._getDistance()}_getDistance(){this.distanceVector=G(R(),this.focalPoint,this.position),this.distance=L(this.distanceVector),this.dollyingStep=this.distance/100}_getOrthoMatrix(){if(this.projectionMode===jr.ORTHOGRAPHIC){var t=this.position,e=J(Q(),[0,0,1],-this.roll*Math.PI/180);k(this.orthoMatrix,e,I((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),I(this.zoom,this.zoom,1),t)}}triggerUpdate(){if(this.enableUpdate){var t=this.getViewTransform(),e=x(v(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Hr.UPDATED)}}rotate(t,e,r){throw Error(Tr)}pan(t,e){throw Error(Tr)}dolly(t){throw Error(Tr)}createLandmark(t,e){throw Error(Tr)}gotoLandmark(t,e){throw Error(Tr)}cancelLandmarkAnimation(){throw Error(Tr)}}var qr=function(t){return t[t.Standard=0]="Standard",t}({}),Zr=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Kr={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new br(0,0,0,0)},$r=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function Qr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){for(var i=arguments.length,n=Array(i),a=0;i>a;a++)n[a]=arguments[a];var s=e?e.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var h=t.apply(this,n);return r.cache=o.set(s,h)||o,h};return r.cache=new(Qr.Cache||Map),r}Qr.Cache=Map;var Jr=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),ti=function(t){return 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",t}({}),ei=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),ri=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),ii=[{name:"em",unit_type:Jr.kEms},{name:"px",unit_type:Jr.kPixels},{name:"deg",unit_type:Jr.kDegrees},{name:"rad",unit_type:Jr.kRadians},{name:"grad",unit_type:Jr.kGradians},{name:"ms",unit_type:Jr.kMilliseconds},{name:"s",unit_type:Jr.kSeconds},{name:"rem",unit_type:Jr.kRems},{name:"turn",unit_type:Jr.kTurns}],ni=function(t){return 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",t}({}),ai=t=>t?"number"===t?Jr.kNumber:"percent"===t||"%"===t?Jr.kPercentage:(t=>ii.find((e=>e.name===t)).unit_type)(t):Jr.kUnknown,si=t=>{var e=1;switch(t){case Jr.kPixels:case Jr.kDegrees:case Jr.kSeconds:break;case Jr.kMilliseconds:e=.001;break;case Jr.kRadians:e=180/Math.PI;break;case Jr.kGradians:e=.9;break;case Jr.kTurns:e=360}return e},oi=t=>{switch(t){case Jr.kNumber:case Jr.kInteger:return"";case Jr.kPercentage:return"%";case Jr.kEms:return"em";case Jr.kRems:return"rem";case Jr.kPixels:return"px";case Jr.kDegrees:return"deg";case Jr.kRadians:return"rad";case Jr.kGradians:return"grad";case Jr.kMilliseconds:return"ms";case Jr.kSeconds:return"s";case Jr.kTurns:return"turn"}return""};class hi{static isAngle(t){return t===Jr.kDegrees||t===Jr.kRadians||t===Jr.kGradians||t===Jr.kTurns}static isLength(t){return t>=Jr.kEms&&Jr.kDegrees>t}static isRelativeUnit(t){return t===Jr.kPercentage||t===Jr.kEms||t===Jr.kRems}static isTime(t){return t===Jr.kSeconds||t===Jr.kMilliseconds}toString(){return this.buildCSSText(ei.kNo,ri.kNo,"")}isNumericValue(){return this.getType()>=ni.kUnitType&&this.getType()<=ni.kClampType}}class li extends hi{constructor(t){super(),this.colorSpace=t}getType(){return ni.kColorType}to(t){return this}}var ci=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({});class ui extends hi{constructor(t,e){super(),this.type=t,this.value=e}clone(){return new ui(this.type,this.value)}buildCSSText(t,e,r){return r}getType(){return ni.kColorType}}class di extends hi{constructor(t){super(),this.value=t}clone(){return new di(this.value)}getType(){return ni.kKeywordType}buildCSSText(t,e,r){return r+this.value}}var pi=t=>(t=>{switch(t){case ti.kUNumber:return Jr.kNumber;case ti.kULength:return Jr.kPixels;case ti.kUPercent:return Jr.kPercentage;case ti.kUTime:return Jr.kSeconds;case ti.kUAngle:return Jr.kDegrees;default:return Jr.kUnknown}})((t=>{switch(t){case Jr.kNumber:case Jr.kInteger:return ti.kUNumber;case Jr.kPercentage:return ti.kUPercent;case Jr.kPixels:return ti.kULength;case Jr.kMilliseconds:case Jr.kSeconds:return ti.kUTime;case Jr.kDegrees:case Jr.kRadians:case Jr.kGradians:case Jr.kTurns:return ti.kUAngle;default:return ti.kUOther}})(t));class vi extends hi{constructor(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jr.kNumber;super(),e="string"==typeof r?ai(r):r,this.unit=e,this.value=t}clone(){return new vi(this.value,this.unit)}equals(t){return this.value===t.value&&this.unit===t.unit}getType(){return ni.kUnitType}convertTo(t){if(this.unit===t)return new vi(this.value,this.unit);var e=pi(this.unit);if(e!==pi(t)||e===Jr.kUnknown)return null;var r=si(this.unit)/si(t);return new vi(this.value*r,t)}buildCSSText(t,e,r){var i;switch(this.unit){case Jr.kUnknown:break;case Jr.kInteger:i=Number(this.value).toFixed(0);break;case Jr.kNumber:case Jr.kPercentage:case Jr.kEms:case Jr.kRems:case Jr.kPixels:case Jr.kDegrees:case Jr.kRadians:case Jr.kGradians:case Jr.kMilliseconds:case Jr.kSeconds:case Jr.kTurns:var n=this.value,a=oi(this.unit);if(-999999>n||n>999999){var s=oi(this.unit);i=!Number.isFinite(n)||Number.isNaN(n)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(n,s):n+(s||"")}else i="".concat(n).concat(a)}return r+=i}}var fi=new vi(0,"px");new vi(1,"px");var mi=new vi(0,"deg");class gi extends li{constructor(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super("rgb"),this.r=t,this.g=e,this.b=r,this.alpha=i,this.isNone=n}clone(){return new gi(this.r,this.g,this.b,this.alpha)}buildCSSText(t,e,r){return"".concat(r,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}var yi=new di("unset"),xi={"":yi,unset:yi,initial:new di("initial"),inherit:new di("inherit")},Ei=new gi(0,0,0,0,!0),bi=new gi(0,0,0,0),Ti=Qr(((t,e,r,i)=>new gi(t,e,r,i)),((t,e,r,i)=>"rgba(".concat(t,",").concat(e,",").concat(r,",").concat(i,")"))),wi=function(t){return new vi(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jr.kNumber)};function Mi(t){var e=t.type,r=t.value;return"hex"===e?"#".concat(r):"literal"===e?r:"rgb"===e?"rgb(".concat(r.join(","),")"):"rgba(".concat(r.join(","),")")}new vi(50,"%");var Ni=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 r(t){throw Error("".concat(e,": ").concat(t))}function i(){var t=p(n);return e.length>0&&r("Invalid input not EOF"),t}function n(){return a("linear-gradient",t.linearGradient,o)||a("repeating-linear-gradient",t.repeatingLinearGradient,o)||a("radial-gradient",t.radialGradient,h)||a("repeating-radial-gradient",t.repeatingRadialGradient,h)||a("conic-gradient",t.conicGradient,h)}function a(e,i,n){return s(i,(function(i){var a=n();return a&&(x(t.comma)||r("Missing comma before color stops")),{type:e,orientation:a,colorStops:p(v)}}))}function s(e,i){var n=x(e);if(n){x(t.startCall)||r("Missing (");var a=i(n);return x(t.endCall)||r("Missing )"),a}}function o(){return y("directional",t.sideOrCorner,1)||y("angular",t.angleValue,1)}function h(){var r,i,n=l();return n&&((r=[]).push(n),i=e,x(t.comma)&&((n=l())?r.push(n):e=i)),r}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=u();else{var e=c();if(e){t=e;var r=u();r&&(t.at=r)}else{var i=d();i&&(t={type:"default-radial",at:i})}}return t}function c(){return y("extent-keyword",t.extentKeywords,1)}function u(){if(y("position",/^at/,0)){var t=d();return t||r("Missing positioning value"),t}}function d(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function p(e){var i=e(),n=[];if(i)for(n.push(i);x(t.comma);)(i=e())?n.push(i):r("One extra comma");return n}function v(){var e=y("hex",t.hexColor,1)||s(t.rgbaColor,(function(){return{type:"rgba",value:p(f)}}))||s(t.rgbColor,(function(){return{type:"rgb",value:p(f)}}))||y("literal",t.literalColor,0);return e||r("Expected color definition"),e.length=m(),e}function f(){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,r){var i=x(e);if(i)return{type:t,value:i[r]}}function x(t){var r=/^[\n\r\t\s]+/.exec(e);r&&E(r[0].length);var i=t.exec(e);return i&&E(i[0].length),i}function E(t){e=e.substring(t)}return function(t){return e=t,i()}}();var Pi=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ki=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Si=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ci=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Ai={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},Ri=Qr((t=>wi("angular"===t.type?Number(t.value):Ai[t.value]||0,"deg"))),Oi=Qr((t=>{var e=50,r=50,i="%",n="%";if("position"===(null==t?void 0:t.type)){var a=t.value,s=a.x,o=a.y;"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?e=50:"right"===s.value?e=100:"top"===s.value?r=0:"bottom"===s.value&&(r=100)),"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?r=50:"right"===o.value?e=100:"top"===o.value?r=0:"bottom"===o.value&&(r=100)),"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,e=Number(s.value)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(n=null==o?void 0:o.type,r=Number(o.value))}return{cx:wi(e,i),cy:wi(r,n)}})),Li=Qr((t=>{if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Ni(t).map((t=>{var e=t.type,r=t.orientation,i=t.colorStops;!function(t){var e,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(r=t[0].length)&&void 0!==r?r:{type:"%",value:"0"});for(var n=0,a=Number(t[0].length.value),s=1;i>s;s++){var o,h=null===(o=t[s].length)||void 0===o?void 0:o.value;if(!ct(h)&&!ct(a)){for(var l=1;s-n>l;l++)t[n+l].length={type:"%",value:"".concat(a+(Number(h)-a)*l/(s-n))};n=s,a=Number(h)}}}(i);var n,a=i.map((t=>({offset:wi(Number(t.length.value),"%"),color:Mi(t)})));if("linear-gradient"===e)return new ui(ci.LinearGradient,{angle:r?Ri(r):mi,steps:a});if("radial-gradient"===e&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var s,o=Oi(r[0].at),h=o.cx,l=o.cy;if(r[0].style){var c=r[0].style,u=c.type,d=c.value;"extent-keyword"===u?(xi[n=d]||(xi[n]=new di(n)),s=xi[n]):s=wi(d,u)}return new ui(ci.RadialGradient,{cx:h,cy:l,size:s,steps:a})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var r=Pi.exec(t);if(r){var i,n=(null===(i=r[2].match(Ci))||void 0===i?void 0:i.map((t=>t.split(":"))))||[];return[new ui(ci.LinearGradient,{angle:wi(parseFloat(r[1]),"deg"),steps:n.map((t=>{var e=h(t,2),r=e[1];return{offset:wi(100*Number(e[0]),"%"),color:r}}))})]}}else if("r"===e){var a=function(t){var e=ki.exec(t);if(e){var r,i=(null===(r=e[4].match(Ci))||void 0===r?void 0:r.map((t=>t.split(":"))))||[];return{cx:wi(50,"%"),cy:wi(50,"%"),steps:i.map((t=>{var e=h(t,2),r=e[1];return{offset:wi(100*Number(e[0]),"%"),color:r}}))}}return null}(t);if(a){if(!mt(a))return[new ui(ci.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=Si.exec(t);if(e){var r=e[1],i=e[2];switch(r){case"a":r="repeat";break;case"x":r="repeat-x";break;case"y":r="repeat-y";break;default:r="no-repeat"}return{image:i,repetition:r}}return null}(t)}));function Ii(t){return t&&!!t.image}function Di(t){return t&&!ct(t.r)&&!ct(t.g)&&!ct(t.b)}var _i=Qr((t=>{if(Ii(t))return a({repetition:"repeat"},t);if(ct(t)&&(t=""),"transparent"===t)return bi;if("currentColor"===t)t="black";else if("none"===t)return Ei;var e=Li(t);if(e)return e;var r=Pe(t),i=[0,0,0,0];return null!==r&&(i[0]=r.r||0,i[1]=r.g||0,i[2]=r.b||0,i[3]=r.opacity),Ti(...i)}));function Fi(t,e){if(Di(t)&&Di(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)],t=>{var e=t.slice();if(e[3])for(var r=0;3>r;r++)e[r]=Math.round(gt(e[r],0,255));return e[3]=gt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Gi(t,e){if(ct(e))return wi(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return wi(Number(e),"px");if("deg".search(t)>=0)return wi(Number(e),"deg")}var r=[];e=e.replace(t,(t=>(r.push(t),"U".concat(t))));var i="U(".concat(t.source,")");return r.map((t=>wi(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(i,"g"),"*0")),t)))[0]}var Bi=t=>Gi(/px/g,t),Vi=Qr(Bi);Qr((t=>Gi(RegExp("%","g"),t)));var Ui=t=>yt(t)||isFinite(Number(t))?wi(Number(t)||0,"px"):Gi(RegExp("px|%|em|rem","g"),t),Yi=Qr(Ui),Xi=t=>Gi(/deg|rad|grad|turn/g,t),ji=Qr(Xi);function Hi(t,e,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",s=t.value||0,o=e.value||0,h=pi(t.unit),l=t.convertTo(h),c=e.convertTo(h);return l&&c?(s=l.value,o=c.value,a=oi(t.unit)):(vi.isLength(t.unit)||vi.isLength(e.unit))&&(s=qi(t,n,r),o=qi(e,n,r),a="px"),[s,o,t=>(i&&(t=Math.max(t,0)),t+a)]}function zi(t){var e=0;return t.unit===Jr.kDegrees?e=t.value:t.unit===Jr.kRadians?e=Ar(Number(t.value)):t.unit===Jr.kTurns?e=Rr(Number(t.value)):t.value&&(e=t.value),e}function Wi(t,e){var r;return Array.isArray(t)?r=t.map((t=>Number(t))):mt(t)?r=t.split(" ").map((t=>Number(t))):yt(t)&&(r=[t]),2===e?1===r.length?[r[0],r[0]]:[r[0],r[1]]:1===r.length?[r[0],r[0],r[0],r[0]]:2===r.length?[r[0],r[1],r[0],r[1]]:3===r.length?[r[0],r[1],r[2],r[1]]:[r[0],r[1],r[2],r[3]]}function qi(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===Jr.kPixels)return Number(t.value);if(t.unit===Jr.kPercentage&&r){var n=r.nodeName===hr.GROUP?r.getLocalBounds():r.getGeometryBounds();return(i?n.min[e]:0)+t.value/100*n.halfExtents[e]*2}return 0}var Zi=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ki(t){return""+t}var $i=t=>wi("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0),Qi=Qr($i);function Ji(t,e){return[t,e,Ki]}function tn(t,e){return(r,i)=>[r,i,r=>Ki(gt(r,t,e))]}function en(t,e){if(t.length===e.length)return[t,e,t=>t]}function rn(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=ne(t.parsedStyle.d.absolutePath,void 0,Mt(Mt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function nn(t,e){return t[0]===e[0]&&t[1]===e[1]}function an(t,e){var r=t.prePoint,i=t.currentPoint,n=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2),o=Math.acos((a+s-(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2)))/(2*Math.sqrt(a)*Math.sqrt(s)));if(!o||0===Math.sin(o)||Et(o,0))return{xExtra:0,yExtra:0};var h=Math.abs(Math.atan2(n[1]-i[1],n[0]-i[0])),l=Math.abs(Math.atan2(n[0]-i[0],n[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(o/2-(h=h>Math.PI/2?Math.PI-h:h))*(e/2*(1/Math.sin(o/2)))-e/2||0,yExtra:Math.cos(l-o/2)*(e/2*(1/Math.sin(o/2)))-e/2||0}}function sn(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Qr((t=>mt(t)?t.split(" ").map(Qi):t.map(Qi)));var on=(t,e)=>(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)))),hn=(t,e,r,i,n,a,s,o)=>{e=Math.abs(e),r=Math.abs(r);var h=Sr(i=bt(i,360));if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===r)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-s.x)/2,c=(t.y-s.y)/2,u={x:Math.cos(h)*l+Math.sin(h)*c,y:-Math.sin(h)*l+Math.cos(h)*c},d=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(r,2);d>1&&(e*=Math.sqrt(d),r*=Math.sqrt(d));var p=(Math.pow(e,2)*Math.pow(r,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(r,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(r,2)*Math.pow(u.x,2)),v=(n!==a?1:-1)*Math.sqrt(p=0>p?0:p),f=v*(e*u.y/r),m=v*(-r*u.x/e),g={x:Math.cos(h)*f-Math.sin(h)*m+(t.x+s.x)/2,y:Math.sin(h)*f+Math.cos(h)*m+(t.y+s.y)/2},y={x:(u.x-f)/e,y:(u.y-m)/r},x=on({x:1,y:0},y),E=on(y,{x:(-u.x-f)/e,y:(-u.y-m)/r});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*o,T=e*Math.cos(b),w=r*Math.sin(b);return{x:Math.cos(h)*T-Math.sin(h)*w+g.x,y:Math.sin(h)*T+Math.cos(h)*w+g.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:g,resultantRx:e,resultantRy:r}};function ln(t,e){var r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.arcParams,n=i.rx,a=void 0===n?0:n,s=i.ry,o=void 0===s?0:s,h=i.xRotation,l=i.arcFlag,c=i.sweepFlag,u=hn({x:t.prePoint[0],y:t.prePoint[1]},a,o,h,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=hn({x:t.prePoint[0],y:t.prePoint[1]},a,o,h,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},r?e+.005:e-.005),p=d.x-u.x,v=d.y-u.y,f=Math.sqrt(p*p+v*v);return{x:-p/f,y:-v/f}}function cn(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function un(t,e){return cn(t)*cn(e)?(t[0]*e[0]+t[1]*e[1])/(cn(t)*cn(e)):1}function dn(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(un(t,e))}function pn(t,e){var r=e[1],i=e[2],n=bt(Sr(e[3]),2*Math.PI),a=e[4],s=e[5],o=t[0],h=t[1],l=e[6],c=e[7],u=Math.cos(n)*(o-l)/2+Math.sin(n)*(h-c)/2,d=-1*Math.sin(n)*(o-l)/2+Math.cos(n)*(h-c)/2,p=u*u/(r*r)+d*d/(i*i);p>1&&(r*=Math.sqrt(p),i*=Math.sqrt(p));var v=r*r*(d*d)+i*i*(u*u),f=v?Math.sqrt((r*r*(i*i)-v)/v):1;a===s&&(f*=-1),isNaN(f)&&(f=0);var m=i?f*r*d/i:0,g=r?f*-i*u/r:0,y=(o+l)/2+Math.cos(n)*m-Math.sin(n)*g,x=(h+c)/2+Math.sin(n)*m+Math.cos(n)*g,E=[(u-m)/r,(d-g)/i],b=[(-1*u-m)/r,(-1*d-g)/i],T=dn([1,0],E),w=dn(E,b);return un(E,b)>-1||(w=Math.PI),1>un(E,b)||(w=0),0===s&&w>0&&(w-=2*Math.PI),1===s&&0>w&&(w+=2*Math.PI),{cx:y,cy:x,rx:nn(t,[l,c])?0:r,ry:nn(t,[l,c])?0:i,startAngle:T,endAngle:T+w,xRotation:n,arcFlag:a,sweepFlag:s}}function vn(t,e,r,i){var n=.5522847498307936,a=t*n,s=e*n,o=r-t,h=r+t,l=i-e,c=i+e;return[["M",o,i],["C",o,i-s,r-a,l,r,l],["C",r+a,l,h,i-s,h,i],["C",h,i+s,r+a,c,r,c],["C",r-a,c,o,i+s,o,i],["Z"]]}var fn=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=Yt(t)}catch(r){e=Yt(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var r=t[e-1],i=t[e];if("M"===i[0]&&r){var n=r[0],a=void 0;"L"===n||"M"===n?a=[r[1],r[2]]:"C"!==n&&"A"!==n&&"Q"!==n||(a=[r[r.length-2],r[r.length-1]]),a&&nn([i[1],i[2]],a)&&(t.splice(e,1),e--)}}}(e);var r=function(t){for(var e=!1,r=t.length,i=0;r>i;i++){var n=t[i][0];if("C"===n||"A"===n||"Q"===n){e=!0;break}}return e}(e),i=function(t){for(var e=[],r=[],i=[],n=0;t.length>n;n++){var a=t[n],s=a[0];"M"===s?(i.length&&(r.push(i),i=[]),i.push([a[1],a[2]])):"Z"===s?i.length&&(e.push(i),i=[]):i.push([a[1],a[2]])}return i.length>0&&r.push(i),{polygons:e,polylines:r}}(e),n=i.polygons,a=i.polylines,s=function(t){for(var e=[],r=null,i=null,n=null,a=0,s=t.length,o=0;s>o;o++){var h=t[o];i=t[o+1];var l=h[0],c={command:l,prePoint:r,params:h,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":n=[h[1],h[2]],a=o;break;case"A":var u=pn(r,h);c.arcParams=u}if("Z"===l)r=n,i=t[a+1];else{var d=h.length;r=[h[d-2],h[d-1]]}i&&"Z"===i[0]&&(i=t[a],e[a]&&(e[a].prePoint=r)),c.currentPoint=r,e[a]&&nn(r,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=i?[i[i.length-2],i[i.length-1]]:null;var p=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[p[0]-r[0],p[1]-r[1]],c.endTangent=[r[0]-p[0],r[1]-p[1]];else if("Q"===l){var v=[h[1],h[2]];c.startTangent=[p[0]-v[0],p[1]-v[1]],c.endTangent=[r[0]-v[0],r[1]-v[1]]}else if("T"===l){var f=e[o-1],m=sn(f.currentPoint,p);"Q"===f.command?(c.command="Q",c.startTangent=[p[0]-m[0],p[1]-m[1]],c.endTangent=[r[0]-m[0],r[1]-m[1]]):(c.command="TL",c.startTangent=[p[0]-r[0],p[1]-r[1]],c.endTangent=[r[0]-p[0],r[1]-p[1]])}else if("C"===l){var g=[h[1],h[2]],y=[h[3],h[4]];c.startTangent=[p[0]-g[0],p[1]-g[1]],c.endTangent=[r[0]-y[0],r[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[o-1],E=sn(x.currentPoint,p),b=[h[1],h[2]];"C"===x.command?(c.command="C",c.startTangent=[p[0]-E[0],p[1]-E[1]],c.endTangent=[r[0]-b[0],r[1]-b[1]]):(c.command="SQ",c.startTangent=[p[0]-b[0],p[1]-b[1]],c.endTangent=[r[0]-b[0],r[1]-b[1]])}else if("A"===l){var T=ln(c,0),w=T.x,M=T.y,N=ln(c,1,!1),P=N.x,k=N.y;c.startTangent=[w,M],c.endTangent=[P,k]}e.push(c)}return e}(e),o=function(t,e){for(var r=[],i=[],n=[],a=0;t.length>a;a++){var s=t[a],o=s.currentPoint,h=s.params,l=s.prePoint,c=void 0;switch(s.command){case"Q":c=tr(l[0],l[1],h[1],h[2],h[3],h[4]);break;case"C":c=Ke(l[0],l[1],h[1],h[2],h[3],h[4],h[5],h[6]);break;case"A":var u=s.arcParams;c=He(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:r.push(o[0]),i.push(o[1])}c&&(s.box=c,r.push(c.x,c.x+c.width),i.push(c.y,c.y+c.height)),e&&("L"===s.command||"M"===s.command)&&s.prePoint&&s.nextPoint&&n.push(s)}r=r.filter((t=>!Number.isNaN(t)&&t!==1/0&&t!==-1/0)),i=i.filter((t=>!Number.isNaN(t)&&t!==1/0&&t!==-1/0));var d=ft(r),p=ft(i),v=vt(r),f=vt(i);if(0===n.length)return{x:d,y:p,width:v-d,height:f-p};for(var m=0;n.length>m;m++){var g=n[m],y=g.currentPoint;y[0]===d?d-=an(g,e).xExtra:y[0]===v&&(v+=an(g,e).xExtra),y[1]===p?p-=an(g,e).yExtra:y[1]===f&&(f+=an(g,e).yExtra)}return{x:d,y:p,width:v-d,height:f-p}}(s,0),h=o.x,l=o.y,c=o.width,u=o.height;return{absolutePath:e,hasArc:r,segments:s,polygons:n,polylines:a,totalLength:0,rect:{x:Number.isFinite(h)?h:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(u)?u:0}}},mn=Qr(fn);function gn(t){return mt(t)?mn(t):fn(t)}function yn(t,e,r){var i=t.curve,n=e.curve;i&&0!==i.length||(i=qt(t.absolutePath,!1),t.curve=i),n&&0!==n.length||(n=qt(e.absolutePath,!1),e.curve=n);var a=[i,n];i.length!==n.length&&(a=oe(i,n));var s,o,h,l,c,u,d,p,v=ae(a[0])!==ae(a[1])?(o=(s=a[0]).slice(1).map((function(t,e,r){return e?r[e-1].slice(-2).concat(t.slice(1)):s[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,r){return t[t.length-r-2*(1-r%2)]}))})).reverse(),[["M"].concat(o[0].slice(0,2))].concat(o.map((function(t){return["C"].concat(t.slice(2))})))):a[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[v,(h=a[1],l=v,c=h.length-1,u=[],d=0,p=function(t){var e=t.length,r=e-1;return t.map((function(i,n){return t.map((function(i,a){var s=n+a;return 0===a||t[s]&&"M"===t[s][0]?["M"].concat(t[s].slice(-2)):(e>s||(s-=r),t[s])}))}))}(h),p.forEach((function(t,e){h.slice(1).forEach((function(t,r){d+=Zt(h[(e+r)%c].slice(-2),l[r%c].slice(-2))})),u[e]=d,d=0})),p[u.indexOf(Math.min.apply(null,u))]),t=>t]}function xn(t,e){return[t.points,e.points,t=>t]}var En=null,bn=/\s*(\w+)\(([^)]*)\)/g;function Tn(t){return function(e){var r=0;return t.map((t=>t===En?e[r++]:t))}}function wn(t){return t}var Mn={matrix:["NNNNNN",[En,En,0,0,En,En,0,0,0,0,1,0,En,En,0,1],wn],matrix3d:["NNNNNNNNNNNNNNNN",wn],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Tn([En,En,new vi(1)]),wn],scaleX:["N",Tn([En,new vi(1),new vi(1)]),Tn([En,new vi(1)])],scaleY:["N",Tn([new vi(1),En,new vi(1)]),Tn([new vi(1),En])],scaleZ:["N",Tn([new vi(1),new vi(1),En])],scale3d:["NNN",wn],skew:["Aa",null,wn],skewX:["A",null,Tn([En,mi])],skewY:["A",null,Tn([mi,En])],translate:["Tt",Tn([En,En,fi]),wn],translateX:["T",Tn([En,fi,fi]),Tn([En,fi])],translateY:["T",Tn([fi,En,fi]),Tn([fi,En])],translateZ:["L",Tn([fi,fi,En])],translate3d:["TTL",wn]};function Nn(t){for(var e=[],r=t.length,i=0;r>i;i++){var n=t[i],a=n[0],s=n.slice(1);if("translate"===a||"skew"===a?1===s.length&&s.push(0):"scale"===a&&1===s.length&&s.push(s[0]),!Mn[a])return[];var o=s.map((t=>wi(t)));e.push({t:a,d:o})}return e}function Pn(t){if(Array.isArray(t))return Nn(t);if("none"===(t=(t||"none").trim()))return[];var e,r=[],i=0;for(bn.lastIndex=0;e=bn.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var n=e[1],a=Mn[n];if(!a)return[];var s=e[2].split(","),o=a[0];if(s.length>o.length)return[];for(var h=[],l=0;o.length>l;l++){var c=s[l],u=o[l],d=void 0;if(void 0===(d=c?{A:t=>"0"===t.trim()?mi:ji(t),N:Qi,T:Yi,L:Vi}[u.toUpperCase()](c):{a:mi,n:h[0],t:fi}[u]))return[];h.push(d)}if(r.push({t:n,d:h}),bn.lastIndex===t.length)return r}return[]}function kn(t){if(Array.isArray(t))return Nn(t);if("none"===(t=(t||"none").trim()))return[];var e,r=[],i=0;for(bn.lastIndex=0;e=bn.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var n=e[1],a=Mn[n];if(!a)return[];var s=e[2].split(","),o=a[0];if(s.length>o.length)return[];for(var h=[],l=0;o.length>l;l++){var c=s[l],u=o[l],d=void 0;if(void 0===(d=c?{A:t=>"0"===t.trim()?mi:Xi(t),N:$i,T:Ui,L:Bi}[u.toUpperCase()](c):{a:mi,n:h[0],t:fi}[u]))return[];h.push(d)}if(r.push({t:n,d:h}),bn.lastIndex===t.length)return r}return[]}function Sn(t){var e,r,i,n;switch(t.t){case"rotateX":return n=Sr(zi(t.d[0])),[1,0,0,0,0,Math.cos(n),Math.sin(n),0,0,-Math.sin(n),Math.cos(n),0,0,0,0,1];case"rotateY":return n=Sr(zi(t.d[0])),[Math.cos(n),0,-Math.sin(n),0,0,1,0,0,Math.sin(n),0,Math.cos(n),0,0,0,0,1];case"rotate":case"rotateZ":return n=Sr(zi(t.d[0])),[Math.cos(n),Math.sin(n),0,0,-Math.sin(n),Math.cos(n),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,r=t.d[1].value,i=t.d[2].value,n=Sr(zi(t.d[3]));var a=e*e+r*r+i*i;if(0===a)e=1,r=0,i=0;else if(1!==a){var s=Math.sqrt(a);e/=s,r/=s,i/=s}var o=Math.sin(n/2),h=o*Math.cos(n/2),l=o*o;return[1-2*(r*r+i*i)*l,2*(e*r*l+i*h),2*(e*i*l-r*h),0,2*(e*r*l-i*h),1-2*(e*e+i*i)*l,2*(r*i*l+e*h),0,2*(e*i*l+r*h),2*(r*i*l-e*h),1-2*(e*e+r*r)*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=Sr(zi(t.d[0])),u=Sr(zi(t.d[1]));return[1,Math.tan(u),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return n=Sr(zi(t.d[0])),[1,0,0,0,Math.tan(n),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return n=Sr(zi(t.d[0])),[1,Math.tan(n),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=qi(t.d[0],0,null)||0,r=qi(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=qi(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,r=qi(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,i=qi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=qi(t.d[0],0,null)||0,r=qi(t.d[1],0,null)||0,i=qi(t.d[2],0,null)||0,1];case"perspective":var d=qi(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d: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((t=>t.value))}}function Cn(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 An(t){var e=[0,0,0],r=[1,1,1],i=[0,0,0],n=[0,0,0,1],a=[0,0,0,1];return function(t,e,r,i,n,a){if(!function(t,e){var r=e[15];if(0===r)return!1;for(var i=1/r,n=0;16>n;n++)t[n]=e[n]*i;return!0}(_r,t))return!1;if(f(Fr,_r),Fr[3]=0,Fr[7]=0,Fr[11]=0,Fr[15]=1,1e-8>Math.abs(function(t){var e=t[0],r=t[1],i=t[2],n=t[3],a=t[4],s=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],v=t[13],f=t[14],m=t[15];return(e*s-r*a)*(u*m-d*f)-(e*o-i*a)*(c*m-d*v)+(e*h-n*a)*(c*f-u*v)+(r*o-i*s)*(l*m-d*p)-(r*h-n*s)*(l*f-u*p)+(i*h-n*o)*(l*v-c*p)}(Fr)))return!1;var s,o,h=_r[3],l=_r[7],c=_r[11],u=_r[12],d=_r[13],p=_r[14],v=_r[15];if(0!==h||0!==l||0!==c){if(Gr[0]=h,Gr[1]=l,Gr[2]=c,Gr[3]=v,!y(Fr,Fr))return!1;!function(t,e){if(t===e){var r=e[1],i=e[2],n=e[3],a=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[11]=e[14],t[12]=n,t[13]=s,t[14]=o}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]}(Fr,Fr),$(n,Gr,Fr)}else n[0]=n[1]=n[2]=0,n[3]=1;if(e[0]=u,e[1]=d,e[2]=p,(s=Br)[0][0]=(o=_r)[0],s[0][1]=o[1],s[0][2]=o[2],s[1][0]=o[4],s[1][1]=o[5],s[1][2]=o[6],s[2][0]=o[8],s[2][1]=o[9],s[2][2]=o[10],r[0]=L(Br[0]),V(Br[0],Br[0]),i[0]=U(Br[0],Br[1]),Ur(Br[1],Br[1],Br[0],1,-i[0]),r[1]=L(Br[1]),V(Br[1],Br[1]),i[0]/=r[1],i[1]=U(Br[0],Br[2]),Ur(Br[2],Br[2],Br[0],1,-i[1]),i[2]=U(Br[1],Br[2]),Ur(Br[2],Br[2],Br[1],1,-i[2]),r[2]=L(Br[2]),V(Br[2],Br[2]),i[1]/=r[2],i[2]/=r[2],Y(Vr,Br[1],Br[2]),0>U(Br[0],Vr))for(var m=0;3>m;m++)r[m]*=-1,Br[m][0]*=-1,Br[m][1]*=-1,Br[m][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+Br[0][0]-Br[1][1]-Br[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Br[0][0]+Br[1][1]-Br[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Br[0][0]-Br[1][1]+Br[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Br[0][0]+Br[1][1]+Br[2][2],0)),Br[2][1]>Br[1][2]&&(a[0]=-a[0]),Br[0][2]>Br[2][0]&&(a[1]=-a[1]),Br[1][0]>Br[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(Sn).reduce(Cn)}(t),e,r,i,n,a),[[e,r,i,a,n]]}var Rn=function(){function t(t,e){for(var r=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],i=0;4>i;i++)for(var n=0;4>n;n++)for(var a=0;4>a;a++)r[i][n]+=e[i][a]*t[a][n];return r}return function(e,r,i,n,a){for(var s=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;4>o;o++)s[o][3]=a[o];for(var h=0;3>h;h++)for(var l=0;3>l;l++)s[3][h]+=e[l]*s[l][h];var c=n[0],u=n[1],d=n[2],p=n[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(u*u+d*d),v[0][1]=2*(c*u-d*p),v[0][2]=2*(c*d+u*p),v[1][0]=2*(c*u+d*p),v[1][1]=1-2*(c*c+d*d),v[1][2]=2*(u*d-c*p),v[2][0]=2*(c*d-u*p),v[2][1]=2*(u*d+c*p),v[2][2]=1-2*(c*c+u*u),s=t(s,v);var f,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];i[2]&&(m[2][1]=i[2],s=t(s,m)),i[1]&&(m[2][1]=0,m[2][0]=i[0],s=t(s,m)),i[0]&&(m[2][0]=0,m[1][0]=i[0],s=t(s,m));for(var g=0;3>g;g++)for(var y=0;3>y;y++)s[g][y]*=r[g];return 0===(f=s)[0][2]&&0===f[0][3]&&0===f[1][2]&&0===f[1][3]&&0===f[2][0]&&0===f[2][1]&&1===f[2][2]&&0===f[2][3]&&0===f[3][2]&&1===f[3][3]?[s[0][0],s[0][1],s[1][0],s[1][1],s[3][0],s[3][1]]:s[0].concat(s[1],s[2],s[3])}}();function On(t){return t.toFixed(6).replace(".000000","")}function Ln(t,e){var r,i;return t.decompositionPair!==e&&(t.decompositionPair=e,r=An(t)),e.decompositionPair!==t&&(e.decompositionPair=t,i=An(e)),null===r[0]||null===i[0]?[[!1],[!0],r=>r?e[0].d:t[0].d]:(r[0].push(0),i[0].push(1),[r,i,t=>{var e=function(t,e,r){var i=function(t,e){for(var r=0,i=0;t.length>i;i++)r+=t[i]*e[i];return r}(t,e);i=gt(i,-1,1);var n=[];if(1===i)n=t;else for(var a=Math.acos(i),s=1*Math.sin(r*a)/Math.sqrt(1-i*i),o=0;4>o;o++)n.push(t[o]*(Math.cos(r*a)-i*s)+e[o]*s);return n}(r[0][3],i[0][3],t[5]);return Rn(t[0],t[1],t[2],e,t[4]).map(On).join(",")}])}function In(t){return t.replace(/[XY]/,"")}function Dn(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function _n(t,e,r){var i=!1;if(!t.length||!e.length){t.length||(i=!0,t=e,e=[]);for(var n=function(){var r=t[a],i=r.t,n=r.d,s="scale"===i.substring(0,5)?1:0;e.push({t:i,d:n.map((t=>"number"==typeof t?wi(s):wi(s,t.unit)))})},a=0;t.length>a;a++)n()}var s,o,h=[],l=[],c=[];if(t.length!==e.length){var u=Ln(t,e);h=[u[0]],l=[u[1]],c=[["matrix",[u[2]]]]}else for(var d=0;t.length>d;d++){var p=t[d].t,v=e[d].t,f=t[d].d,m=e[d].d,g=Mn[p],y=Mn[v],x=void 0;if(o=v,"perspective"===(s=p)&&"perspective"===o||!("matrix"!==s&&"matrix3d"!==s||"matrix"!==o&&"matrix3d"!==o)){var E=Ln([t[d]],[e[d]]);h.push(E[0]),l.push(E[1]),c.push(["matrix",[E[2]]])}else{if(p===v)x=p;else if(g[2]&&y[2]&&In(p)===In(v))x=In(p),f=g[2](f),m=y[2](m);else{if(!g[1]||!y[1]||Dn(p)!==Dn(v)){var b=Ln(t,e);h=[b[0]],l=[b[1]],c=[["matrix",[b[2]]]];break}x=Dn(p),f=g[1](f),m=y[1](m)}for(var T=[],w=[],M=[],N=0;f.length>N;N++){var P=Hi(f[N],m[N],r,!1,N);T[N]=P[0],w[N]=P[1],M.push(P[2])}h.push(T),l.push(w),c.push([x,M])}}if(i){var k=h;h=l,l=k}return[h,l,t=>t.map(((t,e)=>{var r=t.map(((t,r)=>c[e][1][r](t))).join(",");return"matrix"===c[e][0]&&16===r.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===r.split(",").length&&(c[e][0]="matrix"),"".concat(c[e][0],"(").concat(r,")")})).join(" ")]}var Fn=Qr((t=>{if(mt(t)){if("text-anchor"===t)return[wi(0,"px"),wi(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:[Yi(Gn(e[0])),Yi(Gn(e[1]))]}return[wi(t[0]||0,"px"),wi(t[1]||0,"px")]}));function Gn(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Bn=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:$r.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:$r.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:$r.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:$r.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:$r.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:$r.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:$r.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:$r.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:$r.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:$r.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:$r.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:$r.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:$r.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:$r.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:$r.FILTER},{n:"clipPath",syntax:$r.DEFINED_PATH},{n:"textPath",syntax:$r.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:$r.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:$r.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:$r.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:$r.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:$r.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:$r.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:$r.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:$r.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:$r.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:$r.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:$r.COORDINATE},{n:"y1",int:!0,l:!0,syntax:$r.COORDINATE},{n:"z1",int:!0,l:!0,syntax:$r.COORDINATE},{n:"x2",int:!0,l:!0,syntax:$r.COORDINATE},{n:"y2",int:!0,l:!0,syntax:$r.COORDINATE},{n:"z2",int:!0,l:!0,syntax:$r.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:$r.PATH,p:50},{n:"points",int:!0,l:!0,syntax:$r.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:$r.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:$r.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:$r.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:$r.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:$r.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:$r.NUMBER,d:t=>t===hr.PATH||t===hr.POLYGON||t===hr.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:$r.MARKER},{n:"markerEnd",syntax:$r.MARKER},{n:"markerMid",syntax:$r.MARKER},{n:"markerStartOffset",syntax:$r.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:$r.LENGTH,l:!0,int:!0,d:"0"}],Vn=Bn.filter((t=>!!t.l)).map((t=>t.n)),Un={};class Yn{constructor(){this.mixer=Ji}calculator(t,e,r,i){return zi(r)}}class Xn{calculator(t,e,r,i,n){return r instanceof di&&(r=null),n.sceneGraphService.updateDisplayObjectDependency(t,e,r,i),"clipPath"===t&&i.forEach((t=>{0===t.childNodes.length&&n.sceneGraphService.dirtifyToRoot(t)})),r}}class jn{constructor(){this.parser=_i,this.mixer=Fi}calculator(t,e,r,i){return r instanceof di?"none"===r.value?Ei:bi:r}}class Hn{calculator(t,e,r){return r instanceof di?[]:r}}function zn(t){var e=t.parsedStyle.fontSize;return ct(e)?null:e}class Wn{constructor(){this.mixer=Ji}calculator(t,e,r,i,n){if(yt(r))return r;if(!vi.isRelativeUnit(r.unit))return r.value;if(r.unit===Jr.kPercentage)return 0;if(r.unit===Jr.kEms){if(i.parentNode){var a=zn(i.parentNode);if(a)return a*=r.value}return 0}if(r.unit===Jr.kRems){var s;if(null!=i&&null!==(s=i.ownerDocument)&&void 0!==s&&s.documentElement){var o=zn(i.ownerDocument.documentElement);if(o)return o*=r.value}return 0}}}class qn{constructor(){this.mixer=en}calculator(t,e,r){return r.map((t=>t.value))}}class Zn{constructor(){this.mixer=en}calculator(t,e,r){return r.map((t=>t.value))}}class Kn{calculator(t,e,r,i){var n;r instanceof di&&(r=null);var a=null===(n=r)||void 0===n?void 0:n.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}class $n{constructor(){this.mixer=Ji}calculator(t,e,r){return r.value}}class Qn{constructor(){this.mixer=tn(0,1)}calculator(t,e,r){return r.value}postProcessor(t){var e=t.parsedStyle,r=e.offsetPath;if(r){var i=r.nodeName;if(i===hr.LINE||i===hr.PATH||i===hr.POLYLINE){var n=r.getPoint(e.offsetDistance);n&&t.setLocalPosition(n.x,n.y)}}}}class Jn{constructor(){this.mixer=tn(0,1)}calculator(t,e,r){return r.value}}class ta{constructor(){this.parser=gn,this.mixer=yn}calculator(t,e,r){return r instanceof di&&"unset"===r.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new br(0,0,0,0)}:r}}class ea{constructor(){this.mixer=xn}}class ra extends Wn{constructor(){super(...arguments),this.mixer=tn(0,1/0)}}class ia{calculator(t,e,r,i){return r instanceof di?"unset"===r.value?"":r.value:"".concat(r)}postProcessor(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}class na{calculator(t,e,r,i){var n=i.getAttribute("text");if(n){var a=n;"capitalize"===r.value?a=n.charAt(0).toUpperCase()+n.slice(1):"lowercase"===r.value?a=n.toLowerCase():"uppercase"===r.value&&(a=n.toUpperCase()),i.parsedStyle.text=a}return r.value}}var aa=new WeakMap;function sa(t,e,r){if(t){var i="string"==typeof t?document.getElementById(t):t;aa.has(i)?aa.get(i).destroy(r):aa.set(i,e)}}var oa="undefined"!=typeof window&&void 0!==window.document;function ha(t){return!!t.getAttribute}function la(t,e){var r=Number(t.parsedStyle.zIndex||0),i=Number(e.parsedStyle.zIndex||0);if(r===i){var n=t.parentNode;if(n){var a=n.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return r-i}function ca(t){var e=t;do{var r;if(null===(r=e.parsedStyle)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null}function ua(t,e){if(oa)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var da={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},pa="object"==typeof performance&&performance.now?performance:Date;function va(t){return t.nodeName===hr.FRAGMENT||t.getRootNode().nodeName===hr.FRAGMENT}var fa=1,ma="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},ga=Date.now(),ya={},xa=Date.now(),Ea=t=>{if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),r=e-xa,i=r>16?0:16-r,n=fa++;return ya[n]=t,Object.keys(ya).length>1||setTimeout((()=>{xa=e;var t=ya;ya={},Object.keys(t).forEach((e=>t[e](ma.performance&&"function"==typeof ma.performance.now?ma.performance.now():Date.now()-ga)))}),i),n},ba=t=>{delete ya[t]},Ta=t=>"string"!=typeof t?Ea:""===t?ma.requestAnimationFrame:ma["".concat(t,"RequestAnimationFrame")],wa=((t,e)=>{for(var r=0;void 0!==t[r];){if(e(t[r]))return t[r];r+=1}})(["","webkit","moz","ms","o"],(t=>!!Ta(t))),Ma=Ta(wa),Na=(t=>"string"!=typeof t?ba:""===t?ma.cancelAnimationFrame:ma["".concat(t,"CancelAnimationFrame")]||ma["".concat(t,"CancelRequestAnimationFrame")])(wa);ma.requestAnimationFrame=Ma,ma.cancelAnimationFrame=Na;class Pa{constructor(){this.callbacks=[]}getCallbacksNum(){return this.callbacks.length}tapPromise(t,e){this.callbacks.push(e)}promise(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return Promise.all(this.callbacks.map((t=>t(...e))))}}class ka{constructor(){this.callbacks=[]}tapPromise(t,e){this.callbacks.push(e)}promise(){var t=arguments,e=this;return ir(er().mark((function r(){var i,n,a;return er().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.callbacks.length){r.next=14;break}return r.next=3,e.callbacks[0](...t);case 3:i=r.sent,n=0;case 5:if(e.callbacks.length-1<=n){r.next=13;break}return a=e.callbacks[n],r.next=9,a(i);case 9:i=r.sent;case 10:n++,r.next=5;break;case 13:return r.abrupt("return",i);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r)})))()}}class Sa{constructor(){this.callbacks=[]}tap(t,e){this.callbacks.push(e)}call(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var i=arguments;this.callbacks.forEach((function(t){t.apply(void 0,i)}))}}class Ca{constructor(){this.callbacks=[]}tap(t,e){this.callbacks.push(e)}call(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];if(this.callbacks.length){for(var i=this.callbacks[0].apply(void 0,arguments),n=0;this.callbacks.length-1>n;n++){i=(0,this.callbacks[n])(i)}return i}return null}}var Aa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ra=/([\"\'])[^\'\"]+\1/;function Oa(t,e,r){return g(t),t[4]=Math.tan(e),t[1]=Math.tan(r),t}var La=v(),Ia=v(),Da={scale:t=>{T(La,[t[0].value,t[1].value,1])},scaleX:t=>{T(La,[t[0].value,1,1])},scaleY:t=>{T(La,[1,t[0].value,1])},scaleZ:t=>{T(La,[1,1,t[0].value])},scale3d:t=>{T(La,[t[0].value,t[1].value,t[2].value])},translate:t=>{b(La,[t[0].value,t[1].value,0])},translateX:t=>{b(La,[t[0].value,0,0])},translateY:t=>{b(La,[0,t[0].value,0])},translateZ:t=>{b(La,[0,0,t[0].value])},translate3d:t=>{b(La,[t[0].value,t[1].value,t[2].value])},rotate:t=>{w(La,Sr(zi(t[0])))},rotateX:t=>{var e,r,i,n;e=La,r=Sr(zi(t[0])),i=Math.sin(r),n=Math.cos(r),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=i,e[7]=0,e[8]=0,e[9]=-i,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1},rotateY:t=>{var e,r,i,n;e=La,r=Sr(zi(t[0])),i=Math.sin(r),e[0]=n=Math.cos(r),e[1]=0,e[2]=-i,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=i,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1},rotateZ:t=>{w(La,Sr(zi(t[0])))},rotate3d:t=>{!function(t,e,r){var i,n,a,s=r[0],o=r[1],h=r[2],l=Math.hypot(s,o,h);u>l||(s*=l=1/l,o*=l,h*=l,i=Math.sin(e),t[0]=s*s*(a=1-(n=Math.cos(e)))+n,t[1]=o*s*a+h*i,t[2]=h*s*a-o*i,t[3]=0,t[4]=s*o*a-h*i,t[5]=o*o*a+n,t[6]=h*o*a+s*i,t[7]=0,t[8]=s*h*a+o*i,t[9]=o*h*a-s*i,t[10]=h*h*a+n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1)}(La,Sr(zi(t[3])),[t[0].value,t[1].value,t[2].value])},skew:t=>{Oa(La,Sr(t[0].value),Sr(t[1].value))},skewX:t=>{Oa(La,Sr(t[0].value),0)},skewY:t=>{Oa(La,0,Sr(t[0].value))},matrix:t=>{m(La,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:t=>{m(La,...t.map((t=>t.value)))}},_a=I(1,1,1),Fa=R(),Ga={translate:(t,e)=>{Ys.sceneGraphService.setLocalScale(t,_a,!1),Ys.sceneGraphService.setLocalEulerAngles(t,Fa,void 0,void 0,!1),Ys.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Ys.sceneGraphService.dirtifyLocal(t,t.transformable)}};function Ba(t,e){if(t.length){if(1===t.length&&Ga[t[0].t])return void Ga[t[0].t](e,t[0].d);for(var r=g(Ia),i=0;t.length>i;i++){var n=t[i],a=Da[n.t];a&&(a(n.d),A(r,r,La))}e.setLocalTransform(r)}else e.resetLocalTransform();return e.getLocalTransform()}class Va{constructor(){this.parser=kn,this.mixer=_n}calculator(t,e,r,i){return r instanceof di?[]:r}postProcessor(t){Ba(t.parsedStyle.transform,t)}}class Ua{postProcessor(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Jr.kPixels&&e[1].unit===Jr.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}class Ya{calculator(t,e,r,i){return r.value}postProcessor(t){if(t.parentNode){var e=t.parentNode,r=e.renderable,i=e.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=Zr.Z_INDEX_CHANGED)}}}class Xa{update(t,e){var r=t.cx,i=t.cy,n=t.r,a=void 0===n?0:n;return{cx:void 0===r?0:r,cy:void 0===i?0:i,hwidth:a,hheight:a}}}class ja{update(t,e){var r=t.cx,i=t.cy,n=t.rx,a=t.ry;return{cx:void 0===r?0:r,cy:void 0===i?0:i,hwidth:void 0===n?0:n,hheight:void 0===a?0:a}}}class Ha{update(t){var e=t.x1,r=t.y1,i=t.x2,n=t.y2,a=Math.min(e,i),s=Math.max(e,i),o=Math.min(r,n),h=(s-a)/2,l=(Math.max(r,n)-o)/2;return{cx:a+h,cy:o+l,hwidth:h,hheight:l}}}class za{update(t){var e=t.d.rect,r=e.width/2,i=e.height/2;return{cx:e.x+r,cy:e.y+i,hwidth:r,hheight:i}}}class Wa{update(t){if(t.points&&pt(t.points.points)){var e=t.points.points,r=Math.min(...e.map((t=>t[0]))),i=Math.max(...e.map((t=>t[0]))),n=Math.min(...e.map((t=>t[1]))),a=(i-r)/2,s=(Math.max(...e.map((t=>t[1])))-n)/2;return{cx:r+a,cy:n+s,hwidth:a,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}class qa{update(t,e){var r=t.x,i=void 0===r?0:r,n=t.y,a=void 0===n?0:n,s=t.src,o=t.width,h=t.height,l=void 0===o?0:o,c=void 0===h?0:h;return s&&!mt(s)&&(l||(t.width=l=s.width),c||(t.height=c=s.height)),{cx:i+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}class Za{constructor(t){this.globalRuntime=t}isReadyToMeasure(t,e){return t.text}update(t,e){var r,i=t.text,n=t.textAlign,a=void 0===n?"start":n,s=t.lineWidth,o=void 0===s?1:s,h=t.textBaseline,l=void 0===h?"alphabetic":h,c=t.dx,u=void 0===c?0:c,d=t.dy,p=void 0===d?0:d,v=t.x,f=void 0===v?0:v,m=t.y,g=void 0===m?0:m;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:[]},{hwidth:0,hheight:0,cx:0,cy:0};var y=(null==e||null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.getConfig())||{},x=this.globalRuntime.textService.measureText(i,t,y.offscreenCanvas);t.metrics=x;var E=x.width/2,b=x.height/2,T=f+E;"center"===a||"middle"===a?T+=o/2-E:"right"!==a&&"end"!==a||(T+=o-2*E);var w=g-b;return"middle"===l?w+=b:"top"===l||"hanging"===l?w+=2*b:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(w+=0),u&&(T+=u),p&&(w+=p),{cx:T,cy:w,hwidth:E,hheight:b}}}class Ka{update(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}class $a{update(t,e){var r=t.x,i=t.y,n=t.width,a=void 0===n?0:n,s=t.height,o=void 0===s?0:s;return{cx:(void 0===r?0:r)+a/2,cy:(void 0===i?0:i)+o/2,hwidth:a/2,hheight:o/2}}}class Qa{get name(){return this.type}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewportX(){return this.viewport.x}get viewportY(){return this.viewport.y}constructor(t){this.eventPhase=Qa.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Er,this.page=new Er,this.canvas=new Er,this.viewport=new Er,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}get propagationPath(){return this.composedPath()}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw Error(Tr)}}class Ja extends Qa{constructor(){super(...arguments),this.client=new Er,this.movement=new Er,this.offset=new Er,this.global=new Er,this.screen=new Er}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(){throw Error(Tr)}}class ts extends Ja{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw Error("getPredictedEvents is not supported!")}clone(){return this.manager.clonePointerEvent(this)}}class es extends Ja{clone(){return this.manager.cloneWheelEvent(this)}}class rs extends Qa{constructor(t,e){super(null),this.type=t,this.detail=e,Object.assign(this,e)}}var is=new WeakMap;class ns{constructor(){this.emitter=new c}on(t,e,r){return this.addEventListener(t,e,r),this}addEventListener(t,e,r){var i=!1,n=!1;if(Tt(r))i=r;else if(r){var a=r.capture;i=void 0!==a&&a;var s=r.once;n=void 0!==s&&s}i&&(t+="capture"),e=lt(e)?e:e.handleEvent;var o=lt(e)?void 0:e;return n?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this}off(t,e,r){return t?this.removeEventListener(t,e,r):this.removeAllEventListeners(),this}removeAllEventListeners(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}removeEventListener(t,e,r){var i;if(!this.emitter)return this;(Tt(r)?r:null==r?void 0:r.capture)&&(t+="capture"),e=lt(e)?e:null===(i=e)||void 0===i?void 0:i.handleEvent;var n=lt(e)?void 0:e;return this.emitter.off(t,e,n),this}emit(t,e){this.dispatchEvent(new rs(t,e))}dispatchEvent(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=is.get(this);i||(i=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&is.set(this,i);if(i){if(t.manager=i.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],r||(t.target=this),t.manager.dispatchEvent(t,t.type,r)}return!t.defaultPrevented}}class as extends ns{constructor(){super(...arguments),this.shadow=!1,this.ownerDocument=null,this.isConnected=!1,this.baseURI="",this.childNodes=[],this.nodeType=0,this.nodeName="",this.nodeValue=null,this.parentNode=null}static isNode(t){return!!t.childNodes}get textContent(){var t="";this.nodeName===hr.TEXT&&(t+=this.style.text);var e,r=nr(this.childNodes);try{for(r.s();!(e=r.n()).done;){var i=e.value;t+=i.nodeName===hr.TEXT?i.nodeValue:i.textContent}}catch(t){r.e(t)}finally{r.f()}return t}set textContent(t){this.childNodes.slice().forEach((t=>{this.removeChild(t)})),this.nodeName===hr.TEXT&&(this.style.text="".concat(t))}getRootNode(){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}hasChildNodes(){return this.childNodes.length>0}isDefaultNamespace(t){throw Error(Tr)}lookupNamespaceURI(t){throw Error(Tr)}lookupPrefix(t){throw Error(Tr)}normalize(){throw Error(Tr)}isEqualNode(t){return this===t}isSameNode(t){return this.isEqualNode(t)}get parent(){return this.parentNode}get parentElement(){return null}get nextSibling(){return null}get previousSibling(){return null}get firstChild(){return this.childNodes.length>0?this.childNodes[0]:null}get lastChild(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}compareDocumentPosition(t){if(t===this)return 0;for(var e=t,r=this,i=[e],n=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(n.push(r.parentNode),r.parentNode):r}if(e!==r)return as.DOCUMENT_POSITION_DISCONNECTED|as.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|as.DOCUMENT_POSITION_PRECEDING;var s=i.length>n.length?i:n,o=s===i?n:i;if(s[s.length-o.length]===o[0])return s===i?as.DOCUMENT_POSITION_CONTAINED_BY|as.DOCUMENT_POSITION_FOLLOWING:as.DOCUMENT_POSITION_CONTAINS|as.DOCUMENT_POSITION_PRECEDING;for(var h=s.length-o.length,l=o.length-1;l>=0;l--){var c=o[l],u=s[h+l];if(u!==c){var d=c.parentNode.childNodes;return d.indexOf(c)<d.indexOf(u)?o===i?as.DOCUMENT_POSITION_PRECEDING:as.DOCUMENT_POSITION_FOLLOWING:s===i?as.DOCUMENT_POSITION_PRECEDING:as.DOCUMENT_POSITION_FOLLOWING}}return as.DOCUMENT_POSITION_FOLLOWING}contain(t){return this.contains(t)}contains(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}getAncestor(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}forEach(t){if(!1!==t(this))for(var e=this.childNodes,r=e.length,i=0;r>i;i++)e[i].forEach(t)}}as.DOCUMENT_POSITION_DISCONNECTED=1,as.DOCUMENT_POSITION_PRECEDING=2,as.DOCUMENT_POSITION_FOLLOWING=4,as.DOCUMENT_POSITION_CONTAINS=8,as.DOCUMENT_POSITION_CONTAINED_BY=16,as.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;class ss{constructor(t,e){this.emitter=new c,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=v(),this.tmpVec3=R(),this.onPointerDown=t=>{var e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){this.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)},this.onPointerUp=t=>{var e=pa.now(),r=this.createPointerEvent(t,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){this.dispatchEvent(r,2===r.button?"rightup":"mouseup")}var i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),a=n;if(n&&!r.composedPath().includes(n)){for(var s=n;s&&!r.composedPath().includes(s);){if(r.currentTarget=s,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside")}as.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],a=s}if(a){var o,h=this.clonePointerEvent(r,"click");h.target=a,h.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:h.target,timeStamp:e});var l=i.clicksByButton[t.button];l.target===h.target&&this.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>e-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=h.target,l.timeStamp=e,h.detail=l.clickCount,null!==(o=r.detail)&&void 0!==o&&o.preventClick||(this.context.config.useNativeClickEvent||"mouse"!==h.pointerType&&"touch"!==h.pointerType||this.dispatchEvent(h,"click"),this.dispatchEvent(h,"pointertap")),this.freeEvent(h)}this.freeEvent(r)},this.onPointerMove=t=>{var e=this.createPointerEvent(t,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.overTargets);if(i.overTargets&&n!==e.target){var a=this.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",n||void 0);if(this.dispatchEvent(a,"pointerout"),r&&this.dispatchEvent(a,"mouseout"),!e.composedPath().includes(n)){var s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseleave"),as.isNode(s.target)&&(s.target=s.target.parentNode);this.freeEvent(s)}this.freeEvent(a)}if(n!==e.target){var o=this.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");this.dispatchEvent(o,"pointerover"),r&&this.dispatchEvent(o,"mouseover");for(var h=n&&as.isNode(n)&&n.parentNode;h&&h!==(as.isNode(this.rootTarget)&&this.rootTarget.parentNode)&&h!==e.target;)h=h.parentNode;if(!h||h===(as.isNode(this.rootTarget)&&this.rootTarget.parentNode)){var l=this.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==n&&l.target!==(as.isNode(this.rootTarget)&&this.rootTarget.parentNode);)l.currentTarget=l.target,this.notifyTarget(l),r&&this.notifyTarget(l,"mouseenter"),as.isNode(l.target)&&(l.target=l.target.parentNode);this.freeEvent(l)}this.freeEvent(o)}this.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&this.dispatchEvent(e,"touchmove"),r&&(this.dispatchEvent(e,"mousemove"),this.cursor=this.getCursor(e.target)),i.overTargets=e.composedPath(),this.freeEvent(e)},this.onPointerOut=t=>{var e=this.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=this.findMountedTarget(e.overTargets),n=this.createPointerEvent(t,"pointerout",i||void 0);this.dispatchEvent(n),r&&this.dispatchEvent(n,"mouseout");var a=this.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(as.isNode(this.rootTarget)&&this.rootTarget.parentNode);)a.currentTarget=a.target,this.notifyTarget(a),r&&this.notifyTarget(a,"mouseleave"),as.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,this.freeEvent(n),this.freeEvent(a)}this.cursor=null},this.onPointerOver=t=>{var e=this.trackingData(t.pointerId),r=this.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;this.dispatchEvent(r,"pointerover"),i&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursor=this.getCursor(r.target));var n=this.clonePointerEvent(r,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==(as.isNode(this.rootTarget)&&this.rootTarget.parentNode);)n.currentTarget=n.target,this.notifyTarget(n),i&&this.notifyTarget(n,"mouseenter"),as.isNode(n.target)&&(n.target=n.target.parentNode);e.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(n)},this.onPointerUpOutside=t=>{var e=this.trackingData(t.pointerId),r=this.findMountedTarget(e.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(r){for(var n=r;n;)i.currentTarget=n,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||this.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),as.isNode(n)&&(n=n.parentNode);delete e.pressTargetsByButton[t.button]}this.freeEvent(i)},this.onWheel=t=>{var e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)},this.onClick=t=>{if(this.context.config.useNativeClickEvent){var e=this.createPointerEvent(t);this.dispatchEvent(e),this.freeEvent(e)}},this.onPointerCancel=t=>{var e=this.createPointerEvent(t,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0);this.dispatchEvent(e),this.freeEvent(e)},this.globalRuntime=t,this.context=e}init(){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)}destroy(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}getScale(){var t=this.context.contextService.getBoundingClientRect(),e=1,r=1,i=this.context.contextService.getDomElement();if(i&&t){var n=i.offsetWidth,a=i.offsetHeight;n&&a&&(e=t.width/n,r=t.height/a)}return{scaleX:e,scaleY:r,bbox:t}}client2Viewport(t){var e=this.getScale(),r=e.bbox;return new Er((t.x-((null==r?void 0:r.left)||0))/e.scaleX,(t.y-((null==r?void 0:r.top)||0))/e.scaleY)}viewport2Client(t){var e=this.getScale(),r=e.bbox;return new Er((t.x+((null==r?void 0:r.left)||0))*e.scaleX,(t.y+((null==r?void 0:r.top)||0))*e.scaleY)}viewport2Canvas(t){var e=t.x,r=t.y,i=this.rootTarget.defaultView.getCamera(),n=this.context.config,a=n.width,s=n.height,o=i.getPerspectiveInverse(),h=i.getWorldTransform(),l=x(this.tmpMatrix,h,o),c=_(this.tmpVec3,e/a*2-1,2*(1-r/s)-1,0);return j(c,c,l),new Er(c[0],c[1])}canvas2Viewport(t){var e=this.rootTarget.defaultView.getCamera(),r=e.getPerspective(),i=e.getViewTransform(),n=x(this.tmpMatrix,r,i),a=_(this.tmpVec3,t.x,t.y,0);j(this.tmpVec3,this.tmpVec3,n);var s=this.context.config;return new Er((a[0]+1)/2*s.width,(1-(a[1]+1)/2)*s.height)}setPickHandler(t){this.pickHandler=t}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}mapEvent(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var r=0,i=e.length;i>r;r++)e[r].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}dispatchEvent(t,e,r){r?(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)}propagate(t,e){if(t.target){var r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=r.length-1;i>=1;i--)if(t.currentTarget=r[i],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 n=r.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=n+1;r.length>a;a++)if(t.currentTarget=r[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}propagationPath(t){var e=[t],r=this.rootTarget.defaultView||null;if(r&&r===t)return e.unshift(r.document),e;for(var i=0;2048>i&&t!==this.rootTarget;i++)as.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return r&&e.push(r),e}hitTest(t){var e=t.viewportX,r=t.viewportY,i=this.context.config;return 0>e||0>r||e>i.width||r>i.height?null:!i.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}isNativeEventFromCanvas(t,e){var r,i=null==e?void 0:e.target;if(null!==(r=i)&&void 0!==r&&r.shadowRoot&&(i=e.composedPath()[0]),i){if(i===t)return!0;if(t&&t.contains)return t.contains(i)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}getExistedHTML(t){if(t.nativeEvent.composedPath)for(var e=0,r=t.nativeEvent.composedPath();r.length>e;e++){var i=this.nativeHTMLMap.get(r[e]);if(i)return i}return null}pickTarget(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}createPointerEvent(t,e,r,i){var n=this.allocateEvent(ts);this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t;var a=this.getExistedHTML(n),s=this.context.contextService.getDomElement();return n.target=null!=r?r:a||this.isNativeEventFromCanvas(s,n.nativeEvent)&&this.pickTarget(n)||i,"string"==typeof e&&(n.type=e),n}createWheelEvent(t){var e=this.allocateEvent(es);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var r=this.getExistedHTML(e),i=this.context.contextService.getDomElement();return e.target=r||this.isNativeEventFromCanvas(i,e.nativeEvent)&&this.pickTarget(e),e}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}cloneWheelEvent(t){var e=this.allocateEvent(es);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}clonePointerEvent(t,e){var r=this.allocateEvent(ts);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=null!=e?e:r.type,r}copyPointerData(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}copyMouseData(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)}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyData(t,e){e.isTrusted=t.isTrusted,e.timeStamp=pa.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}allocateEvent(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}freeEvent(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)}notifyTarget(t,e){var r;e=null!==(r=e)&&void 0!==r?r: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)}notifyListeners(t,e){var r=t.currentTarget.emitter,i=r._events[e];if(i)if("fn"in i)i.once&&r.removeListener(e,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var n=0;i.length>n&&!t.propagationImmediatelyStopped;n++)i[n].once&&r.removeListener(e,i[n].fn,void 0,!0),i[n].fn.call(t.currentTarget||i[n].context,t)}findMountedTarget(t){if(!t)return null;for(var e=t[t.length-1],r=t.length-2;r>=0;r--){var i=t[r];if(!(i===this.rootTarget||as.isNode(i)&&i.parentNode===e))break;e=t[r]}return e}getCursor(t){for(var e=t;e;){var r=ha(e)&&e.getAttribute("cursor");if(r)return r;e=as.isNode(e)&&e.parentNode}}}class os{static createCanvas(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}getOrCreateCanvas(t,e){if(this.canvas)return this.canvas;if(t||Ys.offscreenCanvas)this.canvas=t||Ys.offscreenCanvas,this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},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",a({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}getOrCreateContext(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}var hs=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({});class ls{constructor(t,e){this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Sa,initAsync:new Pa,dirtycheck:new Ca,cull:new Ca,beginFrame:new Sa,beforeRender:new Sa,render:new Sa,afterRender:new Sa,endFrame:new Sa,destroy:new Sa,pick:new ka,pickSync:new Ca,pointerDown:new Sa,pointerUp:new Sa,pointerMove:new Sa,pointerOut:new Sa,pointerOver:new Sa,pointerWheel:new Sa,pointerCancel:new Sa,click:new Sa},this.globalRuntime=t,this.context=e}init(t){var e=a(a({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((t=>{t.apply(e,this.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((()=>{this.inited=!0,t()}))}getStats(){return this.stats}disableDirtyRectangleRendering(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(hs.CAMERA_CHANGED)}render(t,e,r){this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var n=1===i.renderReasons.size&&i.renderReasons.has(hs.CAMERA_CHANGED),a=!t.disableRenderHooks||!(t.disableRenderHooks&&n);a&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),a&&i.renderListCurrentFrame.forEach((t=>{this.hooks.beforeRender.call(t),this.hooks.render.call(t),this.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),r()}}renderDisplayObject(t,e,r){var i=e.renderer.getConfig(),n=i.enableDirtyCheck?t.renderable.dirty||r.dirtyRectangleRenderingDisabled?t:null:t;if(n){var a=i.enableCulling?this.hooks.cull.call(n,this.context.camera):n;a&&(this.stats.rendered++,r.renderListCurrentFrame.push(a))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var s=t.sortable;s.dirty&&(this.sort(t,s),s.dirty=!1,s.dirtyChildren=[],s.dirtyReason=void 0),(s.sorted||t.childNodes).forEach((t=>{this.renderDisplayObject(t,e,r)}))}sort(t,e){e.sorted&&e.dirtyReason!==Zr.Z_INDEX_CHANGED?e.dirtyChildren.forEach((r=>{if(-1===t.childNodes.indexOf(r)){var i=e.sorted.indexOf(r);0>i||e.sorted.splice(i,1)}else if(0===e.sorted.length)e.sorted.push(r);else{var n=function(t,e){for(var r=0,i=t.length;i>r;){var n=r+i>>>1;0>la(t[n],e)?r=n+1:i=n}return r}(e.sorted,r);e.sorted.splice(n,0,r)}})):e.sorted=t.childNodes.slice().sort(la)}destroy(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}dirtify(){this.context.renderingContext.renderReasons.add(hs.DISPLAY_OBJECT_CHANGED)}}var cs=/\[\s*(.*)=(.*)\s*\]/;class us{selectOne(t,e){if(t.startsWith("."))return e.find((e=>((null==e?void 0:e.classList)||[]).indexOf(this.getIdOrClassname(t))>-1));if(t.startsWith("#"))return e.find((e=>e.id===this.getIdOrClassname(t)));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,n=r.value;return i?e.find((t=>e!==t&&("name"===i?t.name===n:this.attributeToString(t,i)===n))):null}return e.find((r=>e!==r&&r.nodeName===t))}selectAll(t,e){if(t.startsWith("."))return e.findAll((r=>e!==r&&((null==r?void 0:r.classList)||[]).indexOf(this.getIdOrClassname(t))>-1));if(t.startsWith("#"))return e.findAll((r=>e!==r&&r.id===this.getIdOrClassname(t)));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,n=r.value;return i?e.findAll((t=>e!==t&&("name"===i?t.name===n:this.attributeToString(t,i)===n))):[]}return e.findAll((r=>e!==r&&r.nodeName===t))}is(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,n=r.value;return"name"===i?e.name===n:this.attributeToString(e,i)===n}return e.nodeName===t}getIdOrClassname(t){return t.substring(1)}getAttribute(t){var e=t.match(cs),r="",i="";return e&&e.length>2&&(r=e[1].replace(/"/g,""),i=e[2].replace(/"/g,"")),{name:r,value:i}}attributeToString(t,e){if(!t.getAttribute)return"";var r=t.getAttribute(e);return ct(r)?"":r.toString?""+r:""}}var ds=function(t){return t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({});class ps extends Qa{constructor(t,e,r,i,n,a,s,o){super(null),this.relatedNode=e,this.prevValue=r,this.newValue=i,this.attrName=n,this.attrChange=a,this.prevParsedValue=s,this.newParsedValue=o,this.type=t}}function vs(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}ps.ADDITION=2,ps.MODIFICATION=1,ps.REMOVAL=3;var fs=new ps(ds.REPARENT,null,"","","",0,"",""),ms=ht(),gs=R(),ys=I(1,1,1),xs=v(),Es=ht(),bs=R(),Ts=v(),ws=Q(),Ms=R(),Ns=Q(),Ps=R(),ks=R(),Ss=R(),Cs=v(),As=Q(),Rs=Q(),Os=Q(),Ls={affectChildren:!0};class Is{constructor(t){this.pendingEvents=new Map,this.boundsChangedEvent=new rs(ds.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=t}matches(t,e){return this.runtime.sceneGraphSelector.is(t,e)}querySelector(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}querySelectorAll(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}attach(t,e,r){var i,n=!1;t.parentNode&&(n=t.parentNode!==e,this.detach(t));var a=t.nodeName===hr.FRAGMENT,s=va(e);t.parentNode=e;var o=a?t.childNodes:[t];yt(r)?o.forEach((t=>{e.childNodes.splice(r,0,t),t.parentNode=e})):o.forEach((t=>{e.childNodes.push(t),t.parentNode=e}));var h=e.sortable;if((null!=h&&null!==(i=h.sorted)&&void 0!==i&&i.length||t.parsedStyle.zIndex)&&(-1===h.dirtyChildren.indexOf(t)&&h.dirtyChildren.push(t),h.dirty=!0,h.dirtyReason=Zr.ADDED),!s){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}n&&t.dispatchEvent(fs)}}detach(t){if(t.parentNode){var e,r,i=t.transformable,n=t.parentNode.sortable;(null!=n&&null!==(e=n.sorted)&&void 0!==e&&e.length||null!==(r=t.style)&&void 0!==r&&r.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=Zr.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(t,i),t.parentNode=null}}getOrigin(t){return t.getGeometryBounds(),t.transformable.origin}setOrigin(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 r=t.transformable;if(e[0]!==r.origin[0]||e[1]!==r.origin[1]||e[2]!==r.origin[2]){var i=r.origin;i[0]=e[0],i[1]=e[1],i[2]=e[2]||0,this.dirtifyLocal(t,r)}}rotate(t,e){"number"==typeof e&&(e=I(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var i=ws;rt(i,e[0],e[1],e[2]);var n=this.getRotation(t),a=this.getRotation(t.parentNode);nt(Os,a),et(Os,Os),tt(i,Os,i),tt(r.localRotation,i,n),ot(r.localRotation,r.localRotation),this.dirtifyLocal(t,r)}else this.rotateLocal(t,e)}rotateLocal(t,e){"number"==typeof e&&(e=I(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;rt(Rs,e[0],e[1],e[2]),st(r.localRotation,r.localRotation,Rs),this.dirtifyLocal(t,r)}setEulerAngles(t,e){"number"==typeof e&&(e=I(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){rt(r.localRotation,e[0],e[1],e[2]);var i=this.getRotation(t.parentNode);nt(As,et(ws,i)),st(r.localRotation,r.localRotation,As),this.dirtifyLocal(t,r)}else this.setLocalEulerAngles(t,e)}setLocalEulerAngles(t,e){var r=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=I(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var i=t.transformable;rt(i.localRotation,e[0],e[1],e[2]),r&&this.dirtifyLocal(t,i)}translateLocal(t,e){"number"==typeof e&&(e=I(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;H(e,gs)||(!function(t,e,r){var i=r[0],n=r[1],a=r[2],s=e[0],o=e[1],h=e[2],l=n*h-a*o,c=a*s-i*h,u=i*o-n*s,d=n*u-a*c,p=a*l-i*u,v=i*c-n*l,f=2*r[3];c*=f,u*=f,p*=2,v*=2,t[0]=s+(l*=f)+(d*=2),t[1]=o+c+p,t[2]=h+u+v}(e,e,r.localRotation),F(r.localPosition,r.localPosition,e),this.dirtifyLocal(t,r))}setPosition(t,e){var r,i=t.transformable;if(Ss[0]=e[0],Ss[1]=e[1],Ss[2]=null!==(r=e[2])&&void 0!==r?r:0,!H(this.getPosition(t),Ss)){if(D(i.position,Ss),null!==t.parentNode&&t.parentNode.transformable)f(Cs,t.parentNode.transformable.worldTransform),y(Cs,Cs),j(i.localPosition,Ss,Cs);else D(i.localPosition,Ss);this.dirtifyLocal(t,i)}}setLocalPosition(t,e){var r,i=2>=arguments.length||void 0===arguments[2]||arguments[2],n=t.transformable;ks[0]=e[0],ks[1]=e[1],ks[2]=null!==(r=e[2])&&void 0!==r?r:0,H(n.localPosition,ks)||(D(n.localPosition,ks),i&&this.dirtifyLocal(t,n))}scaleLocal(t,e){var r,i,n,a,s=t.transformable;i=s.localScale,n=s.localScale,a=_(bs,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:1),i[0]=n[0]*a[0],i[1]=n[1]*a[1],i[2]=n[2]*a[2],this.dirtifyLocal(t,s)}setLocalScale(t,e){var r,i=2>=arguments.length||void 0===arguments[2]||arguments[2],n=t.transformable;_(bs,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:n.localScale[2]),H(bs,n.localScale)||(D(n.localScale,bs),i&&this.dirtifyLocal(t,n))}translate(t,e){"number"==typeof e&&(e=_(bs,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),H(e,gs)||(F(bs,this.getPosition(t),e),this.setPosition(t,bs))}setRotation(t,e,r,i,n){var a=t.transformable;if("number"==typeof e&&(e=it(e,r,i,n)),null!==t.parentNode&&t.parentNode.transformable){var s=this.getRotation(t.parentNode);nt(ws,s),et(ws,ws),tt(a.localRotation,ws,e),ot(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}setLocalRotation(t,e,r,i,n){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=at(ws,e,r,i,n));var s=t.transformable;nt(s.localRotation,e),a&&this.dirtifyLocal(t,s)}setLocalSkew(t,e,r){var i=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,r){return t[0]=e,t[1]=r,t}(Es,e,r));var n,a,s=t.transformable;(n=s.localSkew)[0]=(a=e)[0],n[1]=a[1],i&&this.dirtifyLocal(t,s)}dirtifyLocal(t,e){va(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}dirtifyWorld(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}dirtifyFragment(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0);for(var i=t.childNodes.length,n=0;i>n;n++)this.dirtifyFragment(t.childNodes[n]);t.nodeName===hr.FRAGMENT&&this.pendingEvents.set(t,!1)}triggerPendingEvents(){var t=new Set,e=new Set;this.pendingEvents.forEach(((t,r)=>{r.nodeName===hr.FRAGMENT&&r.forEach((t=>{t!==r&&e.add(t)}))}));var r=(r,i)=>{!r.isConnected||t.has(r)||e.has(r)||(this.boundsChangedEvent.detail=i,this.boundsChangedEvent.target=r,r.isMutationObserved?r.dispatchEvent(this.boundsChangedEvent):r.ownerDocument.defaultView.dispatchEvent(this.boundsChangedEvent,!0),t.add(r))};this.pendingEvents.forEach(((t,e)=>{Ls.affectChildren=t,t?e.forEach((t=>{r(t,Ls)})):r(e,Ls)})),t.clear(),e.clear(),this.clearPendingEvents()}clearPendingEvents(){this.pendingEvents.clear()}dirtifyToRoot(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t;for(r.renderable&&(r.renderable.dirty=!0);r;)vs(r),r=r.parentNode;e&&t.forEach((t=>{vs(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}updateDisplayObjectDependency(t,e,r,i){if(e&&e!==r){var n=this.displayObjectDependencyMap.get(e);if(n&&n[t]){var a=n[t].indexOf(i);n[t].splice(a,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[t]||(s[t]=[]),s[t].push(i)}}informDependentDisplayObjects(t){var e=this.displayObjectDependencyMap.get(t);e&&Object.keys(e).forEach((t=>{e[t].forEach((e=>{this.dirtifyToRoot(e,!0),e.dispatchEvent(new ps(ds.ATTR_MODIFIED,e,this,this,t,ps.MODIFICATION,this,this)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,this,this)}))}))}getPosition(t){var e=t.transformable;return M(e.position,this.getWorldTransform(t,e))}getRotation(t){var e=t.transformable;return P(e.rotation,this.getWorldTransform(t,e))}getScale(t){var e=t.transformable;return N(e.scaling,this.getWorldTransform(t,e))}getWorldTransform(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}getLocalPosition(t){return t.transformable.localPosition}getLocalRotation(t){return t.transformable.localRotation}getLocalScale(t){return t.transformable.localScale}getLocalSkew(t){return t.transformable.localSkew}calcLocalTransform(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){k(t.localTransform,t.localRotation,t.localPosition,I(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(g(Ts),Ts[4]=Math.tan(t.localSkew[0]),Ts[1]=Math.tan(t.localSkew[1]),x(t.localTransform,t.localTransform,Ts));var e=k(Ts,at(ws,0,0,0,1),_(bs,1,1,1),t.localScale,t.origin);x(t.localTransform,t.localTransform,e)}else{var r=t.localTransform,i=t.localPosition,n=t.localRotation,a=t.localScale,s=t.origin,o=0!==i[0]||0!==i[1]||0!==i[2];1!==n[3]||0!==n[0]||0!==n[1]||0!==n[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==s[0]||0!==s[1]||0!==s[2])?k(r,n,i,a,s):o?b(r,i):g(r)}}getLocalTransform(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}setLocalTransform(t,e){var r=M(Ms,e),i=P(Ns,e),n=N(Ps,e);this.setLocalScale(t,n,!1),this.setLocalPosition(t,r,!1),this.setLocalRotation(t,i,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}resetLocalTransform(t){this.setLocalScale(t,ys,!1),this.setLocalPosition(t,gs,!1),this.setLocalEulerAngles(t,gs,void 0,void 0,!1),this.setLocalSkew(t,ms,void 0,!1),this.dirtifyLocal(t,t.transformable)}getTransformedGeometryBounds(t){var e=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!mr.isEmpty(r)){var i=e||new mr;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}getGeometryBounds(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.geometry;return r.dirty&&Ys.styleValueRegistry.updateGeometry(t),(e?r.renderBounds:r.contentBounds||null)||new mr}getBounds(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],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,n=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((t=>{var r=this.getBounds(t,e);r&&(n?n.add(r):(n=i||new mr).update(r.center,r.halfExtents))})),n||(n=new mr),e){var a=ca(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);n?s&&(n=s.intersection(n)):n.update(s.center,s.halfExtents)}}return e?(r.renderBounds=n,r.renderBoundsDirty=!1):(r.bounds=n,r.boundsDirty=!1),n}getLocalBounds(t){if(t.parentNode){var e=xs;t.parentNode.transformable&&(e=y(Ts,this.getWorldTransform(t.parentNode)));var r=this.getBounds(t);if(!mr.isEmpty(r)){var i=new mr;return i.setFromTransformedAABB(r,e),i}}return this.getBounds(t)}getBoundingClientRect(t){var e,r,i=this.getGeometryBounds(t);mr.isEmpty(i)||(r=new mr).setFromTransformedAABB(i,this.getWorldTransform(t));var n=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var a=h(r.getMin(),2),s=a[0],o=a[1],l=h(r.getMax(),2);return new br(s+((null==n?void 0:n.left)||0),o+((null==n?void 0:n.top)||0),l[0]-s,l[1]-o)}return new br((null==n?void 0:n.left)||0,(null==n?void 0:n.top)||0,0,0)}dirtifyWorldInternal(t,e){if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((t=>{var e=t.transformable;e.dirtyFlag||this.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}syncHierarchy(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var r=t.childNodes,i=0;r.length>i;i++)this.syncHierarchy(r[i])}}sync(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var r=t.parentNode,i=r&&r.transformable;null!==r&&i?x(e.worldTransform,i.worldTransform,e.localTransform):f(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}unfreezeParentToRoot(t){for(var e=t.parentNode;e;){var r=e.transformable;r&&(r.frozen=!1),e=e.parentNode}}}var Ds={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]},_s=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Fs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Gs=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source));class Bs{constructor(t){this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=(t,e)=>!this.isBreakingSpace(e)&&!(!t||!Gs.exec(e)&&!Fs.exec(t)),this.trimByKinsokuShorui=t=>{var e=[...t],r=e[e.length-2];if(!r)return t;var i=r[r.length-1];return e[e.length-2]=r.slice(0,-1),e[e.length-1]=i+e[e.length-1],e},this.runtime=t}measureFont(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var r={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),n=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});n.font=t;var a=Ds.MetricsString+Ds.BaselineSymbol,s=Math.ceil(n.measureText(a).width),o=Math.ceil(n.measureText(Ds.BaselineSymbol).width),h=Ds.HeightMultiplier*o;o=o*Ds.BaselineMultiplier|0,i.width=s,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,s,h),n.font=t,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(a,0,o);var l=n.getImageData(0,0,s||1,h||1).data,c=l.length,u=4*s,d=0,p=0,v=!1;for(d=0;o>d;++d){for(var f=0;u>f;f+=4)if(255!==l[p+f]){v=!0;break}if(v)break;p+=u}for(r.ascent=o-d,p=c-u,v=!1,d=h;d>o;--d){for(var m=0;u>m;m+=4)if(255!==l[p+m]){v=!0;break}if(v)break;p-=u}return r.descent=d-o,r.fontSize=r.ascent+r.descent,this.fontMetricsCache[t]=r,r}measureText(t,e,r){var i=e.fontSize,n=void 0===i?16:i,a=e.wordWrap,s=void 0!==a&&a,o=e.lineHeight,h=e.lineWidth,l=void 0===h?1:h,c=e.textBaseline,u=void 0===c?"alphabetic":c,d=e.textAlign,p=void 0===d?"start":d,v=e.letterSpacing,f=void 0===v?0:v,m=e.textPath,g=e.leading,y=void 0===g?0:g,x=function(t){for(var e=t.fontSize,r=void 0===e?16:e,i=t.fontFamily,n=void 0===i?"sans-serif":i,a=t.fontStyle,s=void 0===a?"normal":a,o=t.fontVariant,h=void 0===o?"normal":o,l=t.fontWeight,c=void 0===l?"normal":l,u=yt(r)&&"".concat(r,"px")||"16px",d=n.split(","),p=d.length-1;p>=0;p--){var v=d[p].trim();!Ra.test(v)&&0>Aa.indexOf(v)&&(v='"'.concat(v,'"')),d[p]=v}return"".concat(s," ").concat(h," ").concat(c," ").concat(u," ").concat(d.join(","))}(e),E=this.measureFont(x,r);0===E.fontSize&&(E.fontSize=n,E.ascent=n);var b=this.runtime.offscreenCanvasCreator.getOrCreateContext(r);b.font=x,e.isOverflowing=!1;var T=(s?this.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),w=Array(T.length),M=0;if(!m){for(var N=0;T.length>N;N++){var P=b.measureText(T[N]).width+(T[N].length-1)*f;w[N]=P,M=Math.max(M,P)}var k=M+l,S=o||E.fontSize+l,C=Math.max(S,E.fontSize+l)+(T.length-1)*(S+y),A=0;return"middle"===u?A=-C/2:"bottom"===u||"alphabetic"===u||"ideographic"===u?A=-C:"top"!==u&&"hanging"!==u||(A=0),{font:x,width:k,height:C,lines:T,lineWidths:w,lineHeight:S+=y,maxLineWidth:M,fontProperties:E,lineMetrics:w.map(((t,e)=>{var r=0;return"center"===p||"middle"===p?r-=t/2:"right"!==p&&"end"!==p||(r-=t),new br(r-l/2,A+e*S,t+l,S)}))}}m.getTotalLength();for(var R=0;T.length>R;R++)b.measureText(T[R])}setGraphemeOnPath(){}wordWrap(t,e,r){var i=e.wordWrapWidth,n=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,o=e.maxLines,h=void 0===o?1/0:o,l=e.textOverflow,c=this.runtime.offscreenCanvasCreator.getOrCreateContext(r),u=n+s,d="";"ellipsis"===l?d="...":l&&"clip"!==l&&(d=l);for(var p=[],v=0,f=0,m={},g=t=>this.getFromCache(t,s,m,c),y=Array.from(d).reduce(((t,e)=>t+g(e)),0),x=Array.from(t),E=0;x.length>E;E++){var b=x[E],T=t[E-1],w=t[E+1],M=g(b);if(this.isNewline(b)){if(++v>=h){e.isOverflowing=!0;break}f=0,p[v]=""}else{if(f>0&&f+M>u){if(v+1>=h){if(e.isOverflowing=!0,y>0&&u>=y){for(var N=p[v].length,P=0,k=N,S=0;N>S;S++){var C=g(p[v][S]);if(P+C+y>u){k=S;break}P+=C}p[v]=(p[v]||"").slice(0,k)+d}break}if(f=0,p[++v]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(p=this.trimToBreakable(p),f=this.sumTextWidthByCache(p[v]||"",m)),this.shouldBreakByKinsokuShorui(b,w)&&(p=this.trimByKinsokuShorui(p),f+=g(T||""))}f+=M,p[v]=(p[v]||"")+b}}return p.join("\n")}isBreakingSpace(t){return"string"==typeof t&&Ds.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}isNewline(t){return"string"==typeof t&&Ds.Newlines.indexOf(t.charCodeAt(0))>=0}trimToBreakable(t){var e=[...t],r=e[e.length-2],i=this.findBreakableIndex(r);if(-1===i||!r)return e;var n=r.slice(i,i+1),a=i+(this.isBreakingSpace(n)?0:1);return e[e.length-1]+=r.slice(i+1,r.length),e[e.length-2]=r.slice(0,a),e}canBreakInLastChar(t){return!t||!_s.test(t)}sumTextWidthByCache(t,e){return t.split("").reduce(((t,r)=>{if(!e[r])throw Error("cannot count the word without cache");return t+e[r]}),0)}findBreakableIndex(t){for(var e=t.length-1;e>=0;e--)if(!_s.test(t[e]))return e;return-1}getFromCache(t,e,r,i){var n=r[t];if("number"!=typeof n){var a=t.length*e;n=i.measureText(t).width+a,r[t]=n}return n}}var Vs,Us,Ys={},Xs=(Vs=new qa,Us=new Wa,{[hr.CIRCLE]:new Xa,[hr.ELLIPSE]:new ja,[hr.RECT]:Vs,[hr.IMAGE]:Vs,[hr.GROUP]:new Ka,[hr.LINE]:new Ha,[hr.TEXT]:new Za(Ys),[hr.POLYLINE]:Us,[hr.POLYGON]:Us,[hr.PATH]:new za,[hr.HTML]:new $a,[hr.MESH]:null}),js=(()=>{var t=new jn,e=new Wn;return{[$r.PERCENTAGE]:null,[$r.NUMBER]:new $n,[$r.ANGLE]:new Yn,[$r.DEFINED_PATH]:new Xn,[$r.PAINT]:t,[$r.COLOR]:t,[$r.FILTER]:new Hn,[$r.LENGTH]:e,[$r.LENGTH_PERCENTAGE]:e,[$r.LENGTH_PERCENTAGE_12]:new qn,[$r.LENGTH_PERCENTAGE_14]:new Zn,[$r.COORDINATE]:new Wn,[$r.OFFSET_DISTANCE]:new Qn,[$r.OPACITY_VALUE]:new Jn,[$r.PATH]:new ta,[$r.LIST_OF_POINTS]:new ea,[$r.SHADOW_BLUR]:new ra,[$r.TEXT]:new ia,[$r.TEXT_TRANSFORM]:new na,[$r.TRANSFORM]:new Va,[$r.TRANSFORM_ORIGIN]:new Ua,[$r.Z_INDEX]:new Ya,[$r.MARKER]:new Kn}})();Ys.CameraContribution=Wr,Ys.AnimationTimeline=null,Ys.EasingFunction=null,Ys.offscreenCanvasCreator=new os,Ys.sceneGraphSelector=new us,Ys.sceneGraphService=new Is(Ys),Ys.textService=new Bs(Ys),Ys.geometryUpdaterFactory=Xs,Ys.CSSPropertySyntaxFactory=js,Ys.styleValueRegistry=new class{constructor(t){this.runtime=t,Bn.forEach((t=>{this.registerMetadata(t)}))}registerMetadata(t){[t.n,...t.a||[]].forEach((e=>{Un[e]=t}))}getPropertySyntax(t){return this.runtime.CSSPropertySyntaxFactory[t]}processProperties(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var i=t.parsedStyle.clipPath,n=t.parsedStyle.offsetPath;Object.assign(t.parsedStyle,e);var s,o=!!r.forceUpdateGeometry;!o&&Vn.some((t=>t in e))&&(o=!0),e.fill&&(t.parsedStyle.fill=_i(e.fill)),e.stroke&&(t.parsedStyle.stroke=_i(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=_i(e.shadowColor)),e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,r=/\s*([\w-]+)\(([^)]*)\)/g,i=[],n=0;e=r.exec(t);){if(e.index!==n)return[];if(n=e.index+e[0].length,Zi.indexOf(e[1])>-1&&i.push({name:e[1],params:e[2].split(" ").map((t=>Gi(/deg|rad|grad|turn|px|%/g,t)||_i(t)))}),r.lastIndex===t.length)return i}return[]}(e.filter)),ct(e.radius)||(t.parsedStyle.radius=Wi(e.radius,4)),ct(e.lineDash)||(t.parsedStyle.lineDash=Wi(e.lineDash,2)),e.points&&(t.parsedStyle.points={points:mt(s=e.points)?s.split(" ").map((t=>{var e=h(t.split(","),2),r=e[1];return[Number(e[0]),Number(r)]})):s,totalLength:0,segments:[]}),""===e.d&&(t.parsedStyle.d=a({},Kr)),e.d&&(t.parsedStyle.d=gn(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory[$r.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),wt(e.clipPath)||this.runtime.CSSPropertySyntaxFactory[$r.DEFINED_PATH].calculator("clipPath",i,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[$r.DEFINED_PATH].calculator("offsetPath",n,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=Pn(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Fn(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[$r.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[$r.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[$r.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),ct(e.zIndex)||this.runtime.CSSPropertySyntaxFactory[$r.Z_INDEX].postProcessor(t),ct(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[$r.OFFSET_DISTANCE].postProcessor(t),e.transform&&this.runtime.CSSPropertySyntaxFactory[$r.TRANSFORM].postProcessor(t),e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[$r.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}updateGeometry(t){var e=t.nodeName,r=this.runtime.geometryUpdaterFactory[e];if(r){var i=t.geometry;i.contentBounds||(i.contentBounds=new mr),i.renderBounds||(i.renderBounds=new mr);var n=t.parsedStyle,a=r.update(n,t),s=a.cx,o=void 0===s?0:s,h=a.cy,l=void 0===h?0:h,c=a.cz,u=void 0===c?0:c,d=a.hwidth,p=void 0===d?0:d,v=a.hheight,f=void 0===v?0:v,m=a.hdepth,g=void 0===m?0:m,y=[Math.abs(p),Math.abs(f),g],x=n.stroke,E=n.lineWidth,b=void 0===E?1:E,T=n.increasedLineWidthForHitTesting,w=void 0===T?0:T,M=n.shadowType,N=void 0===M?"outer":M,P=n.shadowColor,k=n.filter,S=void 0===k?[]:k,C=n.transformOrigin,A=[o,l,u];if(i.contentBounds.update(A,y),x&&!x.isNone){var R=((b||0)+(w||0))*(e===hr.POLYLINE||e===hr.POLYGON||e===hr.PATH?Math.SQRT2:.5);y[0]+=R,y[1]+=R}if(i.renderBounds.update(A,y),P&&N&&"inner"!==N){var O=i.renderBounds,L=O.min,I=O.max,D=n.shadowBlur||0,_=n.shadowOffsetX||0,G=n.shadowOffsetY||0,B=I[0]+D+_,V=L[1]-D+G,U=I[1]+D+G;L[0]=Math.min(L[0],L[0]-D+_),I[0]=Math.max(I[0],B),L[1]=Math.min(L[1],V),I[1]=Math.max(I[1],U),i.renderBounds.setMinMax(L,I)}S.forEach((t=>{var e=t.name,r=t.params;if("blur"===e){var n=r[0].value;i.renderBounds.update(i.renderBounds.center,F(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[n,n,0]))}else if("drop-shadow"===e){var a=r[0].value,s=r[1].value,o=r[2].value,h=i.renderBounds,l=h.min,c=h.max,u=c[0]+o+a,d=l[1]-o+s,p=c[1]+o+s;l[0]=Math.min(l[0],l[0]-o+a),c[0]=Math.max(c[0],u),l[1]=Math.min(l[1],d),c[1]=Math.max(c[1],p),i.renderBounds.setMinMax(l,c)}})),t.geometry.dirty=!1;var Y=0>f,X=(0>p?-1:1)*(C?qi(C[0],0,t,!0):0),j=(Y?-1:1)*(C?qi(C[1],1,t,!0):0);(X||j)&&t.setOrigin(X,j)}}updateSizeAttenuation(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===hr.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===hr.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}(Ys),Ys.layoutRegistry=null,Ys.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Ys.enableStyleSyntax=!0,Ys.enableSizeAttenuation=!1;var Hs=0;var zs=new ps(ds.INSERTED,null,"","","",0,"",""),Ws=new ps(ds.REMOVED,null,"","","",0,"",""),qs=new rs(ds.DESTROY);class Zs extends as{constructor(){super(...arguments),this.entity=Hs++,this.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},this.cullable={strategy:qr.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},this.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]},this.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},this.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},this.rBushNode={aabb:void 0},this.namespaceURI="g",this.scrollLeft=0,this.scrollTop=0,this.clientTop=0,this.clientLeft=0,this.destroyed=!1,this.style={},this.computedStyle={},this.parsedStyle={},this.attributes={}}get className(){return this.getAttribute("class")||""}set className(t){this.setAttribute("class",t)}get classList(){return this.className.split(" ").filter((t=>""!==t))}get tagName(){return this.nodeName}get children(){return this.childNodes}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.firstChild}get lastElementChild(){return this.lastChild}get parentElement(){return this.parentNode}get nextSibling(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}get previousSibling(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}cloneNode(t){throw Error(Tr)}appendChild(t,e){var r;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Ys.sceneGraphService.attach(t,this,e),null!==(r=this.ownerDocument)&&void 0!==r&&r.defaultView&&(va(this)||t.nodeName!==hr.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(zs.relatedNode=this,t.dispatchEvent(zs)),t}insertBefore(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var r=this.childNodes.indexOf(e);-1===r?this.appendChild(t):this.appendChild(t,r)}else this.appendChild(t);return t}replaceChild(t,e){var r=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,r),e}removeChild(t){var e;return Ws.relatedNode=this,t.dispatchEvent(Ws),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Ys.sceneGraphService.detach(t),t}removeChildren(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}destroyChildren(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}}matches(t){return Ys.sceneGraphService.matches(t,this)}getElementById(t){return Ys.sceneGraphService.querySelector("#".concat(t),this)}getElementsByName(t){return Ys.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}getElementsByClassName(t){return Ys.sceneGraphService.querySelectorAll(".".concat(t),this)}getElementsByTagName(t){return Ys.sceneGraphService.querySelectorAll(t,this)}querySelector(t){return Ys.sceneGraphService.querySelector(t,this)}querySelectorAll(t){return Ys.sceneGraphService.querySelectorAll(t,this)}closest(t){var e=this;do{if(Ys.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}find(t){var e=null;return this.forEach((r=>r===this||!t(r)||(e=r,!1))),e}findAll(t){var e=[];return this.forEach((r=>{r!==this&&t(r)&&e.push(r)})),e}after(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,r=Array(e),i=0;e>i;i++)r[i]=arguments[i];r.forEach(((e,r)=>{var i;return null===(i=this.parentNode)||void 0===i?void 0:i.appendChild(e,t+r+1)}))}}before(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,r=Array(e),i=0;e>i;i++)r[i]=arguments[i];var n=r[0],a=r.slice(1);this.parentNode.appendChild(n,t),n.after(...a)}}replaceWith(){this.after(...arguments),this.remove()}append(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];e.forEach((t=>this.appendChild(t)))}prepend(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];e.forEach(((t,e)=>this.appendChild(t,e)))}replaceChildren(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append(...arguments)}remove(){return this.parentNode?this.parentNode.removeChild(this):this}destroy(){this.dispatchEvent(qs),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}getGeometryBounds(){return Ys.sceneGraphService.getGeometryBounds(this)}getRenderBounds(){return Ys.sceneGraphService.getBounds(this,!0)}getBounds(){return Ys.sceneGraphService.getBounds(this)}getLocalBounds(){return Ys.sceneGraphService.getLocalBounds(this)}getBoundingClientRect(){return Ys.sceneGraphService.getBoundingClientRect(this)}getClientRects(){return[this.getBoundingClientRect()]}computedStyleMap(){return new Map(Object.entries(this.computedStyle))}getAttributeNames(){return Object.keys(this.attributes)}getAttribute(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}hasAttribute(t){return this.getAttributeNames().includes(t)}hasAttributes(){return!!this.getAttributeNames().length}removeAttribute(t){this.setAttribute(t,null),delete this.attributes[t]}setAttribute(t,e,r,i){this.attributes[t]=e}getAttributeNS(t,e){throw Error(Tr)}getAttributeNode(t){throw Error(Tr)}getAttributeNodeNS(t,e){throw Error(Tr)}hasAttributeNS(t,e){throw Error(Tr)}removeAttributeNS(t,e){throw Error(Tr)}removeAttributeNode(t){throw Error(Tr)}setAttributeNS(t,e,r){throw Error(Tr)}setAttributeNode(t){throw Error(Tr)}setAttributeNodeNS(t){throw Error(Tr)}toggleAttribute(t,e){throw Error(Tr)}}function Ks(t){return!(null==t||!t.nodeName)}var $s=Ys.globalThis.Proxy?Ys.globalThis.Proxy:function(){},Qs=new ps(ds.ATTR_MODIFIED,null,null,null,null,ps.MODIFICATION,null,null),Js=R(),to=Q();class eo extends Zs{constructor(t){super(),this.isCustomElement=!1,this.isMutationObserved=!1,this.activeAnimations=[],this.config=t,this.id=t.id||"",this.name=t.name||"",(t.className||t.class)&&(this.className=t.className||t.class),this.nodeName=t.type||hr.GROUP,t.initialParsedStyle&&Object.assign(this.parsedStyle,t.initialParsedStyle),this.initAttributes(t.style),Ys.enableStyleSyntax&&(this.style=new $s({setProperty:(t,e)=>{this.setAttribute(t,e)},getPropertyValue:t=>this.getAttribute(t),removeProperty:t=>{this.removeAttribute(t)},item:()=>""},{get:(t,e)=>void 0!==t[e]?t[e]:this.getAttribute(e),set:(t,e,r)=>(this.setAttribute(e,r),!0)}))}destroy(){super.destroy(),this.getAnimations().forEach((t=>{t.cancel()}))}cloneNode(t,e){var r=a({},this.attributes);for(var i in r){var n=r[i];Ks(n)&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(r[i]=n.cloneNode(t)),e&&(r[i]=e(i,n))}var s=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return s.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((e=>{if(!e.style.isMarker){var r=e.cloneNode(t);s.appendChild(r)}})),s}initAttributes(){Ys.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.renderable.dirty=!0}setAttribute(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];wt(e)||(r||e!==this.attributes[t])&&(this.internalSetAttribute(t,e,{memoize:i}),super.setAttribute(t,e))}internalSetAttribute(t,e){var r=this.renderable,i=this.attributes[t],n=this.parsedStyle[t];Ys.styleValueRegistry.processProperties(this,{[t]:e},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),r.dirty=!0;var a=this.parsedStyle[t];this.isConnected&&(Qs.relatedNode=this,Qs.prevValue=i,Qs.newValue=e,Qs.attrName=t,Qs.prevParsedValue=n,Qs.newParsedValue=a,this.isMutationObserved?this.dispatchEvent(Qs):(Qs.target=this,this.ownerDocument.defaultView.dispatchEvent(Qs,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,n,a)}getBBox(){var t=this.getBounds(),e=h(t.getMin(),2),r=e[0],i=e[1],n=h(t.getMax(),2);return new br(r,i,n[0]-r,n[1]-i)}setOrigin(t){return Ys.sceneGraphService.setOrigin(this,Pr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}getOrigin(){return Ys.sceneGraphService.getOrigin(this)}setPosition(t){return Ys.sceneGraphService.setPosition(this,Pr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}setLocalPosition(t){return Ys.sceneGraphService.setLocalPosition(this,Pr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}translate(t){return Ys.sceneGraphService.translate(this,Pr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}translateLocal(t){return Ys.sceneGraphService.translateLocal(this,Pr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}getPosition(){return Ys.sceneGraphService.getPosition(this)}getLocalPosition(){return Ys.sceneGraphService.getLocalPosition(this)}scale(t,e,r){return this.scaleLocal(t,e,r)}scaleLocal(t,e,r){return"number"==typeof t&&(t=Pr(t,e=e||t,r=r||t,!1)),Ys.sceneGraphService.scaleLocal(this,t),this}setLocalScale(t,e,r){return"number"==typeof t&&(t=Pr(t,e=e||t,r=r||t,!1)),Ys.sceneGraphService.setLocalScale(this,t),this}getLocalScale(){return Ys.sceneGraphService.getLocalScale(this)}getScale(){return Ys.sceneGraphService.getScale(this)}getEulerAngles(){return Ar(h(Lr(Js,Ys.sceneGraphService.getWorldTransform(this)),3)[2])}getLocalEulerAngles(){return Ar(h(Lr(Js,Ys.sceneGraphService.getLocalRotation(this)),3)[2])}setEulerAngles(t){return Ys.sceneGraphService.setEulerAngles(this,0,0,t),this}setLocalEulerAngles(t){return Ys.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}rotateLocal(t,e,r){return ct(e)&&ct(r)?Ys.sceneGraphService.rotateLocal(this,0,0,t):Ys.sceneGraphService.rotateLocal(this,t,e,r),this}rotate(t,e,r){return ct(e)&&ct(r)?Ys.sceneGraphService.rotate(this,0,0,t):Ys.sceneGraphService.rotate(this,t,e,r),this}setRotation(t,e,r,i){return Ys.sceneGraphService.setRotation(this,t,e,r,i),this}setLocalRotation(t,e,r,i){return Ys.sceneGraphService.setLocalRotation(this,t,e,r,i),this}setLocalSkew(t,e){return Ys.sceneGraphService.setLocalSkew(this,t,e),this}getRotation(){return Ys.sceneGraphService.getRotation(this)}getLocalRotation(){return Ys.sceneGraphService.getLocalRotation(this)}getLocalSkew(){return Ys.sceneGraphService.getLocalSkew(this)}getLocalTransform(){return Ys.sceneGraphService.getLocalTransform(this)}getWorldTransform(){return Ys.sceneGraphService.getWorldTransform(this)}setLocalTransform(t){return Ys.sceneGraphService.setLocalTransform(this,t),this}resetLocalTransform(){Ys.sceneGraphService.resetLocalTransform(this)}getAnimations(){return this.activeAnimations}animate(t,e){var r,i=null===(r=this.ownerDocument)||void 0===r?void 0:r.timeline;return i?i.play(this,t,e):null}isVisible(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}get interactive(){return this.isInteractive()}set interactive(t){this.style.pointerEvents=t?"auto":"none"}isInteractive(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}isCulled(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}toFront(){return this.parentNode&&(this.style.zIndex=Math.max(...this.parentNode.children.map((t=>Number(t.style.zIndex))))+1),this}toBack(){return this.parentNode&&(this.style.zIndex=Math.min(...this.parentNode.children.map((t=>Number(t.style.zIndex))))-1),this}getConfig(){return this.config}attr(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var i=e[0],n=e[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((t=>{this.setAttribute(t,i[t])})),this):2===e.length?(this.setAttribute(i,n),this):this.attributes[i]:this.attributes}getMatrix(t){var e=t||this.getWorldTransform(),r=h(M(Js,e),2),i=r[0],n=r[1],a=h(N(Js,e),2),s=a[0],o=a[1],l=P(to,e),c=h(Lr(Js,l),3);return Ir(c[0]||c[2],i,n,s,o)}getLocalMatrix(){return this.getMatrix(this.getLocalTransform())}setMatrix(t){var e=h(Dr(t),5),r=e[0],i=e[1],n=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(r,i).setLocalScale(n,a)}setLocalMatrix(t){var e=h(Dr(t),5),r=e[0],i=e[1],n=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(r,i).setLocalScale(n,a)}show(){this.forEach((t=>{t.style.visibility="visible"}))}hide(){this.forEach((t=>{t.style.visibility="hidden"}))}getCount(){return this.childElementCount}getParent(){return this.parentElement}getChildren(){return this.children}getFirst(){return this.firstElementChild}getLast(){return this.lastElementChild}getChildByIndex(t){return this.children[t]||null}add(t,e){return this.appendChild(t,e)}set(t,e){this.config[t]=e}get(t){return this.config[t]}moveTo(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}move(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}setZIndex(t){return this.style.zIndex=t,this}}class ro extends eo{constructor(){super(a({type:hr.CIRCLE},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}var io=["style"];class no extends eo{constructor(){super(a({type:hr.ELLIPSE},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}class ao extends eo{constructor(){super(a({type:hr.GROUP},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}var so=["style"];class oo extends eo{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=ar(t,so);super(a({type:hr.HTML,style:e},r)),this.cullable.enable=!1}getDomElement(){return this.parsedStyle.$el}getClientRects(){return[this.getBoundingClientRect()]}getLocalBounds(){if(this.parentNode){var t=y(v(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!mr.isEmpty(e)){var r=new mr;return r.setFromTransformedAABB(e,t),r}}return this.getBounds()}}class ho extends eo{constructor(){super(a({type:hr.IMAGE},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}var lo=["style"];class co extends eo{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=ar(t,lo);super(a({type:hr.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},e)},r)),this.markerStartAngle=0,this.markerEndAngle=0;var i=this.parsedStyle,n=i.markerStart,s=i.markerEnd;n&&Ks(n)&&(this.markerStartAngle=n.getLocalEulerAngles(),this.appendChild(n)),s&&Ks(s)&&(this.markerEndAngle=s.getLocalEulerAngles(),this.appendChild(s)),this.transformMarker(!0),this.transformMarker(!1)}attributeChangedCallback(t,e,r,i,n){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&Ks(i)&&(this.markerStartAngle=0,i.remove()),n&&Ks(n)&&(this.markerStartAngle=n.getLocalEulerAngles(),this.appendChild(n),this.transformMarker(!0))):"markerEnd"===t&&(i&&Ks(i)&&(this.markerEndAngle=0,i.remove()),n&&Ks(n)&&(this.markerEndAngle=n.getLocalEulerAngles(),this.appendChild(n),this.transformMarker(!1)))}transformMarker(t){var e=this.parsedStyle,r=e.markerStartOffset,i=e.markerEndOffset,n=e.x1,a=e.x2,s=e.y1,o=e.y2,h=t?e.markerStart:e.markerEnd;if(h&&Ks(h)){var l,c,u,d,p,v,f;t?(d=n,p=s,c=a-n,u=o-s,v=r||0,f=this.markerStartAngle):(d=a,p=o,c=n-a,u=s-o,v=i||0,f=this.markerEndAngle),h.setLocalEulerAngles(180*(l=Math.atan2(u,c))/Math.PI+f),h.setLocalPosition(d+Math.cos(l)*v,p+Math.sin(l)*v)}}getPoint(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.parsedStyle,i=We(r.x1,r.y1,r.x2,r.y2,t),n=i.x,a=i.y,s=j(R(),I(n,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Er(s[0],s[1])}getPointAtLength(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}getTotalLength(){var t=this.parsedStyle;return ze(t.x1,t.y1,t.x2,t.y2)}}var uo=["style"];class po extends eo{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=ar(t,uo);super(a({type:hr.PATH,style:e,initialParsedStyle:{miterLimit:4,d:a({},Kr)}},r)),this.markerStartAngle=0,this.markerEndAngle=0,this.markerMidList=[];var i=this.parsedStyle,n=i.markerStart,s=i.markerEnd,o=i.markerMid;n&&Ks(n)&&(this.markerStartAngle=n.getLocalEulerAngles(),this.appendChild(n)),o&&Ks(o)&&this.placeMarkerMid(o),s&&Ks(s)&&(this.markerEndAngle=s.getLocalEulerAngles(),this.appendChild(s)),this.transformMarker(!0),this.transformMarker(!1)}attributeChangedCallback(t,e,r,i,n){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&Ks(i)&&(this.markerStartAngle=0,i.remove()),n&&Ks(n)&&(this.markerStartAngle=n.getLocalEulerAngles(),this.appendChild(n),this.transformMarker(!0))):"markerEnd"===t?(i&&Ks(i)&&(this.markerEndAngle=0,i.remove()),n&&Ks(n)&&(this.markerEndAngle=n.getLocalEulerAngles(),this.appendChild(n),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(n)}transformMarker(t){var e=this.parsedStyle,r=e.markerStartOffset,i=e.markerEndOffset,n=t?e.markerStart:e.markerEnd;if(n&&Ks(n)){var a,s,o,l,c,u,d;if(t){var p=h(this.getStartTangent(),2),v=p[0],f=p[1];l=f[0],c=f[1],s=v[0]-f[0],o=v[1]-f[1],u=r||0,d=this.markerStartAngle}else{var m=h(this.getEndTangent(),2),g=m[0],y=m[1];l=y[0],c=y[1],s=g[0]-y[0],o=g[1]-y[1],u=i||0,d=this.markerEndAngle}n.setLocalEulerAngles(180*(a=Math.atan2(o,s))/Math.PI+d),n.setLocalPosition(l+Math.cos(a)*u,c+Math.sin(a)*u)}}placeMarkerMid(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((t=>{t.remove()})),t&&Ks(t))for(var r=1;e.length-1>r;r++){var i=h(e[r].currentPoint,2),n=i[0],a=i[1],s=1===r?t:t.cloneNode(!0);this.markerMidList.push(s),this.appendChild(s),s.setLocalPosition(n,a)}}getTotalLength(){return rn(this)}getPointAtLength(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=function(t,e,r){return ne(t,e,Mt(Mt({},r),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),i=r.x,n=r.y,a=j(R(),I(i,n,0),e?this.getWorldTransform():this.getLocalTransform());return new Er(a[0],a[1])}getPoint(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*rn(this),e)}getStartTangent(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var r=t[0].currentPoint,i=t[1].currentPoint,n=t[1].startTangent;e=[],n?(e.push([r[0]-n[0],r[1]-n[1]]),e.push([r[0],r[1]])):(e.push([i[0],i[1]]),e.push([r[0],r[1]]))}return e}getEndTangent(){var t=this.parsedStyle.d.segments,e=t.length,r=[];if(e>1){var i=t[e-2].currentPoint,n=t[e-1].currentPoint,a=t[e-1].endTangent;r=[],a?(r.push([n[0]-a[0],n[1]-a[1]]),r.push([n[0],n[1]])):(r.push([i[0],i[1]]),r.push([n[0],n[1]]))}return r}}var vo=["style"];class fo extends eo{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=ar(t,vo);super(a({type:hr.POLYGON,style:e,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},r)),this.markerStartAngle=0,this.markerEndAngle=0,this.markerMidList=[];var i=this.parsedStyle,n=i.markerStart,s=i.markerEnd,o=i.markerMid;n&&Ks(n)&&(this.markerStartAngle=n.getLocalEulerAngles(),this.appendChild(n)),o&&Ks(o)&&this.placeMarkerMid(o),s&&Ks(s)&&(this.markerEndAngle=s.getLocalEulerAngles(),this.appendChild(s)),this.transformMarker(!0),this.transformMarker(!1)}attributeChangedCallback(t,e,r,i,n){"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?(i&&Ks(i)&&(this.markerStartAngle=0,i.remove()),n&&Ks(n)&&(this.markerStartAngle=n.getLocalEulerAngles(),this.appendChild(n),this.transformMarker(!0))):"markerEnd"===t?(i&&Ks(i)&&(this.markerEndAngle=0,i.remove()),n&&Ks(n)&&(this.markerEndAngle=n.getLocalEulerAngles(),this.appendChild(n),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(n)}transformMarker(t){var e=this.parsedStyle,r=e.markerStartOffset,i=e.markerEndOffset,n=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&Ks(a)&&n){var s,o,h,l,c,u,d;if(l=n[0][0],c=n[0][1],t)o=n[1][0]-n[0][0],h=n[1][1]-n[0][1],u=r||0,d=this.markerStartAngle;else{var p=n.length;this.parsedStyle.isClosed?(o=n[p-1][0]-n[0][0],h=n[p-1][1]-n[0][1]):(l=n[p-1][0],c=n[p-1][1],o=n[p-2][0]-n[p-1][0],h=n[p-2][1]-n[p-1][1]),u=i||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(h,o))/Math.PI+d),a.setLocalPosition(l+Math.cos(s)*u,c+Math.sin(s)*u)}}placeMarkerMid(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((t=>{t.remove()})),this.markerMidList=[],t&&Ks(t)&&e)for(var r=1;(this.parsedStyle.isClosed?e.length:e.length-1)>r;r++){var i=e[r][0],n=e[r][1],a=1===r?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,n)}}}var mo=["style"];class go extends fo{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=ar(t,mo);super(a({type:hr.POLYLINE,style:e,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))}getTotalLength(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=$e(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}getPointAtLength(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}getPoint(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var i,n,a=[],s=0,o=this.getTotalLength();r.forEach(((t,e)=>{r[e+1]&&((i=[0,0])[0]=s/o,n=ze(t[0],t[1],r[e+1][0],r[e+1][1]),i[1]=(s+=n)/o,a.push(i))})),this.parsedStyle.points.segments=a}var h=0,l=0;this.parsedStyle.points.segments.forEach(((e,r)=>{e[0]>t||t>e[1]||(h=(t-e[0])/(e[1]-e[0]),l=r)}));var c=We(r[l][0],r[l][1],r[l+1][0],r[l+1][1],h),u=c.x,d=c.y,p=j(R(),I(u,d,0),e?this.getWorldTransform():this.getLocalTransform());return new Er(p[0],p[1])}getStartTangent(){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}getEndTangent(){var t=this.parsedStyle.points.points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r}}class yo extends eo{constructor(){super(a({type:hr.RECT},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}var xo=["style"];class Eo extends eo{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=ar(t,xo);super(a({type:hr.TEXT,style:a({fill:"black"},e)},r))}getComputedTextLength(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}getLineBoundingRects(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}isOverflowing(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}class bo{constructor(){this.registry={},this.define(hr.CIRCLE,ro),this.define(hr.ELLIPSE,no),this.define(hr.RECT,yo),this.define(hr.IMAGE,ho),this.define(hr.LINE,co),this.define(hr.GROUP,ao),this.define(hr.PATH,po),this.define(hr.POLYGON,fo),this.define(hr.POLYLINE,go),this.define(hr.TEXT,Eo),this.define(hr.HTML,oo)}define(t,e){this.registry[t]=e}get(t){return this.registry[t]}}var To={number:t=>new vi(t),percent:t=>new vi(t,"%"),px:t=>new vi(t,"px"),em:t=>new vi(t,"em"),rem:t=>new vi(t,"rem"),deg:t=>new vi(t,"deg"),grad:t=>new vi(t,"grad"),rad:t=>new vi(t,"rad"),turn:t=>new vi(t,"turn"),s:t=>new vi(t,"s"),ms:t=>new vi(t,"ms"),registerProperty:t=>{Ys.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:(t,e)=>{Ys.layoutRegistry.registerLayout(t,e)}};class wo extends as{constructor(){super(),this.defaultView=null,this.ownerDocument=null,this.nodeName="document";try{this.timeline=new Ys.AnimationTimeline(this)}catch(t){}var t={};Bn.forEach((e=>{var r=e.d;e.inh&&r&&(t[e.n]=lt(r)?r(hr.GROUP):r)})),this.documentElement=new ao({id:"g-root",style:t}),this.documentElement.ownerDocument=this,this.documentElement.parentNode=this,this.childNodes=[this.documentElement]}get children(){return this.childNodes}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.firstChild}get lastElementChild(){return this.lastChild}createElement(t,e){if("svg"===t)return this.documentElement;var r=this.defaultView.customElements.get(t);r||(console.warn("Unsupported tagName: ",t),r="tspan"===t?Eo:ao);var i=new r(e);return i.ownerDocument=this,i}createElementNS(t,e,r){return this.createElement(e,r)}cloneNode(t){throw Error(Tr)}destroy(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}elementsFromBBox(t,e,r,i){var n=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:r,maxY:i}),a=[];return n.forEach((t=>{var e=t.displayObject,r=e.parsedStyle.pointerEvents,i=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===r?"auto":r);(!i||i&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort(((t,e)=>e.sortable.renderOrder-t.sortable.renderOrder)),a}elementFromPointSync(t,e){var r=this.defaultView.canvas2Viewport({x:t,y:e}),i=r.x,n=r.y,a=this.defaultView.getConfig();if(0>i||0>n||i>a.width||n>a.height)return null;var s=this.defaultView.viewport2Client({x:i,y:n}),o=s.x,h=s.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:i,viewportY:n,clientX:o,clientY:h},picked:[]}).picked;return l&&l[0]||this.documentElement}elementFromPoint(t,e){var r=this;return ir(er().mark((function i(){var n,a,s,o,h,l,c,u,d,p;return er().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(n=r.defaultView.canvas2Viewport({x:t,y:e}),a=n.x,s=n.y,o=r.defaultView.getConfig(),h=o.width,l=o.height,!(0>a||0>s||a>h||s>l)){i.next=4;break}return i.abrupt("return",null);case 4:return c=r.defaultView.viewport2Client({x:a,y:s}),u=c.x,d=c.y,i.next=7,r.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:a,viewportY:s,clientX:u,clientY:d},picked:[]});case 7:return i.abrupt("return",(p=i.sent.picked)&&p[0]||r.documentElement);case 10:case"end":return i.stop()}}),i)})))()}elementsFromPointSync(t,e){var r=this.defaultView.canvas2Viewport({x:t,y:e}),i=r.x,n=r.y,a=this.defaultView.getConfig();if(0>i||0>n||i>a.width||n>a.height)return[];var s=this.defaultView.viewport2Client({x:i,y:n}),o=s.x,h=s.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:i,viewportY:n,clientX:o,clientY:h},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}elementsFromPoint(t,e){var r=this;return ir(er().mark((function i(){var n,a,s,o,h,l,c,u,d,p;return er().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(n=r.defaultView.canvas2Viewport({x:t,y:e}),a=n.x,s=n.y,o=r.defaultView.getConfig(),h=o.width,l=o.height,!(0>a||0>s||a>h||s>l)){i.next=4;break}return i.abrupt("return",[]);case 4:return c=r.defaultView.viewport2Client({x:a,y:s}),u=c.x,d=c.y,i.next=7,r.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:a,viewportY:s,clientX:u,clientY:d},picked:[]});case 7:return(p=i.sent.picked)[p.length-1]!==r.documentElement&&p.push(r.documentElement),i.abrupt("return",p);case 11:case"end":return i.stop()}}),i)})))()}appendChild(t,e){throw Error(wr)}insertBefore(t,e){throw Error(wr)}removeChild(t,e){throw Error(wr)}replaceChild(t,e,r){throw Error(wr)}append(){throw Error(wr)}prepend(){throw Error(wr)}getElementById(t){return this.documentElement.getElementById(t)}getElementsByName(t){return this.documentElement.getElementsByName(t)}getElementsByTagName(t){return this.documentElement.getElementsByTagName(t)}getElementsByClassName(t){return this.documentElement.getElementsByClassName(t)}querySelector(t){return this.documentElement.querySelector(t)}querySelectorAll(t){return this.documentElement.querySelectorAll(t)}find(t){return this.documentElement.find(t)}findAll(t){return this.documentElement.findAll(t)}}class Mo{constructor(t){this.strategies=t}apply(t){var e=t.camera,r=t.renderingService,i=t.renderingContext,n=this.strategies;r.hooks.cull.tap(Mo.tag,(t=>{if(t){var r=t.cullable;return r.visible=0===n.length?i.unculledEntities.indexOf(t.entity)>-1:n.every((r=>r.isVisible(e,t))),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new rs(ds.CULLED)),null)}return t})),r.hooks.afterRender.tap(Mo.tag,(t=>{t.cullable.visibilityPlaneMask=-1}))}}Mo.tag="Culling";class No{constructor(){this.autoPreventDefault=!1,this.rootPointerEvent=new ts(null),this.rootWheelEvent=new es(null),this.onPointerMove=t=>{var e,r=null===(e=this.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,n=nr(this.normalizeToPointerEvent(t,r));try{for(n.s();!(i=n.n()).done;){var a=this.bootstrapEvent(this.rootPointerEvent,i.value,r,t);this.context.eventService.mapEvent(a)}}catch(t){n.e(t)}finally{n.f()}this.setCursor(this.context.eventService.cursor)}},this.onClick=t=>{var e,r,i=null===(e=this.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView,n=nr(this.normalizeToPointerEvent(t,i));try{for(n.s();!(r=n.n()).done;){var a=this.bootstrapEvent(this.rootPointerEvent,r.value,i,t);this.context.eventService.mapEvent(a)}}catch(t){n.e(t)}finally{n.f()}this.setCursor(this.context.eventService.cursor)}}apply(t){this.context=t;var e=t.renderingService,r=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((t=>this.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null)),e.hooks.pointerWheel.tap(No.tag,(t=>{var e=this.normalizeWheelEvent(t);this.context.eventService.mapEvent(e)})),e.hooks.pointerDown.tap(No.tag,(t=>{if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerEvent(t,r);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var i,n=nr(e);try{for(n.s();!(i=n.n()).done;){var a=this.bootstrapEvent(this.rootPointerEvent,i.value,r,t);this.context.eventService.mapEvent(a)}}catch(t){n.e(t)}finally{n.f()}this.setCursor(this.context.eventService.cursor)}})),e.hooks.pointerUp.tap(No.tag,(t=>{if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e,i=this.context.contextService.getDomElement(),n=this.context.eventService.isNativeEventFromCanvas(i,t)?"":"outside",a=nr(this.normalizeToPointerEvent(t,r));try{for(a.s();!(e=a.n()).done;){var s=this.bootstrapEvent(this.rootPointerEvent,e.value,r,t);s.type+=n,this.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}this.setCursor(this.context.eventService.cursor)}})),e.hooks.pointerMove.tap(No.tag,this.onPointerMove),e.hooks.pointerOver.tap(No.tag,this.onPointerMove),e.hooks.pointerOut.tap(No.tag,this.onPointerMove),e.hooks.click.tap(No.tag,this.onClick),e.hooks.pointerCancel.tap(No.tag,(t=>{var e,i=nr(this.normalizeToPointerEvent(t,r));try{for(i.s();!(e=i.n()).done;){var n=this.bootstrapEvent(this.rootPointerEvent,e.value,r,t);this.context.eventService.mapEvent(n)}}catch(t){i.e(t)}finally{i.f()}this.setCursor(this.context.eventService.cursor)}))}bootstrapEvent(t,e,r,i){t.view=r,t.originalEvent=null,t.nativeEvent=i,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 n=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=n.y;t.viewport.x=n.x,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),o=s.y;return t.canvas.x=s.x,t.canvas.y=o,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=da[t.type]||t.type),t}normalizeWheelEvent(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 r=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=r.y;e.viewport.x=r.x,e.viewport.y=i;var n=this.context.eventService.viewport2Canvas(e.viewport),a=n.y;return e.canvas.x=n.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=pa.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}setCursor(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}normalizeToPointerEvent(t,e){var r=[];if(e.isTouchEvent(t))for(var i=0;t.changedTouches.length>i;i++){var n=t.changedTouches[i];wt(n.button)&&(n.button=0),wt(n.buttons)&&(n.buttons=1),wt(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),wt(n.width)&&(n.width=n.radiusX||1),wt(n.height)&&(n.height=n.radiusY||1),wt(n.tiltX)&&(n.tiltX=0),wt(n.tiltY)&&(n.tiltY=0),wt(n.pointerType)&&(n.pointerType="touch"),wt(n.pointerId)&&(n.pointerId=n.identifier||0),wt(n.pressure)&&(n.pressure=n.force||.5),wt(n.twist)&&(n.twist=0),wt(n.tangentialPressure)&&(n.tangentialPressure=0),n.isNormalized=!0,n.type=t.type,r.push(n)}else if(e.isMouseEvent(t)){var a=t;wt(a.isPrimary)&&(a.isPrimary=!0),wt(a.width)&&(a.width=1),wt(a.height)&&(a.height=1),wt(a.tiltX)&&(a.tiltX=0),wt(a.tiltY)&&(a.tiltY=0),wt(a.pointerType)&&(a.pointerType="mouse"),wt(a.pointerId)&&(a.pointerId=1),wt(a.pressure)&&(a.pressure=.5),wt(a.twist)&&(a.twist=0),wt(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,r.push(a)}else r.push(t);return r}}No.tag="Event";var Po=[hr.CIRCLE,hr.ELLIPSE,hr.IMAGE,hr.RECT,hr.LINE,hr.POLYLINE,hr.POLYGON,hr.TEXT,hr.PATH,hr.HTML];class ko{isVisible(t,e){var r,i=e.cullable;if(!i.enable)return!0;var n=e.getRenderBounds();if(mr.isEmpty(n))return!1;var a=t.getFrustum(),s=null===(r=e.parentNode)||void 0===r||null===(r=r.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,s||yr.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==yr.OUTSIDE,i.visible}computeVisibilityWithPlaneMask(t,e,r,i){if(r===yr.OUTSIDE||r===yr.INSIDE)return r;for(var n=yr.INSIDE,a=Po.indexOf(t.nodeName)>-1,s=0,o=i.length;o>s;++s){var h=1<<s;if(0!=(r&h)&&(!a||4!==s&&5!==s)){var l=i[s],c=l.normal,u=l.distance;if(0>U(c,e.getPositiveFarPoint(i[s]))+u)return yr.OUTSIDE;0>U(c,e.getNegativeFarPoint(i[s]))+u&&(n|=h)}}return n}}class So{constructor(){this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}apply(t){var e,r=t.renderingService,i=t.renderingContext.root.ownerDocument.defaultView;this.rBush=t.rBushRoot;var n=t=>{t.target.renderable.dirty=!0,r.dirtify()},a=t=>{this.syncTasks.set(t.target,t.detail.affectChildren),r.dirtify()},s=t=>{Ys.enableSizeAttenuation&&Ys.styleValueRegistry.updateSizeAttenuation(t.target,i.getCamera().getZoom())},o=t=>{var e=t.target,i=e.rBushNode;i.aabb&&this.rBush.remove(i.aabb),this.syncTasks.delete(e),Ys.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(So.tag,(()=>{i.addEventListener(ds.MOUNTED,s),i.addEventListener(ds.UNMOUNTED,o),i.addEventListener(ds.ATTR_MODIFIED,n),i.addEventListener(ds.BOUNDS_CHANGED,a)})),r.hooks.destroy.tap(So.tag,(()=>{i.removeEventListener(ds.MOUNTED,s),i.removeEventListener(ds.UNMOUNTED,o),i.removeEventListener(ds.ATTR_MODIFIED,n),i.removeEventListener(ds.BOUNDS_CHANGED,a),this.syncTasks.clear()}));var h=null!==(e=Ys.globalThis.requestIdleCallback)&&void 0!==e?e:Ma.bind(Ys.globalThis);r.hooks.endFrame.tap(So.tag,(()=>{this.isFirstTimeRendering?(this.isFirstTimeRendering=!1,this.syncing=!0,h((()=>{this.syncRTree(!0),this.isFirstTimeRenderingFinished=!0}))):this.syncRTree()}))}syncNode(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var r=t.rBushNode;r.aabb&&this.rBush.remove(r.aabb);var i=t.getRenderBounds();if(i){var n=t.renderable;e&&(n.dirtyRenderBounds||(n.dirtyRenderBounds=new mr),n.dirtyRenderBounds.update(i.center,i.halfExtents));var a=h(i.getMin(),2),s=a[0],o=a[1],l=h(i.getMax(),2),c=l[0],u=l[1];r.aabb||(r.aabb={}),r.aabb.displayObject=t,r.aabb.minX=s,r.aabb.minY=o,r.aabb.maxX=c,r.aabb.maxY=u}return r.aabb&&!(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY))?r.aabb:void 0}}syncRTree(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var e=[],r=new Set,i=i=>{if(!r.has(i)&&i.renderable){var n=this.syncNode(i,t);n&&(e.push(n),r.add(i))}};this.syncTasks.forEach(((t,e)=>{t&&e.forEach(i);for(var r=e;r;)i(r),r=r.parentElement})),this.rBush.load(e),e.length=0,this.syncing=!1}}}So.tag="Prepare";var Co=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Ao=new rs(ds.MOUNTED),Ro=new rs(ds.UNMOUNTED),Oo=new rs(Co.BEFORE_RENDER),Lo=new rs(Co.RERENDER),Io=new rs(Co.AFTER_RENDER);
|
|
26
|
+
/*!
|
|
27
|
+
* @antv/g-camera-api
|
|
28
|
+
* @description A simple implementation of Camera API.
|
|
29
|
+
* @version 2.0.15
|
|
30
|
+
* @date 10/23/2024, 7:12:57 AM
|
|
31
|
+
* @author AntVis
|
|
32
|
+
* @docs https://g.antv.antgroup.com/
|
|
33
|
+
*/
|
|
34
|
+
class Do extends Wr{constructor(){super(...arguments),this.landmarks=[]}rotate(t,e,r){if(this.relElevation=Mr(e),this.relAzimuth=Mr(t),this.relRoll=Mr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Yr.EXPLORING){var i=J(Q(),[1,0,0],Sr((this.rotateWorld?1:-1)*this.relElevation)),n=J(Q(),[0,1,0],Sr((this.rotateWorld?1:-1)*this.relAzimuth)),a=J(Q(),[0,0,1],Sr(this.relRoll)),s=tt(Q(),n,i);s=tt(Q(),s,a);var o=S(v(),s);E(this.matrix,this.matrix,[0,0,-this.distance]),x(this.matrix,this.matrix,o),E(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Yr.ORBITING||this.type===Yr.EXPLORING?this._getPosition():this.type===Yr.TRACKING&&this._getFocalPoint(),this._update(),this}pan(t,e){var r=Pr(t,e,0),i=O(this.position);return F(i,i,B(R(),this.right,r[0])),F(i,i,B(R(),this.up,r[1])),this._setPosition(i),this.triggerUpdate(),this}dolly(t){var e,r=this.forward,i=O(this.position);return i[0]+=(e=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*r[0],i[1]+=e*r[1],i[2]+=e*r[2],this._setPosition(i),this.type===Yr.ORBITING||this.type===Yr.EXPLORING?this._getDistance():this.type===Yr.TRACKING&&F(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this}cancelLandmarkAnimation(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}createLandmark(t){var e,r,i,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=a.position,o=void 0===s?this.position:s,h=a.focalPoint,l=void 0===h?this.focalPoint:h,c=a.roll,u=a.zoom,p=new Ys.CameraContribution;p.setType(this.type,void 0),p.setPosition(o[0],null!==(e=o[1])&&void 0!==e?e:this.position[1],null!==(r=o[2])&&void 0!==r?r:this.position[2]),p.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(n=l[2])&&void 0!==n?n:this.focalPoint[2]),p.setRoll(null!=c?c:this.roll),p.setZoom(null!=u?u:this.zoom);var v,f,m={name:t,matrix:(v=p.getWorldTransform(),f=new d(16),f[0]=v[0],f[1]=v[1],f[2]=v[2],f[3]=v[3],f[4]=v[4],f[5]=v[5],f[6]=v[6],f[7]=v[7],f[8]=v[8],f[9]=v[9],f[10]=v[10],f[11]=v[11],f[12]=v[12],f[13]=v[13],f[14]=v[14],f[15]=v[15],f),right:O(p.right),up:O(p.up),forward:O(p.forward),position:O(p.getPosition()),focalPoint:O(p.getFocalPoint()),distanceVector:O(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(m),m}gotoLandmark(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=mt(t)?this.landmarks.find((e=>e.name===t)):t;if(r){var i=yt(e)?{duration:e}:e,n=i.easing,a=void 0===n?"linear":n,s=i.duration,o=void 0===s?100:s,h=i.easingFunction,l=void 0===h?void 0:h,c=i.onfinish,u=void 0===c?void 0:c,d=i.onframe,p=void 0===d?void 0:d;this.cancelLandmarkAnimation();var v,f=r.position,m=r.focalPoint,g=r.zoom,y=r.roll,x=l||Ys.EasingFunction(a),E=()=>{this.setFocalPoint(m),this.setPosition(f),this.setRoll(y),this.setZoom(g),this.computeMatrix(),this.triggerUpdate(),null==u||u()};if(0===o)return E();var b=t=>{void 0===v&&(v=t);var e=t-v;if(o>e){var r,i,n=x(e/o),a=R(),s=R();if(X(a,this.focalPoint,m,n),X(s,this.position,f,n),i=this.roll*(1-n)+y*n,r=this.zoom*(1-n)+g*n,this.setFocalPoint(a),this.setPosition(s),this.setRoll(i),this.setZoom(r),.01>=W(a,m)+W(s,f)&&void 0===g&&void 0===y)return E();this.computeMatrix(),this.triggerUpdate(),o>e&&(null==p||p(n),this.landmarkAnimationID=this.canvas.requestAnimationFrame(b))}else E()};this.canvas.requestAnimationFrame(b)}}}Ys.CameraContribution=Do;
|
|
35
|
+
/*!
|
|
36
|
+
* @antv/g-dom-mutation-observer-api
|
|
37
|
+
* @description A simple implementation of DOM MutationObserver API.
|
|
38
|
+
* @version 2.0.12
|
|
39
|
+
* @date 10/23/2024, 7:13:09 AM
|
|
40
|
+
* @author AntVis
|
|
41
|
+
* @docs https://g.antv.antgroup.com/
|
|
42
|
+
*/
|
|
43
|
+
class _o{static copy(t){var e=new _o(t.type,t.target);return e.addedNodes=t.addedNodes.slice(),e.removedNodes=t.removedNodes.slice(),e.previousSibling=t.previousSibling,e.nextSibling=t.nextSibling,e.attributeName=t.attributeName,e.attributeNamespace=t.attributeNamespace,e.oldValue=t.oldValue,e}constructor(t,e){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}}var Fo,Go,Bo=0,Vo=new WeakMap;class Uo{constructor(t,e,r){this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=r}enqueue(t){var e=this.observer.records,r=e.length;if(e.length>0){var i=function(t,e){return t===e?t:Go&&function(t){return t===Go||t===Fo}(t)?Go:null}(e[r-1],t);if(i)return void(e[r-1]=i)}else Ho.push(this.observer),jo||(jo=!0,void 0!==Ys.globalThis?Ys.globalThis.setTimeout(zo):zo());e[r]=t}addListeners(){this.addListeners_(this.target)}addListeners_(t){var e=this.options;e.attributes&&t.addEventListener(ds.ATTR_MODIFIED,this,!0),e.childList&&t.addEventListener(ds.INSERTED,this,!0),(e.childList||e.subtree)&&t.addEventListener(ds.REMOVED,this,!0)}removeListeners(){this.removeListeners_(this.target)}removeListeners_(t){var e=this.options;e.attributes&&t.removeEventListener(ds.ATTR_MODIFIED,this,!0),e.childList&&t.removeEventListener(ds.INSERTED,this,!0),(e.childList||e.subtree)&&t.removeEventListener(ds.REMOVED,this,!0)}removeTransientObservers(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Vo.get(t),r=0;e.length>r;r++)if(e[r]===this){e.splice(r,1);break}}),this)}handleEvent(t){var e,r;switch(t.stopImmediatePropagation(),t.type){case ds.ATTR_MODIFIED:var i=t.attrName,n=t.relatedNode.namespaceURI;(e=Yo("attributes",r=t.target)).attributeName=i,e.attributeNamespace=n;var a=t.attrChange===ps.ADDITION?null:t.prevValue;Xo(r,(t=>{if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(n)))return t.attributeOldValue?function(t){return Go||((Go=_o.copy(Fo)).oldValue=t,Go)}(a):e}));break;case ds.REMOVED:case ds.INSERTED:var s,o,h=t.target;t.type===ds.INSERTED?(s=[h],o=[]):(s=[],o=[h]);var l=h.previousSibling,c=h.nextSibling;(e=Yo("childList",r=t.relatedNode)).addedNodes=s,e.removedNodes=o,e.previousSibling=l,e.nextSibling=c,Xo(r,(function(t){if(t.childList)return e}))}Fo=Go=void 0}}function Yo(t,e){return Fo=new _o(t,e)}function Xo(t,e){for(var r=t;r;r=r.parentNode){var i=Vo.get(r);if(i)for(var n=0;i.length>n;n++){var a=i[n],s=a.options;if(r===t||s.subtree){var o=e(s);o&&a.enqueue(o)}}}}var jo=!1,Ho=[];function zo(){jo=!1;var t=Ho;Ho=[],t.sort(((t,e)=>t.uid-e.uid));var e=!1;t.forEach((function(t){var r=t.takeRecords();!function(t){t.nodes.forEach((e=>{var r=Vo.get(e);r&&r.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),r.length&&(t.callback(r,t),e=!0)})),e&&zo()}
|
|
44
|
+
/*!
|
|
45
|
+
* @antv/g-web-animations-api
|
|
46
|
+
* @description A simple implementation of Web Animations API.
|
|
47
|
+
* @version 2.1.1
|
|
48
|
+
* @date 10/23/2024, 7:14:37 AM
|
|
49
|
+
* @author AntVis
|
|
50
|
+
* @docs https://g.antv.antgroup.com/
|
|
51
|
+
*/class Wo extends Qa{constructor(t,e,r,i){super(t),this.currentTime=r,this.timelineTime=i,this.target=e,this.type="finish",this.bubbles=!1,this.currentTarget=e,this.defaultPrevented=!1,this.eventPhase=this.AT_TARGET,this.timeStamp=Date.now(),this.currentTime=r,this.timelineTime=i}}var qo=0;class Zo{get pending(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}get playState(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}get ready(){return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(((t,e)=>{this.resolveReadyPromise=()=>{t(this)},this.rejectReadyPromise=()=>{e(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise}get finished(){return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(((t,e)=>{this.resolveFinishedPromise=()=>{t(this)},this.rejectFinishedPromise=()=>{e(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}get currentTime(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime}set currentTime(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))}}get startTime(){return this._startTime}set startTime(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()}}get playbackRate(){return this._playbackRate}set playbackRate(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()}}get _isFinished(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}get totalDuration(){return this._totalDuration}get _needsTick(){return this.pending||"running"===this.playState||!this._finishedFlag}constructor(t,e){var r;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(qo++),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()}updatePromises(){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}play(){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()}pause(){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()}finish(){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())}cancel(){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 t=new Wo(null,this,this.currentTime,null);setTimeout((()=>{this.oncancel(t)}))}}reverse(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}updatePlaybackRate(t){this.playbackRate=t}targetAnimations(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}markTarget(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}unmarkTarget(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}tick(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))}rewind(){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}persist(){throw Error(Tr)}addEventListener(t,e,r){throw Error(Tr)}removeEventListener(t,e,r){throw Error(Tr)}dispatchEvent(t){throw Error(Tr)}commitStyles(){throw Error(Tr)}ensureAlive(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}tickCurrentTime(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}fireEvents(t){if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var e=new Wo(null,this,this.currentTime,t);setTimeout((()=>{this.onfinish&&this.onfinish(e)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Wo(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}var Ko=.1,$o="function"==typeof Float32Array,Qo=(t,e)=>1-3*e+3*t,Jo=(t,e)=>3*e-6*t,th=t=>3*t,eh=(t,e,r)=>((Qo(e,r)*t+Jo(e,r))*t+th(e))*t,rh=(t,e,r)=>3*Qo(e,r)*t*t+2*Jo(e,r)*t+th(e),ih=(t,e,r,i)=>{if(0>t||t>1||0>r||r>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&r===i)return t=>t;for(var n=$o?new Float32Array(11):[,,,,,,,,,,,],a=0;11>a;++a)n[a]=eh(a*Ko,t,r);var s=e=>{for(var i=0,a=1;10!==a&&e>=n[a];++a)i+=Ko;--a;var s=i+(e-n[a])/(n[a+1]-n[a])*Ko,o=rh(s,t,r);return.001>o?0===o?s:((t,e,r,i,n)=>{var a,s,o=0;do{(a=eh(s=e+(r-e)/2,i,n)-t)>0?r=s:e=s}while(Math.abs(a)>1e-7&&10>++o);return s})(e,i,i+Ko,t,r):((t,e,r,i)=>{for(var n=0;4>n;++n){var a=rh(e,r,i);if(0===a)return e;e-=(eh(e,r,i)-t)/a}return e})(e,s,t,r)};return t=>0===t||1===t?t:eh(s(t),e,i)},nh=t=>Math.pow(t,2),ah=t=>Math.pow(t,3),sh=t=>Math.pow(t,4),oh=t=>Math.pow(t,5),hh=t=>Math.pow(t,6),lh=t=>1-Math.cos(t*Math.PI/2),ch=t=>1-Math.sqrt(1-t*t),uh=t=>t*t*(3*t-2),dh=t=>{for(var e,r=4;t<((e=Math.pow(2,--r))-1)/11;);return 1/Math.pow(4,3-r)-7.5625*Math.pow((3*e-2)/22-t,2)},ph=function(t){var e=h(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),r=e[0],i=e[1],n=void 0===i?.5:i,a=gt(Number(void 0===r?1:r),1,10),s=gt(Number(n),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-s/(2*Math.PI)*Math.asin(1/a))/s)},vh=function(t){var e=arguments.length>2?arguments[2]:void 0,r=h(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),i=r[0],n=void 0===i?1:i,a=r[1],s=void 0===a?100:a,o=r[2],l=void 0===o?10:o,c=r[3],u=void 0===c?0:c;n=gt(n,.1,1e3),s=gt(s,.1,1e3),l=gt(l,.1,1e3),u=gt(u,.1,1e3);var d=Math.sqrt(s/n),p=l/(2*Math.sqrt(s*n)),v=1>p?d*Math.sqrt(1-p*p):0,f=1>p?(p*d-u)/v:-u+d,m=e?e*t/1e3:t;return m=1>p?Math.exp(-m*p*d)*(1*Math.cos(v*m)+f*Math.sin(v*m)):(1+f*m)*Math.exp(-m*d),0===t||1===t?t:1-m},fh=function(t){var e=h(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),r=e[0],i=void 0===r?10:r;return("start"===e[1]?Math.ceil:Math.floor)(gt(t,0,1)*i)/i},mh=function(t){var e=h(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4);return ih(e[0],e[1],e[2],e[3])(t)},gh=ih(.42,0,1,1),yh=t=>function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)},xh=t=>function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return.5>e?t(2*e,r,i)/2:1-t(-2*e+2,r,i)/2},Eh=t=>function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return.5>e?(1-t(1-2*e,r,i))/2:(t(2*e-1,r,i)+1)/2},bh={steps:fh,"step-start":t=>fh(t,[1,"start"]),"step-end":t=>fh(t,[1,"end"]),linear:t=>t,"cubic-bezier":mh,ease:t=>mh(t,[.25,.1,.25,1]),in:gh,out:yh(gh),"in-out":xh(gh),"out-in":Eh(gh),"in-quad":nh,"out-quad":yh(nh),"in-out-quad":xh(nh),"out-in-quad":Eh(nh),"in-cubic":ah,"out-cubic":yh(ah),"in-out-cubic":xh(ah),"out-in-cubic":Eh(ah),"in-quart":sh,"out-quart":yh(sh),"in-out-quart":xh(sh),"out-in-quart":Eh(sh),"in-quint":oh,"out-quint":yh(oh),"in-out-quint":xh(oh),"out-in-quint":Eh(oh),"in-expo":hh,"out-expo":yh(hh),"in-out-expo":xh(hh),"out-in-expo":Eh(hh),"in-sine":lh,"out-sine":yh(lh),"in-out-sine":xh(lh),"out-in-sine":Eh(lh),"in-circ":ch,"out-circ":yh(ch),"in-out-circ":xh(ch),"out-in-circ":Eh(ch),"in-back":uh,"out-back":yh(uh),"in-out-back":xh(uh),"out-in-back":Eh(uh),"in-bounce":dh,"out-bounce":yh(dh),"in-out-bounce":xh(dh),"out-in-bounce":Eh(dh),"in-elastic":ph,"out-elastic":yh(ph),"in-out-elastic":xh(ph),"out-in-elastic":Eh(ph),spring:vh,"spring-in":vh,"spring-out":yh(vh),"spring-in-out":xh(vh),"spring-out-in":Eh(vh)},Th=t=>bh[(t=>{return(e=t,"-"===(e=e.replace(/([A-Z])/g,(t=>"-".concat(t.toLowerCase())))).charAt(0)?e.substring(1):e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim();var e})(t)]||bh.linear,wh=t=>t,Mh=1,Nh=.5,Ph=0;function kh(t,e){return function(r){if(r>=1)return 1;var i=1/t;return(r+=e*i)-r%i}}var Sh="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Ch=RegExp("cubic-bezier\\(".concat(Sh,",").concat(Sh,",").concat(Sh,",").concat(Sh,"\\)")),Ah=/steps\(\s*(\d+)\s*\)/,Rh=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Oh(t){var e=Ch.exec(t);if(e)return ih(...e.slice(1).map(Number));var r=Ah.exec(t);if(r)return kh(Number(r[1]),Ph);var i=Rh.exec(t);return i?kh(Number(i[1]),{start:Mh,middle:Nh,end:Ph}[i[2]]):Th(t)}function Lh(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 Ih=0,Dh=1,_h=2,Fh=3;function Gh(t,e,r){var i=function(t,e,r){if(null===e)return Ih;var i=r.endTime;return Math.min(r.delay,i)>e?Dh:Math.min(r.delay+t+r.endDelay,i)>e?Fh:_h}(t,e,r),n=function(t,e,r,i,n){switch(i){case Dh:return"backwards"===e||"both"===e?0:null;case Fh:return r-n;case _h:return"forwards"===e||"both"===e?t:null;case Ih:return null}}(t,r.fill,e,i,r.delay);if(null===n)return null;var a="auto"===r.duration?0:r.duration,s=function(t,e,r,i,n){var a=n;return 0===t?e!==Dh&&(a+=r):a+=i/t,a}(a,i,r.iterations,n,r.iterationStart),o=function(t,e,r,i,n,a){var s=t===1/0?e%1:t%1;return 0!==s||r!==_h||0===i||0===n&&0!==a||(s=1),s}(s,r.iterationStart,i,r.iterations,n,a),h=function(t,e,r,i){return t===_h&&e===1/0?1/0:1===r?Math.floor(i)-1:Math.floor(i)}(i,r.iterations,o,s),l=function(t,e,r){var i=t;if("normal"!==t&&"reverse"!==t){var n=e;"alternate-reverse"===t&&(n+=1),i="normal",n!==1/0&&n%2!=0&&(i="reverse")}return"normal"===i?r:1-r}(r.direction,h,o);return r.currentIteration=h,r.progress=l,r.easingFunction(l)}function Bh(t,e,r){var i=function(t,e){for(var r={},i=0;t.length>i;i++)for(var n in t[i])if(Vh(n)){var a={offset:t[i].offset,computedOffset:t[i].computedOffset,easing:t[i].easing,easingFunction:Oh(t[i].easing)||e.easingFunction,value:t[i][n]};r[n]=r[n]||[],r[n].push(a)}return r}(t,e),n=function(t,e){var r=[];for(var i in t)for(var n=t[i],a=0;n.length-1>a;a++){var s=a,o=a+1,h=n[s].computedOffset,l=n[o].computedOffset,c=h,u=l;0===a&&(c=-1/0,0===l&&(o=s)),a===n.length-2&&(u=1/0,1===h&&(s=o)),r.push({applyFrom:c,applyTo:u,startOffset:n[s].computedOffset,endOffset:n[o].computedOffset,easingFunction:n[s].easingFunction,property:i,interpolation:Yh(i,n[s].value,n[o].value,e)})}return r.sort(((t,e)=>t.startOffset-e.startOffset)),r}(i,r);return function(t,e){if(null!==e)n.filter((t=>e>=t.applyFrom&&t.applyTo>e)).forEach((r=>{var i=r.endOffset-r.startOffset;t.setAttribute(r.property,r.interpolation(0===i?0:(e-r.startOffset)/i),!1,!1)}));else for(var r in i)Vh(r)&&t.setAttribute(r,null)}}function Vh(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Uh=(t,e,r)=>i=>{var n=Xh(t,e,i);return yt(n)?n:r(n)};function Yh(t,e,r,i){var n=Un[t];if(n&&n.syntax&&n.int){var a=Ys.styleValueRegistry.getPropertySyntax(n.syntax);if(a){var s=a.parser,o=s?s(e,i):e,h=s?s(r,i):r,l=a.mixer(o,h,i);if(l){var c=Uh(...l);return function(t){return 0===t?e:1===t?r:c(t)}}}}return Uh(!1,!0,(function(t){return t?r:e}))}function Xh(t,e,r){if("number"==typeof t&&"number"==typeof e)return t*(1-r)+e*r;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>r?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var i=t.length,n=e.length,a=Math.max(i,n),s=[],o=0;a>o;o++)s.push(Xh(t[i>o?o:i-1],e[n>o?o:n-1],r));return s}throw Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}class jh{constructor(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=wh,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}get easing(){return this._easing}set easing(t){this.easingFunction=Oh(t),this._easing=t}}function Hh(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var r in t)if(!(r in["easing","offset","composite"])){var i=t[r];Array.isArray(i)||(i=[i]);for(var n=i.length,a=0;n>a;a++){if(!e[a]){var s={};"offset"in t&&(s.offset=Number(t.offset)),"easing"in t&&(s.easing=t.easing),"composite"in t&&(s.composite=t.composite),e[a]=s}null!=i[a]&&(e[a][r]=i[a])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var r=t.map((t=>{var r={};for(var i in null!=e&&e.composite&&(r.composite="auto"),t){var n=t[i];if("offset"===i){if(null!==n){if(!isFinite(n=Number(n)))throw Error("Keyframe offsets must be numbers.");if(0>n||n>1)throw Error("Keyframe offsets must be between 0 and 1.");r.computedOffset=n}}else if("composite"===i&&-1===["replace","add","accumulate","auto"].indexOf(n))throw Error("".concat(n," compositing is not supported"));r[i]=n}return void 0===r.offset&&(r.offset=null),void 0===r.easing&&(r.easing=(null==e?void 0:e.easing)||"linear"),void 0===r.composite&&(r.composite="auto"),r})),i=!0,n=-1/0,a=0;r.length>a;a++){var s=r[a].offset;if(ct(s))i=!1;else{if(n>s)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");n=s}}return r=r.filter((t=>Number(t.offset)>=0&&1>=Number(t.offset))),i||function(){var t,e,i=r.length;r[i-1].computedOffset=Number(null!==(t=r[i-1].offset)&&void 0!==t?t:1),i>1&&(r[0].computedOffset=Number(null!==(e=r[0].offset)&&void 0!==e?e:0));for(var n=0,a=Number(r[0].computedOffset),s=1;i>s;s++){var o=r[s].computedOffset;if(!ct(o)&&!ct(a)){for(var h=1;s-n>h;h++)r[n+h].computedOffset=a+(Number(o)-a)*h/(s-n);n=s,a=Number(o)}}}(),r}var zh="backwards|forwards|both|none".split("|"),Wh="reverse|alternate|alternate-reverse".split("|");function qh(t,e){var r=new jh;return e&&(r.fill="both",r.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((e=>{if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof r[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===zh.indexOf(t[e]))return;if("direction"===e&&-1===Wh.indexOf(t[e]))return;r[e]=t[e]}})):r.duration=t,r}function Zh(t,e){var r;return qh(t=Kh(null!==(r=t)&&void 0!==r?r:{duration:"auto"}),e)}function Kh(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}class $h{constructor(t,e,r){this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Zh(r,!1),this.timing.effect=this,this.timing.activeDuration=Lh(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Hh(e,this.timing),this.interpolations=Bh(this.normalizedKeyframes,this.timing,this.target);var i=Ys.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:(t,e)=>"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?this.animation&&this.animation.currentTime||null:"currentIteration"===e?this.animation&&"running"===this.animation.playState?t.currentIteration||0:null:"progress"===e?this.animation&&"running"===this.animation.playState?t.progress||0:null:t[e],set:()=>!0}):this.timing}applyInterpolations(){this.interpolations(this.target,Number(this.timeFraction))}update(t){return null!==t&&(this.timeFraction=Gh(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}getKeyframes(){return this.normalizedKeyframes}setKeyframes(t){this.normalizedKeyframes=Hh(t)}getComputedTiming(){return this.computedTiming}getTiming(){return this.timing}updateTiming(t){Object.keys(t||{}).forEach((e=>{this.timing[e]=t[e]}))}}function Qh(t,e){return Number(t.id)-Number(e.id)}class Jh{constructor(t){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.webAnimationsNextTick=t=>{this.currentTime=t,this.discardAnimations(),0===this.animations.length?this.timelineTicking=!1:this.requestAnimationFrame(this.webAnimationsNextTick)},this.processRafCallbacks=t=>{var e=this.rafCallbacks;this.rafCallbacks=[],Number(this.currentTime)>t&&(t=Number(this.currentTime)),this.animations.sort(Qh),this.animations=this.tick(t,!0,this.animations)[0],e.forEach((e=>{e[1](t)})),this.applyPendingEffects()},this.document=t}getAnimations(){return this.discardAnimations(),this.animations.slice()}isTicking(){return this.inTick}play(t,e,r){var i=new $h(t,e,r),n=new Zo(i,this);return this.animations.push(n),this.restartWebAnimationsNextTick(),n.updatePromises(),n.play(),n.updatePromises(),n}applyDirtiedAnimation(t){if(!this.inTick){t.markTarget();var e=t.targetAnimations();e.sort(Qh),this.tick(Number(this.currentTime),!1,e.slice())[1].forEach((t=>{var e=this.animations.indexOf(t);-1!==e&&this.animations.splice(e,1)})),this.applyPendingEffects()}}restart(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((()=>{})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}destroy(){this.document.defaultView.cancelAnimationFrame(this.frameId)}applyPendingEffects(){this.pendingEffects.forEach((t=>{null==t||t.applyInterpolations()})),this.pendingEffects=[]}updateAnimationsPromises(){this.animationsWithPromises=this.animationsWithPromises.filter((t=>t.updatePromises()))}discardAnimations(){this.updateAnimationsPromises(),this.animations=this.animations.filter((t=>"finished"!==t.playState&&"idle"!==t.playState))}restartWebAnimationsNextTick(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}rAF(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}requestAnimationFrame(t){return this.rAF((e=>{this.updateAnimationsPromises(),t(e),this.updateAnimationsPromises()}))}tick(t,e,r){this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var i=[],n=[],a=[],s=[];return r.forEach((r=>{r.tick(t,e),r._inEffect?(n.push(r.effect),r.markTarget()):(i.push(r.effect),r.unmarkTarget()),r._needsTick&&(this.ticking=!0);var o=r._inEffect||r._needsTick;r._inTimeline=o,o?a.push(r):s.push(r)})),this.pendingEffects.push(...i),this.pendingEffects.push(...n),this.ticking&&this.requestAnimationFrame((()=>{})),this.inTick=!1,[a,s]}}Ys.EasingFunction=Oh,Ys.AnimationTimeline=Jh,t.AABB=mr,t.AbstractRenderer=class{constructor(t){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.plugins=[],this.config=a({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},t)}registerPlugin(t){-1===this.plugins.findIndex((e=>e===t))&&this.plugins.push(t)}unregisterPlugin(t){var e=this.plugins.findIndex((e=>e===t));e>-1&&this.plugins.splice(e,1)}getPlugins(){return this.plugins}getPlugin(t){return this.plugins.find((e=>e.name===t))}getConfig(){return this.config}setConfig(t){Object.assign(this.config,t)}},t.AbstractRendererPlugin=class{constructor(){this.plugins=[]}addRenderingPlugin(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}removeAllRenderingPlugins(){this.plugins.forEach((t=>{var e=this.context.renderingPlugins.indexOf(t);0>e||this.context.renderingPlugins.splice(e,1)}))}},t.AdvancedCamera=Do,t.Animation=Zo,t.AnimationEvent=Wo,t.AnimationTimeline=Jh,t.BUILT_IN_PROPERTIES=Bn,t.CSS=To,t.CSSGradientValue=ui,t.CSSKeywordValue=di,t.CSSRGB=gi,t.CSSStyleValue=hi,t.CSSUnitValue=vi,t.Camera=Wr,t.CameraEvent=Hr,t.CameraProjectionMode=jr,t.CameraTrackingMode=Xr,t.CameraType=Yr,t.Canvas=class extends ns{constructor(t){super(),this.Element=eo,this.inited=!1,this.context={},this.document=new wo,this.document.defaultView=this,this.customElements=new bo;var e=t.container,r=t.canvas,i=t.offscreenCanvas,n=t.width,a=t.height,s=t.devicePixelRatio,o=t.renderer,h=t.background,l=t.cursor,c=t.document,u=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,v=t.enableLargeImageOptimization,f=t.supportsPointerEvents,m=t.supportsTouchEvents,g=t.supportsCSSTransform,y=t.cleanUpOnDestroy,x=void 0===y||y,E=t.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,T=t.isTouchEvent,w=t.isMouseEvent,M=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||sa(e,this,x);var N=n,P=a,k=s;r&&(k=1>(k=s||oa&&window.devicePixelRatio||1)?1:Math.ceil(k),N=n||function(t){var e=ua(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(r)||r.width/k,P=a||function(t){var e=ua(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(r)||r.height/k),i&&(Ys.offscreenCanvas=i),this.devicePixelRatio=k,this.requestAnimationFrame=null!=u?u:Ma.bind(Ys.globalThis),this.cancelAnimationFrame=null!=d?d:Na.bind(Ys.globalThis),this.supportsTouchEvents=null!=m?m:"ontouchstart"in Ys.globalThis,this.supportsPointerEvents=null!=f?f:!!Ys.globalThis.PointerEvent,this.isTouchEvent=null!=T?T:t=>this.supportsTouchEvents&&t instanceof Ys.globalThis.TouchEvent,this.isMouseEvent=null!=w?w:t=>!Ys.globalThis.MouseEvent||t instanceof Ys.globalThis.MouseEvent&&(!this.supportsPointerEvents||!(t instanceof Ys.globalThis.PointerEvent)),this.dblClickSpeed=null!=M?M:200,this.initRenderingContext({container:e,canvas:r,width:N,height:P,renderer:o,offscreenCanvas:i,devicePixelRatio:k,cursor:l||"default",background:h||"transparent",createImage:p,enableLargeImageOptimization:v,document:c,supportsCSSTransform:g,useNativeClickEvent:E,cleanUpOnDestroy:x,alwaysTriggerPointerEventOnCanvas:b}),this.initDefaultCamera(N,P,o.clipSpaceNearZ),this.initRenderer(o,!0)}initRenderingContext(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}initDefaultCamera(t,e,r){var i=new Ys.CameraContribution;i.clipSpaceNearZ=r,i.setType(Yr.EXPLORING,Xr.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Hr.UPDATED,(()=>{this.context.renderingContext.renderReasons.add(hs.CAMERA_CHANGED),Ys.enableSizeAttenuation&&this.getConfig().renderer.getConfig().enableSizeAttenuation&&this.updateSizeAttenuation()})),this.context.camera=i}updateSizeAttenuation(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((e=>{Ys.styleValueRegistry.updateSizeAttenuation(e,t)}))}getConfig(){return this.context.config}getRoot(){return this.document.documentElement}getCamera(){return this.context.camera}getContextService(){return this.context.contextService}getEventService(){return this.context.eventService}getRenderingService(){return this.context.renderingService}getRenderingContext(){return this.context.renderingContext}getStats(){return this.getRenderingService().getStats()}get ready(){return this.readyPromise||(this.readyPromise=new Promise((t=>{this.resolveReadyPromise=()=>{t(this)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}destroy(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;(void 0===e&&(e=this.getConfig().fastCleanExistingCanvas),e||this.dispatchEvent(new rs(Co.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new rs(Co.AFTER_DESTROY));var i=t=>{t.currentTarget=null,t.manager=null,t.target=null};i(Ao),i(Ro),i(Oo),i(Lo),i(Io),this.cancelAnimationFrame(this.frameId)}changeSize(t,e){this.resize(t,e)}resize(t,e){var r=this.context.config;r.width=t,r.height=e,this.getContextService().resize(t,e);var i=this.context.camera,n=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),n===jr.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e),this.dispatchEvent(new rs(Co.RESIZE,{width:t,height:e}))}appendChild(t,e){return this.document.documentElement.appendChild(t,e)}insertBefore(t,e){return this.document.documentElement.insertBefore(t,e)}removeChild(t){return this.document.documentElement.removeChild(t)}removeChildren(){this.document.documentElement.removeChildren()}destroyChildren(){this.document.documentElement.destroyChildren()}render(t){t&&(Oo.detail=t,Io.detail=t),this.dispatchEvent(Oo),this.getRenderingService().render(this.getConfig(),t,(()=>{this.dispatchEvent(Lo)})),this.dispatchEvent(Io)}run(){var t=(e,r)=>{this.render(r),this.frameId=this.requestAnimationFrame(t)};t()}initRenderer(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new or,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new No,new So,new Mo([new ko])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(a(a({},Ys),this.context)),this.context.renderingService=new ls(Ys,this.context),this.context.eventService=new ss(Ys,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((()=>{this.initRenderingService(t,e)}))}initRenderingService(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((()=>{this.inited=!0,e?r?this.requestAnimationFrame((()=>{this.dispatchEvent(new rs(Co.READY))})):this.dispatchEvent(new rs(Co.READY)):this.dispatchEvent(new rs(Co.RENDERER_CHANGED)),this.readyPromise&&this.resolveReadyPromise(),e||this.getRoot().forEach((t=>{var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),t.getConfig().enableAutoRendering&&this.run()}))}loadRendererContainerModule(t){t.getPlugins().forEach((t=>{t.context=this.context,t.init(Ys)}))}setRenderer(t){var e=this.getConfig();if(e.renderer!==t){var r=e.renderer;e.renderer=t,this.destroy(!1,!0),[...(null==r?void 0:r.getPlugins())||[]].reverse().forEach((t=>{t.destroy(Ys)})),this.initRenderer(t)}}setCursor(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}unmountChildren(t){t.childNodes.forEach((t=>{this.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Ro):(Ro.target=t,this.dispatchEvent(Ro,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}mountChildren(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:va(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,e||(t.isMutationObserved?t.dispatchEvent(Ao):(Ao.target=t,this.dispatchEvent(Ao,!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((t=>{this.mountChildren(t,e)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}mountFragment(t){this.mountChildren(t,!1)}client2Viewport(t){return this.getEventService().client2Viewport(t)}viewport2Client(t){return this.getEventService().viewport2Client(t)}viewport2Canvas(t){return this.getEventService().viewport2Canvas(t)}canvas2Viewport(t){return this.getEventService().canvas2Viewport(t)}getPointByClient(t,e){return this.client2Viewport({x:t,y:e})}getClientByPoint(t,e){return this.viewport2Client({x:t,y:e})}},t.CanvasEvent=Co,t.Circle=ro,t.CircleUpdater=Xa,t.ClipSpaceNearZ=lr,t.CustomElement=class extends eo{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(a({style:t.style},ar(t,io))),this.isCustomElement=!0}},t.CustomElementRegistry=bo,t.CustomEvent=rs,t.DefaultSceneGraphSelector=us,t.DefaultSceneGraphService=Is,t.DisplayObject=eo,t.Document=wo,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Tr,t.EasingFunctions=bh,t.Element=Zs,t.ElementEvent=ds,t.Ellipse=no,t.EllipseUpdater=ja,t.EventService=ss,t.EventTarget=ns,t.FederatedEvent=Qa,t.FederatedMouseEvent=Ja,t.FederatedPointerEvent=ts,t.FederatedWheelEvent=es,t.Fragment=class extends eo{constructor(){super({type:hr.FRAGMENT})}},t.Frustum=xr,t.GradientType=ci,t.Group=ao,t.GroupUpdater=Ka,t.HTML=oo,t.HTMLUpdater=$a,t.Image=ho,t.KeyframeEffect=$h,t.Line=co,t.LineUpdater=Ha,t.Mask=yr,t.MutationEvent=ps,t.MutationObserver=class{constructor(t){this.nodes=[],this.records=[],this.uid=Bo++,this.callback=t}observe(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 r,i=Vo.get(t);i||Vo.set(t,i=[]);for(var n=0;i.length>n;n++)if(i[n].observer===this){(r=i[n]).removeListeners(),r.options=e;break}r||(r=new Uo(this,t,e),i.push(r),this.nodes.push(t)),r.addListeners()}disconnect(){this.nodes.forEach((t=>{for(var e=Vo.get(t),r=0;e.length>r;r++){var i=e[r];if(i.observer===this){i.removeListeners(),e.splice(r,1);break}}}),this),this.records=[]}takeRecords(){var t=this.records;return this.records=[],t}},t.MutationRecord=_o,t.Node=as,t.OffscreenCanvasCreator=os,t.Path=po,t.PathUpdater=za,t.Plane=gr,t.Point=Er,t.Polygon=fo,t.Polyline=go,t.PolylineUpdater=Wa,t.PropertySyntax=$r,t.RBush=or,t.Rect=yo,t.RectUpdater=qa,t.Rectangle=br,t.Registration=Uo,t.RenderReason=hs,t.RenderingService=ls,t.Shape=hr,t.SortReason=Zr,t.Strategy=qr,t.Text=Eo,t.TextService=Bs,t.TextUpdater=Za,t.UnitType=Jr,t.compareAnimations=Qh,t.computeLinearGradient=function(t,e,r,i){var n=Sr(i.value),a=0+e/2,s=0+r/2,o=Math.abs(e*Math.cos(n))+Math.abs(r*Math.sin(n));return{x1:t[0]+a-Math.cos(n)*o/2,y1:t[1]+s-Math.sin(n)*o/2,x2:t[0]+a+Math.cos(n)*o/2,y2:t[1]+s+Math.sin(n)*o/2}},t.computeRadialGradient=function(t,e,r,i,n,a){var s=i.value,o=n.value;i.unit===Jr.kPercentage&&(s=i.value/100*e),n.unit===Jr.kPercentage&&(o=n.value/100*r);var h=Math.max(Zt([0,0],[s,o]),Zt([0,r],[s,o]),Zt([e,r],[s,o]),Zt([e,0],[s,o]));return a&&(a instanceof vi?h=a.value:a instanceof di&&("closest-side"===a.value?h=Math.min(s,e-s,o,r-o):"farthest-side"===a.value?h=Math.max(s,e-s,o,r-o):"closest-corner"===a.value&&(h=Math.min(Zt([0,0],[s,o]),Zt([0,r],[s,o]),Zt([e,r],[s,o]),Zt([e,0],[s,o]))))),{x:s+t[0],y:o+t[1],r:h}},t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),r=[];switch(t.nodeName){case hr.LINE:var i=t.parsedStyle,n=i.x1,a=i.y1,s=i.x2,o=i.y2;r=function(t,e,r,i){return[["M",t,e],["L",r,i]]}(void 0===n?0:n,void 0===a?0:a,void 0===s?0:s,void 0===o?0:o);break;case hr.CIRCLE:var l=t.parsedStyle,c=l.r,u=void 0===c?0:c,d=l.cx,p=l.cy;r=vn(u,u,void 0===d?0:d,void 0===p?0:p);break;case hr.ELLIPSE:var v=t.parsedStyle,f=v.rx,m=v.ry,g=v.cx,y=v.cy;r=vn(void 0===f?0:f,void 0===m?0:m,void 0===g?0:g,void 0===y?0:y);break;case hr.POLYLINE:case hr.POLYGON:r=function(t,e){var r=t.map(((t,e)=>[0===e?"M":"L",t[0],t[1]]));return e&&r.push(["Z"]),r}(t.parsedStyle.points.points,t.nodeName===hr.POLYGON);break;case hr.RECT:var x=t.parsedStyle,E=x.width,b=void 0===E?0:E,T=x.height,w=void 0===T?0:T,M=x.x,N=void 0===M?0:M,P=x.y,k=void 0===P?0:P,S=x.radius,C=S&&S.some((t=>0!==t));r=function(t,e,r,i,n){if(n){var a=h(n,4),s=a[0],o=a[1],l=a[2],c=a[3],u=t>0?1:-1,d=e>0?1:-1,p=u+d!==0?1:0;return[["M",u*s+r,i],["L",t-u*o+r,i],o?["A",o,o,0,0,p,t+r,d*o+i]:null,["L",t+r,e-d*l+i],l?["A",l,l,0,0,p,t+r-u*l,e+i]:null,["L",r+u*c,e+i],c?["A",c,c,0,0,p,r,e+i-d*c]:null,["L",r,d*s+i],s?["A",s,s,0,0,p,u*s+r,i]:null,["Z"]].filter((t=>t))}return[["M",r,i],["L",r+t,i],["L",r+t,i+e],["L",r,i+e],["Z"]]}(b,w,N,k,C&&S.map((t=>gt(t,0,Math.min(Math.abs(b)/2,Math.abs(w)/2)))));break;case hr.PATH:r=[...t.parsedStyle.d.absolutePath]}if(r.length)return function(t,e,r){return t.reduce(((t,e)=>{var i="";if("M"===e[0]||"L"===e[0]){var n=I(e[1],e[2],0);r&&j(n,n,r),i="".concat(e[0]).concat(n[0],",").concat(n[1])}else if("Z"===e[0])i=e[0];else if("C"===e[0]){var a=I(e[1],e[2],0),s=I(e[3],e[4],0),o=I(e[5],e[6],0);r&&(j(a,a,r),j(s,s,r),j(o,o,r)),i="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1],",").concat(o[0],",").concat(o[1])}else if("A"===e[0]){var h=I(e[6],e[7],0);r&&j(h,h,r),i="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(h[0],",").concat(h[1])}else if("Q"===e[0]){var l=I(e[1],e[2],0),c=I(e[3],e[4],0);r&&(j(l,l,r),j(c,c,r)),i="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+i}),"")}(r,0,e)},t.createVec3=Pr,t.decompose=Dr,t.definedProps=t=>Object.fromEntries(Object.entries(t).filter((t=>void 0!==h(t,2)[1]))),t.deg2rad=Sr,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=ca,t.fromRotationTranslationScale=Ir,t.getAngle=Mr,t.getEuler=Lr,t.getOrCalculatePathTotalLength=rn,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.isBrowser=oa,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Di,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Ks,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=!1,n=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(i=!!e&&!e.isNone,n=!!r&&!r.isNone):"visiblefill"===t||"fill"===t?i=!0:"visiblestroke"===t||"stroke"===t?n=!0:"visible"!==t&&"all"!==t||(i=!0,n=!0),[i,n]},t.isPattern=Ii,t.makeTiming=qh,t.mergeColors=Fi,t.normalizeKeyframes=Hh,t.normalizeTimingInput=Zh,t.numericTimingToObject=Kh,t.parseColor=_i,t.parseLength=Vi,t.parsePath=gn,t.parseTransform=Pn,t.parsedTransformToMat4=Ba,t.propertyMetadataCache=Un,t.rad2deg=Ar,t.resetEntityCounter=function(){Hs=0},t.runtime=Ys,t.setDOMSize=function(t,e,r){oa&&t.style&&(t.style.width=e+"px",t.style.height=r+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map(((a,s)=>{var o=t[s+1],h=0===s&&(0!==e||0!==r),l=(s===t.length-1||o&&("M"===o[0]||"Z"===o[0]))&&0!==i&&0!==n;switch(a[0]){case"M":return h?"M ".concat(a[1]+e,",").concat(a[2]+r," L ").concat(a[1],",").concat(a[2]):"M ".concat(a[1],",").concat(a[2]);case"L":return"L ".concat(a[1]+(l?i:0),",").concat(a[2]+(l?n:0));case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4]).concat(l?" L ".concat(a[3]+i,",").concat(a[4]+n):"");case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]," ").concat(a[6]).concat(l?" L ".concat(a[5]+i,",").concat(a[6]+n):"");case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]," ").concat(a[7]).concat(l?" L ".concat(a[6]+i,",").concat(a[7]+n):"");case"Z":return"Z";default:return null}})).filter((t=>null!==t)).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=Rr}));
|
|
2
52
|
//# sourceMappingURL=index.umd.min.js.map
|