@antv/g 5.18.14 → 5.18.16
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.js +4 -4
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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))}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,S=i*c-o*u,P=l*y-h*d,M=l*v-p*d,w=l*m-f*d,N=h*v-p*y,C=h*m-f*y,k=p*m-f*v,A=g*k-x*C+b*N+E*w-T*M+S*P;return A?(t[0]=(s*k-u*C+c*N)*(A=1/A),t[1]=(i*C-r*k-o*N)*A,t[2]=(y*S-v*T+m*E)*A,t[3]=(p*T-h*S-f*E)*A,t[4]=(u*w-a*k-c*M)*A,t[5]=(n*k-i*w+o*M)*A,t[6]=(v*b-d*S-m*x)*A,t[7]=(l*S-p*b+f*x)*A,t[8]=(a*C-s*w+c*P)*A,t[9]=(r*w-n*C-o*P)*A,t[10]=(d*T-y*b+m*g)*A,t[11]=(h*b-l*T-f*g)*A,t[12]=(s*M-a*N-u*P)*A,t[13]=(n*N-r*M+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 S(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 M(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function w(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 N(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 C(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,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 A(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function O(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 R(t,e){var n=new f(3);O(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 L(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],S=r[2],P=i[0],M=i[1],w=i[2],N=(1-(y+m))*E,C=(f+b)*E,k=(d-x)*E,A=(f-b)*T,O=(1-(p+m))*T,R=(v+g)*T,L=(d+x)*S,I=(v-g)*S,D=(1-(p+y))*S;return t[0]=N,t[1]=C,t[2]=k,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+P-(N*P+A*M+L*w),t[13]=n[1]+M-(C*P+O*M+I*w),t[14]=n[2]+w-(k*P+R*M+D*w),t[15]=1,t}function I(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 D(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 _(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 F=_;function G(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 U(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],S=n[1],P=n[2];return p>Math.abs(y-T)&&p>Math.abs(v-S)&&p>Math.abs(m-P)?x(t):(d=1/Math.hypot(l=y-T,h=v-S,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 B(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 V=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],S=e[4],P=e[5],M=e[6],w=e[7],N=e[8],C=e[9],k=e[10],A=e[11],O=e[12],R=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-S)>p*Math.max(1,Math.abs(a),Math.abs(S))||Math.abs(s-P)>p*Math.max(1,Math.abs(s),Math.abs(P))||Math.abs(u-M)>p*Math.max(1,Math.abs(u),Math.abs(M))||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-C)>p*Math.max(1,Math.abs(h),Math.abs(C))||Math.abs(f-k)>p*Math.max(1,Math.abs(f),Math.abs(k))||Math.abs(d-A)>p*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(y-O)>p*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(v-R)>p*Math.max(1,Math.abs(v),Math.abs(R))||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:I,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)),k(t,e,n),t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return 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)},fromRotationTranslation:k,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:L,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromTranslation:C,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:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},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:R,getScaling:O,getTranslation:A,identity:x,invert:E,lookAt:U,mul:S,multiply:S,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:F,orthoNO:_,orthoZO:G,perspective:D,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:D,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,S,P,M,w,N,C,k=r[0],A=r[1],O=r[2],R=Math.hypot(k,A,O);return p>R?null:(k*=R=1/R,A*=R,O*=R,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],S=k*A*(a=1-(o=Math.cos(n)))-O*i,P=A*A*a+o,M=O*A*a+k*i,w=k*O*a+A*i,N=A*O*a-k*i,C=O*O*a+o,t[0]=(s=e[0])*(b=k*k*a+o)+(h=e[4])*(E=A*k*a+O*i)+(v=e[8])*(T=O*k*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*S+h*P+v*M,t[5]=u*S+f*P+m*M,t[6]=c*S+d*P+g*M,t[7]=l*S+y*P+x*M,t[8]=s*w+h*N+v*C,t[9]=u*w+f*N+m*C,t[10]=c*w+d*N+g*C,t[11]=l*w+y*N+x*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:w,rotateY:N,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:M,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:B,subtract:B,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 j(){var t=new f(3);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Y(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 X(t,e,n){var r=new f(3);return r[0]=t,r[1]=e,r[2]=n,r}function W(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function H(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function q(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Z(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function K(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Q(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 $(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function J(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 tt(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 et(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 nt(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 rt=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},it=z;function ot(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function at(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 st(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ut(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 ct(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 lt(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 ht(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}j(),function(){var t=ot()}();var pt=function(t,e,n,r){var i=new f(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ft=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},dt=ct,yt=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};j(),X(1,0,0),X(0,1,0),st(),st(),d(),function(){var t,e=(t=new f(2),f!=Float32Array&&(t[0]=0,t[1]=0),t)}();var vt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function mt(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 gt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return gt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function bt(t){return xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Et(t){return bt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Tt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=gt[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,gt[n]))),gt[n]););}function St(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Pt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Mt(t){return t>=48&&57>=t}function wt(t){var e,n=t.max,r=t.pathValue,i=t.index,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)),Mt(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Mt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Mt(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;Mt(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Mt(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Mt(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function Nt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Ct(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=gt[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Nt(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?wt(t):St(t),t.err.length)return;t.data.push(t.param),Nt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Nt(t))}if(t.index>=t.max)break;if(!Pt(n.charCodeAt(t.index)))break}Tt(t)}else Tt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var kt=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function At(t){if(bt(t))return[].concat(t);var e=function(t){if(xt(t))return[].concat(t);var e=new kt(t);for(Nt(e);e.max>e.index&&!e.err.length;)Ct(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,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 Ot(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 Rt(t){if(Et(t))return[].concat(t);for(var e=At(t),n=r({},vt),i=0;e.length>i;i+=1){e[i]=Ot(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 Lt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function It(t,e,n,r,i,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),S=[];if(c)h=c[0],p=c[1],f=c[2],d=c[3];else{v=(l=Lt(y,v,-T)).y;var P=((y=l.x)-(x=(l=Lt(x,b,-T)).x))/2,M=(v-(b=l.y))/2,w=P*P/(m*m)+M*M/(g*g);w>1&&(m*=w=Math.sqrt(w),g*=w);var N=m*m,C=g*g,k=(o===a?-1:1)*Math.sqrt(Math.abs((N*C-N*M*M-C*P*P)/(N*M*M+C*P*P)));f=k*m*M/g+(y+x)/2,h=Math.asin(((v-(d=k*-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 O=p,R=x,L=b;S=It(x=f+m*Math.cos(p=h+E*(a&&p>h?1:-1)),b=d+g*Math.sin(p),m,g,i,0,a,R,L,[p,O,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*_],z=[x,b];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],c)return j.concat(Y,z,S);for(var X=[],W=0,H=(S=j.concat(Y,z,S)).length;H>W;W+=1)X[W]=W%2?Lt(S[W-1],S[W],T).y:Lt(S[W],S[W+1],T).x;return X}function Dt(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var _t=function(t,e,n,r){return c(c([],Dt([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ft(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(It(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=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(_t(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(_t(f,d,y,v))}return t}function Gt(t,e){if(void 0===e&&(e=!1),function(t){return Et(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var i,o,a=Rt(t),s=r({},vt),u=[],c="",l=a.length,h=[],p=0;l>p;p+=1){a[p]&&(c=a[p][0]),u[p]=c;var f=Ft(a[p],s);a[p]=f,mt(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 Ut(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Bt(t,e,n,r,i){var o=Ut([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=Dt([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 Vt(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 jt(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 Bt(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)),S=(o!==a?1:-1)*f(T=0>T?0:T),P=S*(y*b.y/v),M=S*(-v*b.x/y),w=p(m)*P-h(m)*M+(t+s)/2,N=h(m)*P+p(m)*M+(e+u)/2,C={x:(b.x-P)/y,y:(b.y-M)/v},k=Vt({x:1,y:0},C),A=Vt(C,{x:(-b.x-P)/y,y:(-b.y-M)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var O=k+(A%=2*d)*c,R=y*p(O),L=v*h(O);return{x:p(m)*R-h(m)*L+w,y:h(m)*R+p(m)*L+N}}function Yt(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],S=[x,b],P={x:0,y:0},M=[{x:x,y:b}];g&&0>=c&&(P={x:x,y:b});for(var w=0;m>=w;w+=1){if(x=(h=jt(t,e,n,r,i,o,a,s,u,w/m)).x,b=h.y,f&&M.push({x:x,y:b}),y&&(E+=Ut(S,[x,b])),S=[x,b],g&&E>=c&&c>T[2]){var N=(E-c)/(E-T[2]);P={x:S[0]*(1-N)+T[0]*N,y:S[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,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 zt(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 Xt(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],S={x:0,y:0},P=[{x:g,y:x}];m&&0>=u&&(S={x:g,y:x});for(var M=0;v>=M;M+=1){if(g=(l=zt(t,e,n,r,i,o,a,s,M/v)).x,x=l.y,p&&P.push({x:g,y:x}),d&&(b+=Ut(T,[g,x])),T=[g,x],m&&b>=u&&u>E[2]){var w=(b-u)/(b-E[2]);S={x:T[0]*(1-w)+E[0]*w,y:T[1]*(1-w)+E[1]*w}}E=[g,x,b]}return m&&u>=b&&(S={x:a,y:s}),{length:b,point:S,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function Wt(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 Ht(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 S=0;d>=S;S+=1){if(v=(u=Wt(t,e,n,r,i,o,S/d)).x,m=u.y,l&&T.push({x:v,y:m}),p&&(g+=Ut(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 qt(t,e,n){for(var r,i,o,a,s,u,c,l,h,p=Rt(t),f="number"==typeof e,d=[],y=0,v=0,m=0,g=0,x=[],b=[],E=0,T={x:0,y:0},S=T,P=T,M=T,w=0,N=0,C=p.length;C>N;N+=1)d=(c="M"===(l=(h=p[N])[0]))?d:[y,v].concat(h.slice(1)),c?(S=T={x:m=h[1],y:g=h[2]},E=0,f&&.001>e&&(M=T)):"L"===l?(E=(r=Bt(d[0],d[1],d[2],d[3],(e||0)-w)).length,T=r.min,S=r.max,P=r.point):"A"===l?(E=(i=Yt(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,S=i.max,P=i.point):"C"===l?(E=(o=Xt(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-w,n||{})).length,T=o.min,S=o.max,P=o.point):"Q"===l?(E=(a=Ht(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-w,n||{})).length,T=a.min,S=a.max,P=a.point):"Z"===l&&(E=(s=Bt((d=[y,v,m,g])[0],d[1],d[2],d[3],(e||0)-w)).length,T=s.min,S=s.max,P=s.point),f&&e>w&&w+E>=e&&(M=P),b.push(S),x.push(T),w+=E,y=(u="Z"!==l?h.slice(-2):[m,g])[0],v=u[1];return f&&e>=w&&(M={x:y,y:v}),{length:w,point:M,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}function Zt(t){return function(t){var e=0,n=0,r=0;return Gt(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 Kt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Xt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Dt(n,r,e),s=Dt(r,i,e),u=Dt(i,o,e),c=Dt(a,s,e),l=Dt(s,u,e),h=Dt(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Qt(t,e,n){var r=Kt(t),i=Kt(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:Qt(y[0],y[1],h)}var $t=function(t){return null==t},Jt={}.toString,te=function(t,e){return Jt.call(t)==="[object "+e+"]"},ee=function(t){return Array.isArray?Array.isArray(t):te(t,"Array")},ne=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},re=function(t){if(ee(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ie=function(t){if(ee(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},oe=function(t){return te(t,"String")},ae=function(t,e,n){return e>t?e:t>n?n:t},se=function(t){return te(t,"Number")},ue=1e-5;function ce(t,e,n){return void 0===n&&(n=ue),n>Math.abs(t-e)}var le=function(t,e){return(t%e+e)%e},he=function(t){return te(t,"Boolean")},pe=function(t){return void 0===t};function fe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function de(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ye(){}var ve=.7,me=1/ve,ge="\\s*([+-]?\\d+)\\s*",xe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",be="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ee=/^#([0-9a-f]{3,8})$/,Te=RegExp("^rgb\\("+[ge,ge,ge]+"\\)$"),Se=RegExp("^rgb\\("+[be,be,be]+"\\)$"),Pe=RegExp("^rgba\\("+[ge,ge,ge,xe]+"\\)$"),Me=RegExp("^rgba\\("+[be,be,be,xe]+"\\)$"),we=RegExp("^hsl\\("+[xe,be,be]+"\\)$"),Ne=RegExp("^hsla\\("+[xe,be,be,xe]+"\\)$"),Ce={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 ke(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Oe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ee.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Re(e):3===n?new Ie(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new Ie(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new Ie(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=Te.exec(t))?new Ie(e[1],e[2],e[3],1):(e=Se.exec(t))?new Ie(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Pe.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Me.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=we.exec(t))?Ge(e[1],e[2]/100,e[3]/100,1):(e=Ne.exec(t))?Ge(e[1],e[2]/100,e[3]/100,e[4]):Ce.hasOwnProperty(t)?Re(Ce[t]):"transparent"===t?new Ie(NaN,NaN,NaN,0):null}function Re(t){return new Ie(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,n,r){return r>0||(t=e=n=NaN),new Ie(t,e,n,r)}function Ie(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function De(){return"#"+Fe(this.r)+Fe(this.g)+Fe(this.b)}function _e(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Fe(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Ge(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Be(t,e,n,r)}function Ue(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof ye||(t=Oe(t)),!t)return new Be;if(t instanceof Be)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),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 Be(a,s,u,t.opacity)}function Be(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ve(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 je(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Ye(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 ze(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Xe(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function We(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=ze(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=Xe(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 He(t,e,n,r){return je(t,e,n,r)}function qe(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Ze(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 Ke(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(ce(s,0))ce(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;ce(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 Qe(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=Ke(t,n,i,a),h=Ke(e,r,o,s),p=0;l.length>p;p++)u.push(Ze(t,n,i,a,l[p]));for(p=0;h.length>p;p++)c.push(Ze(e,r,o,s,h[p]));return Ye(u,c)}function $e(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+=je(r[0],r[1],i[0],i[1])}return e}(t)}function Je(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function tn(t,e,n){var r=t+n-2*e;if(ce(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function en(t,e,n,r,i,o){var a=tn(t,n,i)[0],s=tn(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(Je(t,n,i,a)),void 0!==s&&c.push(Je(e,r,o,s)),Ye(u,c)}fe(ye,Oe,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ke,formatHex:ke,formatHsl:function(){return Ue(this).formatHsl()},formatRgb:Ae,toString:Ae}),fe(Ie,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof ye||(i=Oe(i)),i?new Ie((i=i.rgb()).r,i.g,i.b,i.opacity):new Ie):new Ie(t,e,n,null==r?1:r);var i}),de(ye,{brighter:function(t){return new Ie(this.r*(t=null==t?me:Math.pow(me,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Ie(this.r*(t=null==t?ve:Math.pow(ve,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:De,formatHex:De,formatRgb:_e,toString:_e})),fe(Be,(function(t,e,n,r){return 1===arguments.length?Ue(t):new Be(t,e,n,null==r?1:r)}),de(ye,{brighter:function(t){return new Be(this.h,this.s,this.l*(t=null==t?me:Math.pow(me,t)),this.opacity)},darker:function(t){return new Be(this.h,this.s,this.l*(t=null==t?ve:Math.pow(ve,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Ie(Ve(240>t?t+120:t-240,r,n),Ve(t,r,n),Ve(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var nn={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}()}(nn);var rn,on,an=nn.exports;t.Shape=void 0,(rn=t.Shape||(t.Shape={})).GROUP="g",rn.CIRCLE="circle",rn.ELLIPSE="ellipse",rn.IMAGE="image",rn.RECT="rect",rn.LINE="line",rn.POLYLINE="polyline",rn.POLYGON="polygon",rn.TEXT="text",rn.PATH="path",rn.HTML="html",rn.MESH="mesh",t.ClipSpaceNearZ=void 0,(on=t.ClipSpaceNearZ||(t.ClipSpaceNearZ={}))[on.ZERO=0]="ZERO",on[on.NEGATIVE_ONE=1]="NEGATIVE_ONE";var sn=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}(),un=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},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}();function cn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ln(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function hn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function pn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function fn(t){return void 0===t?0:t>360||-360>t?t%360:t}function dn(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Y(t):se(t)?X(t,e,n):X(t[0],t[1]||e,t[2]||n)}function yn(t){return t*(Math.PI/180)}function vn(t){return t*(180/Math.PI)}function mn(t){return 360*t}function gn(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=u(O(j(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return i>l?l>-i?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function xn(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 bn(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=vn(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var En=y(),Tn=y(),Sn=ot(),Pn=[j(),j(),j()],Mn=j();function wn(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Nn,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){cn(this.center,t),cn(this.halfExtents,e),ln(this.min,this.center,this.halfExtents),hn(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){hn(this.center,e,t),pn(this.center,this.center,.5),ln(this.halfExtents,e,t),pn(this.halfExtents,this.halfExtents,.5),cn(this.min,t),cn(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],S=b[2],P=m-E,M=m+E,w=g-T,N=g+T,C=x-S,k=x+S;l>P&&(l=P),M>h&&(h=M),p>w&&(p=w),N>f&&(f=N),d>C&&(d=C),k>y&&(y=k),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),S=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]+S*o[2],ln(this.min,n,r),hn(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,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?cn([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?cn([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}(),kn=function(){function t(t,e){this.distance=t||0,this.normal=e||X(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 $(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/it(this.normal);K(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&&tt(n,t,e,i),o},t}();t.Mask=void 0,(Nn=t.Mask||(t.Mask={}))[Nn.OUTSIDE=4294967295]="OUTSIDE",Nn[Nn.INSIDE=0]="INSIDE",Nn[Nn.INDETERMINATE=2147483647]="INDETERMINATE";var An,On,Rn,Ln=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new kn)}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];H(this.planes[0].normal,o-n,l-a,d-h),this.planes[0].distance=g-y,H(this.planes[1].normal,o+n,l+a,d+h),this.planes[1].distance=g+y,H(this.planes[2].normal,o+r,l+s,d+p),this.planes[2].distance=g+v,H(this.planes[3].normal,o-r,l-s,d-p),this.planes[3].distance=g-v,H(this.planes[4].normal,o-i,l-c,d-f),this.planes[4].distance=g-m,H(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}(),In=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}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}(),Dn=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.prototype.toJSON=function(){},t}(),_n="Method not implemented.",Fn="Use document.documentElement instead.";t.CameraType=void 0,(An=t.CameraType||(t.CameraType={}))[An.ORBITING=0]="ORBITING",An[An.EXPLORING=1]="EXPLORING",An[An.TRACKING=2]="TRACKING",t.CameraTrackingMode=void 0,(On=t.CameraTrackingMode||(t.CameraTrackingMode={}))[On.DEFAULT=0]="DEFAULT",On[On.ROTATIONAL=1]="ROTATIONAL",On[On.TRANSLATIONAL=2]="TRANSLATIONAL",On[On.CINEMATIC=3]="CINEMATIC",t.CameraProjectionMode=void 0,(Rn=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Rn.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Rn[Rn.PERSPECTIVE=1]="PERSPECTIVE";var Gn,Un,Bn,Vn,jn,Yn={UPDATED:"updated"},zn=2e-4,Xn=function(){function e(){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.eventEmitter=new h,this.matrix=y(),this.right=X(1,0,0),this.up=X(0,1,0),this.forward=X(0,0,1),this.position=X(0,0,1),this.focalPoint=X(0,0,0),this.distanceVector=X(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 Ln,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=C(y(),[t,e,0]);this.jitteredProjectionMatrix=S(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.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=X(a.x-r,a.y-i,0),u=$(s,this.right)/z(this.right),c=$(s,this.up)/z(this.up);return this.pan(-u,-c),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(yn(.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/(r-i),h=(n+e)/(n-e),p=(r+i)/(r-i);s?(u=-a/(a-o),c=-a*o/(a-o)):(u=-(a+o)/(a-o),c=-2*a*o/(a-o)),t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=h,t[9]=p,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+u,a,a-s,e,this.far,this.clipSpaceNearZ===t.ClipSpaceNearZ.ZERO),M(this.projectionMatrix,this.projectionMatrix,X(1,-1,1)),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?F(this.projectionMatrix,p,f,y,d,o,a):G(this.projectionMatrix,p,f,y,d,o,a),M(this.projectionMatrix,this.projectionMatrix,X(1,-1,1)),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=dn(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=X(0,1,0);if(this.focalPoint=dn(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=Z(j(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=z(o),s=vn(Math.asin(n/a)),u=90+vn(Math.atan2(r,e)),c=y();N(c,c,yn(u)),w(c,c,yn(s)),i=et(j(),[0,1,0],c)}return E(this.matrix,U(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,zn>this.distance&&(this.distance=zn),this.dollyingStep=this.distance/100;var e=j(),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=fn(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=fn(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=fn(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=ut(st(),[0,0,1],yn(this.roll));x(this.matrix);var n=ut(st(),[1,0,0],yn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=ut(st(),[0,1,0],yn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=ct(st(),r,n);i=ct(st(),i,e);var o=I(y(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(P(this.matrix,this.matrix,this.focalPoint),S(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),S(this.matrix,this.matrix,o))},e.prototype._setPosition=function(t,e,n){this.position=dn(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(){W(this.right,dn(at(ot(),[1,0,0,0],this.matrix))),W(this.up,dn(at(ot(),[0,1,0,0],this.matrix))),W(this.forward,dn(at(ot(),[0,0,1,0],this.matrix))),Q(this.right,this.right),Q(this.up,this.up),Q(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=vn(Math.asin(n/i)),this.azimuth=vn(Math.atan2(-e,-r))):(this.elevation=-vn(Math.asin(n/i)),this.azimuth=-vn(Math.atan2(-e,-r)))},e.prototype._getPosition=function(){W(this.position,dn(at(ot(),[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)),q(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=Z(j(),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=ut(st(),[0,0,1],-this.roll*Math.PI/180);L(this.orthoMatrix,n,X((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),X(this.zoom,this.zoom,1),e)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=S(y(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Yn.UPDATED)}},e.prototype.rotate=function(t,e,n){throw Error(_n)},e.prototype.pan=function(t,e){throw Error(_n)},e.prototype.dolly=function(t){throw Error(_n)},e.prototype.createLandmark=function(t,e){throw Error(_n)},e.prototype.gotoLandmark=function(t,e){throw Error(_n)},e.prototype.cancelLandmarkAnimation=function(){throw Error(_n)},e}();function Wn(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(Wn.Cache||Map),n}Wn.Cache=Map,t.UnitType=void 0,(Gn=t.UnitType||(t.UnitType={}))[Gn.kUnknown=0]="kUnknown",Gn[Gn.kNumber=1]="kNumber",Gn[Gn.kPercentage=2]="kPercentage",Gn[Gn.kEms=3]="kEms",Gn[Gn.kPixels=4]="kPixels",Gn[Gn.kRems=5]="kRems",Gn[Gn.kDegrees=6]="kDegrees",Gn[Gn.kRadians=7]="kRadians",Gn[Gn.kGradians=8]="kGradians",Gn[Gn.kTurns=9]="kTurns",Gn[Gn.kMilliseconds=10]="kMilliseconds",Gn[Gn.kSeconds=11]="kSeconds",Gn[Gn.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"}(Un||(Un={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Bn||(Bn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Vn||(Vn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(jn||(jn={}));var Hn,qn=[{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"}(Hn||(Hn={}));var Zn,Kn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return qn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},Qn=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},$n=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""},Jn=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(Vn.kNo,jn.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=Hn.kUnitType&&this.getType()<=Hn.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 Hn.kColorType},e.prototype.to=function(t){return this},e}(Jn);t.GradientType=void 0,(Zn=t.GradientType||(t.GradientType={}))[Zn.Constant=0]="Constant",Zn[Zn.LinearGradient=1]="LinearGradient",Zn[Zn.RadialGradient=2]="RadialGradient";var er=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 Hn.kColorType},e}(Jn),nr=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 Hn.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Jn),rr=Wn((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),ir=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function or(t){return"function"==typeof t}var ar={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},sr=Wn((function(t){var e=rr(t),n=ar[e];return e=(null==n?void 0:n.alias)||e})),ur=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},cr=function(e){return function(e){switch(e){case Un.kUNumber:return t.UnitType.kNumber;case Un.kULength:return t.UnitType.kPixels;case Un.kUPercent:return t.UnitType.kPercentage;case Un.kUTime:return t.UnitType.kSeconds;case Un.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return Un.kUNumber;case t.UnitType.kPercentage:return Un.kUPercent;case t.UnitType.kPixels:return Un.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Un.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Un.kUAngle;default:return Un.kUOther}}(e))},lr=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?Kn(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 Hn.kUnitType},r.prototype.convertTo=function(e){if(this.unit===e)return new r(this.value,this.unit);var n=cr(this.unit);if(n!==cr(e)||n===t.UnitType.kUnknown)return null;var i=Qn(this.unit)/Qn(e);return new r(this.value*i,e)},r.prototype.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=$n(this.unit);if(-999999>o||o>999999){var s=$n(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?ur(o,s):o+(s||"")}else i="".concat(o).concat(a)}return r+=i},r}(Jn),hr=new lr(0,"px");new lr(1,"px");var pr,fr,dr=new lr(0,"deg"),yr=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),vr=new nr("unset"),mr=new nr("initial"),gr=new nr("inherit"),xr={"":vr,unset:vr,initial:mr,inherit:gr},br=function(t){return xr[t]||(xr[t]=new nr(t)),xr[t]},Er=new yr(0,0,0,0,!0),Tr=new yr(0,0,0,0),Sr=Wn((function(t,e,n,r){return new yr(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Pr=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new lr(e,n)},Mr=new lr(50,"%");t.Strategy=void 0,(pr=t.Strategy||(t.Strategy={}))[pr.Standard=0]="Standard",t.SortReason=void 0,(fr=t.SortReason||(t.SortReason={}))[fr.ADDED=0]="ADDED",fr[fr.REMOVED=1]="REMOVED",fr[fr.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED";var wr,Nr={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dn(0,0,0,0)};function Cr(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(","),")")}t.PropertySyntax=void 0,(wr=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",wr.COLOR="<color>",wr.PAINT="<paint>",wr.NUMBER="<number>",wr.ANGLE="<angle>",wr.OPACITY_VALUE="<opacity-value>",wr.SHADOW_BLUR="<shadow-blur>",wr.LENGTH="<length>",wr.PERCENTAGE="<percentage>",wr.LENGTH_PERCENTAGE="<length> | <percentage>",wr.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",wr.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",wr.LIST_OF_POINTS="<list-of-points>",wr.PATH="<path>",wr.FILTER="<filter>",wr.Z_INDEX="<z-index>",wr.OFFSET_DISTANCE="<offset-distance>",wr.DEFINED_PATH="<defined-path>",wr.MARKER="<marker>",wr.TRANSFORM="<transform>",wr.TRANSFORM_ORIGIN="<transform-origin>",wr.TEXT="<text>",wr.TEXT_TRANSFORM="<text-transform>";var kr=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 Ar=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Or=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Rr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Lr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Ir={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},Dr=Wn((function(t){return Pr("angular"===t.type?Number(t.value):Ir[t.value]||0,"deg")})),_r=Wn((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:Pr(e,r),cy:Pr(n,i)}})),Fr=Wn((function(e){var n;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return kr(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(!$t(u)&&!$t(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=i.map((function(t){return{offset:Pr(Number(t.length.value),"%"),color:Cr(t)}}));if("linear-gradient"===n)return new er(t.GradientType.LinearGradient,{angle:r?Dr(r):dr,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a=_r(r[0].at),s=a.cx,u=a.cy,c=void 0;if(r[0].style){var l=r[0].style,h=l.type,p=l.value;c="extent-keyword"===h?br(p):Pr(p,h)}return new er(t.GradientType.RadialGradient,{cx:s,cy:u,size:c,steps:o})}}));var r=e[0];if("("===e[1]||"("===e[2])if("l"===r){var i=Ar.exec(e);if(i){var o=(null===(n=i[2].match(Lr))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return[new er(t.GradientType.LinearGradient,{angle:Pr(parseFloat(i[1]),"deg"),steps:o.map((function(t){var e=u(t,2),n=e[1];return{offset:Pr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===r){var a=function(t){var e,n=Or.exec(t);if(n){var r=(null===(e=n[4].match(Lr))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Pr(50,"%"),cy:Pr(50,"%"),steps:r.map((function(t){var e=u(t,2),n=e[1];return{offset:Pr(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(a){if(!oe(a))return[new er(t.GradientType.RadialGradient,a)];e=a}}else if("p"===r)return function(t){var e=Rr.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 Gr(t){return t&&!!t.image}function Ur(t){return t&&!$t(t.r)&&!$t(t.g)&&!$t(t.b)}var Br=Wn((function(t){if(Gr(t))return r({repetition:"repeat"},t);if($t(t)&&(t=""),"transparent"===t)return Tr;"currentColor"===t&&(t="black");var e=Fr(t);if(e)return e;var n=Oe(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),Sr.apply(void 0,c([],u(i),!1))}));function Vr(t,e){if(Ur(t)&&Ur(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(ae(e[n],0,255));return e[3]=ae(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function jr(t,e){if($t(e))return Pr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Pr(Number(e),"px");if("deg".search(t)>=0)return Pr(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 Pr(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Yr=Wn((function(t){return jr(/px/g,t)}));Wn((function(t){return jr(RegExp("%","g"),t)}));var zr=function(t){return se(t)||isFinite(Number(t))?Pr(Number(t)||0,"px"):jr(RegExp("px|%|em|rem","g"),t)},Xr=Wn((function(t){return jr(/deg|rad|grad|turn/g,t)}));function Wr(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=cr(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=$n(t.unit)):(lr.isLength(t.unit)||lr.isLength(e.unit))&&(a=Kr(t,i,n),s=Kr(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Hr(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=vn(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=mn(Number(e.value))),n}function qr(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):oe(t)?n=t.split(" ").map((function(t){return Number(t)})):se(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Zr(t){return oe(t)?t.split(" ").map((function(t){return zr(t)})):t.map((function(t){return zr(""+t)}))}function Kr(e,n,r){if(0===e.value)return 0;if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var Qr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function $r(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,Qr.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return jr(/deg|rad|grad|turn|px|%/g,t)||Br(t)}))}),n.lastIndex===t.length)return r}return[]}function Jr(t){return""+t}var ti=Wn((function(t){return Pr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));function ei(t,e){return[t,e,Jr]}function ni(t,e){return function(n,r){return[n,r,function(n){return Jr(ae(n,t,e))}]}}function ri(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ii(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=qt(t.parsedStyle.path.absolutePath,void 0,r(r({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function oi(t,e){return t[0]===e[0]&&t[1]===e[1]}function ai(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)||ce(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 si(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Wn((function(t){return oe(t)?t.split(" ").map(ti):t.map(ti)}));var ui=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))))},ci=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=yn(r=le(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=ui({x:1,y:0},g),b=ui(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),S=n*Math.sin(E);return{x:Math.cos(u)*T-Math.sin(u)*S+m.x,y:Math.sin(u)*T+Math.cos(u)*S+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+b,ellipticalArcAngle:E,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function li(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=ci({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=ci({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 hi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function pi(t,e){return hi(t)*hi(e)?(t[0]*e[0]+t[1]*e[1])/(hi(t)*hi(e)):1}function fi(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(pi(t,e))}function di(t,e){var n=e[1],r=e[2],i=le(yn(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=fi([1,0],b),S=fi(b,E);return pi(b,E)>-1||(S=Math.PI),1>pi(b,E)||(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&0>S&&(S+=2*Math.PI),{cx:g,cy:x,rx:oi(t,[c,l])?0:n,ry:oi(t,[c,l])?0:r,startAngle:T,endAngle:T+S,xRotation:i,arcFlag:o,sweepFlag:a}}function yi(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 vi=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Rt(t)}catch(n){e=Rt(""),console.error("[g]: Invalid SVG Path definition: ".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&&oi([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=di(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]&&oi(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=si((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=si((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=li(l,0),x=g.x,b=g.y,E=li(l,1,!1),T=E.x,S=E.y;l.startTangent=[x,b],l.endTangent=[T,S]}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=en(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=Qe(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=y.arcParams;c=We(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=ie(n),p=ie(r),f=re(n),d=re(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-=ai(y,e).xExtra:a[0]===f&&(f+=ai(y,e).xExtra),a[1]===p?p-=ai(y,e).yExtra:a[1]===d&&(d+=ai(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}}},mi=Wn(vi);function gi(t){return oe(t)?mi(t):vi(t)}function xi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Gt(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Gt(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=Qt(r,i));var a,s,u,c,l,h,p,f,d=Zt(o[0])!==Zt(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+=Ut(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 bi(t,e){var n;n=oe(t)?t.split(" ").map((function(t){var e=u(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=$e(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=He(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var l=Math.min.apply(Math,c([],u(n.map((function(t){return t[0]}))),!1)),h=Math.min.apply(Math,c([],u(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=l,e.parsedStyle.defY=h),{points:n,totalLength:s,segments:o}}function Ei(t,e){return[t.points,e.points,function(t){return t}]}var Ti=null;function Si(t){return function(e){var n=0;return t.map((function(t){return t===Ti?e[n++]:t}))}}function Pi(t){return t}var Mi={matrix:["NNNNNN",[Ti,Ti,0,0,Ti,Ti,0,0,0,0,1,0,Ti,Ti,0,1],Pi],matrix3d:["NNNNNNNNNNNNNNNN",Pi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Si([Ti,Ti,new lr(1)]),Pi],scalex:["N",Si([Ti,new lr(1),new lr(1)]),Si([Ti,new lr(1)])],scaley:["N",Si([new lr(1),Ti,new lr(1)]),Si([new lr(1),Ti])],scalez:["N",Si([new lr(1),new lr(1),Ti])],scale3d:["NNN",Pi],skew:["Aa",null,Pi],skewx:["A",null,Si([Ti,dr])],skewy:["A",null,Si([dr,Ti])],translate:["Tt",Si([Ti,Ti,hr]),Pi],translatex:["T",Si([Ti,hr,hr]),Si([Ti,hr])],translatey:["T",Si([hr,Ti,hr]),Si([hr,Ti])],translatez:["L",Si([hr,hr,Ti])],translate3d:["TTL",Pi]};function wi(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Mi[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],p=u[l],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?dr:Xr(t)},N:ti,T:zr,L:Yr}[p.toUpperCase()](h):{a:dr,n:c[0],t:hr}[p]))return[];c.push(f)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Ni(t){var e,n,r,i;switch(t.t){case"rotatex":return i=yn(Hr(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=yn(Hr(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=yn(Hr(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=yn(Hr(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=yn(Hr(t.d[0])),h=yn(Hr(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=yn(Hr(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=yn(Hr(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=Kr(t.d[0],0,null)||0,n=Kr(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Kr(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=Kr(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=Kr(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Kr(t.d[0],0,null)||0,n=Kr(t.d[1],0,null)||0,r=Kr(t.d[2],0,null)||0,1];case"perspective":var p=Kr(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 Ci(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 ki(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}(En,t))return!1;if(m(Tn,En),Tn[3]=0,Tn[7]=0,Tn[11]=0,Tn[15]=1,1e-8>Math.abs(T(Tn)))return!1;var a,s,u=En[3],c=En[7],l=En[11],h=En[12],p=En[13],f=En[14],d=En[15];if(0!==u||0!==c||0!==l){if(Sn[0]=u,Sn[1]=c,Sn[2]=l,Sn[3]=d,!E(Tn,Tn))return!1;b(Tn,Tn),at(i,Sn,Tn)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=p,e[2]=f,(a=Pn)[0][0]=(s=En)[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(Pn[0]),Q(Pn[0],Pn[0]),r[0]=$(Pn[0],Pn[1]),wn(Pn[1],Pn[1],Pn[0],1,-r[0]),n[1]=z(Pn[1]),Q(Pn[1],Pn[1]),r[0]/=n[1],r[1]=$(Pn[0],Pn[2]),wn(Pn[2],Pn[2],Pn[0],1,-r[1]),r[2]=$(Pn[1],Pn[2]),wn(Pn[2],Pn[2],Pn[1],1,-r[2]),n[2]=z(Pn[2]),Q(Pn[2],Pn[2]),r[1]/=n[2],r[2]/=n[2],J(Mn,Pn[1],Pn[2]),0>$(Pn[0],Mn))for(var y=0;3>y;y++)n[y]*=-1,Pn[y][0]*=-1,Pn[y][1]*=-1,Pn[y][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Pn[0][0]-Pn[1][1]-Pn[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Pn[0][0]+Pn[1][1]-Pn[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Pn[0][0]-Pn[1][1]+Pn[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Pn[0][0]+Pn[1][1]+Pn[2][2],0)),Pn[2][1]>Pn[1][2]&&(o[0]=-o[0]),Pn[0][2]>Pn[2][0]&&(o[1]=-o[1]),Pn[1][0]>Pn[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(Ni).reduce(Ci)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Ai=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 Oi(t){return t.toFixed(6).replace(".000000","")}function Ri(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ki(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=ki(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=ae(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 Ai(t[0],t[1],t[2],e,t[4]).map(Oi).join(",")}])}function Li(t){return t.replace(/[xy]/,"")}function Ii(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Di(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?Pr(a):Pr(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length)u=[(g=Ri(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=Mi[h],v=Mi[p],m=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var g=Ri([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]&&Li(h)===Li(p))m=Li(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||Ii(h)!==Ii(p)){u=[(g=Ri(t,e))[0]],c=[g[1]],l=[["matrix",[g[2]]]];break}m=Ii(h),f=y[1](f),d=v[1](d)}for(var x=[],b=[],E=[],T=0;f.length>T;T++){g=Wr(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 S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var _i=Wn((function(t){if(oe(t)){if("text-anchor"===t)return[Pr(0,"px"),Pr(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:[zr(Fi(e[0])),zr(Fi(e[1]))]}return[Pr(t[0]||0,"px"),Pr(t[1]||0,"px")]}));function Fi(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Gi=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cz",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],Ui=Gi.filter((function(t){return!!t.l})).map((function(t){return t.n})),Bi={},Vi=new WeakMap,ji=function(){function e(t){var e=this;this.runtime=t,Gi.forEach((function(t){e.registerMetadata(t)}))}return e.prototype.registerMetadata=function(t){c([t.n],u(t.a||[]),!1).forEach((function(e){Bi[e]=t}))},e.prototype.unregisterMetadata=function(t){delete Bi[t]},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(e,n,i){var o=this;if(void 0===i&&(i={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(e.attributes,n);var a=Object.keys(n),s=e.parsedStyle.clipPath,u=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var c=!!i.forceUpdateGeometry;if(!c)for(var l=0;Ui.length>l;l++)if(Ui[l]in n){c=!0;break}return n.fill&&(e.parsedStyle.fill=Br(n.fill)),n.stroke&&(e.parsedStyle.stroke=Br(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Br(n.shadowColor)),n.filter&&(e.parsedStyle.filter=$r(n.filter)),$t(n.radius)||(e.parsedStyle.radius=qr(n.radius,4)),$t(n.lineDash)||(e.parsedStyle.lineDash=qr(n.lineDash,2)),n.points&&(e.parsedStyle.points=bi(n.points,e)),""===n.path&&(e.parsedStyle.path=r({},Nr)),n.path&&(e.parsedStyle.path=gi(n.path),e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y),n.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",s,n.clipPath,e,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",u,n.offsetPath,e,this.runtime),n.anchor&&(e.parsedStyle.anchor=qr(n.anchor,2)),n.transform&&(e.parsedStyle.transform=wi(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=_i(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||$t(n.cx)&&$t(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||$t(n.x)&&$t(n.y)&&$t(n.z))&&(e.nodeName!==t.Shape.LINE||$t(n.x1)&&$t(n.y1)&&$t(n.z1)&&$t(n.x2)&&$t(n.y2)&&$t(n.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,a),$t(n.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,a),n.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(e,a),n.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,a),$t(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,a),n.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,a),void(c&&this.updateGeometry(e))}var h=i.skipUpdateAttribute,p=i.skipParse,f=i.usedAttributes,d=i.forceUpdateGeometry,y=Object.keys(n);y.forEach((function(t){var r;h||(e.attributes[t]=n[t]),!d&&(null===(r=Bi[t])||void 0===r?void 0:r.l)&&(d=!0)})),p||y.forEach((function(t){e.computedStyle[t]=o.parseProperty(t,e.attributes[t],e)})),(null==f?void 0:f.length)&&(y=Array.from(new Set(y.concat(f)))),y.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=o.computeProperty(t,e.computedStyle[t],e))})),d&&this.updateGeometry(e),y.forEach((function(t){t in e.parsedStyle&&o.postProcessProperty(t,e,y)})),this.runtime.enableCSSParsing&&e.children.length&&y.forEach((function(t){t in e.parsedStyle&&o.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},e.prototype.parseProperty=function(t,e,n){var r=Bi[t],i=e;if((""===e||$t(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=br(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=br(e):s&&s.parser&&(i=s.parser(e,n))}return i},e.prototype.computeProperty=function(t,e,n){var r=Bi[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof nr){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)$t(a)||(e=this.parseProperty(t,or(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return $t(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this.runtime);else i=e instanceof nr?e.value:e}return i},e.prototype.postProcessProperty=function(t,e,n){var r=Bi[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},e.prototype.addUnresolveProperty=function(t,e){var n=Vi.get(t);n||(Vi.set(t,[]),n=Vi.get(t)),-1===n.indexOf(e)&&n.push(e)},e.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Vi.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},e.prototype.recalc=function(t){var e=Vi.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Vi.delete(t)}},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.width,u=a.height,c=a.depth,l=void 0===c?0:c,h=a.offsetX,p=void 0===h?0:h,f=a.offsetY,d=void 0===f?0:f,y=a.offsetZ,v=void 0===y?0:y,m=[Math.abs(s)/2,Math.abs(u)/2,l/2],g=o.stroke,x=o.lineWidth,b=o.increasedLineWidthForHitTesting,E=o.shadowType,T=o.shadowColor,S=o.filter,P=void 0===S?[]:S,M=o.transformOrigin,w=o.anchor;n===t.Shape.TEXT?delete o.anchor:n===t.Shape.MESH&&(o.anchor[2]=.5);var N=[(1-2*(w&&w[0]||0))*s/2+p,(1-2*(w&&w[1]||0))*u/2+d,(1-2*(w&&w[2]||0))*m[2]+v];if(i.contentBounds.update(N,m),g&&!g.isNone){var C=((x||0)+(b||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);m[0]+=C,m[1]+=C}if(i.renderBounds.update(N,m),T&&E&&"inner"!==E){var k=i.renderBounds,A=k.min,O=k.max,R=o.shadowBlur||0,L=o.shadowOffsetX||0,I=o.shadowOffsetY||0,D=O[0]+R+L,_=A[1]-R+I,F=O[1]+R+I;A[0]=Math.min(A[0],A[0]-R+L),O[0]=Math.max(O[0],D),A[1]=Math.min(A[1],_),O[1]=Math.max(O[1],F),i.renderBounds.setMinMax(A,O)}P.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,hn(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)}})),w=o.anchor;var G=0>s,U=0>u,B=(G?-1:1)*(M?Kr(M[0],0,e):0),V=(U?-1:1)*(M?Kr(M[1],1,e):0);e.setOrigin(B-=(G?-1:1)*(w&&w[0]||0)*i.contentBounds.halfExtents[0]*2,V-=(U?-1:1)*(w&&w[1]||0)*i.contentBounds.halfExtents[1]*2),this.runtime.sceneGraphService.dirtifyToRoot(e)}},e.prototype.isPropertyInheritable=function(t){var e=Bi[t];return!!e&&e.inh},e}(),Yi=function(){function t(){this.parser=Xr,this.parserWithCSSDisabled=null,this.mixer=ei}return t.prototype.calculator=function(t,e,n,r){return Hr(n)},t}(),zi=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof nr&&(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}(),Xi=function(){function t(){this.parser=Br,this.parserWithCSSDisabled=Br,this.mixer=Vr}return t.prototype.calculator=function(t,e,n,r){return n instanceof nr?"none"===n.value?Er:Tr:n},t}(),Wi=function(){function t(){this.parser=$r}return t.prototype.calculator=function(t,e,n){return n instanceof nr?[]:n},t}();function Hi(t){var e=t.parsedStyle.fontSize;return $t(e)?null:e}var qi=function(){function e(){this.parser=zr,this.parserWithCSSDisabled=null,this.mixer=ei}return e.prototype.calculator=function(e,n,r,i,o){var a;if(se(r))return r;if(!lr.isRelativeUnit(r.unit))return r.value;var s=o.styleValueRegistry;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){if(u=Hi(i.parentNode))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){if(null===(a=null==i?void 0:i.ownerDocument)||void 0===a?void 0:a.documentElement){var u;if(u=Hi(i.ownerDocument.documentElement))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}},e}(),Zi=function(){function t(){this.mixer=ri}return t.prototype.parser=function(t){var e=Zr(se(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Ki=function(){function t(){this.mixer=ri}return t.prototype.parser=function(t){var e=Zr(se(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Qi=y();function $i(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(a[0],1,1)}else if("scaley"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,a[0],1)}else if("scalez"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,a[0])}else if("scale3d"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(a[0],a[1],a[2])}else if("translate"===i){e.translateLocal((s=o||[hr,hr])[0].value,s[1].value,0)}else if("translatex"===i){e.translateLocal((s=o||[hr])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(s=o||[hr])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(s=o||[hr])[0].value)}else if("translate3d"===i){var s;e.translateLocal((s=o||[hr,hr,hr])[0].value,s[1].value,s[2].value)}else if("rotate"===i){e.rotateLocal(0,0,Hr((o||[dr])[0]))}else if("rotatex"===i){e.rotateLocal(Hr((o||[dr])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,Hr((o||[dr])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,Hr((o||[dr])[0]))}else if("rotate3d"===i);else if("skew"===i){var l=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(yn(l[0]),yn(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(yn(l[0]),e.getLocalSkew()[1])}else if("skewy"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],yn(l[0]))}else if("matrix"===i){var h=u(o.map((function(t){return t.value})),6);e.setLocalTransform(g(Qi,h[0],h[1],0,0,h[2],h[3],0,0,0,0,1,0,h[4]+n,h[5]+r,0,1))}else"matrix3d"===i&&(g.apply(V,c([Qi],u(o.map((function(t){return t.value}))),!1)),Qi[12]+=n,Qi[13]+=r,e.setLocalTransform(Qi))})),e.getLocalTransform()}var Ji=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.postProcessor=function(e,n){var r,i,o;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var a=e.parsedStyle,s=a.cx,c=a.cy,l=a.cz;$t(s)||(r=s),$t(c)||(i=c),$t(l)||(o=l);break;case t.Shape.LINE:var h=e.parsedStyle,p=h.y1,f=h.y2;r=Math.min(h.x1,h.x2),i=Math.min(p,f),o=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:$t(e.parsedStyle.x)||(r=e.parsedStyle.x),$t(e.parsedStyle.y)||(i=e.parsedStyle.y),$t(e.parsedStyle.z)||(o=e.parsedStyle.z)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!$t(r)||!$t(i)||!$t(o))&&-1===n.indexOf("transform")){var d=e.parsedStyle.transform;if(d&&d.length)$i(d,e);else{var y=u(e.getLocalPosition(),3),v=y[0],m=y[1],g=y[2];e.setLocalPosition($t(r)?v:r,$t(i)?m:i,$t(o)?g:o)}}},r}(qi),to=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof nr&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),eo=function(){function t(){this.mixer=ei,this.parser=ti,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),no=function(){function e(){this.parser=ti,this.parserWithCSSDisabled=null,this.mixer=ni(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.parsedStyle.defX=o.x,e.parsedStyle.defY=o.y,e.setLocalPosition(o.x,o.y))}}},e}(),ro=function(){function t(){this.parser=ti,this.parserWithCSSDisabled=null,this.mixer=ni(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),io=function(){function e(){this.parser=gi,this.parserWithCSSDisabled=gi,this.mixer=xi}return e.prototype.calculator=function(t,e,n){return n instanceof nr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dn(0,0,0,0)}:n},e.prototype.postProcessor=function(e,n){if(e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y,e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,o=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===o?0:o)}},e}(),oo=function(){function e(){this.parser=bi,this.mixer=Ei}return e.prototype.postProcessor=function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}},e}(),ao=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=ni(0,1/0),e}return n(e,t),e}(qi),so=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof nr?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),uo=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}(),co={},lo=0;var ho="undefined"!=typeof window&&void 0!==window.document;function po(t){return!!t.getAttribute}function fo(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function yo(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 vo(t,e){if(ho)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var mo={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},go="object"==typeof performance&&performance.now?performance:Date;var xo=1,bo="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Eo=Date.now(),To={},So=Date.now(),Po=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-So,r=n>16?0:16-n,i=xo++;return To[i]=t,Object.keys(To).length>1||setTimeout((function(){So=e;var t=To;To={},Object.keys(t).forEach((function(e){return t[e](bo.performance&&"function"==typeof bo.performance.now?bo.performance.now():Date.now()-Eo)}))}),r),i},Mo=function(t){delete To[t]},wo=function(t){return"string"!=typeof t?Po:""===t?bo.requestAnimationFrame:bo[t+"RequestAnimationFrame"]},No=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!!wo(t)})),Co=wo(No),ko=function(t){return"string"!=typeof t?Mo:""===t?bo.cancelAnimationFrame:bo[t+"CancelAnimationFrame"]||bo[t+"CancelRequestAnimationFrame"]}(No);bo.requestAnimationFrame=Co,bo.cancelAnimationFrame=ko;var Ao=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}(),Oo=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}(),Ro=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}(),Lo=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}(),Io=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Do=/([\"\'])[^\'\"]+\1/;var _o=function(){function t(){this.parser=wi,this.parserWithCSSDisabled=wi,this.mixer=Di}return t.prototype.calculator=function(t,e,n,r){return n instanceof nr?[]:n},t.prototype.postProcessor=function(t){$i(t.parsedStyle.transform,t)},t}(),Fo=function(){this.parser=_i},Go=function(){function e(){this.parser=ti}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}(),Uo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Bo=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Vo=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),jo=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Yo=function(){function t(){}return t.prototype.update=function(t){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));return{width:r-n,height:Math.max.apply(Math,c([],u(e.map((function(t){return t[1]}))),!1))-i}},t}(),zo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!oe(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),Xo=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!$t(t.lineWidth)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var l=((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,h=this.globalRuntime.textService.measureText(i,t,l);t.metrics=h;var p=[h.width/2,h.height/2,0],f=[0,1],d=0;"center"===o||"middle"===o?(d=a/2,f=[.5,1]):"right"!==o&&"end"!==o||(d=a,f=[1,1]);var y=0;return"middle"===s?y=p[1]:"top"===s||"hanging"===s?y=2*p[1]:"alphabetic"===s?y=this.globalRuntime.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(y=0),u&&(d+=u),c&&(y+=c),t.anchor=[f[0],f[1],0],{width:2*p[0],height:2*p[1],offsetX:d,offsetY:y}},t}();function Wo(t){return!!t.type}var Ho,qo=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 In,this.page=new In,this.canvas=new In,this.viewport=new In,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(_n)},t}(),Zo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new In,e.movement=new In,e.offset=new In,e.global=new In,e.screen=new In,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(_n)},e}(qo),Ko=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||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}(Zo),Qo=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}(Zo),$o=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}(qo),Jo=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=he(n)&&n||ne(n)&&n.capture,i=ne(n)&&n.once,o=or(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var l=u(t.split(":"),2);t=l[1],s=l[0],a=!0}if(t=r?"".concat(t,"capture"):t,e=or(e)?e:e.handleEvent,a){var h=e;e=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&h.apply(void 0,c([],u(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=he(n)&&n||ne(n)&&n.capture,i=or(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=or(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new $o(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!Wo(t))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),ta=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||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(_n)},r.prototype.lookupNamespaceURI=function(t){throw Error(_n)},r.prototype.lookupPrefix=function(t){throw Error(_n)},r.prototype.normalize=function(){throw Error(_n)},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,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.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}(Jo),ea=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new h,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=y(),this.tmpVec3=j(),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=go.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")}ta.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&&200>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"),ta.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&&ta.isNode(o)&&o.parentNode;c&&c!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(ta.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!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),r&&n.notifyTarget(l,"mouseenter"),ta.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!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),ta.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!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),ta.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"),ta.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.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new In(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new In(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},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=S(this.tmpMatrix,u,s),l=H(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return et(l,l,c),new In(l[0],l[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=S(this.tmpMatrix,n,r),o=H(this.tmpVec3,t.x,t.y,0);et(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new In((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},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++)ta.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:this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},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.globalRuntime.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(Ko);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i);return i.target=null!=n?n:o||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(Qo);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},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(Qo);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(Ko);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=go.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||ta.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=po(e)&&e.getAttribute("cursor");if(n)return n;e=ta.isNode(e)&&e.parentNode}},t}(),na=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||xa.offscreenCanvas)this.canvas=t||xa.offscreenCanvas,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();t.RenderReason=void 0,(Ho=t.RenderReason||(t.RenderReason={}))[Ho.CAMERA_CHANGED=0]="CAMERA_CHANGED",Ho[Ho.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Ho[Ho.NONE=2]="NONE";var ra,ia=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 Ro,initAsync:new Ao,dirtycheck:new Lo,cull:new Lo,beginFrame:new Ro,beforeRender:new Ro,render:new Ro,afterRender:new Ro,endFrame:new Ro,destroy:new Ro,pick:new Oo,pickSync:new Lo,pointerDown:new Ro,pointerUp:new Ro,pointerMove:new Ro,pointerOut:new Ro,pointerOver:new Ro,pointerWheel:new Ro,pointerCancel:new Ro,click:new Ro}}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(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},e.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable;c.dirty&&(this.sort(t,c),c.dirty=!1,c.dirtyChildren=[],c.dirtyReason=void 0),(c.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>fo(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(fo)},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}(),oa=/\[\s*(.*)=(.*)\s*\]/,aa=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(oa),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 $t(n)?"":n.toString?""+n:""},t}(),sa=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}(qo);function ua(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}t.ElementEvent=void 0,(ra=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",ra.DESTROY="destroy",ra.ATTR_MODIFIED="DOMAttrModified",ra.INSERTED="DOMNodeInserted",ra.REMOVED="removed",ra.MOUNTED="DOMNodeInsertedIntoDocument",ra.UNMOUNTED="DOMNodeRemovedFromDocument",ra.BOUNDS_CHANGED="bounds-changed",ra.CULLED="culled";var ca,la,ha,pa=new sa(t.ElementEvent.REPARENT,null,"","","",0,"",""),fa=function(){function e(e){var n,r,i,o,a,s,u,c,l=this;this.runtime=e,this.pendingEvents=[],this.boundsChangedEvent=new $o(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=st(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=X(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=st();ht(a,e[0],e[1],e[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);ft(n,u),lt(n,n),ct(a,n,a),ct(o.localRotation,a,s),yt(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,e)}),this.rotateLocal=(r=st(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=X(e,n,i));var o=t.transformable;ht(r,e[0],e[1],e[2]),dt(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}),this.setEulerAngles=(i=st(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=X(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ht(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);ft(i,lt(st(),a)),dt(o.localRotation,o.localRotation,i),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=X(e,n,r));var i=t.transformable;nt(e,j())||(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),q(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(o=y(),a=j(),function(t,e){var n=t.transformable;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,nt(l.getPosition(t),a)||(W(n.position,a),null!==t.parentNode&&t.parentNode.transformable?(m(o,t.parentNode.transformable.worldTransform),E(o,o),et(n.localPosition,a,o)):W(n.localPosition,a),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=j();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,nt(r.localPosition,t)||(W(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(s=j(),u=j(),c=j(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=H(u,e,n,r)),nt(e,s)||(q(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=st();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=pt(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);ft(t,s),lt(t,t),ct(a.localRotation,t,n),yt(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=y(),e=j(),n=pt(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(L(r.localTransform,r.localRotation,r.localPosition,X(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=x(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),S(r.localTransform,r.localTransform,i)}var o=L(t,n,e,r.localScale,r.origin);S(r.localTransform,r.localTransform,o)}else L(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}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,a=!1;e.parentNode&&(a=e.parentNode!==n,this.detach(e)),e.parentNode=n,$t(r)?e.parentNode.childNodes.push(e):e.parentNode.childNodes.splice(r,0,e);var s=n.sortable;((null===(i=null==s?void 0:s.sorted)||void 0===i?void 0:i.length)||(null===(o=e.style)||void 0===o?void 0:o.zIndex))&&(-1===s.dirtyChildren.indexOf(e)&&s.dirtyChildren.push(e),s.dirty=!0,s.dirtyReason=t.SortReason.ADDED);var u=e.transformable;u&&this.dirtifyWorld(e,u),u.frozen&&this.unfreezeParentToRoot(e),a&&e.dispatchEvent(pa)},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.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.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=X(e,n,r));var i=t.transformable;ht(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},e.prototype.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=X(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},e.prototype.setLocalScale=function(t,e){var n=t.transformable,r=X(e[0],e[1],e[2]||n.localScale[2]);nt(r,n.localScale)||(W(n.localScale,r),this.dirtifyLocal(t,n))},e.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=pt(e,n,r,i));var o=t.transformable;ft(o.localRotation,e),this.dirtifyLocal(t,o)},e.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new f(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)},e.prototype.dirtifyLocal=function(t,e){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.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=u(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},e.prototype.clearPendingEvents=function(){this.pendingEvents=[]},e.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)ua(n),n=n.parentNode;e&&t.forEach((function(t){ua(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren: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 sa(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,sa.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},e.prototype.getPosition=function(t){var e=t.transformable;return A(e.position,this.getWorldTransform(t,e))},e.prototype.getRotation=function(t){var e=t.transformable;return R(e.rotation,this.getWorldTransform(t,e))},e.prototype.getScale=function(t){var e=t.transformable;return O(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.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=A(j(),e),r=R(st(),e),i=O(j(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},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(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))})),e){var a=yo(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Cn),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},e.prototype.getLocalBounds=function(t){if(t.parentNode){var e=y();t.parentNode.transformable&&(e=E(y(),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 Dn(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),l[0]-s,l[1]-c)}return new Dn((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?S(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}(),da={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]},ya=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,va=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),ma=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ga=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!ma.exec(n)&&!va.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=da.MetricsString+da.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(da.BaselineSymbol).width),u=da.HeightMultiplier*s;s=s*da.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=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,c=e.letterSpacing,l=e.textPath,h=e.leading,p=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=se(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var c=s[u].trim();!Do.test(c)&&0>Io.indexOf(c)&&(c='"'.concat(c,'"')),s[u]=c}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),d=this.measureFont(f,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var y=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);y.font=f,e.isOverflowing=!1;var v=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=Array(v.length),g=0;if(!l){for(S=0;v.length>S;S++){var x=y.measureText(v[S]).width+(v[S].length-1)*c;m[S]=x,g=Math.max(g,x)}P=g+a;var b=o||d.fontSize+a,E=Math.max(b,d.fontSize+a)+(v.length-1)*(b+p),T=0;return"middle"===s?T=-E/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?T=-E:"top"!==s&&"hanging"!==s||(T=0),{font:f,width:P,height:E,lines:v,lineWidths:m,lineHeight:b+=p,maxLineWidth:g,fontProperties:d,lineMetrics:m.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Dn(n-a/2,T+e*b,t+a,b)}))}}l.getTotalLength();for(var S=0;v.length>S;S++)var P=y.measureText(v[S]).width+(v[S].length-1)*c},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=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),h=o+a,p="";"ellipsis"===c?p="...":c&&"clip"!==c&&(p=c);for(var f=[],d=0,y=0,v={},m=function(t){return r.getFromCache(t,a,v,l)},g=Array.from(p).reduce((function(t,e){return t+m(e)}),0),x=Array.from(t),b=0;x.length>b;b++){var E=x[b],T=t[b-1],S=t[b+1],P=m(E);if(this.isNewline(E)){if(++d>=u){e.isOverflowing=!0;break}y=0,f[d]=""}else{if(y>0&&y+P>h){if(d+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var M=f[d].length,w=0,N=M,C=0;M>C;C++){var k=m(f[d][C]);if(w+k+g>h){N=C;break}w+=k}f[d]=(f[d]||"").slice(0,N)+p}break}if(y=0,f[++d]="",this.isBreakingSpace(E))continue;this.canBreakInLastChar(E)||(f=this.trimToBreakable(f),y=this.sumTextWidthByCache(f[d]||"",v)),this.shouldBreakByKinsokuShorui(E,S)&&(f=this.trimByKinsokuShorui(f),y+=m(T||""))}y+=P,f[d]=(f[d]||"")+E}}return f.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&da.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&da.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||!ya.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(!ya.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}(),xa={},ba=(la=new zo,ha=new Yo,(ca={})[t.Shape.CIRCLE]=new Uo,ca[t.Shape.ELLIPSE]=new Bo,ca[t.Shape.RECT]=la,ca[t.Shape.IMAGE]=la,ca[t.Shape.GROUP]=la,ca[t.Shape.LINE]=new Vo,ca[t.Shape.TEXT]=new Xo(xa),ca[t.Shape.POLYLINE]=ha,ca[t.Shape.POLYGON]=ha,ca[t.Shape.PATH]=new jo,ca[t.Shape.HTML]=null,ca[t.Shape.MESH]=null,ca),Ea=function(){var e,n=new Xi,r=new qi;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new eo,e[t.PropertySyntax.ANGLE]=new Yi,e[t.PropertySyntax.DEFINED_PATH]=new zi,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new Wi,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new Zi,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new Ki,e[t.PropertySyntax.COORDINATE]=new Ji,e[t.PropertySyntax.OFFSET_DISTANCE]=new no,e[t.PropertySyntax.OPACITY_VALUE]=new ro,e[t.PropertySyntax.PATH]=new io,e[t.PropertySyntax.LIST_OF_POINTS]=new oo,e[t.PropertySyntax.SHADOW_BLUR]=new ao,e[t.PropertySyntax.TEXT]=new so,e[t.PropertySyntax.TEXT_TRANSFORM]=new uo,e[t.PropertySyntax.TRANSFORM]=new _o,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new Fo,e[t.PropertySyntax.Z_INDEX]=new Go,e[t.PropertySyntax.MARKER]=new to,e}();xa.CameraContribution=Xn,xa.AnimationTimeline=null,xa.EasingFunction=null,xa.offscreenCanvasCreator=new na,xa.nativeHTMLMap=new WeakMap,xa.sceneGraphSelector=new aa,xa.sceneGraphService=new fa(xa),xa.textService=new ga(xa),xa.geometryUpdaterFactory=ba,xa.CSSPropertySyntaxFactory=Ea,xa.styleValueRegistry=new ji(xa),xa.layoutRegistry=null,xa.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},xa.enableCSSParsing=!0,xa.enableDataset=!1,xa.enableStyleSyntax=!0;var Ta=0;var Sa=new sa(t.ElementEvent.INSERTED,null,"","","",0,"",""),Pa=new sa(t.ElementEvent.REMOVED,null,"","","",0,"",""),Ma=new $o(t.ElementEvent.DESTROY),wa=function(e){function r(){var n=null!==e&&e.apply(this,arguments)||this;return n.entity=Ta++,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},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=xa.enableCSSParsing?{anchor:vr,opacity:vr,fillOpacity:vr,strokeOpacity:vr,fill:vr,stroke:vr,transform:vr,transformOrigin:vr,visibility:vr,pointerEvents:vr,lineWidth:vr,lineCap:vr,lineJoin:vr,increasedLineWidthForHitTesting:vr,fontSize:vr,fontFamily:vr,fontStyle:vr,fontWeight:vr,fontVariant:vr,textAlign:vr,textBaseline:vr,textTransform:vr,zIndex:vr,filter:vr,shadowType:vr}:null,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(_n)},r.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return xa.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Sa.relatedNode=this,t.dispatchEvent(Sa),t},r.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}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 Pa.relatedNode=this,t.dispatchEvent(Pa),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),xa.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 xa.sceneGraphService.matches(t,this)},r.prototype.getElementById=function(t){return xa.sceneGraphService.querySelector("#".concat(t),this)},r.prototype.getElementsByName=function(t){return xa.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},r.prototype.getElementsByClassName=function(t){return xa.sceneGraphService.querySelectorAll(".".concat(t),this)},r.prototype.getElementsByTagName=function(t){return xa.sceneGraphService.querySelectorAll(t,this)},r.prototype.querySelector=function(t){return xa.sceneGraphService.querySelector(t,this)},r.prototype.querySelectorAll=function(t){return xa.sceneGraphService.querySelectorAll(t,this)},r.prototype.closest=function(t){var e=this;do{if(xa.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,!0)})),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(Ma),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.prototype.getGeometryBounds=function(){return xa.sceneGraphService.getGeometryBounds(this)},r.prototype.getRenderBounds=function(){return xa.sceneGraphService.getBounds(this,!0)},r.prototype.getBounds=function(){return xa.sceneGraphService.getBounds(this)},r.prototype.getLocalBounds=function(){return xa.sceneGraphService.getLocalBounds(this)},r.prototype.getBoundingClientRect=function(){return xa.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(function(t){return"symbol"==typeof t}(t))return xa.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=sr(t);return e=this.attributes[n],xa.enableCSSParsing&&$t(e)?null:e}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){this.attributes[t]=e},r.prototype.getAttributeNS=function(t,e){throw Error(_n)},r.prototype.getAttributeNode=function(t){throw Error(_n)},r.prototype.getAttributeNodeNS=function(t,e){throw Error(_n)},r.prototype.hasAttributeNS=function(t,e){throw Error(_n)},r.prototype.removeAttributeNS=function(t,e){throw Error(_n)},r.prototype.removeAttributeNode=function(t){throw Error(_n)},r.prototype.setAttributeNS=function(t,e,n){throw Error(_n)},r.prototype.setAttributeNode=function(t){throw Error(_n)},r.prototype.setAttributeNodeNS=function(t){throw Error(_n)},r.prototype.toggleAttribute=function(t,e){throw Error(_n)},r}(ta);function Na(t){return!!(null==t?void 0:t.nodeName)}var Ca,ka=new sa(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,sa.MODIFICATION,null,null),Aa={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Oa={anchor:[0,0],fill:Er,stroke:Er,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Ra=r(r({},Oa),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),La=c(c([],u(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Ia="data-",Da=function(e){function i(n){var r,i=this;(i=e.call(this)||this).isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=i.config.style||i.config.attrs||{},Object.assign(i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,xa.enableCSSParsing?Oa:Ra,i.config.initialParsedStyle),xa.enableCSSParsing&&Object.assign(i.attributes,Aa),i.initAttributes(i.config.style);var o=xa.globalThis.Proxy?xa.globalThis.Proxy:function(){};return xa.enableDataset&&(i.dataset=new o({},{get:function(t,e){var n="".concat(Ia).concat(ir(e));return void 0!==t[n]?t[n]:i.getAttribute(n)},set:function(t,e,n){return i.setAttribute("".concat(Ia).concat(ir(e)),n),!0}})),xa.enableStyleSyntax&&(i.style=new o({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}})),i}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];Na(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={});var e=this.renderable,n={forceUpdateGeometry:!0};xa.enableCSSParsing&&(n.usedAttributes=La);var r={};for(var i in t){r[sr(i)]=t[i]}xa.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},i.prototype.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=sr(t);pe(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),e.prototype.setAttribute.call(this,i,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];xa.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(ka.relatedNode=this,ka.prevValue=o,ka.newValue=e,ka.attrName=t,ka.prevParsedValue=a,ka.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(ka):(ka.target=this,this.ownerDocument.defaultView.dispatchEvent(ka,!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 Dn(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),xa.sceneGraphService.setOrigin(this,dn(t,e,n)),this},i.prototype.getOrigin=function(){return xa.sceneGraphService.getOrigin(this)},i.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.setPosition(this,dn(t,e,n)),this},i.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.setLocalPosition(this,dn(t,e,n)),this},i.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.translate(this,dn(t,e,n)),this},i.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.translateLocal(this,dn(t,e,n)),this},i.prototype.getPosition=function(){return xa.sceneGraphService.getPosition(this)},i.prototype.getLocalPosition=function(){return xa.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=dn(t,e=e||t,n=n||t)),xa.sceneGraphService.scaleLocal(this,t),this},i.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=dn(t,e=e||t,n=n||t)),xa.sceneGraphService.setLocalScale(this,t),this},i.prototype.getLocalScale=function(){return xa.sceneGraphService.getLocalScale(this)},i.prototype.getScale=function(){return xa.sceneGraphService.getScale(this)},i.prototype.getEulerAngles=function(){return vn(u(gn(j(),xa.sceneGraphService.getWorldTransform(this)),3)[2])},i.prototype.getLocalEulerAngles=function(){return vn(u(gn(j(),xa.sceneGraphService.getLocalRotation(this)),3)[2])},i.prototype.setEulerAngles=function(t){return xa.sceneGraphService.setEulerAngles(this,0,0,t),this},i.prototype.setLocalEulerAngles=function(t){return xa.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},i.prototype.rotateLocal=function(t,e,n){return $t(e)&&$t(n)?xa.sceneGraphService.rotateLocal(this,0,0,t):xa.sceneGraphService.rotateLocal(this,t,e,n),this},i.prototype.rotate=function(t,e,n){return $t(e)&&$t(n)?xa.sceneGraphService.rotate(this,0,0,t):xa.sceneGraphService.rotate(this,t,e,n),this},i.prototype.setRotation=function(t,e,n,r){return xa.sceneGraphService.setRotation(this,t,e,n,r),this},i.prototype.setLocalRotation=function(t,e,n,r){return xa.sceneGraphService.setLocalRotation(this,t,e,n,r),this},i.prototype.setLocalSkew=function(t,e){return xa.sceneGraphService.setLocalSkew(this,t,e),this},i.prototype.getRotation=function(){return xa.sceneGraphService.getRotation(this)},i.prototype.getLocalRotation=function(){return xa.sceneGraphService.getLocalRotation(this)},i.prototype.getLocalSkew=function(){return xa.sceneGraphService.getLocalSkew(this)},i.prototype.getLocalTransform=function(){return xa.sceneGraphService.getLocalTransform(this)},i.prototype.getWorldTransform=function(){return xa.sceneGraphService.getWorldTransform(this)},i.prototype.setLocalTransform=function(t){return xa.sceneGraphService.setLocalTransform(this,t),this},i.prototype.resetLocalTransform=function(){xa.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"visible"===(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?ne(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(A(j(),e),2),r=n[0],i=n[1],o=u(O(j(),e),2),a=o[0],s=o[1],c=R(st(),e),l=u(gn(j(),c),3);return xn(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(bn(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(bn(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(){xa.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},i.prototype.hide=function(){xa.enableCSSParsing?this.style.visibility="hidden":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.setClip=function(t){this.style.clipPath=t},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}(wa),_a={number:function(t){return new lr(t)},percent:function(t){return new lr(t,"%")},px:function(t){return new lr(t,"px")},em:function(t){return new lr(t,"em")},rem:function(t){return new lr(t,"rem")},deg:function(t){return new lr(t,"deg")},grad:function(t){return new lr(t,"grad")},rad:function(t){return new lr(t,"rad")},turn:function(t){return new lr(t,"turn")},s:function(t){return new lr(t,"s")},ms:function(t){return new lr(t,"ms")},registerProperty:function(t){xa.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){xa.layoutRegistry.registerLayout(t,e)}},Fa=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.CIRCLE,style:r(xa.enableCSSParsing?{cx:"",cy:"",r:""}:{},o),initialParsedStyle:{anchor:[.5,.5],transformOrigin:xa.enableCSSParsing?null:[Mr,Mr]}},a))||this}return n(o,e),o}(Da),Ga=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:r(xa.enableCSSParsing?{x:"",y:""}:{},o)},a))||this).isCustomElement=!0,n}return n(e,t),e}(Da),Ua=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.ELLIPSE,style:r(xa.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},o),initialParsedStyle:{anchor:[.5,.5],transformOrigin:xa.enableCSSParsing?null:[Mr,Mr]}},a))||this}return n(o,e),o}(Da),Ba=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.GROUP,style:r(xa.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},o)},a))||this}return n(o,e),o}(Da),Va=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:r(xa.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},a)},s))||this).cullable.enable=!1,o}return n(o,e),o.prototype.getDomElement=function(){return this.parsedStyle.$el},o.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle;return new Dn(t.x,t.y,t.width,t.height)},o.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},o.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new Cn,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},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}(Da),ja=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.IMAGE,style:r(xa.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},o)},a))||this}return n(o,e),o}(Da),Ya=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,isBillboard:!1},a)},s))||this).markerStartAngle=0,o.markerEndAngle=0;var u=o.parsedStyle,c=u.markerStart,l=u.markerEnd;return c&&Na(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),l&&Na(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&&Na(r)&&(this.markerStartAngle=0,r.remove()),i&&Na(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Na(r)&&(this.markerEndAngle=0,r.remove()),i&&Na(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=e.defX,c=e.defY,l=t?e.markerStart:e.markerEnd;if(l&&Na(l)){var h,p,f,d,y,v,m;t?(d=i-u,y=a-c,p=o-i,f=s-a,v=n||0,m=this.markerStartAngle):(d=o-u,y=s-c,p=i-o,f=a-s,v=r||0,m=this.markerEndAngle),l.setLocalEulerAngles(180*(h=Math.atan2(f,p))/Math.PI+m),l.setLocalPosition(d+Math.cos(h)*v,y+Math.sin(h)*v)}},o.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=qe(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=et(j(),X(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new In(u[0],u[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 He(t.x1,t.y1,t.x2,t.y2)},o}(Da),za=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:r(xa.enableCSSParsing?{path:"",miterLimit:""}:{},a),initialParsedStyle:xa.enableCSSParsing?null:{miterLimit:4,path:r({},Nr)}},s))||this).markerStartAngle=0,o.markerEndAngle=0,o.markerMidList=[];var u=o.parsedStyle,c=u.markerStart,l=u.markerEnd,h=u.markerMid;return c&&Na(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),h&&Na(h)&&o.placeMarkerMid(h),l&&Na(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){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Na(r)&&(this.markerStartAngle=0,r.remove()),i&&Na(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Na(r)&&(this.markerEndAngle=0,r.remove()),i&&Na(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.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&Na(a)){var s,c,l,h,p,f,d;if(t){var y=u(this.getStartTangent(),2);h=(m=y[1])[0]-i,p=m[1]-o,c=(v=y[0])[0]-m[0],l=v[1]-m[1],f=n||0,d=this.markerStartAngle}else{var v,m,g=u(this.getEndTangent(),2);h=(m=g[1])[0]-i,p=m[1]-o,c=(v=g[0])[0]-m[0],l=v[1]-m[1],f=r||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(l,c))/Math.PI+d),a.setLocalPosition(h+Math.cos(s)*f,p+Math.sin(s)*f)}},o.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Na(t))for(var o=1;n.length-1>o;o++){var a=u(n[o].currentPoint,2),s=a[0],c=a[1],l=1===o?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,c-i)}},o.prototype.getTotalLength=function(){return ii(this)},o.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,i=n.defX,o=n.defY,a=function(t,e,n){return qt(t,e,r(r({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),s=a.x,u=a.y,c=et(j(),X(s-i,u-o,0),e?this.getWorldTransform():this.getLocalTransform());return new In(c[0],c[1])},o.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*ii(this),e)},o.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},o.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},o}(Da),Xa=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:r(xa.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},a),initialParsedStyle:xa.enableCSSParsing?null:{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&&Na(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),h&&Na(h)&&o.placeMarkerMid(h),l&&Na(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&&Na(r)&&(this.markerStartAngle=0,r.remove()),i&&Na(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Na(r)&&(this.markerEndAngle=0,r.remove()),i&&Na(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=e.defX,a=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&Na(s)){var u,c,l,h,p,f,d;if(h=i[0][0]-o,p=i[0][1]-a,t)c=i[1][0]-i[0][0],l=i[1][1]-i[0][1],f=n||0,d=this.markerStartAngle;else{var y=i.length;this.parsedStyle.isClosed?(c=i[y-1][0]-i[0][0],l=i[y-1][1]-i[0][1]):(h=i[y-1][0]-o,p=i[y-1][1]-a,c=i[y-2][0]-i[y-1][0],l=i[y-2][1]-i[y-1][1]),f=r||0,d=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(l,c))/Math.PI+d),s.setLocalPosition(h+Math.cos(u)*f,p+Math.sin(u)*f)}},o.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Na(t))for(var o=1;(this.parsedStyle.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},o}(Da),Wa=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:r(xa.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},o),initialParsedStyle:xa.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},a))||this}return n(o,e),o.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},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,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var c=qe(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),l=c.x,h=c.y,p=et(j(),X(l-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new In(p[0],p[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}(Xa),Ha=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.RECT,style:r(xa.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},o)},a))||this}return n(o,e),o}(Da),qa=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(xa.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},o),initialParsedStyle:xa.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},a))||this}return n(o,e),o.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},o.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},o.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},o}(Da),Za=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Fa),this.define(t.Shape.ELLIPSE,Ua),this.define(t.Shape.RECT,Ha),this.define(t.Shape.IMAGE,ja),this.define(t.Shape.LINE,Ya),this.define(t.Shape.GROUP,Ba),this.define(t.Shape.PATH,za),this.define(t.Shape.POLYGON,Xa),this.define(t.Shape.POLYLINE,Wa),this.define(t.Shape.TEXT,qa),this.define(t.Shape.HTML,Va)}return e.prototype.define=function(t,e){this.registry[t]=e},e.prototype.get=function(t){return this.registry[t]},e}(),Ka=function(e){function r(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new xa.AnimationTimeline(n)}catch(t){}var r={};return Gi.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=or(n)?n(t.Shape.GROUP):n)})),n.documentElement=new Ba({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?qa:Ba);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(_n)},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=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},r.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(Fn)},r.prototype.insertBefore=function(t,e){throw Error(Fn)},r.prototype.removeChild=function(t,e){throw Error(Fn)},r.prototype.replaceChild=function(t,e,n){throw Error(Fn)},r.prototype.append=function(){throw Error(Fn)},r.prototype.prepend=function(){throw Error(Fn)},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}(ta),Qa=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 $o(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e.tag="Culling",e}(),$a=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t.tag="DirtyCheck",t}(),Ja=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Ko(null),this.rootWheelEvent=new Qo(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="outside";try{a=o&&t.target&&t.target!==o&&o.contains&&!o.contains(t.target)?"outside":""}catch(t){}var 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.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||$t(r)||$t(i)){var s=this.context.eventService.client2Viewport(new In(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.prototype.bootstrapEvent=function(t,e,n,r){var i,o;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 a=(i=this.getViewportXY(e)).x,s=i.y;t.viewport.x=a,t.viewport.y=s;var u=(o=this.context.eventService.viewport2Canvas(t.viewport)).x,c=o.y;return t.canvas.x=u,t.canvas.y=c,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=mo[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e,n,r=this.rootWheelEvent;this.transferMouseData(r,t),r.deltaMode=t.deltaMode,r.deltaX=t.deltaX,r.deltaY=t.deltaY,r.deltaZ=t.deltaZ;var i=(e=this.getViewportXY(t)).x,o=e.y;r.viewport.x=i,r.viewport.y=o;var a=(n=this.context.eventService.viewport2Canvas(r.viewport)).x,s=n.y;return r.canvas.x=a,r.canvas.y=s,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.nativeEvent=t,r.type=t.type,r},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=go.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];pe(i.button)&&(i.button=0),pe(i.buttons)&&(i.buttons=1),pe(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),pe(i.width)&&(i.width=i.radiusX||1),pe(i.height)&&(i.height=i.radiusY||1),pe(i.tiltX)&&(i.tiltX=0),pe(i.tiltY)&&(i.tiltY=0),pe(i.pointerType)&&(i.pointerType="touch"),pe(i.pointerId)&&(i.pointerId=i.identifier||0),pe(i.pressure)&&(i.pressure=i.force||.5),pe(i.twist)&&(i.twist=0),pe(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;pe(o.isPrimary)&&(o.isPrimary=!0),pe(o.width)&&(o.width=1),pe(o.height)&&(o.height=1),pe(o.tiltX)&&(o.tiltX=0),pe(o.tiltY)&&(o.tiltY=0),pe(o.pointerType)&&(o.pointerType="mouse"),pe(o.pointerId)&&(o.pointerId=1),pe(o.pressure)&&(o.pressure=.5),pe(o.twist)&&(o.twist=0),pe(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),ts=[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],es=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=ts.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>$(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>$(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}(),ns=function(){function e(){this.toSync=new Set}return e.prototype.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var a=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;i.dirtify()},u=function(t){var e=t.target;xa.enableCSSParsing&&xa.styleValueRegistry.recalc(e),xa.sceneGraphService.dirtifyToRoot(e),i.dirtify()},c=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),xa.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(e.tag,(function(){o.addEventListener(t.ElementEvent.MOUNTED,u),o.addEventListener(t.ElementEvent.UNMOUNTED,c),o.addEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s)})),i.hooks.destroy.tap(e.tag,(function(){o.removeEventListener(t.ElementEvent.MOUNTED,u),o.removeEventListener(t.ElementEvent.UNMOUNTED,c),o.removeEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s),r.toSync.clear()})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))},e.prototype.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r,i,o=n.rBushNode;o&&o.aabb&&t.rBush.remove(o.aabb);var a=n.getRenderBounds();if(a){var s=(r=u(a.getMin(),2))[0],c=r[1],l=(i=u(a.getMax(),2))[0],h=i[1];o.aabb||(o.aabb={}),o.aabb.displayObject=n,o.aabb.minX=s,o.aabb.minY=c,o.aabb.maxX=l,o.aabb.maxY=h}o.aabb&&(isNaN(o.aabb.maxX)||isNaN(o.aabb.maxX)||isNaN(o.aabb.minX)||isNaN(o.aabb.minY)||e.push(o.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e.tag="Prepare",e}();t.CanvasEvent=void 0,(Ca=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Ca.BEFORE_RENDER="beforerender",Ca.RERENDER="rerender",Ca.AFTER_RENDER="afterrender",Ca.BEFORE_DESTROY="beforedestroy",Ca.AFTER_DESTROY="afterdestroy",Ca.RESIZE="resize",Ca.DIRTY_RECTANGLE="dirtyrectangle",Ca.RENDERER_CHANGED="rendererchanged";var rs=new $o(t.ElementEvent.MOUNTED),is=new $o(t.ElementEvent.UNMOUNTED),os=new $o(t.CanvasEvent.BEFORE_RENDER),as=new $o(t.CanvasEvent.RERENDER),ss=new $o(t.CanvasEvent.AFTER_RENDER),us=function(e){function i(t){var n=e.call(this)||this;n.Element=Da,n.inited=!1,n.context={},n.document=new Ka,n.document.defaultView=n,n.customElements=new Za;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.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,E=t.isTouchEvent,T=t.isMouseEvent;t.supportsMutipleCanvasesInOneContainer||function(t,e){if(t){var n="string"==typeof t?t:t.id||lo++;co[n]&&co[n].destroy(),co[n]=e}}(r,n);var S=a,P=s,M=u;return i&&(M=1>(M=u||ho&&window.devicePixelRatio||1)?1:Math.ceil(M),S=a||function(t){var e=vo(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/M,P=s||function(t){var e=vo(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/M),o&&(xa.offscreenCanvas=o),n.devicePixelRatio=M,n.requestAnimationFrame=null!=f?f:Co.bind(xa.globalThis),n.cancelAnimationFrame=null!=d?d:ko.bind(xa.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in xa.globalThis,n.supportsPointerEvents=null!=v?v:!!xa.globalThis.PointerEvent,n.isTouchEvent=null!=E?E:function(t){return n.supportsTouchEvents&&t instanceof xa.globalThis.TouchEvent},n.isMouseEvent=null!=T?T:function(t){return!xa.globalThis.MouseEvent||t instanceof xa.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof xa.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:S,height:P,renderer:c,offscreenCanvas:o,devicePixelRatio:M,cursor:h||"default",background:l||"transparent",createImage:y,document:p,supportsCSSTransform:g,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:b}),n.initDefaultCamera(S,P,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 xa.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(Yn.UPDATED,(function(){i.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=o},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=!1),n||this.dispatchEvent(new $o(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 $o(t.CanvasEvent.AFTER_DESTROY))},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 $o(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(){var t=this;this.dispatchEvent(os),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(as)})),this.dispatchEvent(ss)},i.prototype.run=function(){var t=this,e=function(){t.render(),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 an,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Ja,new ns,new $a,new Qa([new es])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(r(r({},xa),this.context)),this.context.renderingService=new ia(xa,this.context),this.context.eventService=new ea(xa,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 $o(t.CanvasEvent.READY))})):i.dispatchEvent(new $o(t.CanvasEvent.READY)),i.readyPromise&&i.resolveReadyPromise()):i.dispatchEvent(new $o(t.CanvasEvent.RENDERER_CHANGED)),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(xa)}))},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(xa)})),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&&(t.isMutationObserved?t.dispatchEvent(is):(is.target=t,this.dispatchEvent(is,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},i.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(rs):(rs.target=t,this.dispatchEvent(rs,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},i.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}(Jo),cs=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.landmarks=[],t}return n(r,e),r.prototype.rotate=function(e,n,r){if(this.relElevation=fn(n),this.relAzimuth=fn(e),this.relRoll=fn(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=ut(st(),[1,0,0],yn((this.rotateWorld?1:-1)*this.relElevation)),o=ut(st(),[0,1,0],yn((this.rotateWorld?1:-1)*this.relAzimuth)),a=ut(st(),[0,0,1],yn(this.relRoll)),s=ct(st(),o,i);s=ct(st(),s,a);var u=I(y(),s);P(this.matrix,this.matrix,[0,0,-this.distance]),S(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=dn(t,e,0),r=Y(this.position);return q(r,r,K(j(),this.right,n[0])),q(r,r,K(j(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},r.prototype.dolly=function(e){var n,r=this.forward,i=Y(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&&q(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 xa.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:Y(p.right),up:Y(p.up),forward:Y(p.forward),position:Y(p.getPosition()),focalPoint:Y(p.getFocalPoint()),distanceVector:Y(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=oe(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=se(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;if(0===u)return this.syncFromLandmark(r),void(p&&p());this.cancelLandmarkAnimation();var f,d=r.position,y=r.focalPoint,v=r.zoom,m=r.roll,g=l||xa.EasingFunction(a),x=function(){n.setFocalPoint(y),n.setPosition(d),n.setRoll(m),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),p&&p()},b=function(t){void 0===f&&(f=t);var e=t-f;if(u<e)x();else{var r,i,o=g(e/u),a=j(),s=j();tt(a,n.focalPoint,y,o),tt(s,n.position,d,o),i=n.roll*(1-o)+m*o,r=n.zoom*(1-o)+v*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),rt(a,y)+rt(s,d)>.01||null!=v||null!=m?(n.computeMatrix(),n.triggerUpdate(),u>e&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(b))):x()}};this.canvas.requestAnimationFrame(b)}},r.prototype.syncFromLandmark=function(t){this.matrix=m(this.matrix,t.matrix),this.right=W(this.right,t.right),this.up=W(this.up,t.up),this.forward=W(this.forward,t.forward),this.position=W(this.position,t.position),this.focalPoint=W(this.focalPoint,t.focalPoint),this.distanceVector=W(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},r}(Xn);xa.CameraContribution=cs;var ls,hs,ps=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}(),fs=0,ds=new WeakMap,ys=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:hs&&function(t){return t===hs||t===ls}(t)?hs:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else bs.push(this.observer),xs||(xs=!0,void 0!==xa.globalThis?xa.globalThis.setTimeout(Es):Es());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=ds.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=ms("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===sa.ADDITION?null:e.prevValue;gs(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,hs||((hs=ps.copy(ls)).oldValue=e,hs)):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=ms("childList",r=e.relatedNode)).addedNodes=u,n.removedNodes=c,n.previousSibling=l,n.nextSibling=h,gs(r,(function(t){if(t.childList)return n}))}ls=hs=void 0},e}(),vs=function(){function t(t){this.callback=t,this.nodes=[],this.records=[],this.uid=fs++}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=ds.get(t);r||ds.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 ys(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=ds.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 ms(t,e){return ls=new ps(t,e)}function gs(t,e){for(var n=t;n;n=n.parentNode){var r=ds.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 xs=!1,bs=[];function Es(){xs=!1;var t=bs;bs=[],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=ds.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&Es()}var Ts=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}(qo),Ss=0,Ps=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(Ss++),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 Ts(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(_n)},t.prototype.addEventListener=function(t,e,n){throw Error(_n)},t.prototype.removeEventListener=function(t,e,n){throw Error(_n)},t.prototype.dispatchEvent=function(t){throw Error(_n)},t.prototype.commitStyles=function(){throw Error(_n)},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 Ts(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 Ts(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Ms=.1,ws="function"==typeof Float32Array,Ns=function(t,e){return 1-3*e+3*t},Cs=function(t,e){return 3*e-6*t},ks=function(t){return 3*t},As=function(t,e,n){return((Ns(e,n)*t+Cs(e,n))*t+ks(e))*t},Os=function(t,e,n){return 3*Ns(e,n)*t*t+2*Cs(e,n)*t+ks(e)},Rs=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=ws?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=As(o*Ms,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=Ms;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Ms,s=Os(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=As(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+Ms,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=Os(e,n,r);if(0===o)return e;e-=(As(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:As(a(t),e,r)}},Ls=function(t){return Math.pow(t,2)},Is=function(t){return Math.pow(t,3)},Ds=function(t){return Math.pow(t,4)},_s=function(t){return Math.pow(t,5)},Fs=function(t){return Math.pow(t,6)},Gs=function(t){return 1-Math.cos(t*Math.PI/2)},Us=function(t){return 1-Math.sqrt(1-t*t)},Bs=function(t){return t*t*(3*t-2)},Vs=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)},js=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=ae(Number(void 0===r?1:r),1,10),s=ae(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)},Ys=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=ae(o,.1,1e3),s=ae(s,.1,1e3),l=ae(l,.1,1e3),p=ae(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},zs=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)(ae(t,0,1)*i)/i},Xs=function(t,e){void 0===e&&(e=[]);var n=u(e,4);return Rs(n[0],n[1],n[2],n[3])(t)},Ws=Rs(.42,0,1,1),Hs=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},qs=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}},Zs=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}},Ks={steps:zs,"step-start":function(t){return zs(t,[1,"start"])},"step-end":function(t){return zs(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Xs,ease:function(t){return Xs(t,[.25,.1,.25,1])},in:Ws,out:Hs(Ws),"in-out":qs(Ws),"out-in":Zs(Ws),"in-quad":Ls,"out-quad":Hs(Ls),"in-out-quad":qs(Ls),"out-in-quad":Zs(Ls),"in-cubic":Is,"out-cubic":Hs(Is),"in-out-cubic":qs(Is),"out-in-cubic":Zs(Is),"in-quart":Ds,"out-quart":Hs(Ds),"in-out-quart":qs(Ds),"out-in-quart":Zs(Ds),"in-quint":_s,"out-quint":Hs(_s),"in-out-quint":qs(_s),"out-in-quint":Zs(_s),"in-expo":Fs,"out-expo":Hs(Fs),"in-out-expo":qs(Fs),"out-in-expo":Zs(Fs),"in-sine":Gs,"out-sine":Hs(Gs),"in-out-sine":qs(Gs),"out-in-sine":Zs(Gs),"in-circ":Us,"out-circ":Hs(Us),"in-out-circ":qs(Us),"out-in-circ":Zs(Us),"in-back":Bs,"out-back":Hs(Bs),"in-out-back":qs(Bs),"out-in-back":Zs(Bs),"in-bounce":Vs,"out-bounce":Hs(Vs),"in-out-bounce":qs(Vs),"out-in-bounce":Zs(Vs),"in-elastic":js,"out-elastic":Hs(js),"in-out-elastic":qs(js),"out-in-elastic":Zs(js),spring:Ys,"spring-in":Ys,"spring-out":Hs(Ys),"spring-in-out":qs(Ys),"spring-out-in":Zs(Ys)},Qs=function(t){return Ks[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)]||Ks.linear},$s=function(t){return t},Js=1,tu=.5,eu=0;function nu(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var ru="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",iu=RegExp("cubic-bezier\\("+ru+","+ru+","+ru+","+ru+"\\)"),ou=/steps\(\s*(\d+)\s*\)/,au=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function su(t){var e=iu.exec(t);if(e)return Rs.apply(void 0,c([],u(e.slice(1).map(Number)),!1));var n=ou.exec(t);if(n)return nu(Number(n[1]),eu);var r=au.exec(t);return r?nu(Number(r[1]),{start:Js,middle:tu,end:eu}[r[2]]):Qs(t)}function uu(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 cu=0,lu=1,hu=2,pu=3;function fu(t,e,n){var r=function(t,e,n){if(null===e)return cu;var r=n.endTime;return Math.min(n.delay,r)>e?lu:Math.min(n.delay+t+n.endDelay,r)>e?pu:hu}(t,e,n),i=function(t,e,n,r,i){switch(r){case lu:return"backwards"===e||"both"===e?0:null;case pu:return n-i;case hu:return"forwards"===e||"both"===e?t:null;case cu: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!==lu&&(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!==hu||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===hu&&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 du(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(yu(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:su(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:mu(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.setAttribute(n.property,n.interpolation(i))}));else for(var n in r)yu(n)&&t.setAttribute(n,null)}}function yu(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var vu=function(t,e,n){return function(r){var i=gu(t,e,r);return!xa.enableCSSParsing&&se(i)?i:n(i)}};function mu(t,e,n,r){var i=Bi[t];if(i&&i.syntax&&i.int){var o=xa.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(xa.enableCSSParsing){var l=xa.styleValueRegistry.parseProperty(t,e,r),h=xa.styleValueRegistry.parseProperty(t,n,r);a=xa.styleValueRegistry.computeProperty(t,l,r),s=xa.styleValueRegistry.computeProperty(t,h,r)}else{var p=o.parserWithCSSDisabled;a=p?p(e,r):e,s=p?p(n,r):n}var f=o.mixer(a,s,r);if(f){var d=vu.apply(void 0,c([],u(f),!1));return function(t){return 0===t?e:1===t?n:d(t)}}}}return vu(!1,!0,(function(t){return t?n:e}))}function gu(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(gu(t[r>s?s:r-1],e[i>s?s:i-1],n));return a}throw Error("Mismatched interpolation arguments "+t+":"+e)}var xu=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=$s,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=su(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function bu(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($t(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(!$t(s)&&!$t(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 Eu="backwards|forwards|both|none".split("|"),Tu="reverse|alternate|alternate-reverse".split("|");function Su(t,e){var n=new xu;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===Eu.indexOf(t[e]))return;if("direction"===e&&-1===Tu.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Pu(t,e){return Su(t=Mu(null!=t?t:{duration:"auto"}),e)}function Mu(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var wu=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Pu(n,!1),this.timing.effect=this,this.timing.activeDuration=uu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=bu(e,this.timing),this.interpolations=du(this.normalizedKeyframes,this.timing,this.target);var i=xa.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=fu(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=bu(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 Nu(t,e){return Number(t.id)-Number(e.id)}var Cu=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(Nu),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 wu(t,e,n),i=new Ps(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(Nu),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}();xa.EasingFunction=su,xa.AnimationTimeline=Cu,t.AABB=Cn,t.AbstractRenderer=un,t.AbstractRendererPlugin=sn,t.AdvancedCamera=cs,t.Animation=Ps,t.AnimationEvent=Ts,t.AnimationTimeline=Cu,t.BUILT_IN_PROPERTIES=Gi,t.CSS=_a,t.CSSGradientValue=er,t.CSSKeywordValue=nr,t.CSSRGB=yr,t.CSSStyleValue=Jn,t.CSSUnitValue=lr,t.Camera=Xn,t.CameraEvent=Yn,t.Canvas=us,t.Circle=Fa,t.CircleUpdater=Uo,t.CustomElement=Ga,t.CustomElementRegistry=Za,t.CustomEvent=$o,t.DefaultSceneGraphSelector=aa,t.DefaultSceneGraphService=fa,t.DisplayObject=Da,t.Document=Ka,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=_n,t.Element=wa,t.Ellipse=Ua,t.EllipseUpdater=Bo,t.EventService=ea,t.EventTarget=Jo,t.FederatedEvent=qo,t.FederatedMouseEvent=Zo,t.FederatedPointerEvent=Ko,t.FederatedWheelEvent=Qo,t.Frustum=Ln,t.Group=Ba,t.HTML=Va,t.Image=ja,t.KeyframeEffect=wu,t.Line=Ya,t.LineUpdater=Vo,t.MutationEvent=sa,t.MutationObserver=vs,t.MutationRecord=ps,t.Node=ta,t.OffscreenCanvasCreator=na,t.Path=za,t.PathUpdater=jo,t.Plane=kn,t.Point=In,t.Polygon=Xa,t.Polyline=Wa,t.PolylineUpdater=Yo,t.RBush=an,t.Rect=Ha,t.RectUpdater=zo,t.Rectangle=Dn,t.Registration=ys,t.RenderingService=ia,t.Text=qa,t.TextService=ga,t.TextUpdater=Xo,t.compareAnimations=Nu,t.computeLinearGradient=function(t,e,n){var r=yn(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Ut([0,0],[a,s]),Ut([0,n],[a,s]),Ut([e,n],[a,s]),Ut([e,0],[a,s]));return o&&(o instanceof lr?u=o.value:o instanceof nr&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(Ut([0,0],[a,s]),Ut([0,n],[a,s]),Ut([e,n],[a,s]),Ut([e,0],[a,s]))))),{x:a,y:s,r:u}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle,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=yi(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=yi(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,S=void 0===T?0:T,P=E.height,M=void 0===P?0:P,w=E.x,N=void 0===w?0:w,C=E.y,k=void 0===C?0:C,A=E.radius,O=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"]]}(S,M,N,k,O&&A.map((function(t){return ae(t,0,Math.min(Math.abs(S)/2,Math.abs(M)/2))})));break;case t.Shape.PATH:r=c([],u(e.parsedStyle.path.absolutePath),!1)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=X(e[1]-o,e[2]-s,0);n&&et(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 a=X(e[1]-o,e[2]-s,0),u=X(e[3]-o,e[4]-s,0),c=X(e[5]-o,e[6]-s,0);n&&(et(a,a,n),et(u,u,n),et(c,c,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(u[0],",").concat(u[1],",").concat(c[0],",").concat(c[1])}else if("A"===e[0]){var l=X(e[6]-o,e[7]-s,0);n&&et(l,l,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(l[0],",").concat(l[1])}else"Q"===e[0]&&(a=X(e[1]-o,e[2]-s,0),u=X(e[3]-o,e[4]-s,0),n&&(et(a,a,n),et(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(r,e,n)},t.createVec3=dn,t.decompose=bn,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==u(t,2)[1]})))},t.deg2rad=yn,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=yo,t.fromRotationTranslationScale=xn,t.getAngle=fn,t.getEuler=gn,t.getOrCalculatePathTotalLength=ii,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=ho,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Ur,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Na,t.isFederatedEvent=Wo,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Gr,t.makeTiming=Su,t.mergeColors=Vr,t.normalizeKeyframes=bu,t.normalizeTimingInput=Pu,t.numericTimingToObject=Mu,t.parseColor=Br,t.parseLength=Yr,t.parsePath=gi,t.parseTransform=wi,t.parsedTransformToMat4=$i,t.propertyMetadataCache=Bi,t.rad2deg=vn,t.resetEntityCounter=function(){Ta=0},t.runtime=xa,t.setDOMSize=function(t,e,n){ho&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c=t[u+1],l=0===u&&(0!==r||0!==i),h=(u===t.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==o&&0!==a;switch(s[0]){case"M":return l?"M ".concat(s[1]-e+r,",").concat(s[2]-n+i," L ").concat(s[1]-e,",").concat(s[2]-n):"M ".concat(s[1]-e,",").concat(s[2]-n);case"L":return"L ".concat(s[1]-e+(h?o:0),",").concat(s[2]-n+(h?a:0));case"Q":return"Q ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n)+(h?" L ".concat(s[3]-e+o,",").concat(s[4]-n+a):"");case"C":return"C ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n,",").concat(s[5]-e," ").concat(s[6]-n)+(h?" L ".concat(s[5]-e+o,",").concat(s[6]-n+a):"");case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]-e," ").concat(s[7]-n)+(h?" L ".concat(s[6]-e+o,",").concat(s[7]-n+a):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=mn}));
|
|
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))}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,S=i*c-o*u,P=l*y-h*d,M=l*v-p*d,w=l*m-f*d,N=h*v-p*y,C=h*m-f*y,k=p*m-f*v,A=g*k-x*C+b*N+E*w-T*M+S*P;return A?(t[0]=(s*k-u*C+c*N)*(A=1/A),t[1]=(i*C-r*k-o*N)*A,t[2]=(y*S-v*T+m*E)*A,t[3]=(p*T-h*S-f*E)*A,t[4]=(u*w-a*k-c*M)*A,t[5]=(n*k-i*w+o*M)*A,t[6]=(v*b-d*S-m*x)*A,t[7]=(l*S-p*b+f*x)*A,t[8]=(a*C-s*w+c*P)*A,t[9]=(r*w-n*C-o*P)*A,t[10]=(d*T-y*b+m*g)*A,t[11]=(h*b-l*T-f*g)*A,t[12]=(s*M-a*N-u*P)*A,t[13]=(n*N-r*M+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 S(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 M(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function w(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 N(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 C(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,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 A(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function O(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 R(t,e){var n=new f(3);O(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 L(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],S=r[2],P=i[0],M=i[1],w=i[2],N=(1-(y+m))*E,C=(f+b)*E,k=(d-x)*E,A=(f-b)*T,O=(1-(p+m))*T,R=(v+g)*T,L=(d+x)*S,I=(v-g)*S,D=(1-(p+y))*S;return t[0]=N,t[1]=C,t[2]=k,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+P-(N*P+A*M+L*w),t[13]=n[1]+M-(C*P+O*M+I*w),t[14]=n[2]+w-(k*P+R*M+D*w),t[15]=1,t}function I(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 D(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 _(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 F=_;function G(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 U(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],S=n[1],P=n[2];return p>Math.abs(y-T)&&p>Math.abs(v-S)&&p>Math.abs(m-P)?x(t):(d=1/Math.hypot(l=y-T,h=v-S,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 B(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 V=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],S=e[4],P=e[5],M=e[6],w=e[7],N=e[8],C=e[9],k=e[10],A=e[11],O=e[12],R=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-S)>p*Math.max(1,Math.abs(a),Math.abs(S))||Math.abs(s-P)>p*Math.max(1,Math.abs(s),Math.abs(P))||Math.abs(u-M)>p*Math.max(1,Math.abs(u),Math.abs(M))||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-C)>p*Math.max(1,Math.abs(h),Math.abs(C))||Math.abs(f-k)>p*Math.max(1,Math.abs(f),Math.abs(k))||Math.abs(d-A)>p*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(y-O)>p*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(v-R)>p*Math.max(1,Math.abs(v),Math.abs(R))||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:I,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)),k(t,e,n),t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return 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)},fromRotationTranslation:k,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:L,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromTranslation:C,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:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},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:R,getScaling:O,getTranslation:A,identity:x,invert:E,lookAt:U,mul:S,multiply:S,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:F,orthoNO:_,orthoZO:G,perspective:D,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:D,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,S,P,M,w,N,C,k=r[0],A=r[1],O=r[2],R=Math.hypot(k,A,O);return p>R?null:(k*=R=1/R,A*=R,O*=R,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],S=k*A*(a=1-(o=Math.cos(n)))-O*i,P=A*A*a+o,M=O*A*a+k*i,w=k*O*a+A*i,N=A*O*a-k*i,C=O*O*a+o,t[0]=(s=e[0])*(b=k*k*a+o)+(h=e[4])*(E=A*k*a+O*i)+(v=e[8])*(T=O*k*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*S+h*P+v*M,t[5]=u*S+f*P+m*M,t[6]=c*S+d*P+g*M,t[7]=l*S+y*P+x*M,t[8]=s*w+h*N+v*C,t[9]=u*w+f*N+m*C,t[10]=c*w+d*N+g*C,t[11]=l*w+y*N+x*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:w,rotateY:N,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:M,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:B,subtract:B,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 j(){var t=new f(3);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Y(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 X(t,e,n){var r=new f(3);return r[0]=t,r[1]=e,r[2]=n,r}function H(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function W(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function q(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Z(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function K(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Q(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 $(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function J(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 tt(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 et(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 nt(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 rt=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},it=z;function ot(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function at(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 st(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ut(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 ct(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 lt(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 ht(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}j(),function(){var t=ot()}();var pt=function(t,e,n,r){var i=new f(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ft=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},dt=ct,yt=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};j(),X(1,0,0),X(0,1,0),st(),st(),d(),function(){var t,e=(t=new f(2),f!=Float32Array&&(t[0]=0,t[1]=0),t)}();var vt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function mt(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 gt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return gt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function bt(t){return xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Et(t){return bt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Tt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=gt[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,gt[n]))),gt[n]););}function St(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Pt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Mt(t){return t>=48&&57>=t}function wt(t){var e,n=t.max,r=t.pathValue,i=t.index,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)),Mt(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Mt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Mt(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;Mt(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Mt(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Mt(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function Nt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Ct(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=gt[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Nt(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?wt(t):St(t),t.err.length)return;t.data.push(t.param),Nt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Nt(t))}if(t.index>=t.max)break;if(!Pt(n.charCodeAt(t.index)))break}Tt(t)}else Tt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var kt=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function At(t){if(bt(t))return[].concat(t);var e=function(t){if(xt(t))return[].concat(t);var e=new kt(t);for(Nt(e);e.max>e.index&&!e.err.length;)Ct(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,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 Ot(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 Rt(t){if(Et(t))return[].concat(t);for(var e=At(t),n=r({},vt),i=0;e.length>i;i+=1){e[i]=Ot(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 Lt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function It(t,e,n,r,i,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),S=[];if(c)h=c[0],p=c[1],f=c[2],d=c[3];else{v=(l=Lt(y,v,-T)).y;var P=((y=l.x)-(x=(l=Lt(x,b,-T)).x))/2,M=(v-(b=l.y))/2,w=P*P/(m*m)+M*M/(g*g);w>1&&(m*=w=Math.sqrt(w),g*=w);var N=m*m,C=g*g,k=(o===a?-1:1)*Math.sqrt(Math.abs((N*C-N*M*M-C*P*P)/(N*M*M+C*P*P)));f=k*m*M/g+(y+x)/2,h=Math.asin(((v-(d=k*-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 O=p,R=x,L=b;S=It(x=f+m*Math.cos(p=h+E*(a&&p>h?1:-1)),b=d+g*Math.sin(p),m,g,i,0,a,R,L,[p,O,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*_],z=[x,b];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],c)return j.concat(Y,z,S);for(var X=[],H=0,W=(S=j.concat(Y,z,S)).length;W>H;H+=1)X[H]=H%2?Lt(S[H-1],S[H],T).y:Lt(S[H],S[H+1],T).x;return X}function Dt(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var _t=function(t,e,n,r){return c(c([],Dt([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ft(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(It(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=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(_t(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(_t(f,d,y,v))}return t}function Gt(t,e){if(void 0===e&&(e=!1),function(t){return Et(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var i,o,a=Rt(t),s=r({},vt),u=[],c="",l=a.length,h=[],p=0;l>p;p+=1){a[p]&&(c=a[p][0]),u[p]=c;var f=Ft(a[p],s);a[p]=f,mt(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 Ut(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Bt(t,e,n,r,i){var o=Ut([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=Dt([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 Vt(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 jt(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 Bt(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)),S=(o!==a?1:-1)*f(T=0>T?0:T),P=S*(y*b.y/v),M=S*(-v*b.x/y),w=p(m)*P-h(m)*M+(t+s)/2,N=h(m)*P+p(m)*M+(e+u)/2,C={x:(b.x-P)/y,y:(b.y-M)/v},k=Vt({x:1,y:0},C),A=Vt(C,{x:(-b.x-P)/y,y:(-b.y-M)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var O=k+(A%=2*d)*c,R=y*p(O),L=v*h(O);return{x:p(m)*R-h(m)*L+w,y:h(m)*R+p(m)*L+N}}function Yt(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],S=[x,b],P={x:0,y:0},M=[{x:x,y:b}];g&&0>=c&&(P={x:x,y:b});for(var w=0;m>=w;w+=1){if(x=(h=jt(t,e,n,r,i,o,a,s,u,w/m)).x,b=h.y,f&&M.push({x:x,y:b}),y&&(E+=Ut(S,[x,b])),S=[x,b],g&&E>=c&&c>T[2]){var N=(E-c)/(E-T[2]);P={x:S[0]*(1-N)+T[0]*N,y:S[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,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 zt(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 Xt(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],S={x:0,y:0},P=[{x:g,y:x}];m&&0>=u&&(S={x:g,y:x});for(var M=0;v>=M;M+=1){if(g=(l=zt(t,e,n,r,i,o,a,s,M/v)).x,x=l.y,p&&P.push({x:g,y:x}),d&&(b+=Ut(T,[g,x])),T=[g,x],m&&b>=u&&u>E[2]){var w=(b-u)/(b-E[2]);S={x:T[0]*(1-w)+E[0]*w,y:T[1]*(1-w)+E[1]*w}}E=[g,x,b]}return m&&u>=b&&(S={x:a,y:s}),{length:b,point:S,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function Ht(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 Wt(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 S=0;d>=S;S+=1){if(v=(u=Ht(t,e,n,r,i,o,S/d)).x,m=u.y,l&&T.push({x:v,y:m}),p&&(g+=Ut(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 qt(t,e,n){for(var r,i,o,a,s,u,c,l,h,p=Rt(t),f="number"==typeof e,d=[],y=0,v=0,m=0,g=0,x=[],b=[],E=0,T={x:0,y:0},S=T,P=T,M=T,w=0,N=0,C=p.length;C>N;N+=1)d=(c="M"===(l=(h=p[N])[0]))?d:[y,v].concat(h.slice(1)),c?(S=T={x:m=h[1],y:g=h[2]},E=0,f&&.001>e&&(M=T)):"L"===l?(E=(r=Bt(d[0],d[1],d[2],d[3],(e||0)-w)).length,T=r.min,S=r.max,P=r.point):"A"===l?(E=(i=Yt(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,S=i.max,P=i.point):"C"===l?(E=(o=Xt(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-w,n||{})).length,T=o.min,S=o.max,P=o.point):"Q"===l?(E=(a=Wt(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-w,n||{})).length,T=a.min,S=a.max,P=a.point):"Z"===l&&(E=(s=Bt((d=[y,v,m,g])[0],d[1],d[2],d[3],(e||0)-w)).length,T=s.min,S=s.max,P=s.point),f&&e>w&&w+E>=e&&(M=P),b.push(S),x.push(T),w+=E,y=(u="Z"!==l?h.slice(-2):[m,g])[0],v=u[1];return f&&e>=w&&(M={x:y,y:v}),{length:w,point:M,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}function Zt(t){return function(t){var e=0,n=0,r=0;return Gt(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 Kt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Xt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Dt(n,r,e),s=Dt(r,i,e),u=Dt(i,o,e),c=Dt(a,s,e),l=Dt(s,u,e),h=Dt(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Qt(t,e,n){var r=Kt(t),i=Kt(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:Qt(y[0],y[1],h)}var $t=function(t){return null==t},Jt={}.toString,te=function(t,e){return Jt.call(t)==="[object "+e+"]"},ee=function(t){return Array.isArray?Array.isArray(t):te(t,"Array")},ne=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},re=function(t){if(ee(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ie=function(t){if(ee(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},oe=function(t){return te(t,"String")},ae=function(t,e,n){return e>t?e:t>n?n:t},se=function(t){return te(t,"Number")},ue=1e-5;function ce(t,e,n){return void 0===n&&(n=ue),n>Math.abs(t-e)}var le=function(t,e){return(t%e+e)%e},he=function(t){return te(t,"Boolean")},pe=function(t){return void 0===t};function fe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function de(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ye(){}var ve=.7,me=1/ve,ge="\\s*([+-]?\\d+)\\s*",xe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",be="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ee=/^#([0-9a-f]{3,8})$/,Te=RegExp("^rgb\\("+[ge,ge,ge]+"\\)$"),Se=RegExp("^rgb\\("+[be,be,be]+"\\)$"),Pe=RegExp("^rgba\\("+[ge,ge,ge,xe]+"\\)$"),Me=RegExp("^rgba\\("+[be,be,be,xe]+"\\)$"),we=RegExp("^hsl\\("+[xe,be,be]+"\\)$"),Ne=RegExp("^hsla\\("+[xe,be,be,xe]+"\\)$"),Ce={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 ke(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Oe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ee.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Re(e):3===n?new Ie(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new Ie(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new Ie(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=Te.exec(t))?new Ie(e[1],e[2],e[3],1):(e=Se.exec(t))?new Ie(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Pe.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Me.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=we.exec(t))?Ge(e[1],e[2]/100,e[3]/100,1):(e=Ne.exec(t))?Ge(e[1],e[2]/100,e[3]/100,e[4]):Ce.hasOwnProperty(t)?Re(Ce[t]):"transparent"===t?new Ie(NaN,NaN,NaN,0):null}function Re(t){return new Ie(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,n,r){return r>0||(t=e=n=NaN),new Ie(t,e,n,r)}function Ie(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function De(){return"#"+Fe(this.r)+Fe(this.g)+Fe(this.b)}function _e(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Fe(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Ge(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Be(t,e,n,r)}function Ue(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof ye||(t=Oe(t)),!t)return new Be;if(t instanceof Be)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),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 Be(a,s,u,t.opacity)}function Be(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ve(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 je(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Ye(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 ze(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Xe(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function He(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=ze(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=Xe(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 We(t,e,n,r){return je(t,e,n,r)}function qe(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Ze(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 Ke(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(ce(s,0))ce(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;ce(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 Qe(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=Ke(t,n,i,a),h=Ke(e,r,o,s),p=0;l.length>p;p++)u.push(Ze(t,n,i,a,l[p]));for(p=0;h.length>p;p++)c.push(Ze(e,r,o,s,h[p]));return Ye(u,c)}function $e(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+=je(r[0],r[1],i[0],i[1])}return e}(t)}function Je(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function tn(t,e,n){var r=t+n-2*e;if(ce(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function en(t,e,n,r,i,o){var a=tn(t,n,i)[0],s=tn(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(Je(t,n,i,a)),void 0!==s&&c.push(Je(e,r,o,s)),Ye(u,c)}fe(ye,Oe,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ke,formatHex:ke,formatHsl:function(){return Ue(this).formatHsl()},formatRgb:Ae,toString:Ae}),fe(Ie,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof ye||(i=Oe(i)),i?new Ie((i=i.rgb()).r,i.g,i.b,i.opacity):new Ie):new Ie(t,e,n,null==r?1:r);var i}),de(ye,{brighter:function(t){return new Ie(this.r*(t=null==t?me:Math.pow(me,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Ie(this.r*(t=null==t?ve:Math.pow(ve,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:De,formatHex:De,formatRgb:_e,toString:_e})),fe(Be,(function(t,e,n,r){return 1===arguments.length?Ue(t):new Be(t,e,n,null==r?1:r)}),de(ye,{brighter:function(t){return new Be(this.h,this.s,this.l*(t=null==t?me:Math.pow(me,t)),this.opacity)},darker:function(t){return new Be(this.h,this.s,this.l*(t=null==t?ve:Math.pow(ve,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Ie(Ve(240>t?t+120:t-240,r,n),Ve(t,r,n),Ve(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var nn={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}()}(nn);var rn,on,an=nn.exports;t.Shape=void 0,(rn=t.Shape||(t.Shape={})).GROUP="g",rn.CIRCLE="circle",rn.ELLIPSE="ellipse",rn.IMAGE="image",rn.RECT="rect",rn.LINE="line",rn.POLYLINE="polyline",rn.POLYGON="polygon",rn.TEXT="text",rn.PATH="path",rn.HTML="html",rn.MESH="mesh",t.ClipSpaceNearZ=void 0,(on=t.ClipSpaceNearZ||(t.ClipSpaceNearZ={}))[on.ZERO=0]="ZERO",on[on.NEGATIVE_ONE=1]="NEGATIVE_ONE";var sn=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}(),un=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},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}();function cn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ln(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function hn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function pn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function fn(t){return void 0===t?0:t>360||-360>t?t%360:t}function dn(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Y(t):se(t)?X(t,e,n):X(t[0],t[1]||e,t[2]||n)}function yn(t){return t*(Math.PI/180)}function vn(t){return t*(180/Math.PI)}function mn(t){return 360*t}function gn(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=u(O(j(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return i>l?l>-i?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function xn(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 bn(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=vn(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var En=y(),Tn=y(),Sn=ot(),Pn=[j(),j(),j()],Mn=j();function wn(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Nn,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){cn(this.center,t),cn(this.halfExtents,e),ln(this.min,this.center,this.halfExtents),hn(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){hn(this.center,e,t),pn(this.center,this.center,.5),ln(this.halfExtents,e,t),pn(this.halfExtents,this.halfExtents,.5),cn(this.min,t),cn(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],S=b[2],P=m-E,M=m+E,w=g-T,N=g+T,C=x-S,k=x+S;l>P&&(l=P),M>h&&(h=M),p>w&&(p=w),N>f&&(f=N),d>C&&(d=C),k>y&&(y=k),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),S=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]+S*o[2],ln(this.min,n,r),hn(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,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?cn([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?cn([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}(),kn=function(){function t(t,e){this.distance=t||0,this.normal=e||X(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 $(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/it(this.normal);K(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&&tt(n,t,e,i),o},t}();t.Mask=void 0,(Nn=t.Mask||(t.Mask={}))[Nn.OUTSIDE=4294967295]="OUTSIDE",Nn[Nn.INSIDE=0]="INSIDE",Nn[Nn.INDETERMINATE=2147483647]="INDETERMINATE";var An,On,Rn,Ln=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new kn)}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];W(this.planes[0].normal,o-n,l-a,d-h),this.planes[0].distance=g-y,W(this.planes[1].normal,o+n,l+a,d+h),this.planes[1].distance=g+y,W(this.planes[2].normal,o+r,l+s,d+p),this.planes[2].distance=g+v,W(this.planes[3].normal,o-r,l-s,d-p),this.planes[3].distance=g-v,W(this.planes[4].normal,o-i,l-c,d-f),this.planes[4].distance=g-m,W(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}(),In=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}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}(),Dn=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.prototype.toJSON=function(){},t}(),_n="Method not implemented.",Fn="Use document.documentElement instead.";t.CameraType=void 0,(An=t.CameraType||(t.CameraType={}))[An.ORBITING=0]="ORBITING",An[An.EXPLORING=1]="EXPLORING",An[An.TRACKING=2]="TRACKING",t.CameraTrackingMode=void 0,(On=t.CameraTrackingMode||(t.CameraTrackingMode={}))[On.DEFAULT=0]="DEFAULT",On[On.ROTATIONAL=1]="ROTATIONAL",On[On.TRANSLATIONAL=2]="TRANSLATIONAL",On[On.CINEMATIC=3]="CINEMATIC",t.CameraProjectionMode=void 0,(Rn=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Rn.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Rn[Rn.PERSPECTIVE=1]="PERSPECTIVE";var Gn,Un,Bn,Vn,jn,Yn={UPDATED:"updated"},zn=2e-4,Xn=function(){function e(){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.eventEmitter=new h,this.matrix=y(),this.right=X(1,0,0),this.up=X(0,1,0),this.forward=X(0,0,1),this.position=X(0,0,1),this.focalPoint=X(0,0,0),this.distanceVector=X(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 Ln,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=C(y(),[t,e,0]);this.jitteredProjectionMatrix=S(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.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=X(a.x-r,a.y-i,0),u=$(s,this.right)/z(this.right),c=$(s,this.up)/z(this.up);return this.pan(-u,-c),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(yn(.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/(r-i),h=(n+e)/(n-e),p=(r+i)/(r-i);s?(u=-a/(a-o),c=-a*o/(a-o)):(u=-(a+o)/(a-o),c=-2*a*o/(a-o)),t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=h,t[9]=p,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+u,a,a-s,e,this.far,this.clipSpaceNearZ===t.ClipSpaceNearZ.ZERO),M(this.projectionMatrix,this.projectionMatrix,X(1,-1,1)),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?F(this.projectionMatrix,p,f,y,d,o,a):G(this.projectionMatrix,p,f,y,d,o,a),M(this.projectionMatrix,this.projectionMatrix,X(1,-1,1)),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=dn(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=X(0,1,0);if(this.focalPoint=dn(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=Z(j(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=z(o),s=vn(Math.asin(n/a)),u=90+vn(Math.atan2(r,e)),c=y();N(c,c,yn(u)),w(c,c,yn(s)),i=et(j(),[0,1,0],c)}return E(this.matrix,U(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,zn>this.distance&&(this.distance=zn),this.dollyingStep=this.distance/100;var e=j(),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=fn(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=fn(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=fn(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=ut(st(),[0,0,1],yn(this.roll));x(this.matrix);var n=ut(st(),[1,0,0],yn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=ut(st(),[0,1,0],yn((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=ct(st(),r,n);i=ct(st(),i,e);var o=I(y(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(P(this.matrix,this.matrix,this.focalPoint),S(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),S(this.matrix,this.matrix,o))},e.prototype._setPosition=function(t,e,n){this.position=dn(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(){H(this.right,dn(at(ot(),[1,0,0,0],this.matrix))),H(this.up,dn(at(ot(),[0,1,0,0],this.matrix))),H(this.forward,dn(at(ot(),[0,0,1,0],this.matrix))),Q(this.right,this.right),Q(this.up,this.up),Q(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=vn(Math.asin(n/i)),this.azimuth=vn(Math.atan2(-e,-r))):(this.elevation=-vn(Math.asin(n/i)),this.azimuth=-vn(Math.atan2(-e,-r)))},e.prototype._getPosition=function(){H(this.position,dn(at(ot(),[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)),q(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=Z(j(),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=ut(st(),[0,0,1],-this.roll*Math.PI/180);L(this.orthoMatrix,n,X((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),X(this.zoom,this.zoom,1),e)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=S(y(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Yn.UPDATED)}},e.prototype.rotate=function(t,e,n){throw Error(_n)},e.prototype.pan=function(t,e){throw Error(_n)},e.prototype.dolly=function(t){throw Error(_n)},e.prototype.createLandmark=function(t,e){throw Error(_n)},e.prototype.gotoLandmark=function(t,e){throw Error(_n)},e.prototype.cancelLandmarkAnimation=function(){throw Error(_n)},e}();function Hn(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(Hn.Cache||Map),n}Hn.Cache=Map,t.UnitType=void 0,(Gn=t.UnitType||(t.UnitType={}))[Gn.kUnknown=0]="kUnknown",Gn[Gn.kNumber=1]="kNumber",Gn[Gn.kPercentage=2]="kPercentage",Gn[Gn.kEms=3]="kEms",Gn[Gn.kPixels=4]="kPixels",Gn[Gn.kRems=5]="kRems",Gn[Gn.kDegrees=6]="kDegrees",Gn[Gn.kRadians=7]="kRadians",Gn[Gn.kGradians=8]="kGradians",Gn[Gn.kTurns=9]="kTurns",Gn[Gn.kMilliseconds=10]="kMilliseconds",Gn[Gn.kSeconds=11]="kSeconds",Gn[Gn.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"}(Un||(Un={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Bn||(Bn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Vn||(Vn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(jn||(jn={}));var Wn,qn=[{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"}(Wn||(Wn={}));var Zn,Kn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return qn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},Qn=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},$n=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""},Jn=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(Vn.kNo,jn.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=Wn.kUnitType&&this.getType()<=Wn.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 Wn.kColorType},e.prototype.to=function(t){return this},e}(Jn);t.GradientType=void 0,(Zn=t.GradientType||(t.GradientType={}))[Zn.Constant=0]="Constant",Zn[Zn.LinearGradient=1]="LinearGradient",Zn[Zn.RadialGradient=2]="RadialGradient";var er=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 Wn.kColorType},e}(Jn),nr=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 Wn.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Jn),rr=Hn((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),ir=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function or(t){return"function"==typeof t}var ar={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},sr=Hn((function(t){var e=rr(t),n=ar[e];return e=(null==n?void 0:n.alias)||e})),ur=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},cr=function(e){return function(e){switch(e){case Un.kUNumber:return t.UnitType.kNumber;case Un.kULength:return t.UnitType.kPixels;case Un.kUPercent:return t.UnitType.kPercentage;case Un.kUTime:return t.UnitType.kSeconds;case Un.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return Un.kUNumber;case t.UnitType.kPercentage:return Un.kUPercent;case t.UnitType.kPixels:return Un.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Un.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Un.kUAngle;default:return Un.kUOther}}(e))},lr=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?Kn(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 Wn.kUnitType},r.prototype.convertTo=function(e){if(this.unit===e)return new r(this.value,this.unit);var n=cr(this.unit);if(n!==cr(e)||n===t.UnitType.kUnknown)return null;var i=Qn(this.unit)/Qn(e);return new r(this.value*i,e)},r.prototype.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=$n(this.unit);if(-999999>o||o>999999){var s=$n(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?ur(o,s):o+(s||"")}else i="".concat(o).concat(a)}return r+=i},r}(Jn),hr=new lr(0,"px");new lr(1,"px");var pr,fr,dr=new lr(0,"deg"),yr=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),vr=new nr("unset"),mr=new nr("initial"),gr=new nr("inherit"),xr={"":vr,unset:vr,initial:mr,inherit:gr},br=function(t){return xr[t]||(xr[t]=new nr(t)),xr[t]},Er=new yr(0,0,0,0,!0),Tr=new yr(0,0,0,0),Sr=Hn((function(t,e,n,r){return new yr(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Pr=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new lr(e,n)},Mr=new lr(50,"%");t.Strategy=void 0,(pr=t.Strategy||(t.Strategy={}))[pr.Standard=0]="Standard",t.SortReason=void 0,(fr=t.SortReason||(t.SortReason={}))[fr.ADDED=0]="ADDED",fr[fr.REMOVED=1]="REMOVED",fr[fr.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED";var wr,Nr={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dn(0,0,0,0)};function Cr(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(","),")")}t.PropertySyntax=void 0,(wr=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",wr.COLOR="<color>",wr.PAINT="<paint>",wr.NUMBER="<number>",wr.ANGLE="<angle>",wr.OPACITY_VALUE="<opacity-value>",wr.SHADOW_BLUR="<shadow-blur>",wr.LENGTH="<length>",wr.PERCENTAGE="<percentage>",wr.LENGTH_PERCENTAGE="<length> | <percentage>",wr.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",wr.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",wr.LIST_OF_POINTS="<list-of-points>",wr.PATH="<path>",wr.FILTER="<filter>",wr.Z_INDEX="<z-index>",wr.OFFSET_DISTANCE="<offset-distance>",wr.DEFINED_PATH="<defined-path>",wr.MARKER="<marker>",wr.TRANSFORM="<transform>",wr.TRANSFORM_ORIGIN="<transform-origin>",wr.TEXT="<text>",wr.TEXT_TRANSFORM="<text-transform>";var kr=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 Ar=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Or=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Rr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Lr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Ir={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},Dr=Hn((function(t){return Pr("angular"===t.type?Number(t.value):Ir[t.value]||0,"deg")})),_r=Hn((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:Pr(e,r),cy:Pr(n,i)}})),Fr=Hn((function(e){var n;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return kr(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(!$t(u)&&!$t(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=i.map((function(t){return{offset:Pr(Number(t.length.value),"%"),color:Cr(t)}}));if("linear-gradient"===n)return new er(t.GradientType.LinearGradient,{angle:r?Dr(r):dr,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a=_r(r[0].at),s=a.cx,u=a.cy,c=void 0;if(r[0].style){var l=r[0].style,h=l.type,p=l.value;c="extent-keyword"===h?br(p):Pr(p,h)}return new er(t.GradientType.RadialGradient,{cx:s,cy:u,size:c,steps:o})}}));var r=e[0];if("("===e[1]||"("===e[2])if("l"===r){var i=Ar.exec(e);if(i){var o=(null===(n=i[2].match(Lr))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return[new er(t.GradientType.LinearGradient,{angle:Pr(parseFloat(i[1]),"deg"),steps:o.map((function(t){var e=u(t,2),n=e[1];return{offset:Pr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===r){var a=function(t){var e,n=Or.exec(t);if(n){var r=(null===(e=n[4].match(Lr))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Pr(50,"%"),cy:Pr(50,"%"),steps:r.map((function(t){var e=u(t,2),n=e[1];return{offset:Pr(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(a){if(!oe(a))return[new er(t.GradientType.RadialGradient,a)];e=a}}else if("p"===r)return function(t){var e=Rr.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 Gr(t){return t&&!!t.image}function Ur(t){return t&&!$t(t.r)&&!$t(t.g)&&!$t(t.b)}var Br=Hn((function(t){if(Gr(t))return r({repetition:"repeat"},t);if($t(t)&&(t=""),"transparent"===t)return Tr;"currentColor"===t&&(t="black");var e=Fr(t);if(e)return e;var n=Oe(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),Sr.apply(void 0,c([],u(i),!1))}));function Vr(t,e){if(Ur(t)&&Ur(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(ae(e[n],0,255));return e[3]=ae(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function jr(t,e){if($t(e))return Pr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Pr(Number(e),"px");if("deg".search(t)>=0)return Pr(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 Pr(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Yr=Hn((function(t){return jr(/px/g,t)}));Hn((function(t){return jr(RegExp("%","g"),t)}));var zr=function(t){return se(t)||isFinite(Number(t))?Pr(Number(t)||0,"px"):jr(RegExp("px|%|em|rem","g"),t)},Xr=Hn((function(t){return jr(/deg|rad|grad|turn/g,t)}));function Hr(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=cr(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=$n(t.unit)):(lr.isLength(t.unit)||lr.isLength(e.unit))&&(a=Kr(t,i,n),s=Kr(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Wr(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=vn(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=mn(Number(e.value))),n}function qr(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):oe(t)?n=t.split(" ").map((function(t){return Number(t)})):se(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Zr(t){return oe(t)?t.split(" ").map((function(t){return zr(t)})):t.map((function(t){return zr(""+t)}))}function Kr(e,n,r){if(0===e.value)return 0;if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var Qr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function $r(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,Qr.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return jr(/deg|rad|grad|turn|px|%/g,t)||Br(t)}))}),n.lastIndex===t.length)return r}return[]}function Jr(t){return""+t}var ti=Hn((function(t){return Pr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));function ei(t,e){return[t,e,Jr]}function ni(t,e){return function(n,r){return[n,r,function(n){return Jr(ae(n,t,e))}]}}function ri(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ii(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=qt(t.parsedStyle.path.absolutePath,void 0,r(r({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function oi(t,e){return t[0]===e[0]&&t[1]===e[1]}function ai(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)||ce(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 si(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Hn((function(t){return oe(t)?t.split(" ").map(ti):t.map(ti)}));var ui=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))))},ci=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=yn(r=le(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=ui({x:1,y:0},g),b=ui(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),S=n*Math.sin(E);return{x:Math.cos(u)*T-Math.sin(u)*S+m.x,y:Math.sin(u)*T+Math.cos(u)*S+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+b,ellipticalArcAngle:E,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function li(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=ci({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=ci({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 hi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function pi(t,e){return hi(t)*hi(e)?(t[0]*e[0]+t[1]*e[1])/(hi(t)*hi(e)):1}function fi(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(pi(t,e))}function di(t,e){var n=e[1],r=e[2],i=le(yn(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=fi([1,0],b),S=fi(b,E);return pi(b,E)>-1||(S=Math.PI),1>pi(b,E)||(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&0>S&&(S+=2*Math.PI),{cx:g,cy:x,rx:oi(t,[c,l])?0:n,ry:oi(t,[c,l])?0:r,startAngle:T,endAngle:T+S,xRotation:i,arcFlag:o,sweepFlag:a}}function yi(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 vi=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Rt(t)}catch(n){e=Rt(""),console.error("[g]: Invalid SVG Path definition: ".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&&oi([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=di(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]&&oi(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=si((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=si((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=li(l,0),x=g.x,b=g.y,E=li(l,1,!1),T=E.x,S=E.y;l.startTangent=[x,b],l.endTangent=[T,S]}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=en(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=Qe(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=y.arcParams;c=He(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=ie(n),p=ie(r),f=re(n),d=re(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-=ai(y,e).xExtra:a[0]===f&&(f+=ai(y,e).xExtra),a[1]===p?p-=ai(y,e).yExtra:a[1]===d&&(d+=ai(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}}},mi=Hn(vi);function gi(t){return oe(t)?mi(t):vi(t)}function xi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Gt(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Gt(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=Qt(r,i));var a,s,u,c,l,h,p,f,d=Zt(o[0])!==Zt(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+=Ut(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 bi(t,e){var n;n=oe(t)?t.split(" ").map((function(t){var e=u(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=$e(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=We(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var l=Math.min.apply(Math,c([],u(n.map((function(t){return t[0]}))),!1)),h=Math.min.apply(Math,c([],u(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=l,e.parsedStyle.defY=h),{points:n,totalLength:s,segments:o}}function Ei(t,e){return[t.points,e.points,function(t){return t}]}var Ti=null;function Si(t){return function(e){var n=0;return t.map((function(t){return t===Ti?e[n++]:t}))}}function Pi(t){return t}var Mi={matrix:["NNNNNN",[Ti,Ti,0,0,Ti,Ti,0,0,0,0,1,0,Ti,Ti,0,1],Pi],matrix3d:["NNNNNNNNNNNNNNNN",Pi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Si([Ti,Ti,new lr(1)]),Pi],scalex:["N",Si([Ti,new lr(1),new lr(1)]),Si([Ti,new lr(1)])],scaley:["N",Si([new lr(1),Ti,new lr(1)]),Si([new lr(1),Ti])],scalez:["N",Si([new lr(1),new lr(1),Ti])],scale3d:["NNN",Pi],skew:["Aa",null,Pi],skewx:["A",null,Si([Ti,dr])],skewy:["A",null,Si([dr,Ti])],translate:["Tt",Si([Ti,Ti,hr]),Pi],translatex:["T",Si([Ti,hr,hr]),Si([Ti,hr])],translatey:["T",Si([hr,Ti,hr]),Si([hr,Ti])],translatez:["L",Si([hr,hr,Ti])],translate3d:["TTL",Pi]};function wi(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Mi[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],p=u[l],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?dr:Xr(t)},N:ti,T:zr,L:Yr}[p.toUpperCase()](h):{a:dr,n:c[0],t:hr}[p]))return[];c.push(f)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Ni(t){var e,n,r,i;switch(t.t){case"rotatex":return i=yn(Wr(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=yn(Wr(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=yn(Wr(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=yn(Wr(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=yn(Wr(t.d[0])),h=yn(Wr(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=yn(Wr(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=yn(Wr(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=Kr(t.d[0],0,null)||0,n=Kr(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Kr(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=Kr(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=Kr(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Kr(t.d[0],0,null)||0,n=Kr(t.d[1],0,null)||0,r=Kr(t.d[2],0,null)||0,1];case"perspective":var p=Kr(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 Ci(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 ki(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}(En,t))return!1;if(m(Tn,En),Tn[3]=0,Tn[7]=0,Tn[11]=0,Tn[15]=1,1e-8>Math.abs(T(Tn)))return!1;var a,s,u=En[3],c=En[7],l=En[11],h=En[12],p=En[13],f=En[14],d=En[15];if(0!==u||0!==c||0!==l){if(Sn[0]=u,Sn[1]=c,Sn[2]=l,Sn[3]=d,!E(Tn,Tn))return!1;b(Tn,Tn),at(i,Sn,Tn)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=p,e[2]=f,(a=Pn)[0][0]=(s=En)[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(Pn[0]),Q(Pn[0],Pn[0]),r[0]=$(Pn[0],Pn[1]),wn(Pn[1],Pn[1],Pn[0],1,-r[0]),n[1]=z(Pn[1]),Q(Pn[1],Pn[1]),r[0]/=n[1],r[1]=$(Pn[0],Pn[2]),wn(Pn[2],Pn[2],Pn[0],1,-r[1]),r[2]=$(Pn[1],Pn[2]),wn(Pn[2],Pn[2],Pn[1],1,-r[2]),n[2]=z(Pn[2]),Q(Pn[2],Pn[2]),r[1]/=n[2],r[2]/=n[2],J(Mn,Pn[1],Pn[2]),0>$(Pn[0],Mn))for(var y=0;3>y;y++)n[y]*=-1,Pn[y][0]*=-1,Pn[y][1]*=-1,Pn[y][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Pn[0][0]-Pn[1][1]-Pn[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Pn[0][0]+Pn[1][1]-Pn[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Pn[0][0]-Pn[1][1]+Pn[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Pn[0][0]+Pn[1][1]+Pn[2][2],0)),Pn[2][1]>Pn[1][2]&&(o[0]=-o[0]),Pn[0][2]>Pn[2][0]&&(o[1]=-o[1]),Pn[1][0]>Pn[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(Ni).reduce(Ci)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Ai=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 Oi(t){return t.toFixed(6).replace(".000000","")}function Ri(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ki(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=ki(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=ae(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 Ai(t[0],t[1],t[2],e,t[4]).map(Oi).join(",")}])}function Li(t){return t.replace(/[xy]/,"")}function Ii(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Di(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?Pr(a):Pr(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length)u=[(g=Ri(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=Mi[h],v=Mi[p],m=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var g=Ri([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]&&Li(h)===Li(p))m=Li(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||Ii(h)!==Ii(p)){u=[(g=Ri(t,e))[0]],c=[g[1]],l=[["matrix",[g[2]]]];break}m=Ii(h),f=y[1](f),d=v[1](d)}for(var x=[],b=[],E=[],T=0;f.length>T;T++){g=Hr(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 S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var _i=Hn((function(t){if(oe(t)){if("text-anchor"===t)return[Pr(0,"px"),Pr(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:[zr(Fi(e[0])),zr(Fi(e[1]))]}return[Pr(t[0]||0,"px"),Pr(t[1]||0,"px")]}));function Fi(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Gi=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cz",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],Ui=Gi.filter((function(t){return!!t.l})).map((function(t){return t.n})),Bi={},Vi=new WeakMap,ji=function(){function e(t){var e=this;this.runtime=t,Gi.forEach((function(t){e.registerMetadata(t)}))}return e.prototype.registerMetadata=function(t){c([t.n],u(t.a||[]),!1).forEach((function(e){Bi[e]=t}))},e.prototype.unregisterMetadata=function(t){delete Bi[t]},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(e,n,i){var o=this;if(void 0===i&&(i={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(e.attributes,n);var a=Object.keys(n),s=e.parsedStyle.clipPath,u=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var c=!!i.forceUpdateGeometry;if(!c)for(var l=0;Ui.length>l;l++)if(Ui[l]in n){c=!0;break}return n.fill&&(e.parsedStyle.fill=Br(n.fill)),n.stroke&&(e.parsedStyle.stroke=Br(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Br(n.shadowColor)),n.filter&&(e.parsedStyle.filter=$r(n.filter)),$t(n.radius)||(e.parsedStyle.radius=qr(n.radius,4)),$t(n.lineDash)||(e.parsedStyle.lineDash=qr(n.lineDash,2)),n.points&&(e.parsedStyle.points=bi(n.points,e)),""===n.path&&(e.parsedStyle.path=r({},Nr)),n.path&&(e.parsedStyle.path=gi(n.path),e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y),n.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",s,n.clipPath,e,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",u,n.offsetPath,e,this.runtime),n.anchor&&(e.parsedStyle.anchor=qr(n.anchor,2)),n.transform&&(e.parsedStyle.transform=wi(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=_i(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||$t(n.cx)&&$t(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||$t(n.x)&&$t(n.y)&&$t(n.z))&&(e.nodeName!==t.Shape.LINE||$t(n.x1)&&$t(n.y1)&&$t(n.z1)&&$t(n.x2)&&$t(n.y2)&&$t(n.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,a),$t(n.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,a),n.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(e,a),n.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,a),$t(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,a),n.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,a),void(c&&this.updateGeometry(e))}var h=i.skipUpdateAttribute,p=i.skipParse,f=i.usedAttributes,d=i.forceUpdateGeometry,y=Object.keys(n);y.forEach((function(t){var r;h||(e.attributes[t]=n[t]),!d&&(null===(r=Bi[t])||void 0===r?void 0:r.l)&&(d=!0)})),p||y.forEach((function(t){e.computedStyle[t]=o.parseProperty(t,e.attributes[t],e)})),(null==f?void 0:f.length)&&(y=Array.from(new Set(y.concat(f)))),y.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=o.computeProperty(t,e.computedStyle[t],e))})),d&&this.updateGeometry(e),y.forEach((function(t){t in e.parsedStyle&&o.postProcessProperty(t,e,y)})),this.runtime.enableCSSParsing&&e.children.length&&y.forEach((function(t){t in e.parsedStyle&&o.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},e.prototype.parseProperty=function(t,e,n){var r=Bi[t],i=e;if((""===e||$t(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=br(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=br(e):s&&s.parser&&(i=s.parser(e,n))}return i},e.prototype.computeProperty=function(t,e,n){var r=Bi[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof nr){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)$t(a)||(e=this.parseProperty(t,or(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return $t(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this.runtime);else i=e instanceof nr?e.value:e}return i},e.prototype.postProcessProperty=function(t,e,n){var r=Bi[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},e.prototype.addUnresolveProperty=function(t,e){var n=Vi.get(t);n||(Vi.set(t,[]),n=Vi.get(t)),-1===n.indexOf(e)&&n.push(e)},e.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Vi.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},e.prototype.recalc=function(t){var e=Vi.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Vi.delete(t)}},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.width,u=a.height,c=a.depth,l=void 0===c?0:c,h=a.offsetX,p=void 0===h?0:h,f=a.offsetY,d=void 0===f?0:f,y=a.offsetZ,v=void 0===y?0:y,m=[Math.abs(s)/2,Math.abs(u)/2,l/2],g=o.stroke,x=o.lineWidth,b=o.increasedLineWidthForHitTesting,E=o.shadowType,T=o.shadowColor,S=o.filter,P=void 0===S?[]:S,M=o.transformOrigin,w=o.anchor;n===t.Shape.TEXT?delete o.anchor:n===t.Shape.MESH&&(o.anchor[2]=.5);var N=[(1-2*(w&&w[0]||0))*s/2+p,(1-2*(w&&w[1]||0))*u/2+d,(1-2*(w&&w[2]||0))*m[2]+v];if(i.contentBounds.update(N,m),g&&!g.isNone){var C=((x||0)+(b||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);m[0]+=C,m[1]+=C}if(i.renderBounds.update(N,m),T&&E&&"inner"!==E){var k=i.renderBounds,A=k.min,O=k.max,R=o.shadowBlur||0,L=o.shadowOffsetX||0,I=o.shadowOffsetY||0,D=O[0]+R+L,_=A[1]-R+I,F=O[1]+R+I;A[0]=Math.min(A[0],A[0]-R+L),O[0]=Math.max(O[0],D),A[1]=Math.min(A[1],_),O[1]=Math.max(O[1],F),i.renderBounds.setMinMax(A,O)}P.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,hn(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)}})),w=o.anchor;var G=0>s,U=0>u,B=(G?-1:1)*(M?Kr(M[0],0,e):0),V=(U?-1:1)*(M?Kr(M[1],1,e):0);e.setOrigin(B-=(G?-1:1)*(w&&w[0]||0)*i.contentBounds.halfExtents[0]*2,V-=(U?-1:1)*(w&&w[1]||0)*i.contentBounds.halfExtents[1]*2),this.runtime.sceneGraphService.dirtifyToRoot(e)}},e.prototype.isPropertyInheritable=function(t){var e=Bi[t];return!!e&&e.inh},e}(),Yi=function(){function t(){this.parser=Xr,this.parserWithCSSDisabled=null,this.mixer=ei}return t.prototype.calculator=function(t,e,n,r){return Wr(n)},t}(),zi=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof nr&&(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}(),Xi=function(){function t(){this.parser=Br,this.parserWithCSSDisabled=Br,this.mixer=Vr}return t.prototype.calculator=function(t,e,n,r){return n instanceof nr?"none"===n.value?Er:Tr:n},t}(),Hi=function(){function t(){this.parser=$r}return t.prototype.calculator=function(t,e,n){return n instanceof nr?[]:n},t}();function Wi(t){var e=t.parsedStyle.fontSize;return $t(e)?null:e}var qi=function(){function e(){this.parser=zr,this.parserWithCSSDisabled=null,this.mixer=ei}return e.prototype.calculator=function(e,n,r,i,o){var a;if(se(r))return r;if(!lr.isRelativeUnit(r.unit))return r.value;var s=o.styleValueRegistry;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){if(u=Wi(i.parentNode))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){if(null===(a=null==i?void 0:i.ownerDocument)||void 0===a?void 0:a.documentElement){var u;if(u=Wi(i.ownerDocument.documentElement))return u*=r.value;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}},e}(),Zi=function(){function t(){this.mixer=ri}return t.prototype.parser=function(t){var e=Zr(se(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Ki=function(){function t(){this.mixer=ri}return t.prototype.parser=function(t){var e=Zr(se(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Qi=y();function $i(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(a[0],1,1)}else if("scaley"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,a[0],1)}else if("scalez"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,a[0])}else if("scale3d"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(a[0],a[1],a[2])}else if("translate"===i){e.translateLocal((s=o||[hr,hr])[0].value,s[1].value,0)}else if("translatex"===i){e.translateLocal((s=o||[hr])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(s=o||[hr])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(s=o||[hr])[0].value)}else if("translate3d"===i){var s;e.translateLocal((s=o||[hr,hr,hr])[0].value,s[1].value,s[2].value)}else if("rotate"===i){e.rotateLocal(0,0,Wr((o||[dr])[0]))}else if("rotatex"===i){e.rotateLocal(Wr((o||[dr])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,Wr((o||[dr])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,Wr((o||[dr])[0]))}else if("rotate3d"===i);else if("skew"===i){var l=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(yn(l[0]),yn(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(yn(l[0]),e.getLocalSkew()[1])}else if("skewy"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],yn(l[0]))}else if("matrix"===i){var h=u(o.map((function(t){return t.value})),6);e.setLocalTransform(g(Qi,h[0],h[1],0,0,h[2],h[3],0,0,0,0,1,0,h[4]+n,h[5]+r,0,1))}else"matrix3d"===i&&(g.apply(V,c([Qi],u(o.map((function(t){return t.value}))),!1)),Qi[12]+=n,Qi[13]+=r,e.setLocalTransform(Qi))})),e.getLocalTransform()}var Ji=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.postProcessor=function(e,n){var r,i,o;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var a=e.parsedStyle,s=a.cx,c=a.cy,l=a.cz;$t(s)||(r=s),$t(c)||(i=c),$t(l)||(o=l);break;case t.Shape.LINE:var h=e.parsedStyle,p=h.y1,f=h.y2;r=Math.min(h.x1,h.x2),i=Math.min(p,f),o=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:$t(e.parsedStyle.x)||(r=e.parsedStyle.x),$t(e.parsedStyle.y)||(i=e.parsedStyle.y),$t(e.parsedStyle.z)||(o=e.parsedStyle.z)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!$t(r)||!$t(i)||!$t(o))&&-1===n.indexOf("transform")){var d=e.parsedStyle.transform;if(d&&d.length)$i(d,e);else{var y=u(e.getLocalPosition(),3),v=y[0],m=y[1],g=y[2];e.setLocalPosition($t(r)?v:r,$t(i)?m:i,$t(o)?g:o)}}},r}(qi),to=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof nr&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),eo=function(){function t(){this.mixer=ei,this.parser=ti,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),no=function(){function e(){this.parser=ti,this.parserWithCSSDisabled=null,this.mixer=ni(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.parsedStyle.defX=o.x,e.parsedStyle.defY=o.y,e.setLocalPosition(o.x,o.y))}}},e}(),ro=function(){function t(){this.parser=ti,this.parserWithCSSDisabled=null,this.mixer=ni(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),io=function(){function e(){this.parser=gi,this.parserWithCSSDisabled=gi,this.mixer=xi}return e.prototype.calculator=function(t,e,n){return n instanceof nr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dn(0,0,0,0)}:n},e.prototype.postProcessor=function(e,n){if(e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y,e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,o=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===o?0:o)}},e}(),oo=function(){function e(){this.parser=bi,this.mixer=Ei}return e.prototype.postProcessor=function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}},e}(),ao=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=ni(0,1/0),e}return n(e,t),e}(qi),so=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof nr?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),uo=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}(),co={},lo=0;var ho="undefined"!=typeof window&&void 0!==window.document;function po(t){return!!t.getAttribute}function fo(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function yo(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 vo(t,e){if(ho)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var mo={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},go="object"==typeof performance&&performance.now?performance:Date;var xo=1,bo="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Eo=Date.now(),To={},So=Date.now(),Po=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-So,r=n>16?0:16-n,i=xo++;return To[i]=t,Object.keys(To).length>1||setTimeout((function(){So=e;var t=To;To={},Object.keys(t).forEach((function(e){return t[e](bo.performance&&"function"==typeof bo.performance.now?bo.performance.now():Date.now()-Eo)}))}),r),i},Mo=function(t){delete To[t]},wo=function(t){return"string"!=typeof t?Po:""===t?bo.requestAnimationFrame:bo[t+"RequestAnimationFrame"]},No=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!!wo(t)})),Co=wo(No),ko=function(t){return"string"!=typeof t?Mo:""===t?bo.cancelAnimationFrame:bo[t+"CancelAnimationFrame"]||bo[t+"CancelRequestAnimationFrame"]}(No);bo.requestAnimationFrame=Co,bo.cancelAnimationFrame=ko;var Ao=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}(),Oo=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}(),Ro=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}(),Lo=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}(),Io=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Do=/([\"\'])[^\'\"]+\1/;var _o=function(){function t(){this.parser=wi,this.parserWithCSSDisabled=wi,this.mixer=Di}return t.prototype.calculator=function(t,e,n,r){return n instanceof nr?[]:n},t.prototype.postProcessor=function(t){$i(t.parsedStyle.transform,t)},t}(),Fo=function(){this.parser=_i},Go=function(){function e(){this.parser=ti}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}(),Uo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Bo=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Vo=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),jo=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Yo=function(){function t(){}return t.prototype.update=function(t){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));return{width:r-n,height:Math.max.apply(Math,c([],u(e.map((function(t){return t[1]}))),!1))-i}},t}(),zo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!oe(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),Xo=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!$t(t.lineWidth)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var l=((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,h=this.globalRuntime.textService.measureText(i,t,l);t.metrics=h;var p=[h.width/2,h.height/2,0],f=[0,1],d=0;"center"===o||"middle"===o?(d=a/2,f=[.5,1]):"right"!==o&&"end"!==o||(d=a,f=[1,1]);var y=0;return"middle"===s?y=p[1]:"top"===s||"hanging"===s?y=2*p[1]:"alphabetic"===s?y=this.globalRuntime.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(y=0),u&&(d+=u),c&&(y+=c),t.anchor=[f[0],f[1],0],{width:2*p[0],height:2*p[1],offsetX:d,offsetY:y}},t}();function Ho(t){return!!t.type}var Wo,qo=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 In,this.page=new In,this.canvas=new In,this.viewport=new In,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(_n)},t}(),Zo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new In,e.movement=new In,e.offset=new In,e.global=new In,e.screen=new In,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(_n)},e}(qo),Ko=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||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}(Zo),Qo=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}(Zo),$o=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}(qo),Jo=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=he(n)&&n||ne(n)&&n.capture,i=ne(n)&&n.once,o=or(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var l=u(t.split(":"),2);t=l[1],s=l[0],a=!0}if(t=r?"".concat(t,"capture"):t,e=or(e)?e:e.handleEvent,a){var h=e;e=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&h.apply(void 0,c([],u(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=he(n)&&n||ne(n)&&n.capture,i=or(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=or(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new $o(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!Ho(t))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),ta=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||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(_n)},r.prototype.lookupNamespaceURI=function(t){throw Error(_n)},r.prototype.lookupPrefix=function(t){throw Error(_n)},r.prototype.normalize=function(){throw Error(_n)},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,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.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}(Jo),ea=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new h,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=y(),this.tmpVec3=j(),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=go.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")}ta.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&&200>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"),ta.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&&ta.isNode(o)&&o.parentNode;c&&c!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(ta.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!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),r&&n.notifyTarget(l,"mouseenter"),ta.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!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),ta.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!==(ta.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),ta.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"),ta.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.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new In(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new In(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},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=S(this.tmpMatrix,u,s),l=W(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return et(l,l,c),new In(l[0],l[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=S(this.tmpMatrix,n,r),o=W(this.tmpVec3,t.x,t.y,0);et(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new In((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},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++)ta.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){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},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.globalRuntime.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(Ko);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i);return i.target=null!=n?n:o||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(Qo);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},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(Qo);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(Ko);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=go.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||ta.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=po(e)&&e.getAttribute("cursor");if(n)return n;e=ta.isNode(e)&&e.parentNode}},t}(),na=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||xa.offscreenCanvas)this.canvas=t||xa.offscreenCanvas,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();t.RenderReason=void 0,(Wo=t.RenderReason||(t.RenderReason={}))[Wo.CAMERA_CHANGED=0]="CAMERA_CHANGED",Wo[Wo.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Wo[Wo.NONE=2]="NONE";var ra,ia=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 Ro,initAsync:new Ao,dirtycheck:new Lo,cull:new Lo,beginFrame:new Ro,beforeRender:new Ro,render:new Ro,afterRender:new Ro,endFrame:new Ro,destroy:new Ro,pick:new Oo,pickSync:new Lo,pointerDown:new Ro,pointerUp:new Ro,pointerMove:new Ro,pointerOut:new Ro,pointerOver:new Ro,pointerWheel:new Ro,pointerCancel:new Ro,click:new Ro}}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){var r=this;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 o=1===i.renderReasons.size&&i.renderReasons.has(t.RenderReason.CAMERA_CHANGED),a=!e.disableRenderHooks||!(e.disableRenderHooks&&o);a&&this.renderDisplayObject(i.root,e,i),this.hooks.beginFrame.call(),a&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}},e.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable;c.dirty&&(this.sort(t,c),c.dirty=!1,c.dirtyChildren=[],c.dirtyReason=void 0),(c.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>fo(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(fo)},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}(),oa=/\[\s*(.*)=(.*)\s*\]/,aa=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(oa),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 $t(n)?"":n.toString?""+n:""},t}(),sa=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}(qo);function ua(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}t.ElementEvent=void 0,(ra=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",ra.DESTROY="destroy",ra.ATTR_MODIFIED="DOMAttrModified",ra.INSERTED="DOMNodeInserted",ra.REMOVED="removed",ra.MOUNTED="DOMNodeInsertedIntoDocument",ra.UNMOUNTED="DOMNodeRemovedFromDocument",ra.BOUNDS_CHANGED="bounds-changed",ra.CULLED="culled";var ca,la,ha,pa=new sa(t.ElementEvent.REPARENT,null,"","","",0,"",""),fa=function(){function e(e){var n,r,i,o,a,s,u,c,l=this;this.runtime=e,this.pendingEvents=[],this.boundsChangedEvent=new $o(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=st(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=X(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=st();ht(a,e[0],e[1],e[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);ft(n,u),lt(n,n),ct(a,n,a),ct(o.localRotation,a,s),yt(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,e)}),this.rotateLocal=(r=st(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=X(e,n,i));var o=t.transformable;ht(r,e[0],e[1],e[2]),dt(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}),this.setEulerAngles=(i=st(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=X(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ht(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);ft(i,lt(st(),a)),dt(o.localRotation,o.localRotation,i),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=X(e,n,r));var i=t.transformable;nt(e,j())||(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),q(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(o=y(),a=j(),function(t,e){var n=t.transformable;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,nt(l.getPosition(t),a)||(H(n.position,a),null!==t.parentNode&&t.parentNode.transformable?(m(o,t.parentNode.transformable.worldTransform),E(o,o),et(n.localPosition,a,o)):H(n.localPosition,a),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=j();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,nt(r.localPosition,t)||(H(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(s=j(),u=j(),c=j(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=W(u,e,n,r)),nt(e,s)||(q(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=st();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=pt(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);ft(t,s),lt(t,t),ct(a.localRotation,t,n),yt(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=y(),e=j(),n=pt(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(L(r.localTransform,r.localRotation,r.localPosition,X(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=x(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),S(r.localTransform,r.localTransform,i)}var o=L(t,n,e,r.localScale,r.origin);S(r.localTransform,r.localTransform,o)}else L(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}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,a=!1;e.parentNode&&(a=e.parentNode!==n,this.detach(e)),e.parentNode=n,$t(r)?e.parentNode.childNodes.push(e):e.parentNode.childNodes.splice(r,0,e);var s=n.sortable;((null===(i=null==s?void 0:s.sorted)||void 0===i?void 0:i.length)||(null===(o=e.style)||void 0===o?void 0:o.zIndex))&&(-1===s.dirtyChildren.indexOf(e)&&s.dirtyChildren.push(e),s.dirty=!0,s.dirtyReason=t.SortReason.ADDED);var u=e.transformable;u&&this.dirtifyWorld(e,u),u.frozen&&this.unfreezeParentToRoot(e),a&&e.dispatchEvent(pa)},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.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.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=X(e,n,r));var i=t.transformable;ht(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},e.prototype.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=X(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},e.prototype.setLocalScale=function(t,e){var n=t.transformable,r=X(e[0],e[1],e[2]||n.localScale[2]);nt(r,n.localScale)||(H(n.localScale,r),this.dirtifyLocal(t,n))},e.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=pt(e,n,r,i));var o=t.transformable;ft(o.localRotation,e),this.dirtifyLocal(t,o)},e.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new f(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)},e.prototype.dirtifyLocal=function(t,e){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.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=u(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},e.prototype.clearPendingEvents=function(){this.pendingEvents=[]},e.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)ua(n),n=n.parentNode;e&&t.forEach((function(t){ua(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren: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 sa(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,sa.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},e.prototype.getPosition=function(t){var e=t.transformable;return A(e.position,this.getWorldTransform(t,e))},e.prototype.getRotation=function(t){var e=t.transformable;return R(e.rotation,this.getWorldTransform(t,e))},e.prototype.getScale=function(t){var e=t.transformable;return O(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.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=A(j(),e),r=R(st(),e),i=O(j(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},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(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))})),e){var a=yo(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Cn),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},e.prototype.getLocalBounds=function(t){if(t.parentNode){var e=y();t.parentNode.transformable&&(e=E(y(),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 Dn(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),l[0]-s,l[1]-c)}return new Dn((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?S(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}(),da={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]},ya=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,va=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),ma=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ga=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!ma.exec(n)&&!va.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=da.MetricsString+da.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(da.BaselineSymbol).width),u=da.HeightMultiplier*s;s=s*da.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=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,c=e.letterSpacing,l=e.textPath,h=e.leading,p=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=se(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var c=s[u].trim();!Do.test(c)&&0>Io.indexOf(c)&&(c='"'.concat(c,'"')),s[u]=c}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),d=this.measureFont(f,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var y=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);y.font=f,e.isOverflowing=!1;var v=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=Array(v.length),g=0;if(!l){for(S=0;v.length>S;S++){var x=y.measureText(v[S]).width+(v[S].length-1)*c;m[S]=x,g=Math.max(g,x)}P=g+a;var b=o||d.fontSize+a,E=Math.max(b,d.fontSize+a)+(v.length-1)*(b+p),T=0;return"middle"===s?T=-E/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?T=-E:"top"!==s&&"hanging"!==s||(T=0),{font:f,width:P,height:E,lines:v,lineWidths:m,lineHeight:b+=p,maxLineWidth:g,fontProperties:d,lineMetrics:m.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Dn(n-a/2,T+e*b,t+a,b)}))}}l.getTotalLength();for(var S=0;v.length>S;S++)var P=y.measureText(v[S]).width+(v[S].length-1)*c},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=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),h=o+a,p="";"ellipsis"===c?p="...":c&&"clip"!==c&&(p=c);for(var f=[],d=0,y=0,v={},m=function(t){return r.getFromCache(t,a,v,l)},g=Array.from(p).reduce((function(t,e){return t+m(e)}),0),x=Array.from(t),b=0;x.length>b;b++){var E=x[b],T=t[b-1],S=t[b+1],P=m(E);if(this.isNewline(E)){if(++d>=u){e.isOverflowing=!0;break}y=0,f[d]=""}else{if(y>0&&y+P>h){if(d+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var M=f[d].length,w=0,N=M,C=0;M>C;C++){var k=m(f[d][C]);if(w+k+g>h){N=C;break}w+=k}f[d]=(f[d]||"").slice(0,N)+p}break}if(y=0,f[++d]="",this.isBreakingSpace(E))continue;this.canBreakInLastChar(E)||(f=this.trimToBreakable(f),y=this.sumTextWidthByCache(f[d]||"",v)),this.shouldBreakByKinsokuShorui(E,S)&&(f=this.trimByKinsokuShorui(f),y+=m(T||""))}y+=P,f[d]=(f[d]||"")+E}}return f.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&da.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&da.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||!ya.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(!ya.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}(),xa={},ba=(la=new zo,ha=new Yo,(ca={})[t.Shape.CIRCLE]=new Uo,ca[t.Shape.ELLIPSE]=new Bo,ca[t.Shape.RECT]=la,ca[t.Shape.IMAGE]=la,ca[t.Shape.GROUP]=la,ca[t.Shape.LINE]=new Vo,ca[t.Shape.TEXT]=new Xo(xa),ca[t.Shape.POLYLINE]=ha,ca[t.Shape.POLYGON]=ha,ca[t.Shape.PATH]=new jo,ca[t.Shape.HTML]=null,ca[t.Shape.MESH]=null,ca),Ea=function(){var e,n=new Xi,r=new qi;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new eo,e[t.PropertySyntax.ANGLE]=new Yi,e[t.PropertySyntax.DEFINED_PATH]=new zi,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new Hi,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new Zi,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new Ki,e[t.PropertySyntax.COORDINATE]=new Ji,e[t.PropertySyntax.OFFSET_DISTANCE]=new no,e[t.PropertySyntax.OPACITY_VALUE]=new ro,e[t.PropertySyntax.PATH]=new io,e[t.PropertySyntax.LIST_OF_POINTS]=new oo,e[t.PropertySyntax.SHADOW_BLUR]=new ao,e[t.PropertySyntax.TEXT]=new so,e[t.PropertySyntax.TEXT_TRANSFORM]=new uo,e[t.PropertySyntax.TRANSFORM]=new _o,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new Fo,e[t.PropertySyntax.Z_INDEX]=new Go,e[t.PropertySyntax.MARKER]=new to,e}();xa.CameraContribution=Xn,xa.AnimationTimeline=null,xa.EasingFunction=null,xa.offscreenCanvasCreator=new na,xa.nativeHTMLMap=new WeakMap,xa.sceneGraphSelector=new aa,xa.sceneGraphService=new fa(xa),xa.textService=new ga(xa),xa.geometryUpdaterFactory=ba,xa.CSSPropertySyntaxFactory=Ea,xa.styleValueRegistry=new ji(xa),xa.layoutRegistry=null,xa.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},xa.enableCSSParsing=!0,xa.enableDataset=!1,xa.enableStyleSyntax=!0;var Ta=0;var Sa=new sa(t.ElementEvent.INSERTED,null,"","","",0,"",""),Pa=new sa(t.ElementEvent.REMOVED,null,"","","",0,"",""),Ma=new $o(t.ElementEvent.DESTROY),wa=function(e){function r(){var n=null!==e&&e.apply(this,arguments)||this;return n.entity=Ta++,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},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=xa.enableCSSParsing?{anchor:vr,opacity:vr,fillOpacity:vr,strokeOpacity:vr,fill:vr,stroke:vr,transform:vr,transformOrigin:vr,visibility:vr,pointerEvents:vr,lineWidth:vr,lineCap:vr,lineJoin:vr,increasedLineWidthForHitTesting:vr,fontSize:vr,fontFamily:vr,fontStyle:vr,fontWeight:vr,fontVariant:vr,textAlign:vr,textBaseline:vr,textTransform:vr,zIndex:vr,filter:vr,shadowType:vr}:null,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(_n)},r.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return xa.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Sa.relatedNode=this,t.dispatchEvent(Sa),t},r.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}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 Pa.relatedNode=this,t.dispatchEvent(Pa),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),xa.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 xa.sceneGraphService.matches(t,this)},r.prototype.getElementById=function(t){return xa.sceneGraphService.querySelector("#".concat(t),this)},r.prototype.getElementsByName=function(t){return xa.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},r.prototype.getElementsByClassName=function(t){return xa.sceneGraphService.querySelectorAll(".".concat(t),this)},r.prototype.getElementsByTagName=function(t){return xa.sceneGraphService.querySelectorAll(t,this)},r.prototype.querySelector=function(t){return xa.sceneGraphService.querySelector(t,this)},r.prototype.querySelectorAll=function(t){return xa.sceneGraphService.querySelectorAll(t,this)},r.prototype.closest=function(t){var e=this;do{if(xa.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,!0)})),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(Ma),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.prototype.getGeometryBounds=function(){return xa.sceneGraphService.getGeometryBounds(this)},r.prototype.getRenderBounds=function(){return xa.sceneGraphService.getBounds(this,!0)},r.prototype.getBounds=function(){return xa.sceneGraphService.getBounds(this)},r.prototype.getLocalBounds=function(){return xa.sceneGraphService.getLocalBounds(this)},r.prototype.getBoundingClientRect=function(){return xa.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(function(t){return"symbol"==typeof t}(t))return xa.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=sr(t);return e=this.attributes[n],xa.enableCSSParsing&&$t(e)?null:e}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){this.attributes[t]=e},r.prototype.getAttributeNS=function(t,e){throw Error(_n)},r.prototype.getAttributeNode=function(t){throw Error(_n)},r.prototype.getAttributeNodeNS=function(t,e){throw Error(_n)},r.prototype.hasAttributeNS=function(t,e){throw Error(_n)},r.prototype.removeAttributeNS=function(t,e){throw Error(_n)},r.prototype.removeAttributeNode=function(t){throw Error(_n)},r.prototype.setAttributeNS=function(t,e,n){throw Error(_n)},r.prototype.setAttributeNode=function(t){throw Error(_n)},r.prototype.setAttributeNodeNS=function(t){throw Error(_n)},r.prototype.toggleAttribute=function(t,e){throw Error(_n)},r}(ta);function Na(t){return!!(null==t?void 0:t.nodeName)}var Ca,ka=new sa(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,sa.MODIFICATION,null,null),Aa={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Oa={anchor:[0,0],fill:Er,stroke:Er,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Ra=r(r({},Oa),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),La=c(c([],u(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Ia="data-",Da=function(e){function i(n){var r,i=e.call(this)||this;i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=i.config.style||i.config.attrs||{},Object.assign(i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,xa.enableCSSParsing?Oa:Ra,i.config.initialParsedStyle),xa.enableCSSParsing&&Object.assign(i.attributes,Aa),i.initAttributes(i.config.style);var o=xa.globalThis.Proxy?xa.globalThis.Proxy:function(){};return xa.enableDataset&&(i.dataset=new o({},{get:function(t,e){var n="".concat(Ia).concat(ir(e));return void 0!==t[n]?t[n]:i.getAttribute(n)},set:function(t,e,n){return i.setAttribute("".concat(Ia).concat(ir(e)),n),!0}})),xa.enableStyleSyntax&&(i.style=new o({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}})),i}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];Na(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={});var e=this.renderable,n={forceUpdateGeometry:!0};xa.enableCSSParsing&&(n.usedAttributes=La);var r={};for(var i in t){r[sr(i)]=t[i]}xa.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},i.prototype.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=sr(t);pe(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),e.prototype.setAttribute.call(this,i,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];xa.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(ka.relatedNode=this,ka.prevValue=o,ka.newValue=e,ka.attrName=t,ka.prevParsedValue=a,ka.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(ka):(ka.target=this,this.ownerDocument.defaultView.dispatchEvent(ka,!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 Dn(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),xa.sceneGraphService.setOrigin(this,dn(t,e,n)),this},i.prototype.getOrigin=function(){return xa.sceneGraphService.getOrigin(this)},i.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.setPosition(this,dn(t,e,n)),this},i.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.setLocalPosition(this,dn(t,e,n)),this},i.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.translate(this,dn(t,e,n)),this},i.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),xa.sceneGraphService.translateLocal(this,dn(t,e,n)),this},i.prototype.getPosition=function(){return xa.sceneGraphService.getPosition(this)},i.prototype.getLocalPosition=function(){return xa.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=dn(t,e=e||t,n=n||t)),xa.sceneGraphService.scaleLocal(this,t),this},i.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=dn(t,e=e||t,n=n||t)),xa.sceneGraphService.setLocalScale(this,t),this},i.prototype.getLocalScale=function(){return xa.sceneGraphService.getLocalScale(this)},i.prototype.getScale=function(){return xa.sceneGraphService.getScale(this)},i.prototype.getEulerAngles=function(){return vn(u(gn(j(),xa.sceneGraphService.getWorldTransform(this)),3)[2])},i.prototype.getLocalEulerAngles=function(){return vn(u(gn(j(),xa.sceneGraphService.getLocalRotation(this)),3)[2])},i.prototype.setEulerAngles=function(t){return xa.sceneGraphService.setEulerAngles(this,0,0,t),this},i.prototype.setLocalEulerAngles=function(t){return xa.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},i.prototype.rotateLocal=function(t,e,n){return $t(e)&&$t(n)?xa.sceneGraphService.rotateLocal(this,0,0,t):xa.sceneGraphService.rotateLocal(this,t,e,n),this},i.prototype.rotate=function(t,e,n){return $t(e)&&$t(n)?xa.sceneGraphService.rotate(this,0,0,t):xa.sceneGraphService.rotate(this,t,e,n),this},i.prototype.setRotation=function(t,e,n,r){return xa.sceneGraphService.setRotation(this,t,e,n,r),this},i.prototype.setLocalRotation=function(t,e,n,r){return xa.sceneGraphService.setLocalRotation(this,t,e,n,r),this},i.prototype.setLocalSkew=function(t,e){return xa.sceneGraphService.setLocalSkew(this,t,e),this},i.prototype.getRotation=function(){return xa.sceneGraphService.getRotation(this)},i.prototype.getLocalRotation=function(){return xa.sceneGraphService.getLocalRotation(this)},i.prototype.getLocalSkew=function(){return xa.sceneGraphService.getLocalSkew(this)},i.prototype.getLocalTransform=function(){return xa.sceneGraphService.getLocalTransform(this)},i.prototype.getWorldTransform=function(){return xa.sceneGraphService.getWorldTransform(this)},i.prototype.setLocalTransform=function(t){return xa.sceneGraphService.setLocalTransform(this,t),this},i.prototype.resetLocalTransform=function(){xa.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"visible"===(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?ne(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(A(j(),e),2),r=n[0],i=n[1],o=u(O(j(),e),2),a=o[0],s=o[1],c=R(st(),e),l=u(gn(j(),c),3);return xn(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(bn(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(bn(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(){xa.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},i.prototype.hide=function(){xa.enableCSSParsing?this.style.visibility="hidden":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.setClip=function(t){this.style.clipPath=t},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}(wa),_a={number:function(t){return new lr(t)},percent:function(t){return new lr(t,"%")},px:function(t){return new lr(t,"px")},em:function(t){return new lr(t,"em")},rem:function(t){return new lr(t,"rem")},deg:function(t){return new lr(t,"deg")},grad:function(t){return new lr(t,"grad")},rad:function(t){return new lr(t,"rad")},turn:function(t){return new lr(t,"turn")},s:function(t){return new lr(t,"s")},ms:function(t){return new lr(t,"ms")},registerProperty:function(t){xa.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){xa.layoutRegistry.registerLayout(t,e)}},Fa=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.CIRCLE,style:r(xa.enableCSSParsing?{cx:"",cy:"",r:""}:{},o),initialParsedStyle:{anchor:[.5,.5],transformOrigin:xa.enableCSSParsing?null:[Mr,Mr]}},a))||this}return n(o,e),o}(Da),Ga=function(t){function e(e){var n=this;void 0===e&&(e={});var o=e.style,a=i(e,["style"]);return(n=t.call(this,r({style:r(xa.enableCSSParsing?{x:"",y:""}:{},o)},a))||this).isCustomElement=!0,n}return n(e,t),e}(Da),Ua=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.ELLIPSE,style:r(xa.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},o),initialParsedStyle:{anchor:[.5,.5],transformOrigin:xa.enableCSSParsing?null:[Mr,Mr]}},a))||this}return n(o,e),o}(Da),Ba=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.GROUP,style:r(xa.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},o)},a))||this}return n(o,e),o}(Da),Va=function(e){function o(n){var o=this;void 0===n&&(n={});var a=n.style,s=i(n,["style"]);return(o=e.call(this,r({type:t.Shape.HTML,style:r(xa.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},a)},s))||this).cullable.enable=!1,o}return n(o,e),o.prototype.getDomElement=function(){return this.parsedStyle.$el},o.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle;return new Dn(t.x,t.y,t.width,t.height)},o.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},o.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new Cn,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},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}(Da),ja=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.IMAGE,style:r(xa.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},o)},a))||this}return n(o,e),o}(Da),Ya=function(e){function o(n){var o=this;void 0===n&&(n={});var 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,isBillboard:!1},a)},s))||this).markerStartAngle=0,o.markerEndAngle=0;var u=o.parsedStyle,c=u.markerStart,l=u.markerEnd;return c&&Na(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),l&&Na(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&&Na(r)&&(this.markerStartAngle=0,r.remove()),i&&Na(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Na(r)&&(this.markerEndAngle=0,r.remove()),i&&Na(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=e.defX,c=e.defY,l=t?e.markerStart:e.markerEnd;if(l&&Na(l)){var h,p,f,d,y,v,m;t?(d=i-u,y=a-c,p=o-i,f=s-a,v=n||0,m=this.markerStartAngle):(d=o-u,y=s-c,p=i-o,f=a-s,v=r||0,m=this.markerEndAngle),l.setLocalEulerAngles(180*(h=Math.atan2(f,p))/Math.PI+m),l.setLocalPosition(d+Math.cos(h)*v,y+Math.sin(h)*v)}},o.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=qe(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=et(j(),X(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new In(u[0],u[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 We(t.x1,t.y1,t.x2,t.y2)},o}(Da),za=function(e){function o(n){var o=this;void 0===n&&(n={});var a=n.style,s=i(n,["style"]);(o=e.call(this,r({type:t.Shape.PATH,style:r(xa.enableCSSParsing?{path:"",miterLimit:""}:{},a),initialParsedStyle:xa.enableCSSParsing?null:{miterLimit:4,path:r({},Nr)}},s))||this).markerStartAngle=0,o.markerEndAngle=0,o.markerMidList=[];var u=o.parsedStyle,c=u.markerStart,l=u.markerEnd,h=u.markerMid;return c&&Na(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),h&&Na(h)&&o.placeMarkerMid(h),l&&Na(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){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Na(r)&&(this.markerStartAngle=0,r.remove()),i&&Na(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Na(r)&&(this.markerEndAngle=0,r.remove()),i&&Na(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.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&Na(a)){var s,c,l,h,p,f,d;if(t){var y=u(this.getStartTangent(),2);h=(m=y[1])[0]-i,p=m[1]-o,c=(v=y[0])[0]-m[0],l=v[1]-m[1],f=n||0,d=this.markerStartAngle}else{var v,m,g=u(this.getEndTangent(),2);h=(m=g[1])[0]-i,p=m[1]-o,c=(v=g[0])[0]-m[0],l=v[1]-m[1],f=r||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(l,c))/Math.PI+d),a.setLocalPosition(h+Math.cos(s)*f,p+Math.sin(s)*f)}},o.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Na(t))for(var o=1;n.length-1>o;o++){var a=u(n[o].currentPoint,2),s=a[0],c=a[1],l=1===o?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,c-i)}},o.prototype.getTotalLength=function(){return ii(this)},o.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,i=n.defX,o=n.defY,a=function(t,e,n){return qt(t,e,r(r({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),s=a.x,u=a.y,c=et(j(),X(s-i,u-o,0),e?this.getWorldTransform():this.getLocalTransform());return new In(c[0],c[1])},o.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*ii(this),e)},o.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},o.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},o}(Da),Xa=function(e){function o(n){var o=this;void 0===n&&(n={});var a=n.style,s=i(n,["style"]);(o=e.call(this,r({type:t.Shape.POLYGON,style:r(xa.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},a),initialParsedStyle:xa.enableCSSParsing?null:{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&&Na(c)&&(o.markerStartAngle=c.getLocalEulerAngles(),o.appendChild(c)),h&&Na(h)&&o.placeMarkerMid(h),l&&Na(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&&Na(r)&&(this.markerStartAngle=0,r.remove()),i&&Na(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Na(r)&&(this.markerEndAngle=0,r.remove()),i&&Na(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=e.defX,a=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&Na(s)){var u,c,l,h,p,f,d;if(h=i[0][0]-o,p=i[0][1]-a,t)c=i[1][0]-i[0][0],l=i[1][1]-i[0][1],f=n||0,d=this.markerStartAngle;else{var y=i.length;this.parsedStyle.isClosed?(c=i[y-1][0]-i[0][0],l=i[y-1][1]-i[0][1]):(h=i[y-1][0]-o,p=i[y-1][1]-a,c=i[y-2][0]-i[y-1][0],l=i[y-2][1]-i[y-1][1]),f=r||0,d=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(l,c))/Math.PI+d),s.setLocalPosition(h+Math.cos(u)*f,p+Math.sin(u)*f)}},o.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Na(t))for(var o=1;(this.parsedStyle.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},o}(Da),Ha=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:r(xa.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},o),initialParsedStyle:xa.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},a))||this}return n(o,e),o.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},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,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var c=qe(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),l=c.x,h=c.y,p=et(j(),X(l-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new In(p[0],p[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}(Xa),Wa=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.RECT,style:r(xa.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},o)},a))||this}return n(o,e),o}(Da),qa=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(xa.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},o),initialParsedStyle:xa.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},a))||this}return n(o,e),o.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},o.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},o.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},o}(Da),Za=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Fa),this.define(t.Shape.ELLIPSE,Ua),this.define(t.Shape.RECT,Wa),this.define(t.Shape.IMAGE,ja),this.define(t.Shape.LINE,Ya),this.define(t.Shape.GROUP,Ba),this.define(t.Shape.PATH,za),this.define(t.Shape.POLYGON,Xa),this.define(t.Shape.POLYLINE,Ha),this.define(t.Shape.TEXT,qa),this.define(t.Shape.HTML,Va)}return e.prototype.define=function(t,e){this.registry[t]=e},e.prototype.get=function(t){return this.registry[t]},e}(),Ka=function(e){function r(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new xa.AnimationTimeline(n)}catch(t){}var r={};return Gi.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=or(n)?n(t.Shape.GROUP):n)})),n.documentElement=new Ba({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?qa:Ba);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(_n)},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=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},r.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(Fn)},r.prototype.insertBefore=function(t,e){throw Error(Fn)},r.prototype.removeChild=function(t,e){throw Error(Fn)},r.prototype.replaceChild=function(t,e,n){throw Error(Fn)},r.prototype.append=function(){throw Error(Fn)},r.prototype.prepend=function(){throw Error(Fn)},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}(ta),Qa=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 $o(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e.tag="Culling",e}(),$a=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Ko(null),this.rootWheelEvent=new Qo(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="outside";try{a=o&&t.target&&t.target!==o&&o.contains&&!o.contains(t.target)?"outside":""}catch(t){}var 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.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||$t(r)||$t(i)){var s=this.context.eventService.client2Viewport(new In(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},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.getViewportXY(e),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=mo[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.getViewportXY(t),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=go.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];pe(i.button)&&(i.button=0),pe(i.buttons)&&(i.buttons=1),pe(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),pe(i.width)&&(i.width=i.radiusX||1),pe(i.height)&&(i.height=i.radiusY||1),pe(i.tiltX)&&(i.tiltX=0),pe(i.tiltY)&&(i.tiltY=0),pe(i.pointerType)&&(i.pointerType="touch"),pe(i.pointerId)&&(i.pointerId=i.identifier||0),pe(i.pressure)&&(i.pressure=i.force||.5),pe(i.twist)&&(i.twist=0),pe(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;pe(o.isPrimary)&&(o.isPrimary=!0),pe(o.width)&&(o.width=1),pe(o.height)&&(o.height=1),pe(o.tiltX)&&(o.tiltX=0),pe(o.tiltY)&&(o.tiltY=0),pe(o.pointerType)&&(o.pointerType="mouse"),pe(o.pointerId)&&(o.pointerId=1),pe(o.pressure)&&(o.pressure=.5),pe(o.twist)&&(o.twist=0),pe(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),Ja=[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],ts=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=Ja.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>$(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>$(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}(),es=function(){function e(){this.toSync=new Set}return e.prototype.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var a=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;i.dirtify()},u=function(t){var e=t.target;xa.enableCSSParsing&&xa.styleValueRegistry.recalc(e),xa.sceneGraphService.dirtifyToRoot(e),i.dirtify()},c=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),xa.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(e.tag,(function(){o.addEventListener(t.ElementEvent.MOUNTED,u),o.addEventListener(t.ElementEvent.UNMOUNTED,c),o.addEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s)})),i.hooks.destroy.tap(e.tag,(function(){o.removeEventListener(t.ElementEvent.MOUNTED,u),o.removeEventListener(t.ElementEvent.UNMOUNTED,c),o.removeEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s),r.toSync.clear()})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))},e.prototype.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=u(i.getMin(),2),a=o[0],s=o[1],c=u(i.getMax(),2),l=c[0],h=c[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=l,r.aabb.maxY=h}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e.tag="Prepare",e}();t.CanvasEvent=void 0,(Ca=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Ca.BEFORE_RENDER="beforerender",Ca.RERENDER="rerender",Ca.AFTER_RENDER="afterrender",Ca.BEFORE_DESTROY="beforedestroy",Ca.AFTER_DESTROY="afterdestroy",Ca.RESIZE="resize",Ca.DIRTY_RECTANGLE="dirtyrectangle",Ca.RENDERER_CHANGED="rendererchanged";var ns=new $o(t.ElementEvent.MOUNTED),rs=new $o(t.ElementEvent.UNMOUNTED),is=new $o(t.CanvasEvent.BEFORE_RENDER),os=new $o(t.CanvasEvent.RERENDER),as=new $o(t.CanvasEvent.AFTER_RENDER),ss=function(e){function i(t){var n=e.call(this)||this;n.Element=Da,n.inited=!1,n.context={},n.document=new Ka,n.document.defaultView=n,n.customElements=new Za;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.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,E=t.isTouchEvent,T=t.isMouseEvent;t.supportsMutipleCanvasesInOneContainer||function(t,e){if(t){var n="string"==typeof t?t:t.id||lo++;co[n]&&co[n].destroy(),co[n]=e}}(r,n);var S=a,P=s,M=u;return i&&(M=1>(M=u||ho&&window.devicePixelRatio||1)?1:Math.ceil(M),S=a||function(t){var e=vo(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/M,P=s||function(t){var e=vo(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/M),o&&(xa.offscreenCanvas=o),n.devicePixelRatio=M,n.requestAnimationFrame=null!=f?f:Co.bind(xa.globalThis),n.cancelAnimationFrame=null!=d?d:ko.bind(xa.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in xa.globalThis,n.supportsPointerEvents=null!=v?v:!!xa.globalThis.PointerEvent,n.isTouchEvent=null!=E?E:function(t){return n.supportsTouchEvents&&t instanceof xa.globalThis.TouchEvent},n.isMouseEvent=null!=T?T:function(t){return!xa.globalThis.MouseEvent||t instanceof xa.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof xa.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:S,height:P,renderer:c,offscreenCanvas:o,devicePixelRatio:M,cursor:h||"default",background:l||"transparent",createImage:y,document:p,supportsCSSTransform:g,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:b}),n.initDefaultCamera(S,P,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 xa.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(Yn.UPDATED,(function(){i.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=o},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=!1),n||this.dispatchEvent(new $o(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 $o(t.CanvasEvent.AFTER_DESTROY))},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 $o(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(){var t=this;this.dispatchEvent(is),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(os)})),this.dispatchEvent(as)},i.prototype.run=function(){var t=this,e=function(){t.render(),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 an,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new $a,new es,new Qa([new ts])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(r(r({},xa),this.context)),this.context.renderingService=new ia(xa,this.context),this.context.eventService=new ea(xa,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 $o(t.CanvasEvent.READY))})):i.dispatchEvent(new $o(t.CanvasEvent.READY)),i.readyPromise&&i.resolveReadyPromise()):i.dispatchEvent(new $o(t.CanvasEvent.RENDERER_CHANGED)),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(xa)}))},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(xa)})),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&&(t.isMutationObserved?t.dispatchEvent(rs):(rs.target=t,this.dispatchEvent(rs,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},i.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(ns):(ns.target=t,this.dispatchEvent(ns,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},i.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}(Jo),us=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.landmarks=[],t}return n(r,e),r.prototype.rotate=function(e,n,r){if(this.relElevation=fn(n),this.relAzimuth=fn(e),this.relRoll=fn(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=ut(st(),[1,0,0],yn((this.rotateWorld?1:-1)*this.relElevation)),o=ut(st(),[0,1,0],yn((this.rotateWorld?1:-1)*this.relAzimuth)),a=ut(st(),[0,0,1],yn(this.relRoll)),s=ct(st(),o,i);s=ct(st(),s,a);var u=I(y(),s);P(this.matrix,this.matrix,[0,0,-this.distance]),S(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=dn(t,e,0),r=Y(this.position);return q(r,r,K(j(),this.right,n[0])),q(r,r,K(j(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},r.prototype.dolly=function(e){var n,r=this.forward,i=Y(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&&q(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 xa.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:Y(p.right),up:Y(p.up),forward:Y(p.forward),position:Y(p.getPosition()),focalPoint:Y(p.getFocalPoint()),distanceVector:Y(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=oe(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=se(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;if(0===u)return this.syncFromLandmark(r),void(p&&p());this.cancelLandmarkAnimation();var f,d=r.position,y=r.focalPoint,v=r.zoom,m=r.roll,g=l||xa.EasingFunction(a),x=function(){n.setFocalPoint(y),n.setPosition(d),n.setRoll(m),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),p&&p()},b=function(t){void 0===f&&(f=t);var e=t-f;if(u<e)x();else{var r,i,o=g(e/u),a=j(),s=j();tt(a,n.focalPoint,y,o),tt(s,n.position,d,o),i=n.roll*(1-o)+m*o,r=n.zoom*(1-o)+v*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),rt(a,y)+rt(s,d)>.01||null!=v||null!=m?(n.computeMatrix(),n.triggerUpdate(),u>e&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(b))):x()}};this.canvas.requestAnimationFrame(b)}},r.prototype.syncFromLandmark=function(t){this.matrix=m(this.matrix,t.matrix),this.right=H(this.right,t.right),this.up=H(this.up,t.up),this.forward=H(this.forward,t.forward),this.position=H(this.position,t.position),this.focalPoint=H(this.focalPoint,t.focalPoint),this.distanceVector=H(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},r}(Xn);xa.CameraContribution=us;var cs,ls,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}(),ps=0,fs=new WeakMap,ds=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:ls&&function(t){return t===ls||t===cs}(t)?ls:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else xs.push(this.observer),gs||(gs=!0,void 0!==xa.globalThis?xa.globalThis.setTimeout(bs):bs());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=fs.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=vs("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===sa.ADDITION?null:e.prevValue;ms(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,ls||((ls=hs.copy(cs)).oldValue=e,ls)):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=vs("childList",r=e.relatedNode)).addedNodes=u,n.removedNodes=c,n.previousSibling=l,n.nextSibling=h,ms(r,(function(t){if(t.childList)return n}))}cs=ls=void 0},e}(),ys=function(){function t(t){this.callback=t,this.nodes=[],this.records=[],this.uid=ps++}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=fs.get(t);r||fs.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 ds(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=fs.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 vs(t,e){return cs=new hs(t,e)}function ms(t,e){for(var n=t;n;n=n.parentNode){var r=fs.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 gs=!1,xs=[];function bs(){gs=!1;var t=xs;xs=[],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=fs.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&bs()}var Es=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}(qo),Ts=0,Ss=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(Ts++),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 Es(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(_n)},t.prototype.addEventListener=function(t,e,n){throw Error(_n)},t.prototype.removeEventListener=function(t,e,n){throw Error(_n)},t.prototype.dispatchEvent=function(t){throw Error(_n)},t.prototype.commitStyles=function(){throw Error(_n)},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 Es(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 Es(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Ps=.1,Ms="function"==typeof Float32Array,ws=function(t,e){return 1-3*e+3*t},Ns=function(t,e){return 3*e-6*t},Cs=function(t){return 3*t},ks=function(t,e,n){return((ws(e,n)*t+Ns(e,n))*t+Cs(e))*t},As=function(t,e,n){return 3*ws(e,n)*t*t+2*Ns(e,n)*t+Cs(e)},Os=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=Ms?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=ks(o*Ps,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=Ps;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Ps,s=As(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=ks(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+Ps,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=As(e,n,r);if(0===o)return e;e-=(ks(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:ks(a(t),e,r)}},Rs=function(t){return Math.pow(t,2)},Ls=function(t){return Math.pow(t,3)},Is=function(t){return Math.pow(t,4)},Ds=function(t){return Math.pow(t,5)},_s=function(t){return Math.pow(t,6)},Fs=function(t){return 1-Math.cos(t*Math.PI/2)},Gs=function(t){return 1-Math.sqrt(1-t*t)},Us=function(t){return t*t*(3*t-2)},Bs=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)},Vs=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=ae(Number(void 0===r?1:r),1,10),s=ae(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)},js=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=ae(o,.1,1e3),s=ae(s,.1,1e3),l=ae(l,.1,1e3),p=ae(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},Ys=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)(ae(t,0,1)*i)/i},zs=function(t,e){void 0===e&&(e=[]);var n=u(e,4);return Os(n[0],n[1],n[2],n[3])(t)},Xs=Os(.42,0,1,1),Hs=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Ws=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}},qs=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}},Zs={steps:Ys,"step-start":function(t){return Ys(t,[1,"start"])},"step-end":function(t){return Ys(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":zs,ease:function(t){return zs(t,[.25,.1,.25,1])},in:Xs,out:Hs(Xs),"in-out":Ws(Xs),"out-in":qs(Xs),"in-quad":Rs,"out-quad":Hs(Rs),"in-out-quad":Ws(Rs),"out-in-quad":qs(Rs),"in-cubic":Ls,"out-cubic":Hs(Ls),"in-out-cubic":Ws(Ls),"out-in-cubic":qs(Ls),"in-quart":Is,"out-quart":Hs(Is),"in-out-quart":Ws(Is),"out-in-quart":qs(Is),"in-quint":Ds,"out-quint":Hs(Ds),"in-out-quint":Ws(Ds),"out-in-quint":qs(Ds),"in-expo":_s,"out-expo":Hs(_s),"in-out-expo":Ws(_s),"out-in-expo":qs(_s),"in-sine":Fs,"out-sine":Hs(Fs),"in-out-sine":Ws(Fs),"out-in-sine":qs(Fs),"in-circ":Gs,"out-circ":Hs(Gs),"in-out-circ":Ws(Gs),"out-in-circ":qs(Gs),"in-back":Us,"out-back":Hs(Us),"in-out-back":Ws(Us),"out-in-back":qs(Us),"in-bounce":Bs,"out-bounce":Hs(Bs),"in-out-bounce":Ws(Bs),"out-in-bounce":qs(Bs),"in-elastic":Vs,"out-elastic":Hs(Vs),"in-out-elastic":Ws(Vs),"out-in-elastic":qs(Vs),spring:js,"spring-in":js,"spring-out":Hs(js),"spring-in-out":Ws(js),"spring-out-in":qs(js)},Ks=function(t){return Zs[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)]||Zs.linear},Qs=function(t){return t},$s=1,Js=.5,tu=0;function eu(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var nu="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",ru=RegExp("cubic-bezier\\("+nu+","+nu+","+nu+","+nu+"\\)"),iu=/steps\(\s*(\d+)\s*\)/,ou=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function au(t){var e=ru.exec(t);if(e)return Os.apply(void 0,c([],u(e.slice(1).map(Number)),!1));var n=iu.exec(t);if(n)return eu(Number(n[1]),tu);var r=ou.exec(t);return r?eu(Number(r[1]),{start:$s,middle:Js,end:tu}[r[2]]):Ks(t)}function su(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 uu=0,cu=1,lu=2,hu=3;function pu(t,e,n){var r=function(t,e,n){if(null===e)return uu;var r=n.endTime;return Math.min(n.delay,r)>e?cu:Math.min(n.delay+t+n.endDelay,r)>e?hu:lu}(t,e,n),i=function(t,e,n,r,i){switch(r){case cu:return"backwards"===e||"both"===e?0:null;case hu:return n-i;case lu:return"forwards"===e||"both"===e?t:null;case uu: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!==cu&&(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!==lu||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===lu&&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 fu(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(du(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:au(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:vu(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.setAttribute(n.property,n.interpolation(i))}));else for(var n in r)du(n)&&t.setAttribute(n,null)}}function du(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var yu=function(t,e,n){return function(r){var i=mu(t,e,r);return!xa.enableCSSParsing&&se(i)?i:n(i)}};function vu(t,e,n,r){var i=Bi[t];if(i&&i.syntax&&i.int){var o=xa.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(xa.enableCSSParsing){var l=xa.styleValueRegistry.parseProperty(t,e,r),h=xa.styleValueRegistry.parseProperty(t,n,r);a=xa.styleValueRegistry.computeProperty(t,l,r),s=xa.styleValueRegistry.computeProperty(t,h,r)}else{var p=o.parserWithCSSDisabled;a=p?p(e,r):e,s=p?p(n,r):n}var f=o.mixer(a,s,r);if(f){var d=yu.apply(void 0,c([],u(f),!1));return function(t){return 0===t?e:1===t?n:d(t)}}}}return yu(!1,!0,(function(t){return t?n:e}))}function mu(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(mu(t[r>s?s:r-1],e[i>s?s:i-1],n));return a}throw Error("Mismatched interpolation arguments "+t+":"+e)}var gu=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Qs,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=au(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function xu(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($t(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(!$t(s)&&!$t(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 bu="backwards|forwards|both|none".split("|"),Eu="reverse|alternate|alternate-reverse".split("|");function Tu(t,e){var n=new gu;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===bu.indexOf(t[e]))return;if("direction"===e&&-1===Eu.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Su(t,e){return Tu(t=Pu(null!=t?t:{duration:"auto"}),e)}function Pu(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var Mu=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Su(n,!1),this.timing.effect=this,this.timing.activeDuration=su(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=xu(e,this.timing),this.interpolations=fu(this.normalizedKeyframes,this.timing,this.target);var i=xa.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=pu(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=xu(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 wu(t,e){return Number(t.id)-Number(e.id)}var Nu=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(wu),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 Mu(t,e,n),i=new Ss(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(wu),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}();xa.EasingFunction=au,xa.AnimationTimeline=Nu,t.AABB=Cn,t.AbstractRenderer=un,t.AbstractRendererPlugin=sn,t.AdvancedCamera=us,t.Animation=Ss,t.AnimationEvent=Es,t.AnimationTimeline=Nu,t.BUILT_IN_PROPERTIES=Gi,t.CSS=_a,t.CSSGradientValue=er,t.CSSKeywordValue=nr,t.CSSRGB=yr,t.CSSStyleValue=Jn,t.CSSUnitValue=lr,t.Camera=Xn,t.CameraEvent=Yn,t.Canvas=ss,t.Circle=Fa,t.CircleUpdater=Uo,t.CustomElement=Ga,t.CustomElementRegistry=Za,t.CustomEvent=$o,t.DefaultSceneGraphSelector=aa,t.DefaultSceneGraphService=fa,t.DisplayObject=Da,t.Document=Ka,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=_n,t.Element=wa,t.Ellipse=Ua,t.EllipseUpdater=Bo,t.EventService=ea,t.EventTarget=Jo,t.FederatedEvent=qo,t.FederatedMouseEvent=Zo,t.FederatedPointerEvent=Ko,t.FederatedWheelEvent=Qo,t.Frustum=Ln,t.Group=Ba,t.HTML=Va,t.Image=ja,t.KeyframeEffect=Mu,t.Line=Ya,t.LineUpdater=Vo,t.MutationEvent=sa,t.MutationObserver=ys,t.MutationRecord=hs,t.Node=ta,t.OffscreenCanvasCreator=na,t.Path=za,t.PathUpdater=jo,t.Plane=kn,t.Point=In,t.Polygon=Xa,t.Polyline=Ha,t.PolylineUpdater=Yo,t.RBush=an,t.Rect=Wa,t.RectUpdater=zo,t.Rectangle=Dn,t.Registration=ds,t.RenderingService=ia,t.Text=qa,t.TextService=ga,t.TextUpdater=Xo,t.compareAnimations=wu,t.computeLinearGradient=function(t,e,n){var r=yn(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Ut([0,0],[a,s]),Ut([0,n],[a,s]),Ut([e,n],[a,s]),Ut([e,0],[a,s]));return o&&(o instanceof lr?u=o.value:o instanceof nr&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(Ut([0,0],[a,s]),Ut([0,n],[a,s]),Ut([e,n],[a,s]),Ut([e,0],[a,s]))))),{x:a,y:s,r:u}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle,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=yi(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=yi(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,S=void 0===T?0:T,P=E.height,M=void 0===P?0:P,w=E.x,N=void 0===w?0:w,C=E.y,k=void 0===C?0:C,A=E.radius,O=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"]]}(S,M,N,k,O&&A.map((function(t){return ae(t,0,Math.min(Math.abs(S)/2,Math.abs(M)/2))})));break;case t.Shape.PATH:r=c([],u(e.parsedStyle.path.absolutePath),!1)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=X(e[1]-o,e[2]-s,0);n&&et(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 a=X(e[1]-o,e[2]-s,0),u=X(e[3]-o,e[4]-s,0),c=X(e[5]-o,e[6]-s,0);n&&(et(a,a,n),et(u,u,n),et(c,c,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(u[0],",").concat(u[1],",").concat(c[0],",").concat(c[1])}else if("A"===e[0]){var l=X(e[6]-o,e[7]-s,0);n&&et(l,l,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(l[0],",").concat(l[1])}else"Q"===e[0]&&(a=X(e[1]-o,e[2]-s,0),u=X(e[3]-o,e[4]-s,0),n&&(et(a,a,n),et(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(r,e,n)},t.createVec3=dn,t.decompose=bn,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==u(t,2)[1]})))},t.deg2rad=yn,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=yo,t.fromRotationTranslationScale=xn,t.getAngle=fn,t.getEuler=gn,t.getOrCalculatePathTotalLength=ii,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=ho,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Ur,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Na,t.isFederatedEvent=Ho,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Gr,t.makeTiming=Tu,t.mergeColors=Vr,t.normalizeKeyframes=xu,t.normalizeTimingInput=Su,t.numericTimingToObject=Pu,t.parseColor=Br,t.parseLength=Yr,t.parsePath=gi,t.parseTransform=wi,t.parsedTransformToMat4=$i,t.propertyMetadataCache=Bi,t.rad2deg=vn,t.resetEntityCounter=function(){Ta=0},t.runtime=xa,t.setDOMSize=function(t,e,n){ho&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c=t[u+1],l=0===u&&(0!==r||0!==i),h=(u===t.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==o&&0!==a;switch(s[0]){case"M":return l?"M ".concat(s[1]-e+r,",").concat(s[2]-n+i," L ").concat(s[1]-e,",").concat(s[2]-n):"M ".concat(s[1]-e,",").concat(s[2]-n);case"L":return"L ".concat(s[1]-e+(h?o:0),",").concat(s[2]-n+(h?a:0));case"Q":return"Q ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n)+(h?" L ".concat(s[3]-e+o,",").concat(s[4]-n+a):"");case"C":return"C ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n,",").concat(s[5]-e," ").concat(s[6]-n)+(h?" L ".concat(s[5]-e+o,",").concat(s[6]-n+a):"");case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]-e," ").concat(s[7]-n)+(h?" L ".concat(s[6]-e+o,",").concat(s[7]-n+a):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=mn}));
|
|
2
2
|
//# sourceMappingURL=index.umd.min.js.map
|