@antv/g2 5.1.6-beta.0 → 5.1.6-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:o}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,o]]};r.props={};const i=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];i.props={transform:!0};const o=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};o.props={};const a=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},s=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=a(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};s.props={};const c=()=>[["parallel",0,1,0,1]];c.props={};const l=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];l.props={transform:!0};const u=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:o=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};u.props={};const f=({value:t})=>e=>e.map((()=>t));f.props={};const h=({value:t})=>e=>e.map(t);h.props={};const d=({value:t})=>e=>e.map((e=>e[t]));d.props={};const p=({value:t})=>()=>t;p.props={};var g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t){return"function"==typeof t},y=function(t){return null==t},v={}.toString,b=function(t,e){return v.call(t)==="[object "+e+"]"},x=function(t){return Array.isArray?Array.isArray(t):b(t,"Array")},w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var M=function(t){return"object"==typeof t&&null!==t},E=function(t){if(!M(t)||!b(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},O=function(t){if(x(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},k=function(t){if(x(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},S=function(t,e,n){if(!x(t)&&!E(t))return t;var r=n;return function(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(w(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}(t,(function(t,n){r=e(r,t,n)})),r},A=function(t){return b(t,"String")};var T=function(t,e,n){return t<e?e:t>n?n:t},_=function(t){return b(t,"Number")},P=1e-5;function C(t,e,n){return void 0===n&&(n=P),Math.abs(t-e)<n}var N=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},L=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},j=function(t,e){return(t%e+e)%e},R=function(t){return y(t)?"":t.toString()},I=function(t){var e=R(t);return e.charAt(0).toLowerCase()+e.substring(1)};var B=function(t){var e=R(t);return e.charAt(0).toUpperCase()+e.substring(1)},D=function(t){return b(t,"Boolean")},F=function(t){return void 0===t},z=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=z(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=z(t[i]):e[i]=t[i];return e},G=z;function W(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}}function $(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function H(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function V(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(H(e,i)){var o=e[i];null!==o&&E(o)?(E(t[i])||(t[i]={}),n<r?V(t[i],o,n+1,r):t[i]=e[i]):x(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Y=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)V(t,e[r]);return t},q=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(A(t)||A(e))return!1;if(g(t)||g(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=q(t[r],e[r]));r++);return n}if(M(t)||M(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=q(t[i[r]],e[i[r]]));r++);return n}return!1},U=q,X=function(t,e,n){for(var r=0,i=A(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},K=function(t,e){return S(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},Z=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},Q=function(){},J=1e-6,tt="undefined"!=typeof Float32Array?Float32Array:Array;function et(){var t=new tt(9);return tt!=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}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var nt=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],m=n[4],y=n[5],v=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*l,t[1]=h*i+d*s+p*u,t[2]=h*o+d*c+p*f,t[3]=g*r+m*a+y*l,t[4]=g*i+m*s+y*u,t[5]=g*o+m*c+y*f,t[6]=v*r+b*a+x*l,t[7]=v*i+b*s+x*u,t[8]=v*o+b*c+x*f,t};function rt(){var t=new tt(16);return tt!=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 it(t){var e=new tt(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 ot(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 at(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function st(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 ct(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 lt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,M=r*l-o*s,E=i*l-o*c,O=u*g-f*p,k=u*m-h*p,S=u*y-d*p,A=f*m-h*g,T=f*y-d*g,_=h*y-d*m,P=v*_-b*T+x*A+w*S-M*k+E*O;return P?(P=1/P,t[0]=(s*_-c*T+l*A)*P,t[1]=(i*T-r*_-o*A)*P,t[2]=(g*E-m*M+y*w)*P,t[3]=(h*M-f*E-d*w)*P,t[4]=(c*S-a*_-l*k)*P,t[5]=(n*_-i*S+o*k)*P,t[6]=(m*x-p*E-y*b)*P,t[7]=(u*E-h*x+d*b)*P,t[8]=(a*T-s*S+l*O)*P,t[9]=(r*S-n*T-o*O)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-d*v)*P,t[12]=(s*k-a*A-c*O)*P,t[13]=(n*A-r*k+i*O)*P,t[14]=(g*b-p*w-m*v)*P,t[15]=(u*w-f*b+h*v)*P,t):null}function ut(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(f*m-h*g)-(e*s-r*o)*(u*m-h*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-h*d)-(n*c-i*a)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function ft(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],m=e[13],y=e[14],v=e[15],b=n[0],x=n[1],w=n[2],M=n[3];return t[0]=b*r+x*s+w*f+M*g,t[1]=b*i+x*c+w*h+M*m,t[2]=b*o+x*l+w*d+M*y,t[3]=b*a+x*u+w*p+M*v,b=n[4],x=n[5],w=n[6],M=n[7],t[4]=b*r+x*s+w*f+M*g,t[5]=b*i+x*c+w*h+M*m,t[6]=b*o+x*l+w*d+M*y,t[7]=b*a+x*u+w*p+M*v,b=n[8],x=n[9],w=n[10],M=n[11],t[8]=b*r+x*s+w*f+M*g,t[9]=b*i+x*c+w*h+M*m,t[10]=b*o+x*l+w*d+M*y,t[11]=b*a+x*u+w*p+M*v,b=n[12],x=n[13],w=n[14],M=n[15],t[12]=b*r+x*s+w*f+M*g,t[13]=b*i+x*c+w*h+M*m,t[14]=b*o+x*l+w*d+M*y,t[15]=b*a+x*u+w*p+M*v,t}function ht(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*y+e[12],t[13]=e[1]*g+e[5]*m+e[9]*y+e[13],t[14]=e[2]*g+e[6]*m+e[10]*y+e[14],t[15]=e[3]*g+e[7]*m+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*m+f*y+e[12],t[13]=i*g+c*m+h*y+e[13],t[14]=o*g+l*m+d*y+e[14],t[15]=a*g+u*m+p*y+e[15]),t}function dt(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 pt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=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+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function gt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=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-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function mt(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 yt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=o*l,m=a*s,y=a*c,v=a*l;return t[0]=1-(d+g),t[1]=f+v,t[2]=h-y,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=h+y,t[9]=p-m,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function bt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function wt(t,e){var n=new tt(3);xt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,g=a+u+p,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(f-d)/m,t[1]=(h-c)/m,t[2]=(s-l)/m):a>u&&a>p?(m=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(h+c)/m):u>p?(m=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/m,t[0]=(h+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function Mt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,g=a*u,m=a*f,y=s*f,v=c*l,b=c*u,x=c*f,w=r[0],M=r[1],E=r[2],O=i[0],k=i[1],S=i[2],A=(1-(g+y))*w,T=(d+x)*w,_=(p-b)*w,P=(d-x)*M,C=(1-(h+y))*M,N=(m+v)*M,L=(p+b)*E,j=(m-v)*E,R=(1-(h+g))*E;return t[0]=A,t[1]=T,t[2]=_,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+O-(A*O+P*k+L*S),t[13]=n[1]+k-(T*O+C*k+j*S),t[14]=n[2]+S-(_*O+N*k+R*S),t[15]=1,t}function Et(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,g=o*a,m=o*s,y=o*c;return t[0]=1-f-p,t[1]=u+y,t[2]=h-m,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+m,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ot(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?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var kt=Ot;function St(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var At=St;function Tt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function _t(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],m=e[2],y=r[0],v=r[1],b=r[2],x=n[0],w=n[1],M=n[2];return Math.abs(p-x)<J&&Math.abs(g-w)<J&&Math.abs(m-M)<J?st(t):(u=p-x,f=g-w,h=m-M,i=v*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),o=b*(u*=d)-y*h,a=y*f-v*u,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-u*a,l=u*o-f*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+o*g+a*m),t[13]=-(s*p+c*g+l*m),t[14]=-(u*p+f*g+h*m),t[15]=1,t)}function Pt(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 Ct=ft,Nt=Pt,Lt=Object.freeze({__proto__:null,create:rt,clone:it,copy:ot,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var m=new tt(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]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m},set:at,identity:st,transpose:ct,invert:lt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15];return t[0]=s*(h*y-d*m)-f*(c*y-l*m)+g*(c*d-l*h),t[1]=-(r*(h*y-d*m)-f*(i*y-o*m)+g*(i*d-o*h)),t[2]=r*(c*y-l*m)-s*(i*y-o*m)+g*(i*l-o*c),t[3]=-(r*(c*d-l*h)-s*(i*d-o*h)+f*(i*l-o*c)),t[4]=-(a*(h*y-d*m)-u*(c*y-l*m)+p*(c*d-l*h)),t[5]=n*(h*y-d*m)-u*(i*y-o*m)+p*(i*d-o*h),t[6]=-(n*(c*y-l*m)-a*(i*y-o*m)+p*(i*l-o*c)),t[7]=n*(c*d-l*h)-a*(i*d-o*h)+u*(i*l-o*c),t[8]=a*(f*y-d*g)-u*(s*y-l*g)+p*(s*d-l*f),t[9]=-(n*(f*y-d*g)-u*(r*y-o*g)+p*(r*d-o*f)),t[10]=n*(s*y-l*g)-a*(r*y-o*g)+p*(r*l-o*s),t[11]=-(n*(s*d-l*f)-a*(r*d-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*m-h*g)-u*(s*m-c*g)+p*(s*h-c*f)),t[13]=n*(f*m-h*g)-u*(r*m-i*g)+p*(r*h-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-a*(r*h-i*f)+u*(r*c-i*s),t},determinant:ut,multiply:ft,translate:ht,scale:dt,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,m,y,v,b,x,w,M,E,O,k,S,A,T=r[0],_=r[1],P=r[2],C=Math.hypot(T,_,P);return C<J?null:(T*=C=1/C,_*=C,P*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],m=e[9],y=e[10],v=e[11],b=T*T*a+o,x=_*T*a+P*i,w=P*T*a-_*i,M=T*_*a-P*i,E=_*_*a+o,O=P*_*a+T*i,k=T*P*a+_*i,S=_*P*a-T*i,A=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+h*x+m*w,t[2]=l*b+d*x+y*w,t[3]=u*b+p*x+v*w,t[4]=s*M+f*E+g*O,t[5]=c*M+h*E+m*O,t[6]=l*M+d*E+y*O,t[7]=u*M+p*E+v*O,t[8]=s*k+f*S+g*A,t[9]=c*k+h*S+m*A,t[10]=l*k+d*S+y*A,t[11]=u*k+p*S+v*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:pt,rotateY:gt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=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+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:mt,fromScaling:yt,fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<J?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:vt,fromQuat2:function(t,e){var n=new tt(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),vt(t,e,n),t},getTranslation:bt,getScaling:xt,getRotation:wt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,m=a*u,y=s*c,v=s*l,b=s*u,x=r[0],w=r[1],M=r[2];return t[0]=(1-(p+m))*x,t[1]=(h+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+m))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(d+v)*M,t[9]=(g-y)*M,t[10]=(1-(f+p))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Mt,fromQuat:Et,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=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*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Ot,perspective:kt,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?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:St,ortho:At,orthoZO:Tt,lookAt:_t,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],h=a-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,m=s*f-c*u;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-h*g,t[5]=h*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Pt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],m=t[14],y=t[15],v=e[0],b=e[1],x=e[2],w=e[3],M=e[4],E=e[5],O=e[6],k=e[7],S=e[8],A=e[9],T=e[10],_=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-v)<=J*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=J*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=J*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=J*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=J*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-E)<=J*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-O)<=J*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-k)<=J*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=J*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=J*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-T)<=J*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-_)<=J*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-P)<=J*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=J*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=J*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=J*Math.max(1,Math.abs(y),Math.abs(L))},mul:Ct,sub:Nt});function jt(){var t=new tt(3);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Rt(t){var e=new tt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function It(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Bt(t,e,n){var r=new tt(3);return r[0]=t,r[1]=e,r[2]=n,r}function Dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ft(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function zt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Gt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Wt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function $t(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 Ht(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function Yt(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 qt(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 a=a||1,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}function Ut(t,e,n){var r=e[0],i=e[1],o=e[2];return 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],t}function Xt(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=J*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=J*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=J*Math.max(1,Math.abs(i),Math.abs(s))}var Kt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},Zt=It;function Qt(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Jt(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 te(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ee(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function ne(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function re(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 ie(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t}jt(),function(){var t=Qt()}();var oe=function(t,e,n,r){var i=new tt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ae=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},se=ne,ce=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};jt(),Bt(1,0,0),Bt(0,1,0),te(),te(),et(),function(){var t,e=(t=new tt(2),tt!=Float32Array&&(t[0]=0,t[1]=0),t)}();var le=function(t,e){return le=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])},le(t,e)};function ue(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}le(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var fe=function(){return fe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},fe.apply(this,arguments)};function he(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function de(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function pe(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function ge(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(c){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]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){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,c])}}}function me(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 ye(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 ve(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function be(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var xe={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function we(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 Me={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ee(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Me[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Oe(t){return Ee(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ke(t){return Oe(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Se(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Me[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,Me[n]))),Me[n]););}function Ae(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 Te(t){return t>=48&&t<=57||43===t||45===t||46===t}function _e(t){return t>=48&&t<=57}function Pe(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),_e(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&_e(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&_e(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;_e(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&_e(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&_e(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'}function Ce(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(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 Ne(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Me[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,Ce(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Pe(t):Ae(t),t.err.length)return;t.data.push(t.param),Ce(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ce(t))}if(t.index>=t.max)break;if(!Te(n.charCodeAt(t.index)))break}Se(t)}else Se(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Le=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 je(t){if(Oe(t))return[].concat(t);var e=function(t){if(Ee(t))return[].concat(t);var e=new Le(t);for(Ce(e);e.index<e.max&&!e.err.length;)Ne(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],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e}))}function Re(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function Ie(t){if(ke(t))return[].concat(t);for(var e=je(t),n=fe({},xe),r=0;r<e.length;r+=1){e[r]=Re(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Be(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function De(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,m=e,y=n,v=r,b=s,x=c,w=120*Math.PI/180,M=Math.PI/180*(+i||0),E=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=Be(g,m,-M)).x,m=u.y;var O=(g-(b=(u=Be(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=O*O/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var A=y*y,T=v*v,_=(o===a?-1:1)*Math.sqrt(Math.abs((A*T-A*k*k-T*O*O)/(A*k*k+T*O*O)));d=_*y*k/v+(g+b)/2,p=_*-v*O/y+(m+x)/2,f=Math.asin(((m-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),a&&f>h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var C=h,N=b,L=x;h=f+w*(a&&h>f?1:-1),E=De(b=d+y*Math.cos(h),x=p+v*Math.sin(h),y,v,i,0,a,N,L,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),B=Math.sin(h),D=Math.tan(P/4),F=4/3*y*D,z=4/3*v*D,G=[g,m],W=[g+F*R,m-z*j],$=[b+F*B,x-z*I],H=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,H,E);for(var V=[],Y=0,q=(E=W.concat($,H,E)).length;Y<q;Y+=1)V[Y]=Y%2?Be(E[Y-1],E[Y],M).y:Be(E[Y],E[Y+1],M).x;return V}function Fe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var ze=function(t,e,n,r){return ve(ve([],Fe([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ge(t,e){var n,r,i,o,a,s,c,l,u,f=t[0],h=t.slice(1).map(Number),d=h[0],p=h[1],g=e.x1,m=e.y1,y=e.x,v=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=d,e.y=p,t;case"A":return n=[g,m].concat(h),["C"].concat(De(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=d,e.qy=p,n=[g,m].concat(h),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*o,l*i+u*a,l*s+u*o,l*c+u*a,s,c]));case"L":return["C"].concat(ze(g,m,d,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(ze(g,m,y,v))}return t}function We(t,e){if(void 0===e&&(e=!1),function(t){return ke(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=Ie(t),a=fe({},xe),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=Ge(o[f],a);o[f]=h,we(o,s,f),l=o.length,"Z"===c&&u.push(f),i=(r=o[f]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function $e(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function He(t,e,n,r,i){var o=$e([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Fe([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}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 Ve(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function Ye(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),m=u(r),y=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===m)return He(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:h(y)*v+f(y)*b,y:-f(y)*v+h(y)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=d(w),m*=d(w));var M=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(m,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(m,2)*Math.pow(x.x,2)),E=(o!==a?1:-1)*d(M=M<0?0:M),O=E*(g*x.y/m),k=E*(-m*x.x/g),S=h(y)*O-f(y)*k+(t+s)/2,A=f(y)*O+h(y)*k+(e+c)/2,T={x:(x.x-O)/g,y:(x.y-k)/m},_=Ve({x:1,y:0},T),P=Ve(T,{x:(-x.x-O)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=_+(P%=2*p)*l,N=g*h(C),L=m*f(C);return{x:h(y)*N-f(y)*L+S,y:f(y)*N+h(y)*L+A}}function qe(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,m=u.sampleSize,y=void 0===m?30:m,v="number"==typeof l,b=t,x=e,w=0,M=[b,x,w],E=[b,x],O={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(O={x:b,y:x});for(var S=0;S<=y;S+=1){if(b=(f=Ye(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,d&&k.push({x:b,y:x}),g&&(w+=$e(E,[b,x])),E=[b,x],v&&w>=l&&l>M[2]){var A=(w-l)/(w-M[2]);O={x:E[0]*(1-A)+M[0]*A,y:E[1]*(1-A)+M[1]*A}}M=[b,x,w]}return v&&l>=w&&(O={x:s,y:c}),{length:w,point:O,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function Ue(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function Xe(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,m=void 0===g?10:g,y="number"==typeof c,v=t,b=e,x=0,w=[v,b,x],M=[v,b],E={x:0,y:0},O=[{x:v,y:b}];y&&c<=0&&(E={x:v,y:b});for(var k=0;k<=m;k+=1){if(v=(u=Ue(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,h&&O.push({x:v,y:b}),p&&(x+=$e(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);E={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&c>=x&&(E={x:a,y:s}),{length:x,point:E,min:{x:Math.min.apply(null,O.map((function(t){return t.x}))),y:Math.min.apply(null,O.map((function(t){return t.y})))},max:{x:Math.max.apply(null,O.map((function(t){return t.x}))),y:Math.max.apply(null,O.map((function(t){return t.y})))}}}function Ke(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 Ze(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,m=t,y=e,v=0,b=[m,y,v],x=[m,y],w={x:0,y:0},M=[{x:m,y:y}];g&&a<=0&&(w={x:m,y:y});for(var E=0;E<=p;E+=1){if(m=(c=Ke(t,e,n,r,i,o,E/p)).x,y=c.y,u&&M.push({x:m,y:y}),h&&(v+=$e(x,[m,y])),x=[m,y],g&&v>=a&&a>b[2]){var O=(v-a)/(v-b[2]);w={x:x[0]*(1-O)+b[0]*O,y:x[1]*(1-O)+b[1]*O}}b=[m,y,v]}return g&&a>=v&&(w={x:i,y:o}),{length:v,point:w,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function Qe(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=Ie(t),d="number"==typeof e,p=[],g=0,m=0,y=0,v=0,b=[],x=[],w=0,M={x:0,y:0},E=M,O=M,k=M,S=0,A=0,T=h.length;A<T;A+=1)p=(l="M"===(u=(f=h[A])[0]))?p:[g,m].concat(f.slice(1)),l?(E=M={x:y=f[1],y:v=f[2]},w=0,d&&e<.001&&(k=M)):"L"===u?(w=(r=He(p[0],p[1],p[2],p[3],(e||0)-S)).length,M=r.min,E=r.max,O=r.point):"A"===u?(w=(i=qe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,M=i.min,E=i.max,O=i.point):"C"===u?(w=(o=Xe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,M=o.min,E=o.max,O=o.point):"Q"===u?(w=(a=Ze(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,M=a.min,E=a.max,O=a.point):"Z"===u&&(w=(s=He((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,E=s.max,O=s.point),d&&S<e&&S+w>=e&&(k=O),x.push(E),b.push(M),S+=w,g=(c="Z"!==u?f.slice(-2):[y,v])[0],m=c[1];return d&&e>=S&&(k={x:g,y:m}),{length:S,point:k,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Je(t){return function(t){var e=0,n=0,r=0;return We(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function tn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Xe(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=Fe(n,r,e),s=Fe(r,i,e),c=Fe(i,o,e),l=Fe(a,s,e),u=Fe(s,c,e),f=Fe(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function en(t,e,n){var r=tn(t),i=tn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(o,a),h=[l,u],d=[f-o,f-a],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:en(g[0],g[1],f)}function nn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function rn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function on(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function an(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function sn(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function cn(t,e){const n=[];for(const r of t)n[r]=e;return n}function ln(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function un(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=ln(t,n);if(null!==e)return[e,r]}}return[null,null]}function fn(t){return!(t instanceof Date)&&"object"==typeof t}const hn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{y1:on(cn(t,0))}})]};function dn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function gn(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=dn,n=(e,n)=>dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===dn||t===pn?t:mn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function mn(){return 0}function yn(t){return null===t?NaN:+t}hn.props={};const vn=gn(dn),bn=vn.right,xn=vn.left,wn=gn(yn).center;var Mn=bn;function En(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function On(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function kn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Sn extends Map{constructor(t,e=Tn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(An(this,t))}has(t){return super.has(An(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function An({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Tn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function _n(t){return t}function Pn(t,...e){return jn(t,_n,_n,e)}function Cn(t,...e){return jn(t,Array.from,_n,e)}function Nn(t,e,...n){return jn(t,_n,e,n)}function Ln(t,e,...n){return jn(t,Array.from,e,n)}function jn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Sn,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Rn(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const o=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),o.sort(((t,n)=>{for(const r of e){const e=Bn(r[t],r[n]);if(e)return e}}))):(n=t.map(n),o.sort(((t,e)=>Bn(n[t],n[e])))),r=t,i=o,Array.from(i,(t=>r[t]))}var r,i;return t.sort(In(n))}function In(t=dn){if(t===dn)return Bn;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Bn(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var Dn=Array.prototype.slice;function Fn(t){return()=>t}const zn=Math.sqrt(50),Gn=Math.sqrt(10),Wn=Math.sqrt(2);function $n(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=zn?10:o>=Gn?5:o>=Wn?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?$n(t,e,2*n):[s,c,l]}function Hn(t,e,n){return $n(t=+t,e=+e,n=+n)[2]}function Vn(t){return Math.max(1,Math.ceil(Math.log(En(t))/Math.LN2)+1)}function Yn(){var t=_n,e=kn,n=Vn;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===kn&&([u,f]=function(t,e,n){let r;for(;;){const i=Hn(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?$n(e,t,n):$n(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),h[0]<=u&&(a=Hn(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===kn){const t=Hn(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var m,y=new Array(d+1);for(i=0;i<=d;++i)(m=y[i]=[]).x0=i>0?h[i-1]:u,m.x1=i<d?h[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Math.min(d,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);y[Math.min(d,t+(h[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Mn(h,o,0,d)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Fn(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Fn([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Fn(Array.isArray(t)?Dn.call(t):t),r):n},r}function qn(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function Un(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Xn(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Kn(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Zn(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Bn:In(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);Zn(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(Qn(t,n,e),i(t[r],o)>0&&Qn(t,n,r);a<s;){for(Qn(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?Qn(t,n,s):(++s,Qn(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Qn(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Jn(t,e,n=yn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>yn(n(t[r],r,t)))),e<=0)return Kn(r);if(e>=1)return Un(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return Zn(i,a,0,o,((t,e)=>Bn(r[t],r[e]))),a=function(t,e=dn){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?dn(t,i)>0:0===dn(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}function tr(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function er(t,e){return function(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return Xn(t);if(e>=1)return qn(t);var r,i=(r-1)*e,o=Math.floor(i),a=qn(Zn(t,o).subarray(0,o+1));return a+(Xn(t.subarray(o+1))-a)*(i-o)}}(t,.5,e)}function nr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function rr(t){return t}function ir(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),rr)}function or(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function ar(t=""){throw new Error(t)}function sr(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||("transform"===e?(t.attr(e,""),t.attr(e,i)):t.attr(e,i))}function cr(t){return null!=t&&!Number.isNaN(t)}function lr(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function ur(t,e){return fr(t,e)||{}}function fr(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[I(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function hr(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function dr(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function pr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function gr(t){return null===t||!1===t}function mr(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];E(o)&&E(t[i])?mr(t[i],o,n,r+1):t[i]=o}return t}}function yr(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function vr(t){return t.map(((t,e)=>e))}function br(t){return t[0]}function xr(t){return t[t.length-1]}function wr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Mr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Mr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Er(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=ln(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>cr(t)));return Array.from(Pn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function Or(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:dn(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Cr((n=>t(e[n])))}(t):"series"===t?Ar:"value"===t?Tr:"sum"===t?_r:"maxIndex"===t?Pr:()=>null}function kr(t,e){for(const n of t)n.sort(e)}function Sr(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Ar(t,e,n){return Cr((t=>n[t]))}function Tr(t,e,n){return Cr((t=>e[t]))}function _r(t,e,n){const r=vr(t),i=Array.from(Pn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Cr((t=>o.get(n[t])))}function Pr(t,e,n){const r=vr(t),i=Array.from(Pn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,Un(n,(t=>e[t]))])));return Cr((t=>o.get(n[t])))}function Cr(t){return(e,n)=>dn(t(e),t(n))}const Nr=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:c,encode:l,style:u={}}=s,[f,h]=ln(l,"y"),[d,p]=ln(l,"y1"),[g]=a?un(l,"series","color"):ln(l,"color"),m=Er(e,t,s),y=Or(n)(c,f,g);y&&kr(m,y);const v=new Array(t.length),b=new Array(t.length),x=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=d?+d[t[0]]:0,n=[],i=[];for(const r of t){const t=x[r]=+f[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===f[o[s]];)s--;for(;c<a.length-1&&0===f[a[c]];)c++;w.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=x[t];l=v[t]=(b[t]=l)+e}let u=e;for(const t of n){const e=x[t];e>0?u=v[t]=(b[t]=u)+e:v[t]=b[t]=u}}const E=new Set(w),O=new Set(M),k="y"===i?v:b,S="y"===o?v:b;return[t,Y({},s,{encode:{y0:on(f,h),y:rn(k,h),y1:rn(S,p)},style:Object.assign({first:(t,e)=>E.has(e),last:(t,e)=>O.has(e)},u)})]}};Nr.props={};const Lr=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(gr(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>ln(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e])).join(", ")};return[t,Y({},n,{tooltip:{title:s}})]}};Lr.props={};const jr=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{x:on(cn(t,0))},scale:{x:{guide:null}}})]};jr.props={};const Rr=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{y:on(cn(t,0))},scale:{y:{guide:null}}})]};Rr.props={};const Ir=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{size:an(cn(t,3))}})]};Ir.props={};const Br=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=he(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map((({value:t})=>t)),a=t.map((t=>o.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,Y({},e,{encode:{key:rn(a)}})]};Br.props={};const Dr=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=ln(n,"color");return[t,Y({},e,{encode:{series:rn(o,a)}})]};Dr.props={};const Fr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{y:rn(n)}})]};Fr.props={};const zr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{x:rn(n)}})]};zr.props={};const Gr=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=ln(n,"y");return[t,Y({},e,{encode:{y1:rn([...i])}})]};Gr.props={};const Wr=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=ln(n,"x");return[t,Y({},e,{encode:{x1:rn([...i])}})]};Wr.props={};const $r=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(gr(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,Y({},n,{tooltip:{items:a}})]}};$r.props={};const Hr=()=>(t,e)=>[t,Y({scale:{x:{padding:0},y:{padding:0}}},e)];Hr.props={};const Vr=()=>(t,e)=>{const{data:n,style:r={}}=e,i=he(e,["data","style"]),{x:o,y:a}=r,s=he(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],Y({},i,{data:[0],cartesian:!0,encode:{x:rn([o||0]),y:rn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};Vr.props={};const Yr=()=>(t,e)=>{const{style:n={}}=e;return[t,Y({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};Yr.props={};const qr=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(fn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,Y({},e,{encode:{x:rn(i),y:rn(o)}})]};qr.props={};const Ur=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,Y({},e,{encode:{series:an(cn(t,void 0))}})]};Ur.props={};const Xr=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return he(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=ln(s,"y"),[f]=un(s,"series","color"),h=Sr(f,l),d=Er(e,t,o),p=Or(r)(a,u,f);p&&kr(d,p);const g=new Array(t.length);for(const t of d){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=h[e]}return[t,Y({},o,{scale:{series:{domain:h,paddingInner:i}},encode:{series:rn(g)}})]}};Xr.props={};const Kr=t=>{const{groupBy:e=["x"],reducer:n=((t,e)=>e[t[0]]),orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map((t=>[t,ln(s,t)[0]]));if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(Pn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=ln(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[cn(t,u)]:un(s,"enterDuration",cn(t,u)),[h]=un(s,"enterDelay",cn(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=qn(n,(t=>+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,Y({},a,{encode:{enterDuration:an(f),enterDelay:an(d)}})]}};Kr.props={};const Zr=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=he(i,["x"]),s=Object.entries(a).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,ln(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Er(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>Xn(t,(t=>e[+t])),max:(t,e)=>qn(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>tr(t,(t=>e[+t])),median:(t,e)=>er(t,(t=>e[+t])),sum:(t,e)=>nr(t,(t=>e[+t])),deviation:(t,e)=>On(t,(t=>e[+t]))}[t]||qn}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=gr(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,Y({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,rn(e,ln(i,t)[1])])))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Qr(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function Jr(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function ti(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}Zr.props={};const ei=Math.sqrt(50),ni=Math.sqrt(10),ri=Math.sqrt(2);function ii(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=ei?10:o>=ni?5:o>=ri?2:1)*10**i:-(10**-i)/(o>=ei?10:o>=ni?5:o>=ri?2:1)}function oi(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=ei?i*=10:o>=ni?i*=5:o>=ri&&(i*=2),e<t?-i:i}const ai=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=ii(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=ii(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=ii(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},si=1e3,ci=6e4,li=36e5,ui=864e5,fi=6048e5,hi=2592e6,di=31536e6;function pi(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);+l<+e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const gi=pi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),mi=pi(si,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+si*e)}),(t=>t.getSeconds())),yi=pi(ci,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ci*e)}),(t=>t.getMinutes())),vi=pi(li,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+li*e)}),(t=>t.getHours())),bi=pi(ui,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+ui*e)}),(t=>t.getDate()-1)),xi=pi(hi,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),wi=pi(fi,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+fi*e)}),(t=>{const e=xi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/fi)})),Mi=pi(di,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Ei={millisecond:gi,second:mi,minute:yi,hour:vi,day:bi,week:wi,month:xi,year:Mi},Oi=pi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),ki=pi(si,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+si*e)}),(t=>t.getUTCSeconds())),Si=pi(ci,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ci*e)}),(t=>t.getUTCMinutes())),Ai=pi(li,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+li*e)}),(t=>t.getUTCHours())),Ti=pi(ui,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+ui*e)}),(t=>t.getUTCDate()-1)),_i=pi(hi,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Pi=pi(fi,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+fi*e)}),(t=>{const e=_i.floor(t),n=new Date(+t);return Math.floor((+n-+e)/fi)})),Ci=pi(di,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),Ni={millisecond:Oi,second:ki,minute:Si,hour:Ai,day:Ti,week:Pi,month:_i,year:Ci};function Li(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Ni:Ei,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,h=r||(a-o)/f,d=s.length,p=ti(s,h,0,d,u);let g;if(p===d){g=[c,oi(o/c.duration,a/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(oi(o,a,f),1)]}return g}const ji=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Li(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var Ri=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Ii={}.toString,Bi=function(t,e){return Ii.call(t)==="[object "+e+"]"},Di=function(t){return null==t},Fi=function(t){return Array.isArray?Array.isArray(t):Bi(t,"Array")},zi=function(t){return"object"==typeof t&&null!==t},Gi=function(t){if(!zi(t)||!Bi(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},Wi=function(t){return Bi(t,"Number")},$i=function(t){return null===t},Hi=function(t){return void 0===t};function Vi(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&Gi(o)?(Gi(t[i])||(t[i]={}),n<r?Vi(t[i],o,n+1,r):t[i]=e[i]):Fi(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Yi=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Vi(t,e[r]);return t},qi=function(t,e){if(!Ri(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},Ui=function(t){return t};function Xi(t){return Di(t)?0:Ri(t)?t.length:Object.keys(t).length}function Ki(t){return!Hi(t)&&!$i(t)&&!Number.isNaN(t)}const Zi=t=>e=>-t(-e),Qi=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?Zi(r):r},Ji=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?Zi(n):n},to=(t,e,n,r)=>{const i=t<0,o=Qi(r,i),a=Ji(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};var eo={exports:{}},no={exports:{}},ro=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},io=Array.prototype.concat,oo=Array.prototype.slice,ao=no.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];ro(i)?e=io.call(e,oo.call(i)):e.push(i)}return e};ao.wrap=function(t){return function(){return t(ao(arguments))}};var so={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},co=no.exports,lo=Object.hasOwnProperty,uo=Object.create(null);for(var fo in so)lo.call(so,fo)&&(uo[so[fo]]=fo);var ho=eo.exports={to:{},get:{}};function po(t,e,n){return Math.min(Math.max(e,t),n)}function go(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}ho.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=ho.get.hsl(t),n="hsl";break;case"hwb":e=ho.get.hwb(t),n="hwb";break;default:e=ho.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},ho.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:lo.call(so,e[1])?((i=so[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=po(i[n],0,255);return i[3]=po(i[3],0,1),i},ho.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,po(parseFloat(e[2]),0,100),po(parseFloat(e[3]),0,100),po(isNaN(n)?1:n,0,1)]}return null},ho.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,po(parseFloat(e[2]),0,100),po(parseFloat(e[3]),0,100),po(isNaN(n)?1:n,0,1)]}return null},ho.to.hex=function(){var t=co(arguments);return"#"+go(t[0])+go(t[1])+go(t[2])+(t[3]<1?go(Math.round(255*t[3])):"")},ho.to.rgb=function(){var t=co(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},ho.to.rgb.percent=function(){var t=co(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},ho.to.hsl=function(){var t=co(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},ho.to.hwb=function(){var t=co(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},ho.to.keyword=function(t){return uo[t.slice(0,3)]};var mo=eo.exports;function yo(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function vo(t){const e=mo.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*yo(a,o,e+1/3),255*yo(a,o,e),255*yo(a,o,e-1/3),i]}(r):null}const bo=(t,e)=>n=>t*(1-n)+e*n,xo=(t,e)=>"number"==typeof t&&"number"==typeof e?bo(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=vo(t),r=vo(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,wo=(t,e)=>{const n=bo(t,e);return t=>Math.round(n(t))};function Mo({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Eo(t){return"object"==typeof t?t.valueOf():t}class Oo extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Eo,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Mo({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Mo({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class ko{constructor(t){this.options=Yi({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Yi({},this.options,t),this.rescale(t)}rescale(t){}}const So=Symbol("defaultUnknown");function Ao(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function To(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==So)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function _o(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Po extends ko{getDefaultOptions(){return{domain:[],range:[],unknown:So}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Ao(this.domainIndexMap,this.getDomain(),this.domainKey),To({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Ao(this.rangeIndexMap,this.getRange(),this.rangeKey),To({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=_o(e),this.rangeKey=_o(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Po(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Co(t){return Math.round(1e12*t)/1e12}function No(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),y=m.reduce(((t,e)=>t+e)),v=g/y,b=new Oo(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new Oo(e.map(((t,e)=>{const n=m[e]*v+p;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),M=u+(h-(w-w/c*i))*s;let E=a?Math.round(M):M;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=Co(E);const n=e[t];E+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Lo extends Po{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:So,flex:[]}}constructor(t){super(t)}clone(){return new Lo(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return No(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const jo=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=ii(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class Ro extends ko{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:jo}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return Wi(r)&&Wi(i)?t(r,i,n):[]}clone(){return new Ro(this.options)}}function Io(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Bo=[1,5,2,2.5,4,3],Do=100*Number.EPSILON;function Fo(t,e,n,r,i,o){const a=Xi(e),s=qi(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<Do||o-l<Do)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function zo(t,e,n){const r=Xi(e);return 1-qi(e,t)/(r-1)-n+1}function Go(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Wo(t,e){return t>=e?2-(t-1)/(e-1):1}function $o(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Ho(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const Vo=(t,e,n=5,r=!0,i=Bo,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=zo(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=Wo(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=Ho(t,e,h*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,m=Math.ceil(t/h)*c;if(g<=m){const n=m-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,m=Fo(l,i,c,n,d,p),y=$o(t,e,n,d),v=Go(f,a,t,e,n,d),b=1,x=o[0]*m+o[1]*y+o[2]*v+o[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=Io(s.lmax),u=Io(s.lmin),f=Io(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Io(u);for(let t=1;t<h;t+=1)d[t]=Io(d[t-1]+f);return d};class Yo extends ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Vo}}map(t){return Ki(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Yo(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return Wi(r)&&Wi(i)?n(r,i,e):[]}}const qo=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=Jr(r,i),c=n(o,a)):(s=Jr(i,r),c=n(a,o)),Qr(c,s)},Uo=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Jr(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=ti(t,e,1,r)-1,a=i[n];return Qr(o[n],a)(e)}},Xo=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Uo:qo)(t,e,r?wo:n);class Ko extends ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:bo,tickCount:5}}map(t){return Ki(t)?this.output(t):this.options.unknown}invert(t){return Ki(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return ai}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):Ui}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=Xo(n.map(t),r,o,i);this.output=Qr(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=Xo(i,r.map(t),bo);this.input=Qr(e,n,o)}}class Zo extends Ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:xo,tickMethod:jo,tickCount:5}}chooseTransforms(){return[Ui,Ui]}clone(){return new Zo(this.options)}}class Qo extends Lo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:So,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Qo(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Jo=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ta extends Ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:xo,tickMethod:jo,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[Ui,Ui];const e=.5===t?Jo:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new ta(this.options)}}class ea extends ta{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:xo,tickMethod:jo,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ea(this.options)}}class na extends ko{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!Ki(t))return this.options.unknown;const e=ti(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new na(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ra=(t,e,n,r=10)=>{const i=t<0,o=Ji(r,i),a=Qi(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=jo(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=jo(u,f,t).map(o)}return s?h.reverse():h};class ia extends Ko{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:xo,tickMethod:ra,tickCount:5}}chooseNice(){return to}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[Qi(t,n),Ji(t,n)]}clone(){return new ia(this.options)}}class oa extends na{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Vo}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=ai(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new oa(this.options)}}function aa(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class sa extends na{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Vo}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(aa(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new sa(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var ca=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,la=/\[([^]*?)\]/gm;function ua(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function fa(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var ha=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],da=["January","February","March","April","May","June","July","August","September","October","November","December"],pa=ua(da,3),ga=fa({},{dayNamesShort:ua(ha,3),dayNames:ha,monthNamesShort:pa,monthNames:da,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),ma=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},ya={D:function(t){return String(t.getDate())},DD:function(t){return ma(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return ma(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return ma(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return ma(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return ma(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return ma(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return ma(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return ma(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return ma(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return ma(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return ma(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ma(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ma(Math.floor(Math.abs(e)/60),2)+":"+ma(Math.abs(e)%60,2)}},va={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const ba=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Li(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function xa(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class wa extends Ko{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:ba,interpolate:bo,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return ji}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?Ni:Ei,r=e?xa:Ui;return e=>function(t,e,n){if(void 0===e&&(e=va.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=va[e]||e).replace(la,(function(t,e){return r.push(e),"@@@"}));var i=fa(fa({},ga),n);return(e=e.replace(ca,(function(e){return ya[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new wa(this.options)}}var Ma,Ea=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let Oa=Ma=class extends Zo{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Ui,tickMethod:jo,tickCount:5}}constructor(t){super(t)}clone(){return new Ma(this.options)}};function ka(t,e,n){if(null===t)return[-.5,.5];const r=Sr(t,e),i=new Lo({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Sa(t,e,n){return e*(1-t)+n*t}Oa=Ma=Ea([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return Wi(n)?Math.round(n):n})(i):i;this.output=Qr(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return Qr(bo(0,1),Jr(e,n))}))],Oa);const Aa=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=ln(o,"x"),[u]=ln(o,"y"),f=ka(l,s,n),h=ka(u,c,r),d=t.map((()=>Sa(i(),...h))),p=t.map((()=>Sa(i(),...f)));return[t,Y({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:rn(d),dx:rn(p)}})]}};Aa.props={};const Ta=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=ln(i,"x"),c=ka(s,a,e),l=t.map((()=>Sa(n(),...c)));return[t,Y({scale:{x:{padding:.5}}},r,{encode:{dx:rn(l)}})]}};Ta.props={};const _a=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=he(r,["x"]),o=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,ln(r,t)[0]])),a=o.map((([e])=>[e,new Array(t.length)])),s=Er(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap((t=>o.map((([,e])=>+e[t])))),[n,r]=kn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<o.length;n++){const[,r]=o[n],[,i]=a[n];i[t]=+r[t]+e}}return[t,Y({},n,{encode:Object.fromEntries(a.map((([t,e])=>[t,rn(e,ln(r,t)[1])])))})]}};_a.props={};const Pa=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=ln(i,"y"),[a,s]=ln(i,"y1");n?un(i,"series","color"):ln(i,"color");const c=Er(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+o[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=o[r]>i?i:o[r]}}return[t,Y({},r,{encode:{y1:rn(l,s)}})]}};function Ca(t,e){return[t[0]]}function Na(t,e){return[t[t.length-1]]}function La(t,e){return[t[Un(t,(t=>e[t]))]]}function ja(t,e){return[t[Kn(t,(t=>e[t]))]]}Pa.props={};const Ra=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=Er(e,t,i),[s]=ln(o,n),c=function(t){return"function"==typeof t?t:{first:Ca,last:Na,max:La,min:ja}[t]||Ca}(r);return[a.flatMap((t=>c(t,s))),i]}};Ra.props={};const Ia=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return Ra(Object.assign({channel:"x",selector:e},n))};Ia.props={};const Ba=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return Ra(Object.assign({channel:"y",selector:e},n))};function Da(t){return e=>null===e?t:`${t} of ${e}`}function Fa(){return[(t,e)=>tr(t,(t=>+e[t])),Da("mean")]}function za(){return[(t,e)=>er(t,(t=>+e[t])),Da("median")]}function Ga(){return[(t,e)=>qn(t,(t=>+e[t])),Da("max")]}function Wa(){return[(t,e)=>Xn(t,(t=>+e[t])),Da("min")]}function $a(){return[(t,e)=>t.length,Da("count")]}function Ha(){return[(t,e)=>nr(t,(t=>+e[t])),Da("sum")]}function Va(){return[(t,e)=>e[t[0]],Da("first")]}function Ya(){return[(t,e)=>e[t[t.length-1]],Da("last")]}Ba.props={};const qa=(t={})=>{const{groupBy:e}=t,n=he(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:Fa,max:Ga,count:$a,first:Va,last:Ya,sum:Ha,min:Wa,median:za}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=ln(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=ln(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},sn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=ln(o,t),r=a.map((t=>e[t[0]]));return[t,rn(r,n)]})),l=a.map((t=>i[t[0]]));return[vr(a),Y({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};qa.props={};const Ua=(t={})=>{const{channels:e=["x","y"]}=t,n=he(t,["channels"]);return qa(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Er(e,t,n)}))};Ua.props={};const Xa=(t={})=>Ua(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));Xa.props={};const Ka=(t={})=>Ua(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));Ka.props={};const Za=(t={})=>Ua(Object.assign(Object.assign({},t),{channels:["color"]}));function Qa(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=he(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=ln(c,a),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=ln(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>qn(t,(t=>+o[t]));if("min"===i)return t=>Xn(t,(t=>+o[t]));if("sum"===i)return t=>nr(t,(t=>+o[t]));if("median"===i)return t=>er(t,(t=>+o[t]));if("mean"===i)return t=>tr(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(a,s,c),d=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?Rn(Nn(t,e,n),(([t,e],[n,r])=>dn(e,r)||dn(t,n))):Rn(Pn(t,n),(([t,n],[r,i])=>e(n,i)||dn(t,r)))).map((([t])=>t))}(d,h,(t=>f[t]));i&&p.reverse();const g="number"==typeof o?[0,o]:o,m=o?p.slice(...g):p;return[t,Y(e,{scale:{[a]:{domain:m}}})]}Za.props={};const Ja=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=he(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?Qa(t,a,Object.assign({reverse:e,slice:n,channel:r},o)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=ln(o,i),s=Rn(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};Ja.props={};const ts=(t={})=>Ja(Object.assign(Object.assign({},t),{channel:"x"}));ts.props={};const es=(t={})=>Ja(Object.assign(Object.assign({},t),{channel:"color"}));es.props={};const ns=(t={})=>Ja(Object.assign(Object.assign({},t),{channel:"y"}));ns.props={};const rs=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=ln(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):ln(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>nr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Ln(t,l,(t=>s[t])).map((t=>t[1]));return[t,Y({},i,{scale:{x:{flex:u}}})]}};function is([t,e],[n,r]){return[t-n,e-r]}function os([t,e],[n,r]){return[t+n,e+r]}function as([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function ss([t,e]){return Math.atan2(e,t)}function cs([t,e]){return ss([t,e])+Math.PI/2}function ls(t,e){const n=ss(t),r=ss(e);return n<r?r-n:2*Math.PI-(n-r)}function us(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function fs([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function hs(t,e,n){const r=t.length;if(0===r)return[];const{innerWidth:i,innerHeight:o}=n,a=o/i;let s=Math.ceil(Math.sqrt(e/a)),c=i/s,l=Math.ceil(e/s),u=l*c;for(;u>o;)s+=1,c=i/s,l=Math.ceil(e/s),u=l*c;const f=o-l*c,h=l<=1?0:f/(l-1),[d,p]=l<=1?[(i-r*c)/(r-1),(o-c)/2]:[0,0];return t.map(((t,e)=>{const[n,r,i,o]=us(t),a=e%s,u=Math.floor(e/s);return`translate(${a*c-n+d*a}, ${(l-u-1)*c+f-r-h*u-p}) scale(${c/i}, ${c/o})`}))}rs.props={};const ds=()=>(t,e)=>[t,Y({},e,{modifier:hs,axis:!1})];ds.props={};const ps="thresholds";function gs(t){const[e,n]=kn(t);return Math.min(200,function(t,e,n){const r=En(t),i=On(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const ms=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=he(t,["groupChannels","binChannels"]),i={};return qa(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(ps))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=ln(a,t);return e})),c=ur(r,ps),l=t.filter((t=>s.every((e=>cr(e[t]))))),u=[...e.map((t=>{const[e]=ln(a,t);return e})).filter(cr).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||gs(n),o=Yn().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(Pn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};ms.props={};const ys=(t={})=>{const{thresholds:e}=t;return ms(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function vs(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const m=Math.floor((t+1)*c)+1,y=[o(h),a(h)];for(l=u=-1;g<m;g++)u=.5*Math.abs((y[0]-e)*(o(g)-y[1])-(y[0]-a(g))*(n-y[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}ys.props={};const bs=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return vs;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Kn(t,(t=>n[t]))]],max:(t,e,n)=>[t[Un(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],Jn(r,.5,i))]];var r,i}},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=Er(r,t,e),[s]=ln(o,"x"),[c]=ln(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};bs.props={};const xs=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=ln(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(cr);if(0===o.length)return[e,n];const a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e)),c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]]))})]));return[s,Y({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function ws(t){return function(){return t}}xs.props={};const Ms=Math.abs,Es=Math.atan2,Os=Math.cos,ks=Math.max,Ss=Math.min,As=Math.sin,Ts=Math.sqrt,_s=1e-12,Ps=Math.PI,Cs=Ps/2,Ns=2*Ps;function Ls(t){return t>=1?Cs:t<=-1?-Cs:Math.asin(t)}const js=Math.PI,Rs=2*js,Is=1e-6,Bs=Rs-Is;function Ds(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Fs{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ds:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ds;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>Is)if(Math.abs(u*s-c*l)>Is&&i){let h=n-o,d=r-a,p=s*s+c*c,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((js-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Is&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Is||Math.abs(this._y1-l)>Is)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%Rs+Rs),f>Bs?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>Is&&this._append`A${n},${n},0,${+(f>=js)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function zs(){return new Fs}function Gs(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Fs(e)}function Ws(t){return t.innerRadius}function $s(t){return t.outerRadius}function Hs(t){return t.startAngle}function Vs(t){return t.endAngle}function Ys(t){return t&&t.padAngle}function qs(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/Ts(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,w=i-o,M=h*g-p*d,E=(b<0?-1:1)*Ts(ks(0,w*w*x-M*M)),O=(M*b-v*E)/x,k=(-M*v-b*E)/x,S=(M*b+v*E)/x,A=(-M*v+b*E)/x,T=O-m,_=k-y,P=S-m,C=A-y;return T*T+_*_>P*P+C*C&&(O=S,k=A),{cx:O,cy:k,x01:-u,y01:-f,x11:O*(i/w-1),y11:k*(i/w-1)}}function Us(){var t=Ws,e=$s,n=ws(0),r=null,i=Hs,o=Vs,a=Ys,s=null,c=Gs(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Cs,p=o.apply(this,arguments)-Cs,g=Ms(p-d),m=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>_s)if(g>Ns-_s)s.moveTo(h*Os(d),h*As(d)),s.arc(0,0,h,d,p,!m),f>_s&&(s.moveTo(f*Os(p),f*As(p)),s.arc(0,0,f,p,d,m));else{var y,v,b=d,x=p,w=d,M=p,E=g,O=g,k=a.apply(this,arguments)/2,S=k>_s&&(r?+r.apply(this,arguments):Ts(f*f+h*h)),A=Ss(Ms(h-f)/2,+n.apply(this,arguments)),T=A,_=A;if(S>_s){var P=Ls(S/f*As(k)),C=Ls(S/h*As(k));(E-=2*P)>_s?(w+=P*=m?1:-1,M-=P):(E=0,w=M=(d+p)/2),(O-=2*C)>_s?(b+=C*=m?1:-1,x-=C):(O=0,b=x=(d+p)/2)}var N=h*Os(b),L=h*As(b),j=f*Os(M),R=f*As(M);if(A>_s){var I,B=h*Os(x),D=h*As(x),F=f*Os(w),z=f*As(w);if(g<Ps)if(I=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<_s))return[t+(h=(u*(e-o)-f*(t-i))/h)*c,e+h*l]}(N,L,F,z,B,D,j,R)){var G=N-I[0],W=L-I[1],$=B-I[0],H=D-I[1],V=1/As(function(t){return t>1?0:t<-1?Ps:Math.acos(t)}((G*$+W*H)/(Ts(G*G+W*W)*Ts($*$+H*H)))/2),Y=Ts(I[0]*I[0]+I[1]*I[1]);T=Ss(A,(f-Y)/(V-1)),_=Ss(A,(h-Y)/(V+1))}else T=_=0}O>_s?_>_s?(y=qs(F,z,N,L,h,_,m),v=qs(B,D,j,R,h,_,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),_<A?s.arc(y.cx,y.cy,_,Es(y.y01,y.x01),Es(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,_,Es(y.y01,y.x01),Es(y.y11,y.x11),!m),s.arc(0,0,h,Es(y.cy+y.y11,y.cx+y.x11),Es(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,_,Es(v.y11,v.x11),Es(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!m)):s.moveTo(N,L),f>_s&&E>_s?T>_s?(y=qs(j,R,B,D,f,-T,m),v=qs(N,L,F,z,f,-T,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),T<A?s.arc(y.cx,y.cy,T,Es(y.y01,y.x01),Es(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,Es(y.y01,y.x01),Es(y.y11,y.x11),!m),s.arc(0,0,f,Es(y.cy+y.y11,y.cx+y.x11),Es(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,T,Es(v.y11,v.x11),Es(v.y01,v.x01),!m))):s.arc(0,0,f,M,w,m):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ps/2;return[Os(r)*n,As(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ws(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ws(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ws(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:ws(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:ws(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function Xs(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Ks(t){this._context=t}function Zs(t){return new Ks(t)}function Qs(t){return t[0]}function Js(t){return t[1]}function tc(t,e){var n=ws(!0),r=null,i=Zs,o=null,a=Gs(s);function s(s){var c,l,u,f=(s=Xs(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Qs:ws(t),e="function"==typeof e?e:void 0===e?Js:ws(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:ws(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function ec(t,e,n){var r=null,i=ws(!0),o=null,a=Zs,s=null,c=Gs(l);function l(l){var u,f,h,d,p,g=(l=Xs(l)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===m)if(m=!m)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(y[h],v[h]);s.lineEnd(),s.areaEnd()}m&&(y[u]=+t(d,u,l),v[u]=+e(d,u,l),s.point(r?+r(d,u,l):y[u],n?+n(d,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return tc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Qs:ws(+t),e="function"==typeof e?e:ws(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Js:ws(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ws(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ws(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:ws(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}zs.prototype=Fs.prototype,Ks.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var nc=ic(Zs);function rc(t){this._curve=t}function ic(t){function e(e){return new rc(t(e))}return e._curve=t,e}function oc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(ic(t)):e()._curve},t}function ac(){}function sc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function cc(t,e){this._context=t,this._k=(1-e)/6}function lc(t,e){this._context=t,this._k=(1-e)/6}function uc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>_s){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>_s){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function fc(t,e){this._context=t,this._alpha=e}rc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},cc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:sc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:sc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new cc(t,e)}return n.tension=function(e){return t(+e)},n}(0),lc.prototype={areaStart:ac,areaEnd:ac,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:sc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new lc(t,e)}return n.tension=function(e){return t(+e)},n}(0),fc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:uc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var hc=function t(e){function n(t){return e?new fc(t,e):new cc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function dc(t,e){this._context=t,this._alpha=e}dc.prototype={areaStart:ac,areaEnd:ac,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:uc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var pc=function t(e){function n(t){return e?new dc(t,e):new lc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function gc(t){this._context=t}function mc(t){return new gc(t)}function yc(t,e){this._context=t,this._t=e}function vc(t){return new yc(t,.5)}function bc(t){return new yc(t,0)}function xc(t){return new yc(t,1)}function wc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Mc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Ec(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Oc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function kc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Sc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function Ac(t){return Oc(t)||Mc(t)}function Tc(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function _c(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}gc.prototype={areaStart:ac,areaEnd:ac,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},yc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Pc="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Cc={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),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=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=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.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 c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}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 c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&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}(Cc);var Nc=Cc.exports;function Lc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function jc(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Rc(){}var Ic=.7,Bc=1/Ic,Dc="\\s*([+-]?\\d+)\\s*",Fc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",zc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gc=/^#([0-9a-f]{3,8})$/,Wc=new RegExp("^rgb\\("+[Dc,Dc,Dc]+"\\)$"),$c=new RegExp("^rgb\\("+[zc,zc,zc]+"\\)$"),Hc=new RegExp("^rgba\\("+[Dc,Dc,Dc,Fc]+"\\)$"),Vc=new RegExp("^rgba\\("+[zc,zc,zc,Fc]+"\\)$"),Yc=new RegExp("^hsl\\("+[Fc,zc,zc]+"\\)$"),qc=new RegExp("^hsla\\("+[Fc,zc,zc,Fc]+"\\)$"),Uc={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 Xc(){return this.rgb().formatHex()}function Kc(){return this.rgb().formatRgb()}function Zc(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Gc.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Qc(e):3===n?new tl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Jc(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Jc(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=Wc.exec(t))?new tl(e[1],e[2],e[3],1):(e=$c.exec(t))?new tl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Hc.exec(t))?Jc(e[1],e[2],e[3],e[4]):(e=Vc.exec(t))?Jc(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Yc.exec(t))?il(e[1],e[2]/100,e[3]/100,1):(e=qc.exec(t))?il(e[1],e[2]/100,e[3]/100,e[4]):Uc.hasOwnProperty(t)?Qc(Uc[t]):"transparent"===t?new tl(NaN,NaN,NaN,0):null}function Qc(t){return new tl(t>>16&255,t>>8&255,255&t,1)}function Jc(t,e,n,r){return r<=0&&(t=e=n=NaN),new tl(t,e,n,r)}function tl(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function el(){return"#"+rl(this.r)+rl(this.g)+rl(this.b)}function nl(){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 rl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function il(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new al(t,e,n,r)}function ol(t){if(t instanceof al)return new al(t.h,t.s,t.l,t.opacity);if(t instanceof Rc||(t=Zc(t)),!t)return new al;if(t instanceof al)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,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new al(a,s,c,t.opacity)}function al(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function sl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function cl(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ll(t,e){var n=Math.min.apply(Math,ve([],ye(t),!1)),r=Math.min.apply(Math,ve([],ye(e),!1));return{x:n,y:r,width:Math.max.apply(Math,ve([],ye(t),!1))-n,height:Math.max.apply(Math,ve([],ye(e),!1))-r}}function ul(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function fl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function hl(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),c=1/0,l=-1/0,u=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;o<a?o<h&&h<a&&u.push(h):a<h&&h<o&&u.push(h)}for(f=0;f<u.length;f++){var d=ul(t,0,n,r,i,u[f]);d<c&&(c=d),d>l&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,y=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var v=p+f;o<a?o<v&&v<a&&y.push(v):a<v&&v<o&&y.push(v)}for(f=0;f<y.length;f++){var b=fl(0,e,n,r,i,y[f]);b<g&&(g=b),b>m&&(m=b)}return{x:c,y:g,width:l-c,height:m-g}}Lc(Rc,Zc,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Xc,formatHex:Xc,formatHsl:function(){return ol(this).formatHsl()},formatRgb:Kc,toString:Kc}),Lc(tl,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Rc||(i=Zc(i)),i?new tl((i=i.rgb()).r,i.g,i.b,i.opacity):new tl):new tl(t,e,n,null==r?1:r);var i}),jc(Rc,{brighter:function(t){return t=null==t?Bc:Math.pow(Bc,t),new tl(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Ic:Math.pow(Ic,t),new tl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:el,formatHex:el,formatRgb:nl,toString:nl})),Lc(al,(function(t,e,n,r){return 1===arguments.length?ol(t):new al(t,e,n,null==r?1:r)}),jc(Rc,{brighter:function(t){return t=null==t?Bc:Math.pow(Bc,t),new al(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Ic:Math.pow(Ic,t),new al(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new tl(sl(t>=240?t-240:t+120,i,r),sl(t,i,r),sl(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var dl=1e-4;function pl(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],l=20;o&&o>200&&(l=o/10);for(var u=1/l,f=u/10,h=0;h<=l;h++){var d=h*u,p=[i.apply(void 0,ve([],ye(t.concat([d])),!1)),i.apply(void 0,ve([],ye(e.concat([d])),!1))];(v=cl(c[0],c[1],p[0],p[1]))<s&&(a=d,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(h=0;h<32&&!(f<dl);h++){var m=a-f,y=a+f,v=(p=[i.apply(void 0,ve([],ye(t.concat([m])),!1)),i.apply(void 0,ve([],ye(e.concat([m])),!1))],cl(c[0],c[1],p[0],p[1]));if(m>=0&&v<s)a=m,s=v;else{var b=[i.apply(void 0,ve([],ye(t.concat([y])),!1)),i.apply(void 0,ve([],ye(e.concat([y])),!1))],x=cl(c[0],c[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):f*=.5}}return{x:i.apply(void 0,ve([],ye(t.concat([a])),!1)),y:i.apply(void 0,ve([],ye(e.concat([a])),!1))}}function gl(t,e,n,r){return cl(t,e,n,r)}function ml(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function yl(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function vl(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 bl(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,u=[];if(C(s,0))C(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;C(f,0)?u.push(-c/(2*s)):f>0&&(o=(-c-(a=Math.sqrt(f)))/(2*s),(i=(-c+a)/(2*s))>=0&&i<=1&&u.push(i),o>=0&&o<=1&&u.push(o))}return u}function xl(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=bl(t,n,i,a),f=bl(e,r,o,s),h=0;h<u.length;h++)c.push(vl(t,n,i,a,u[h]));for(h=0;h<f.length;h++)l.push(vl(e,r,o,s,f[h]));return ll(c,l)}function wl(t,e,n,r,i,o,a,s,c,l,u){var f=function(t,e,n,r,i,o,a,s,c,l,u){return pl([t,n,i,a],[e,r,o,s],c,l,vl,u)}(t,e,n,r,i,o,a,s,c,l,u);return cl(f.x,f.y,c,l)}function Ml(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=cl(r[0],r[1],i[0],i[1])}return e}(t)}function El(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ol(t,e,n){var r=t+n-2*e;if(C(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function kl(t,e,n,r,i,o){var a=Ol(t,n,i)[0],s=Ol(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(El(t,n,i,a)),void 0!==s&&l.push(El(e,r,o,s)),ll(c,l)}function Sl(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return pl([t,n,i],[e,r,o],a,s,El)}(t,e,n,r,i,o,a,s);return cl(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Pc||"undefined"!=typeof self&&self;var Al={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,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var h=t[r],d=i,p=o;for(n(t,i,r),a(t[o],h)>0&&n(t,i,o);d<p;){for(n(t,d,p),d++,p--;a(t[d],h)<0;)d++;for(;a(t[p],h)>0;)p--}0===a(t[i],h)?n(t,i,p):n(t,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-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;r<e.length;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=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];c(i,t.leaf?r(a):a)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(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(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;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(this.data.height<n.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=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.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(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));v(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);v(t,u,f,c,this.compareMinY);for(var h=u;h<=f;h+=c){var d=Math.min(h+c-1,f);i.children.push(this._build(t,h,d,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;s<e.children.length;s++){var c=e.children[s],l=f(c),u=d(t,c)-l;u<o?(o=u,i=l<i?l:i,a=c):u===o&&l<i&&(i=l,a=c)}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),c(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=y(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=y([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;a<=n-e;a++){var c=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),u=p(c,l),h=f(c)+f(l);u<i?(i=u,r=a,o=h<o?h:o):u===i&&h<o&&(o=h,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&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),l=h(o)+h(a),u=e;u<n-e;u++){var f=t.children[u];c(o,t.leaf?i(f):f),l+=h(o)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];c(a,t.leaf?i(p):p),l+=h(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)c(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}()}(Al);var Tl,_l,Pl=Al.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(Tl||(Tl={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(_l||(_l={}));var Cl=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);n>=0&&t.context.renderingPlugins.splice(n,1)}))},t}(),Nl=function(){function t(t){this.clipSpaceNearZ=_l.NEGATIVE_ONE,this.plugins=[],this.config=fe({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return t.prototype.registerPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function Ll(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function jl(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Rl(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Il(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Bl(t){return void 0===t?0:t>360||t<-360?t%360:t}function Dl(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Rt(t):_(t)?Bt(t,e,n):Bt(t[0],t[1]||e,t[2]||n)}function Fl(t){return t*(Math.PI/180)}function zl(t){return t*(180/Math.PI)}function Gl(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=ye(xt(jt(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return l<i?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,c=o*o,l=n*n+a+s+c,u=n*o-r*i;return u>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*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+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function Wl(t,e,n,r,i){var o,a,s,c,l,u,f,h,d,p,g=Math.cos(t),m=Math.sin(t);return o=r*g,a=i*m,s=0,c=-r*m,l=i*g,u=0,f=e,h=n,d=1,(p=new tt(9))[0]=o,p[1]=a,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=h,p[8]=d,p}function $l(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);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=zl(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Hl=rt(),Vl=rt(),Yl=Qt(),ql=[jt(),jt(),jt()],Ul=jt();function Xl(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 Kl,Zl=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){Ll(this.center,t),Ll(this.halfExtents,e),jl(this.min,this.center,this.halfExtents),Rl(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Rl(this.center,e,t),Il(this.center,this.center,.5),jl(this.halfExtents,e,t),Il(this.halfExtents,this.halfExtents,.5),Ll(this.min,t),Ll(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],c=a[1],l=a[2],u=r-s,f=r+s,h=i-c,d=i+c,p=o-l,g=o+l,m=e.center,y=m[0],v=m[1],b=m[2],x=e.halfExtents,w=x[0],M=x[1],E=x[2],O=y-w,k=y+w,S=v-M,A=v+M,T=b-E,_=b+E;O<u&&(u=O),k>f&&(f=k),S<h&&(h=S),A>d&&(d=A),T<p&&(p=T),_>g&&(g=_),n[0]=.5*(u+f),n[1]=.5*(h+d),n[2]=.5*(p+g),a[0]=.5*(f-u),a[1]=.5*(d-h),a[2]=.5*(g-p),this.min[0]=u,this.min[1]=h,this.min[2]=p,this.max[0]=f,this.max[1]=d,this.max[2]=g}},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],c=e[8],l=e[1],u=e[5],f=e[9],h=e[2],d=e[6],p=e[10],g=Math.abs(a),m=Math.abs(s),y=Math.abs(c),v=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),M=Math.abs(d),E=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+h*i[0]+d*i[1]+p*i[2],r[0]=g*o[0]+m*o[1]+y*o[2],r[1]=v*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+M*o[1]+E*o[2],jl(this.min,n,r),Rl(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]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[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?Ll([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?Ll([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}(),Ql=function(){function t(t,e){this.distance=t||0,this.normal=e||Bt(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 Ht(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/Zt(this.normal);Wt(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&&i<=1;return o&&n&&Yt(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Kl||(Kl={}));var Jl,tu,eu,nu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Ql)}return t.prototype.extractFromVPMatrix=function(t){var e=ye(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],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15];Ft(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=y-p,Ft(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=y+p,Ft(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=y+g,Ft(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=y-g,Ft(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=y-m,Ft(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),ru=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}(),iu=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}(),ou="Method not implemented.",au="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(Jl||(Jl={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(tu||(tu={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(eu||(eu={}));var su,cu,lu,uu,fu,hu="updated",du=2e-4,pu=function(){function t(){this.clipSpaceNearZ=_l.NEGATIVE_ONE,this.eventEmitter=new Nc,this.matrix=rt(),this.right=Bt(1,0,0),this.up=Bt(0,1,0),this.forward=Bt(0,0,1),this.position=Bt(0,0,1),this.focalPoint=Bt(0,0,0),this.distanceVector=Bt(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=rt(),this.projectionMatrixInverse=rt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Jl.EXPLORING,this.trackingMode=tu.DEFAULT,this.projectionMode=eu.PERSPECTIVE,this.frustum=new nu,this.orthoMatrix=rt()}return t.prototype.isOrtho=function(){return this.projectionMode===eu.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.type===Jl.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Jl.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==Jl.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return lt(rt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=mt(rt(),[t,e,0]);this.jitteredProjectionMatrix=ft(rt(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===eu.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===eu.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===eu.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},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===eu.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},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===eu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===eu.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.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=Bt(a.x-r,a.y-i,0),c=Ht(s,this.right)/It(this.right),l=Ht(s,this.up)/It(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=eu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(Fl(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,o-=this.view.offsetY*a/u,s*=this.view.width/l,a*=this.view.height/u}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var c,l,u=2*o/(n-e),f=2*o/(r-i),h=(n+e)/(n-e),d=(r+i)/(r-i);s?(c=-a/(a-o),l=-a*o/(a-o)):(c=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=h,t[9]=d,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,c,c+s,o,o-a,t,this.far,this.clipSpaceNearZ===_l.ZERO),dt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),lt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=eu.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,h=l+s,d=u+c,p=u-c;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===_l.NEGATIVE_ONE?At(this.projectionMatrix,f,h,p,d,i,o):Tt(this.projectionMatrix,f,h,p,d,i,o),dt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),lt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Dl(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=Bt(0,1,0);if(this.focalPoint=Dl(t,e,n),this.trackingMode===tu.CINEMATIC){var i=Gt(jt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=It(i),a=zl(Math.asin(e/o)),s=90+zl(Math.atan2(n,t)),c=rt();gt(c,c,Fl(s)),pt(c,c,Fl(a)),r=qt(jt(),[0,1,0],c)}return lt(this.matrix,_t(rt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<du&&(this.distance=du),this.dollyingStep=this.distance/100;var e=jt();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=Bl(t),this.computeMatrix(),this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=Bl(t),this.computeMatrix(),this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=Bl(t),this.computeMatrix(),this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=ee(te(),[0,0,1],Fl(this.roll));st(this.matrix);var e=ee(te(),[1,0,0],Fl((this.rotateWorld&&this.type!==Jl.TRACKING||this.type===Jl.TRACKING?1:-1)*this.elevation)),n=ee(te(),[0,1,0],Fl((this.rotateWorld&&this.type!==Jl.TRACKING||this.type===Jl.TRACKING?1:-1)*this.azimuth)),r=ne(te(),n,e);r=ne(te(),r,t);var i=Et(rt(),r);this.type===Jl.ORBITING||this.type===Jl.EXPLORING?(ht(this.matrix,this.matrix,this.focalPoint),ft(this.matrix,this.matrix,i),ht(this.matrix,this.matrix,[0,0,this.distance])):this.type===Jl.TRACKING&&(ht(this.matrix,this.matrix,this.position),ft(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=Dl(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()},t.prototype._getAxes=function(){Dt(this.right,Dl(Jt(Qt(),[1,0,0,0],this.matrix))),Dt(this.up,Dl(Jt(Qt(),[0,1,0,0],this.matrix))),Dt(this.forward,Dl(Jt(Qt(),[0,0,1,0],this.matrix))),$t(this.right,this.right),$t(this.up,this.up),$t(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=It(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Jl.TRACKING||this.rotateWorld?(this.elevation=zl(Math.asin(e/r)),this.azimuth=zl(Math.atan2(-t,-n))):(this.elevation=-zl(Math.asin(e/r)),this.azimuth=-zl(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Dt(this.position,Dl(Jt(Qt(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;Ut(this.distanceVector,[0,0,-this.distance],(t=et(),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)),zt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Gt(jt(),this.focalPoint,this.position),this.distance=It(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===eu.ORTHOGRAPHIC){var t=this.position,e=ee(te(),[0,0,1],-this.roll*Math.PI/180);Mt(this.orthoMatrix,e,Bt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Bt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=ft(rt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(hu)}},t.prototype.rotate=function(t,e,n){throw new Error(ou)},t.prototype.pan=function(t,e){throw new Error(ou)},t.prototype.dolly=function(t){throw new Error(ou)},t.prototype.createLandmark=function(t,e){throw new Error(ou)},t.prototype.gotoLandmark=function(t,e){throw new Error(ou)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(ou)},t}();function gu(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;i<arguments.length;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(gu.Cache||Map),n}gu.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(su||(su={})),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"}(cu||(cu={})),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"}(lu||(lu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(uu||(uu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(fu||(fu={}));var mu,yu=[{name:"em",unit_type:su.kEms},{name:"px",unit_type:su.kPixels},{name:"deg",unit_type:su.kDegrees},{name:"rad",unit_type:su.kRadians},{name:"grad",unit_type:su.kGradians},{name:"ms",unit_type:su.kMilliseconds},{name:"s",unit_type:su.kSeconds},{name:"rem",unit_type:su.kRems},{name:"turn",unit_type:su.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"}(mu||(mu={}));var vu,bu=function(t){return t?"number"===t?su.kNumber:"percent"===t||"%"===t?su.kPercentage:function(t){return yu.find((function(e){return e.name===t})).unit_type}(t):su.kUnknown},xu=function(t){var e=1;switch(t){case su.kPixels:case su.kDegrees:case su.kSeconds:break;case su.kMilliseconds:e=.001;break;case su.kRadians:e=180/Math.PI;break;case su.kGradians:e=.9;break;case su.kTurns:e=360}return e},wu=function(t){switch(t){case su.kNumber:case su.kInteger:return"";case su.kPercentage:return"%";case su.kEms:return"em";case su.kRems:return"rem";case su.kPixels:return"px";case su.kDegrees:return"deg";case su.kRadians:return"rad";case su.kGradians:return"grad";case su.kMilliseconds:return"ms";case su.kSeconds:return"s";case su.kTurns:return"turn"}return""},Mu=function(){function t(){}return t.isAngle=function(t){return t===su.kDegrees||t===su.kRadians||t===su.kGradians||t===su.kTurns},t.isLength=function(t){return t>=su.kEms&&t<su.kDegrees},t.isRelativeUnit=function(t){return t===su.kPercentage||t===su.kEms||t===su.kRems},t.isTime=function(t){return t===su.kSeconds||t===su.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(uu.kNo,fu.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=mu.kUnitType&&this.getType()<=mu.kClampType},t}(),Eu=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return ue(e,t),e.prototype.getType=function(){return mu.kColorType},e.prototype.to=function(t){return this},e}(Mu);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(vu||(vu={}));var Ou=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return ue(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 mu.kColorType},e}(Mu),ku=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return ue(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return mu.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Mu),Su=gu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Au=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Tu(t){return"function"==typeof t}var _u={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Pu=gu((function(t){var e=Su(t),n=_u[e];return e=(null==n?void 0:n.alias)||e})),Cu=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw new Error}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Nu=function(t){return function(t){switch(t){case cu.kUNumber:return su.kNumber;case cu.kULength:return su.kPixels;case cu.kUPercent:return su.kPercentage;case cu.kUTime:return su.kSeconds;case cu.kUAngle:return su.kDegrees;default:return su.kUnknown}}(function(t){switch(t){case su.kNumber:case su.kInteger:return cu.kUNumber;case su.kPercentage:return cu.kUPercent;case su.kPixels:return cu.kULength;case su.kMilliseconds:case su.kSeconds:return cu.kUTime;case su.kDegrees:case su.kRadians:case su.kGradians:case su.kTurns:return cu.kUAngle;default:return cu.kUOther}}(t))},Lu=function(t){function e(e,n){void 0===n&&(n=su.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?bu(n):n,i.unit=r,i.value=e,i}return ue(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){var e=t;return this.value===e.value&&this.unit===e.unit},e.prototype.getType=function(){return mu.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Nu(this.unit);if(n!==Nu(t)||n===su.kUnknown)return null;var r=xu(this.unit)/xu(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case su.kUnknown:break;case su.kInteger:r=Number(this.value).toFixed(0);break;case su.kNumber:case su.kPercentage:case su.kEms:case su.kRems:case su.kPixels:case su.kDegrees:case su.kRadians:case su.kGradians:case su.kMilliseconds:case su.kSeconds:case su.kTurns:var i=this.value,o=wu(this.unit);if(i<-999999||i>999999){var a=wu(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?Cu(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Mu),ju=new Lu(0,"px");new Lu(1,"px");var Ru,Iu,Bu=new Lu(0,"deg"),Du=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 ue(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}(Eu),Fu=new ku("unset"),zu=new ku("initial"),Gu=new ku("inherit"),Wu={"":Fu,unset:Fu,initial:zu,inherit:Gu},$u=function(t){return Wu[t]||(Wu[t]=new ku(t)),Wu[t]},Hu=new Du(0,0,0,0,!0),Vu=new Du(0,0,0,0),Yu=gu((function(t,e,n,r){return new Du(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),qu=function(t,e){return void 0===e&&(e=su.kNumber),new Lu(t,e)},Uu=new Lu(50,"%");!function(t){t[t.Standard=0]="Standard"}(Ru||(Ru={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(Iu||(Iu={}));var Xu,Ku={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new iu(0,0,0,0)};function Zu(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(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(Xu||(Xu={}));var Qu=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 new Error(e+": "+t)}function r(){var t=d(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,c)||o("repeating-radial-gradient",t.repeatingRadialGradient,c)||o("conic-gradient",t.conicGradient,c)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(p)}}))}function a(e,r){var i=b(e);if(i){b(t.startCall)||n("Missing (");var o=r(i);return b(t.endCall)||n("Missing )"),o}}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function c(){var n,r,i=l();return i&&((n=[]).push(i),r=e,b(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=v("shape",/^(circle)/i,0);t&&(t.style=y()||u());return t}()||function(){var t=v("shape",/^(ellipse)/i,0);t&&(t.style=m()||u());return t}();if(t)t.at=f();else{var e=u();if(e){t=e;var n=f();n&&(t.at=n)}else{var r=h();r&&(t={type:"default-radial",at:r})}}return t}function u(){return v("extent-keyword",t.extentKeywords,1)}function f(){if(v("position",/^at/,0)){var t=h();return t||n("Missing positioning value"),t}}function h(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);b(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=v("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:d(g)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:d(g)}}))||v("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function g(){return b(t.number)[1]}function m(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||y()}function y(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,n){var r=b(e);if(r)return{type:t,value:r[n]}}function b(t){var n=/^[\n\r\t\s]+/.exec(e);n&&x(n[0].length);var r=t.exec(e);return r&&x(r[0].length),r}function x(t){e=e.substring(t)}return function(t){return e=t,r()}}();var Ju=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,tf=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ef=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,nf=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var rf={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},of=gu((function(t){var e;return e="angular"===t.type?Number(t.value):rf[t.value]||0,qu(e,"deg")})),af=gu((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:qu(e,r),cy:qu(n,i)}})),sf=gu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Qu(t).map((function(t){var e=t.type,n=t.orientation,r=t.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;s<i;s++){var c=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!y(c)&&!y(a)){for(var l=1;l<s-o;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(s-o))};o=s,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:qu(Number(t.length.value),"%"),color:Zu(t)}}));if("linear-gradient"===e)return new Ou(vu.LinearGradient,{angle:n?of(n):Bu,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=af(n[0].at),a=o.cx,s=o.cy,c=void 0;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;c="extent-keyword"===u?$u(f):qu(f,u)}return new Ou(vu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Ju.exec(t);if(r){var i=(null===(e=r[2].match(nf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Ou(vu.LinearGradient,{angle:qu(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:qu(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=tf.exec(t);if(n){var r=(null===(e=n[4].match(nf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:qu(50,"%"),cy:qu(50,"%"),steps:r.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:qu(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!A(o))return[new Ou(vu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=ef.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}(t)}));function cf(t){return t&&!!t.image}function lf(t){return t&&!y(t.r)&&!y(t.g)&&!y(t.b)}var uf=gu((function(t){if(cf(t))return fe({repetition:"repeat"},t);if(y(t)&&(t=""),"transparent"===t)return Vu;"currentColor"===t&&(t="black");var e=sf(t);if(e)return e;var n=Zc(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Yu.apply(void 0,ve([],ye(r),!1))}));function ff(t,e){if(lf(t)&&lf(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;n<3;n++)e[n]=Math.round(T(e[n],0,255));return e[3]=T(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function hf(t,e){if(y(e))return qu(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return qu(Number(e),"px");if("deg".search(t)>=0)return qu(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 qu(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var df=gu((function(t){return hf(new RegExp("px","g"),t)}));gu((function(t){return hf(new RegExp("%","g"),t)}));var pf=function(t){return _(t)||isFinite(Number(t))?qu(Number(t)||0,"px"):hf(new RegExp("px|%|em|rem","g"),t)},gf=gu((function(t){return hf(new RegExp("deg|rad|grad|turn","g"),t)}));function mf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=Nu(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=wu(t.unit)):(Lu.isLength(t.unit)||Lu.isLength(e.unit))&&(a=xf(t,i,n),s=xf(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function yf(t){var e=0;return t.unit===su.kDegrees?e=t.value:t.unit===su.kRadians?e=zl(Number(t.value)):t.unit===su.kTurns&&(e=360*Number(t.value)),e}function vf(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):A(t)?n=t.split(" ").map((function(t){return Number(t)})):_(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 bf(t){return A(t)?t.split(" ").map((function(t){return pf(t)})):t.map((function(t){return pf(t.toString())}))}function xf(t,e,n){if(0===t.value)return 0;if(t.unit===su.kPixels)return Number(t.value);if(t.unit===su.kPercentage&&n){var r=n.nodeName===Tl.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var wf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Mf(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,wf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return hf(/deg|rad|grad|turn|px|%/g,t)||uf(t)}))}),n.lastIndex===t.length)return r}return[]}function Ef(t){return t.toString()}var Of=gu((function(t){return"number"==typeof t?qu(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?qu(Number(t)):qu(0)}));function kf(t,e){return[t,e,Ef]}function Sf(t,e){return function(n,r){return[n,r,function(n){return Ef(T(n,t,e))}]}}function Af(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Tf(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Qe(t.parsedStyle.path.absolutePath,void 0,fe(fe({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function _f(t,e){return t[0]===e[0]&&t[1]===e[1]}function Pf(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.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!c||0===Math.sin(c)||C(c,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(u-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function Cf(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}gu((function(t){return A(t)?t.split(" ").map(Of):t.map(Of)}));var Nf=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},Lf=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=Fl(r=j(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 l=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e=Math.sqrt(h)*e,n=Math.sqrt(h)*n);var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));d=d<0?0:d;var p=(i!==o?1:-1)*Math.sqrt(d),g=p*(e*f.y/n),m=p*(-n*f.x/e),y={x:Math.cos(c)*g-Math.sin(c)*m+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*m+(t.y+a.y)/2},v={x:(f.x-g)/e,y:(f.y-m)/n},b=Nf({x:1,y:0},v),x=Nf(v,{x:(-f.x-g)/e,y:(-f.y-m)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,M=e*Math.cos(w),E=n*Math.sin(w);return{x:Math.cos(c)*M-Math.sin(c)*E+y.x,y:Math.sin(c)*M+Math.cos(c)*E+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function jf(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,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=Lf({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=Lf({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=h.x-f.x,p=h.y-f.y,g=Math.sqrt(d*d+p*p);return{x:-d/g,y:-p/g}}function Rf(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function If(t,e){return Rf(t)*Rf(e)?(t[0]*e[0]+t[1]*e[1])/(Rf(t)*Rf(e)):1}function Bf(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(If(t,e))}function Df(t,e){var n=e[1],r=e[2],i=j(Fl(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],c=t[1],l=e[6],u=e[7],f=Math.cos(i)*(s-l)/2+Math.sin(i)*(c-u)/2,h=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(c-u)/2,d=f*f/(n*n)+h*h/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(h*h)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var m=r?g*n*h/r:0,y=n?g*-r*f/n:0,v=(s+l)/2+Math.cos(i)*m-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*m+Math.cos(i)*y,x=[(f-m)/n,(h-y)/r],w=[(-1*f-m)/n,(-1*h-y)/r],M=Bf([1,0],x),E=Bf(x,w);return If(x,w)<=-1&&(E=Math.PI),If(x,w)>=1&&(E=0),0===a&&E>0&&(E-=2*Math.PI),1===a&&E<0&&(E+=2*Math.PI),{cx:v,cy:b,rx:_f(t,[l,u])?0:n,ry:_f(t,[l,u])?0:r,startAngle:M,endAngle:M+E,xRotation:i,arcFlag:o,sweepFlag:a}}function Ff(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,c,r-a,c,r],["C",c,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function zf(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case Tl.LINE:var r=t.parsedStyle,i=r.x1,o=void 0===i?0:i,a=r.y1,s=void 0===a?0:a,c=r.x2,l=void 0===c?0:c,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(o,s,l,void 0===u?0:u);break;case Tl.CIRCLE:var f=t.parsedStyle,h=f.r,d=void 0===h?0:h,p=f.cx,g=void 0===p?0:p,m=f.cy;n=Ff(d,d,g,void 0===m?0:m);break;case Tl.ELLIPSE:var y=t.parsedStyle,v=y.rx,b=void 0===v?0:v,x=y.ry,w=void 0===x?0:x,M=y.cx,E=(g=void 0===M?0:M,y.cy);n=Ff(b,w,g,void 0===E?0:E);break;case Tl.POLYLINE:case Tl.POLYGON:n=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}(t.parsedStyle.points.points,t.nodeName===Tl.POLYGON);break;case Tl.RECT:var O=t.parsedStyle,k=O.width,S=void 0===k?0:k,A=O.height,_=void 0===A?0:A,P=O.x,C=void 0===P?0:P,N=O.y,L=void 0===N?0:N,j=O.radius,R=j&&j.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=ye(i,4),a=o[0],s=o[1],c=o[2],l=o[3],u=t>0?1:-1,f=e>0?1:-1,h=u+f!==0?1:0;return[["M",u*a+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,h,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,h,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,h,n,e+r-f*l]:null,["L",n,f*a+r],a?["A",a,a,0,0,h,u*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,_,C,L,R&&j.map((function(t){return T(t,0,Math.min(Math.abs(S)/2,Math.abs(_)/2))})));break;case Tl.PATH:n=ve([],ye(t.parsedStyle.path.absolutePath),!1)}if(n.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=Bt(e[1]-o,e[2]-s,0);n&&qt(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=Bt(e[1]-o,e[2]-s,0),c=Bt(e[3]-o,e[4]-s,0),l=Bt(e[5]-o,e[6]-s,0);n&&(qt(a,a,n),qt(c,c,n),qt(l,l,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(c[0],",").concat(c[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var u=Bt(e[6]-o,e[7]-s,0);n&&qt(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(a=Bt(e[1]-o,e[2]-s,0),c=Bt(e[3]-o,e[4]-s,0),n&&(qt(a,a,n),qt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,t,e)}var Gf=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=Ie(t)}catch(n){e=Ie(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=[r[1],r[2]],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&_f(o,a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;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;i<t.length;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;s<a;s++){var c=t[s];r=t[s+1];var l=c[0],u={command:l,prePoint:n,params:c,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[c[1],c[2]],o=s;break;case"A":var f=Df(n,c);u.arcParams=f}if("Z"===l)n=i,r=t[o+1];else{var h=c.length;n=[c[h-2],c[h-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&_f(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=d;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l)g=Cf((v=e[s-1]).currentPoint,p),"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]]);else if("C"===l){var m=[c[1],c[2]],y=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-y[0],m[1]-y[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===l){var v;m=Cf((v=e[s-1]).currentPoint,p),y=[c[1],c[2]],"C"===v.command?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="SQ",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var b=jf(u,0),x=b.x,w=b.y,M=jf(u,1,!1),E=M.x,O=M.y;u.startTangent=[x,w],u.endTangent=[E,O]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,c=g.prePoint,l=void 0;switch(g.command){case"Q":l=kl(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=xl(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=hl(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(g.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=k(n),h=k(r),d=O(n),p=O(r);if(0===i.length)return{x:f,y:h,width:d-f,height:p-h};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===f?f-=Pf(g,e).xExtra:a[0]===d&&(d+=Pf(g,e).xExtra),a[1]===h?h-=Pf(g,e).yExtra:a[1]===p&&(p+=Pf(g,e).yExtra)}return{x:f,y:h,width:d-f,height:p-h}}(a,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},Wf=gu(Gf);function $f(t){return A(t)?Wf(t):Gf(t)}function Hf(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=We(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=We(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=en(r,i));var a,s,c,l,u,f,h,d,p=Je(o[0])!==Je(o[1])?(a=o[0],s=a.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))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[p,(c=o[1],l=p,u=c.length-1,f=[],h=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(c),d.forEach((function(t,e){c.slice(1).forEach((function(t,n){h+=$e(c[(e+n)%u].slice(-2),l[n%u].slice(-2))})),f[e]=h,h=0})),d[f.indexOf(Math.min.apply(null,f))]),function(t){return t}]}function Vf(t,e){var n;n=A(t)?t.split(" ").map((function(t){var e=ye(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t;var r,i,o=[],a=0,s=Ml(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=gl(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))}));var c=Math.min.apply(Math,ve([],ye(n.map((function(t){return t[0]}))),!1)),l=Math.min.apply(Math,ve([],ye(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=c,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:o}}function Yf(t,e){return[t.points,e.points,function(t){return t}]}var qf=null;function Uf(t){return function(e){var n=0;return t.map((function(t){return t===qf?e[n++]:t}))}}function Xf(t){return t}var Kf={matrix:["NNNNNN",[qf,qf,0,0,qf,qf,0,0,0,0,1,0,qf,qf,0,1],Xf],matrix3d:["NNNNNNNNNNNNNNNN",Xf],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Uf([qf,qf,new Lu(1)]),Xf],scalex:["N",Uf([qf,new Lu(1),new Lu(1)]),Uf([qf,new Lu(1)])],scaley:["N",Uf([new Lu(1),qf,new Lu(1)]),Uf([new Lu(1),qf])],scalez:["N",Uf([new Lu(1),new Lu(1),qf])],scale3d:["NNN",Xf],skew:["Aa",null,Xf],skewx:["A",null,Uf([qf,Bu])],skewy:["A",null,Uf([Bu,qf])],translate:["Tt",Uf([qf,qf,ju]),Xf],translatex:["T",Uf([qf,ju,ju]),Uf([qf,ju])],translatey:["T",Uf([ju,qf,ju]),Uf([ju,qf])],translatez:["L",Uf([ju,ju,qf])],translate3d:["TTL",Xf]};function Zf(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=Kf[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],h=c[u],d=void 0;if(void 0===(d=f?{A:function(t){return"0"===t.trim()?Bu:gf(t)},N:Of,T:pf,L:df}[h.toUpperCase()](f):{a:Bu,n:l[0],t:ju}[h]))return[];l.push(d)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Qf(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Fl(yf(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=Fl(yf(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=Fl(yf(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=Fl(yf(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),c=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*c),2*(e*r*l-n*c),0,2*(e*n*l-r*c),1-2*(e*e+r*r)*l,2*(n*r*l+e*c),0,2*(e*r*l+n*c),2*(n*r*l-e*c),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=Fl(yf(t.d[0])),f=Fl(yf(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=Fl(yf(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=Fl(yf(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=xf(t.d[0],0,null)||0,n=xf(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xf(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=xf(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=xf(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xf(t.d[0],0,null)||0,n=xf(t.d[1],0,null)||0,r=xf(t.d[2],0,null)||0,1];case"perspective":var h=xf(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,h?-1/h: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 Jf(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 th(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;i<16;i++)t[i]=e[i]*r;return!0}(Hl,t))return!1;if(ot(Vl,Hl),Vl[3]=0,Vl[7]=0,Vl[11]=0,Vl[15]=1,Math.abs(ut(Vl))<1e-8)return!1;var a,s,c=Hl[3],l=Hl[7],u=Hl[11],f=Hl[12],h=Hl[13],d=Hl[14],p=Hl[15];if(0!==c||0!==l||0!==u){if(Yl[0]=c,Yl[1]=l,Yl[2]=u,Yl[3]=p,!lt(Vl,Vl))return!1;ct(Vl,Vl),Jt(i,Yl,Vl)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=Hl,(a=ql)[0][0]=s[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]=It(ql[0]),$t(ql[0],ql[0]),r[0]=Ht(ql[0],ql[1]),Xl(ql[1],ql[1],ql[0],1,-r[0]),n[1]=It(ql[1]),$t(ql[1],ql[1]),r[0]/=n[1],r[1]=Ht(ql[0],ql[2]),Xl(ql[2],ql[2],ql[0],1,-r[1]),r[2]=Ht(ql[1],ql[2]),Xl(ql[2],ql[2],ql[1],1,-r[2]),n[2]=It(ql[2]),$t(ql[2],ql[2]),r[1]/=n[2],r[2]/=n[2],Vt(Ul,ql[1],ql[2]),Ht(ql[0],Ul)<0)for(var g=0;g<3;g++)n[g]*=-1,ql[g][0]*=-1,ql[g][1]*=-1,ql[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+ql[0][0]-ql[1][1]-ql[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-ql[0][0]+ql[1][1]-ql[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-ql[0][0]-ql[1][1]+ql[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+ql[0][0]+ql[1][1]+ql[2][2],0)),ql[2][1]>ql[1][2]&&(o[0]=-o[0]),ql[0][2]>ql[2][0]&&(o[1]=-o[1]),ql[1][0]>ql[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(Qf).reduce(Jf)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var eh=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;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;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;s<4;s++)a[s][3]=o[s];for(s=0;s<3;s++)for(var c=0;c<3;c++)a[3][s]+=e[c]*a[c][s];var l=i[0],u=i[1],f=i[2],h=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(u*u+f*f),d[0][1]=2*(l*u-f*h),d[0][2]=2*(l*f+u*h),d[1][0]=2*(l*u+f*h),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(u*f-l*h),d[2][0]=2*(l*f-u*h),d[2][1]=2*(u*f+l*h),d[2][2]=1-2*(l*l+u*u),a=t(a,d);var p,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g)),s=0;s<3;s++)for(c=0;c<3;c++)a[s][c]*=n[s];return 0==(p=a)[0][2]&&0==p[0][3]&&0==p[1][2]&&0==p[1][3]&&0==p[2][0]&&0==p[2][1]&&1==p[2][2]&&0==p[2][3]&&0==p[3][2]&&1==p[3][3]?[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 nh(t){return t.toFixed(6).replace(".000000","")}function rh(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=th(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=th(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;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=T(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;s<4;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 eh(t[0],t[1],t[2],e,t[4]).map(nh).join(",")}])}function ih(t){return t.replace(/[xy]/,"")}function oh(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function ah(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?qu(a):qu(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=rh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];else for(o=0;o<t.length;o++){var f=t[o].t,h=e[o].t,d=t[o].d,p=e[o].d,g=Kf[f],m=Kf[h],y=void 0;if(s=h,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=rh([t[o]],[e[o]]);c.push(v[0]),l.push(v[1]),u.push(["matrix",[v[2]]])}else{if(f===h)y=f;else if(g[2]&&m[2]&&ih(f)===ih(h))y=ih(f),d=g[2](d),p=m[2](p);else{if(!g[1]||!m[1]||oh(f)!==oh(h)){c=[(v=rh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=oh(f),d=g[1](d),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<d.length;M++){v=mf(d[M],p[M],n,!1,M);b[M]=v[0],x[M]=v[1],w.push(v[2])}c.push(b),l.push(x),u.push([y,w])}}if(r){var E=c;c=l,l=E}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),u[e][0]+"("+n+")"})).join(" ")}]}var sh=gu((function(t){if(A(t)){if("text-anchor"===t)return[qu(0,"px"),qu(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:[pf(ch(e[0])),pf(ch(e[1]))]}return[qu(t[0]||0,"px"),qu(t[1]||0,"px")]}));function ch(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var lh=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Xu.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Xu.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Xu.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Xu.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Xu.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Xu.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Xu.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Xu.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Xu.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:Xu.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Xu.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Xu.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Xu.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Xu.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:Xu.FILTER},{n:"clipPath",syntax:Xu.DEFINED_PATH},{n:"textPath",syntax:Xu.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Xu.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===Tl.CIRCLE||t===Tl.ELLIPSE?"center":t===Tl.TEXT?"text-anchor":"left top"},l:!0,syntax:Xu.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===Tl.CIRCLE||t===Tl.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:Xu.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"cy",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"cz",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"y",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"z",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:Xu.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Xu.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Xu.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Xu.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Xu.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:Xu.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Xu.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Xu.NUMBER,d:function(t){return t===Tl.PATH||t===Tl.POLYGON||t===Tl.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:Xu.MARKER},{n:"markerEnd",syntax:Xu.MARKER},{n:"markerMid",syntax:Xu.MARKER},{n:"markerStartOffset",syntax:Xu.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Xu.LENGTH,l:!0,int:!0,d:"0"}],uh=lh.filter((function(t){return!!t.l})).map((function(t){return t.n})),fh={},hh=new WeakMap,dh=function(){function t(t){var e=this;this.runtime=t,lh.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){ve([t.n],ye(t.a||[]),!1).forEach((function(e){fh[e]=t}))},t.prototype.unregisterMetadata=function(t){delete fh[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var r=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(t.attributes,e);var i=Object.keys(e),o=t.parsedStyle.clipPath,a=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var s=!!n.forceUpdateGeometry;if(!s)for(var c=0;c<uh.length;c++)if(uh[c]in e){s=!0;break}return e.fill&&(t.parsedStyle.fill=uf(e.fill)),e.stroke&&(t.parsedStyle.stroke=uf(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=uf(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Mf(e.filter)),y(e.radius)||(t.parsedStyle.radius=vf(e.radius,4)),y(e.lineDash)||(t.parsedStyle.lineDash=vf(e.lineDash,2)),e.points&&(t.parsedStyle.points=Vf(e.points,t)),""===e.path&&(t.parsedStyle.path=fe({},Ku)),e.path&&(t.parsedStyle.path=$f(e.path),t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",a,e.offsetPath,t,this.runtime),e.anchor&&(t.parsedStyle.anchor=vf(e.anchor,2)),e.transform&&(t.parsedStyle.transform=Zf(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=sh(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(t.nodeName!==Tl.CIRCLE&&t.nodeName!==Tl.ELLIPSE||y(e.cx)&&y(e.cy))&&(t.nodeName!==Tl.RECT&&t.nodeName!==Tl.IMAGE&&t.nodeName!==Tl.GROUP&&t.nodeName!==Tl.HTML&&t.nodeName!==Tl.TEXT&&t.nodeName!==Tl.MESH||y(e.x)&&y(e.y)&&y(e.z))&&(t.nodeName!==Tl.LINE||y(e.x1)&&y(e.y1)&&y(e.z1)&&y(e.x2)&&y(e.y2)&&y(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(t,i),y(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,i),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(t,i),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(t,i),y(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,i),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,i),void(s&&this.updateGeometry(t))}var l=n.skipUpdateAttribute,u=n.skipParse,f=n.forceUpdateGeometry,h=n.usedAttributes,d=f,p=Object.keys(e);p.forEach((function(n){var r;l||(t.attributes[n]=e[n]),!d&&(null===(r=fh[n])||void 0===r?void 0:r.l)&&(d=!0)})),u||p.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(null==h?void 0:h.length)&&(p=Array.from(new Set(p.concat(h)))),p.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),d&&this.updateGeometry(t),p.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t,p)})),this.runtime.enableCSSParsing&&t.children.length&&p.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},t.prototype.parseProperty=function(t,e,n){var r=fh[t],i=e;if((""===e||y(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=$u(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=$u(e):s&&s.parser&&(i=s.parser(e,n))}return i},t.prototype.computeProperty=function(t,e,n){var r=fh[t],i="g-root"===n.id,o=e;if(r){var a=r.syntax,s=r.inh,c=r.d;if(e instanceof ku){var l=e.value;if("unset"===l&&(l=s&&!i?"inherit":"initial"),"initial"===l)y(c)||(e=this.parseProperty(t,Tu(c)?c(n.nodeName):c,n));else if("inherit"===l){var u=this.tryToResolveProperty(n,t,{inherited:!0});return y(u)?void this.addUnresolveProperty(n,t):u}}var f=a&&this.getPropertySyntax(a);if(f&&f.calculator){var h=n.parsedStyle[t];o=f.calculator(t,h,e,n,this.runtime)}else o=e instanceof ku?e.value:e}return o},t.prototype.postProcessProperty=function(t,e,n){var r=fh[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=hh.get(t);n||(hh.set(t,[]),n=hh.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=hh.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}},t.prototype.recalc=function(t){var e=hh.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),hh.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Zl),r.renderBounds||(r.renderBounds=new Zl);var i=t.parsedStyle,o=n.update(i,t),a=o.width,s=o.height,c=o.depth,l=void 0===c?0:c,u=o.offsetX,f=void 0===u?0:u,h=o.offsetY,d=void 0===h?0:h,p=o.offsetZ,g=void 0===p?0:p,m=[Math.abs(a)/2,Math.abs(s)/2,l/2],y=i,v=y.stroke,b=y.lineWidth,x=y.increasedLineWidthForHitTesting,w=y.shadowType,M=y.shadowColor,E=y.filter,O=void 0===E?[]:E,k=y.transformOrigin,S=i.anchor;e===Tl.TEXT?delete i.anchor:e===Tl.MESH&&(i.anchor[2]=.5);var A=[(1-2*(S&&S[0]||0))*a/2+f,(1-2*(S&&S[1]||0))*s/2+d,(1-2*(S&&S[2]||0))*m[2]+g];r.contentBounds.update(A,m);var T=e===Tl.POLYLINE||e===Tl.POLYGON||e===Tl.PATH?Math.SQRT2:.5;if(v&&!v.isNone){var _=((b||0)+(x||0))*T;m[0]+=_,m[1]+=_}if(r.renderBounds.update(A,m),M&&w&&"inner"!==w){var P=r.renderBounds,C=P.min,N=P.max,L=i,j=L.shadowBlur||0,R=L.shadowOffsetX||0,I=L.shadowOffsetY||0,B=C[0]-j+R,D=N[0]+j+R,F=C[1]-j+I,z=N[1]+j+I;C[0]=Math.min(C[0],B),N[0]=Math.max(N[0],D),C[1]=Math.min(C[1],F),N[1]=Math.max(N[1],z),r.renderBounds.setMinMax(C,N)}O.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,Rl(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,c=r.renderBounds,l=c.min,u=c.max,f=l[0]-s+o,h=u[0]+s+o,d=l[1]-s+a,p=u[1]+s+a;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],h),l[1]=Math.min(l[1],d),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),S=i.anchor;var G=a<0,W=s<0,$=(G?-1:1)*(k?xf(k[0],0,t):0),H=(W?-1:1)*(k?xf(k[1],1,t):0);$-=(G?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,H-=(W?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2,t.setOrigin($,H),this.runtime.sceneGraphService.dirtifyToRoot(t)}},t.prototype.isPropertyInheritable=function(t){var e=fh[t];return!!e&&e.inh},t}(),ph=function(){function t(){this.parser=gf,this.parserWithCSSDisabled=null,this.mixer=kf}return t.prototype.calculator=function(t,e,n,r){return yf(n)},t}(),gh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof ku&&(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}(),mh=function(){function t(){this.parser=uf,this.parserWithCSSDisabled=uf,this.mixer=ff}return t.prototype.calculator=function(t,e,n,r){return n instanceof ku?"none"===n.value?Hu:Vu:n},t}(),yh=function(){function t(){this.parser=Mf}return t.prototype.calculator=function(t,e,n){return n instanceof ku?[]:n},t}();function vh(t){var e=t.parsedStyle.fontSize;return y(e)?null:e}var bh=function(){function t(){this.parser=pf,this.parserWithCSSDisabled=null,this.mixer=kf}return t.prototype.calculator=function(t,e,n,r,i){var o;if(_(n))return n;if(!Lu.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===su.kPercentage)return 0;if(n.unit===su.kEms){if(r.parentNode){if(s=vh(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===su.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=vh(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),xh=function(){function t(){this.mixer=Af}return t.prototype.parser=function(t){var e=bf(_(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}(),wh=function(){function t(){this.mixer=Af}return t.prototype.parser=function(t){var e=bf(_(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}(),Mh=rt();function Eh(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){var s=o||[ju,ju];e.translateLocal(s[0].value,s[1].value,0)}else if("translatex"===i){s=o||[ju];e.translateLocal(s[0].value,0,0)}else if("translatey"===i){s=o||[ju];e.translateLocal(0,s[0].value,0)}else if("translatez"===i){s=o||[ju];e.translateLocal(0,0,s[0].value)}else if("translate3d"===i){s=o||[ju,ju,ju];e.translateLocal(s[0].value,s[1].value,s[2].value)}else if("rotate"===i){var c=o||[Bu];e.rotateLocal(0,0,yf(c[0]))}else if("rotatex"===i){c=o||[Bu];e.rotateLocal(yf(c[0]),0,0)}else if("rotatey"===i){c=o||[Bu];e.rotateLocal(0,yf(c[0]),0)}else if("rotatez"===i){c=o||[Bu];e.rotateLocal(0,0,yf(c[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(Fl(l[0]),Fl(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(Fl(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],Fl(l[0]))}else if("matrix"===i){var u=ye(o.map((function(t){return t.value})),6),f=u[0],h=u[1],d=u[2],p=u[3],g=u[4],m=u[5];e.setLocalTransform(at(Mh,f,h,0,0,d,p,0,0,0,0,1,0,g+n,m+r,0,1))}else"matrix3d"===i&&(at.apply(Lt,ve([Mh],ye(o.map((function(t){return t.value}))),!1)),Mh[12]+=n,Mh[13]+=r,e.setLocalTransform(Mh))})),e.getLocalTransform()}var Oh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.postProcessor=function(t,e){var n,r,i;switch(t.nodeName){case Tl.CIRCLE:case Tl.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy,c=o.cz;y(a)||(n=a),y(s)||(r=s),y(c)||(i=c);break;case Tl.LINE:var l=t.parsedStyle,u=l.x1,f=l.x2,h=l.y1,d=l.y2;n=Math.min(u,f),r=Math.min(h,d),i=0;break;case Tl.RECT:case Tl.IMAGE:case Tl.GROUP:case Tl.HTML:case Tl.TEXT:case Tl.MESH:y(t.parsedStyle.x)||(n=t.parsedStyle.x),y(t.parsedStyle.y)||(r=t.parsedStyle.y),y(t.parsedStyle.z)||(i=t.parsedStyle.z)}if(t.nodeName!==Tl.PATH&&t.nodeName!==Tl.POLYLINE&&t.nodeName!==Tl.POLYGON&&(t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0),(!y(n)||!y(r)||!y(i))&&-1===e.indexOf("transform")){var p=t.parsedStyle.transform;if(p&&p.length)Eh(p,t);else{var g=ye(t.getLocalPosition(),3),m=g[0],v=g[1],b=g[2];t.setLocalPosition(y(n)?m:n,y(r)?v:r,y(i)?b:i)}}},e}(bh),kh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof ku&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),Sh=function(){function t(){this.mixer=kf,this.parser=Of,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Ah=function(){function t(){this.parser=Of,this.parserWithCSSDisabled=null,this.mixer=Sf(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===Tl.LINE||i===Tl.PATH||i===Tl.POLYLINE){var o=n.getPoint(r);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},t}(),Th=function(){function t(){this.parser=Of,this.parserWithCSSDisabled=null,this.mixer=Sf(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),_h=function(){function t(){this.parser=$f,this.parserWithCSSDisabled=$f,this.mixer=Hf}return t.prototype.calculator=function(t,e,n){return n instanceof ku&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new iu(0,0,0,0)}:n},t.prototype.postProcessor=function(t,e){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===Tl.PATH&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=void 0===r?0:r,o=n.defY,a=void 0===o?0:o;t.setLocalPosition(i,a)}},t}(),Ph=function(){function t(){this.parser=Vf,this.mixer=Yf}return t.prototype.postProcessor=function(t,e){if((t.nodeName===Tl.POLYGON||t.nodeName===Tl.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(r,i)}},t}(),Ch=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=Sf(0,1/0),e}return ue(e,t),e}(bh),Nh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof ku?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),Lh=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}(),jh={},Rh=0;var Ih="undefined"!=typeof window&&void 0!==window.document;function Bh(t){return!!t.getAttribute}function Dh(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 Fh(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 zh(t,e){if(Ih)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Gh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Wh="object"==typeof performance&&performance.now?performance:Date;function $h(t,e,n){var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var Hh=1,Vh="object"==typeof self&&self.self==self?self:"object"==typeof Pc&&Pc.global==Pc?Pc:{},Yh=Date.now(),qh={},Uh=Date.now(),Xh=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Uh,r=n>16?0:16-n,i=Hh++;return qh[i]=t,Object.keys(qh).length>1||setTimeout((function(){Uh=e;var t=qh;qh={},Object.keys(t).forEach((function(e){return t[e](Vh.performance&&"function"==typeof Vh.performance.now?Vh.performance.now():Date.now()-Yh)}))}),r),i},Kh=function(t){delete qh[t]},Zh=function(t){return"string"!=typeof t?Xh:""===t?Vh.requestAnimationFrame:Vh[t+"RequestAnimationFrame"]},Qh=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!!Zh(t)})),Jh=Zh(Qh),td=function(t){return"string"!=typeof t?Kh:""===t?Vh.cancelAnimationFrame:Vh[t+"CancelAnimationFrame"]||Vh[t+"CancelRequestAnimationFrame"]}(Qh);Vh.requestAnimationFrame=Jh,Vh.cancelAnimationFrame=td;var ed=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;e<arguments.length;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,ve([],ye(t),!1))})))},t}(),nd=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;e<arguments.length;e++)t[e]=arguments[e];return pe(this,void 0,void 0,(function(){var e,n,r;return ge(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,ve([],ye(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return n<this.callbacks.length-1?[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}(),rd=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}(),id=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=arguments,e=this.callbacks[0].apply(void 0,t),n=0;n<this.callbacks.length-1;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),od=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ad=/([\"\'])[^\'\"]+\1/;var sd=function(){function t(){this.parser=Zf,this.parserWithCSSDisabled=Zf,this.mixer=ah}return t.prototype.calculator=function(t,e,n,r){return n instanceof ku?[]:n},t.prototype.postProcessor=function(t){Eh(t.parsedStyle.transform,t)},t}(),cd=function(){this.parser=sh},ld=function(){function t(){this.parser=Of}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=Iu.Z_INDEX_CHANGED)}},t}(),ud=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),fd=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),hd=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}(),dd=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),pd=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,ve([],ye(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,ve([],ye(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,ve([],ye(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,ve([],ye(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:o-i}},t}(),gd=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=void 0===r?0:r,o=t.height,a=i,s=void 0===o?0:o;return n&&!A(n)&&(a||(a=n.width,t.width=a),s||(s=n.height,t.height=s)),{width:a,height:s}},t}(),md=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,o=t.fontSize,a=t.fontStyle,s=t.fontWeight,c=t.fontVariant,l=t.lineWidth;return n&&o&&a&&s&&c&&r&&i&&!y(l)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,c=t.dx,l=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 u=((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,f=this.globalRuntime.textService.measureText(i,t,u);t.metrics=f;var h=f.width,d=f.height,p=f.lineHeight,g=f.fontProperties,m=[h/2,d/2,0],y=[0,1],v=0;"center"===o||"middle"===o?(v=a/2,y=[.5,1]):"right"!==o&&"end"!==o||(v=a,y=[1,1]);var b=0;return"middle"===s?b=m[1]:"top"===s||"hanging"===s?b=2*m[1]:"alphabetic"===s?b=this.globalRuntime.enableCSSParsing?p-g.ascent:0:"bottom"!==s&&"ideographic"!==s||(b=0),c&&(v+=c),l&&(b+=l),t.anchor=[y[0],y[1],0],{width:2*m[0],height:2*m[1],offsetX:v,offsetY:b}},t}();var yd,vd=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 ru,this.page=new ru,this.canvas=new ru,this.viewport=new ru,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 new Error(ou)},t}(),bd=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new ru,e.movement=new ru,e.offset=new ru,e.global=new ru,e.screen=new ru,e}return ue(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 new Error(ou)},e}(vd),xd=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 ue(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(bd),wd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(bd),Md=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 ue(e,t),e}(vd),Ed=function(){function t(){this.emitter=new Nc}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=D(n)&&n||w(n)&&n.capture,i=w(n)&&n.once,o=Tu(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=ye(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=Tu(e)?e:e.handleEvent,a){var u=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&u.apply(void 0,ve([],ye(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=D(n)&&n||w(n)&&n.capture,i=Tu(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=Tu(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Md(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!t.type)throw new 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}(),Od=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return ue(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===Tl.TEXT&&(n+=this.style.text);try{for(var r=me(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===Tl.TEXT?n+=o.nodeValue:n+=o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Tl.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error(ou)},e.prototype.lookupNamespaceURI=function(t){throw new Error(ou)},e.prototype.lookupPrefix=function(t){throw new Error(ou)},e.prototype.normalize=function(){throw new Error(ou)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,c=s===o?a:o;if(s[s.length-c.length]===c[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)<d.indexOf(h)?c===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(Ed),kd=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new Nc,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=rt(),this.tmpVec3=jt(),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){var r=2===e.button;n.dispatchEvent(e,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=Wh.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){var o=2===i.button;n.dispatchEvent(i,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),c=s;if(s&&!i.composedPath().includes(s)){for(var l=s;l&&!i.composedPath().includes(l);){if(i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){o=2===i.button;n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")}Od.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],c=l}if(c){var u=n.clonePointerEvent(i,"click");u.target=c,u.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:u.target,timeStamp:r});var f=a.clicksByButton[t.button];f.target===u.target&&r-f.timeStamp<200?++f.clickCount:f.clickCount=1,f.target=u.target,f.timeStamp=r,u.detail=f.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}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="mousemove"===t.type?"mouseout":"pointerout",s=n.createPointerEvent(t,a,o||void 0);if(n.dispatchEvent(s,"pointerout"),r&&n.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=n.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseleave"),Od.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=n.clonePointerEvent(e,l);n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var f=o&&Od.isNode(o)&&o.parentNode;f&&f!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var h=n.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==o&&h.target!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode);)h.currentTarget=h.target,n.notifyTarget(h),r&&n.notifyTarget(h,"mouseenter"),Od.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}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!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),Od.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!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),Od.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"),Od.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 ru(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 ru(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(),c=r.getWorldTransform(),l=ft(this.tmpMatrix,c,s),u=Ft(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return qt(u,u,l),new ru(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=ft(this.tmpMatrix,n,r),o=Ft(this.tmpVec3,t.x,t.y,0);qt(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new ru((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)},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;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else 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;r<n.length;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;r<2048&&t!==this.rootTarget;r++)Od.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,i=r.width,o=r.height,a=r.disableHitTesting;return e<0||n<0||e>i||n>o?null:!a&&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=me(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.globalRuntime.nativeHTMLMap.get(o);if(a)return a}}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(xd);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(wd);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(wd);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(xd);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=Wh.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 new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),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;i<r.length&&!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||Od.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Bh(e)&&e.getAttribute("cursor");if(n)return n;e=Od.isNode(e)&&e.parentNode}},t}(),Sd=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||$d.offscreenCanvas)this.canvas=t||$d.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}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(yd||(yd={}));var Ad,Td=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new rd,initAsync:new ed,dirtycheck:new id,cull:new id,beginFrame:new rd,beforeRender:new rd,render:new rd,afterRender:new rd,endFrame:new rd,destroy:new rd,pick:new nd,pickSync:new id,pointerDown:new rd,pointerUp:new rd,pointerMove:new rd,pointerOut:new rd,pointerOver:new rd,pointerWheel:new rd,pointerCancel:new rd,click:new rd}}return t.prototype.init=function(t){var e=this,n=fe(fe({},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()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(yd.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===r.renderReasons.size&&r.renderReasons.has(yd.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&i);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),o&&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()}},t.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=t.renderable,c=o?s.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(c){var l=a?this.hooks.cull.call(c,this.context.camera):c;l&&(this.stats.rendered++,n.renderListCurrentFrame.push(l))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable;u.dirty&&(this.sort(t,u),u.dirty=!1,u.dirtyChildren=[],u.dirtyReason=void 0),(u.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==Iu.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Dh(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Dh)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(yd.DISPLAY_OBJECT_CHANGED)},t}(),_d=/\[\s*(.*)=(.*)\s*\]/,Pd=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(_d),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 y(n)?"":n.toString?n.toString():""},t}(),Cd=function(t){function e(e,n,r,i,o,a,s,c){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=e,l}return ue(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(vd);function Nd(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(Ad||(Ad={}));var Ld,jd,Rd,Id=new Cd(Ad.REPARENT,null,"","","",0,"",""),Bd=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new Md(Ad.BOUNDS_CHANGED),this.rotate=(e=te(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=Bt(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=te();ie(a,n[0],n[1],n[2]);var s=l.getRotation(t),c=l.getRotation(t.parentNode);ae(e,c),re(e,e),ne(a,e,a),ne(o.localRotation,a,s),ce(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=te(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,r,i));var o=t.transformable;ie(n,e[0],e[1],e[2]),se(o.localRotation,o.localRotation,n),l.dirtifyLocal(t,o)}),this.setEulerAngles=(r=te(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,n,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ie(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);ae(r,re(te(),a)),se(o.localRotation,o.localRotation,r),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=Bt(e,n,r));var i=t.transformable;Xt(e,jt())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],c=e[1],l=e[2],u=i*l-o*c,f=o*s-r*l,h=r*c-i*s,d=i*h-o*f,p=o*u-r*h,g=r*f-i*u,m=2*a;u*=m,f*=m,h*=m,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,i.localRotation),zt(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(i=rt(),o=jt(),function(t,e){var n=t.transformable;if(o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,!Xt(l.getPosition(t),o)){if(Dt(n.position,o),null!==t.parentNode&&t.parentNode.transformable){var r=t.parentNode.transformable;ot(i,r.worldTransform),lt(i,i),qt(n.localPosition,o,i)}else Dt(n.localPosition,o);l.dirtifyLocal(t,n)}}),this.setLocalPosition=function(){var t=jt();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,Xt(r.localPosition,t)||(Dt(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(a=jt(),s=jt(),c=jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(s,e,n,r)),Xt(e,a)||(zt(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=te();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=oe(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);ae(t,s),re(t,t),ne(a.localRotation,t,n),ce(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=rt(),e=jt(),n=oe(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Mt(r.localTransform,r.localRotation,r.localPosition,Bt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=st(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),ft(r.localTransform,r.localTransform,i)}var o=Mt(t,n,e,r.localScale,r.origin);ft(r.localTransform,r.localTransform,o)}else Mt(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,y(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null===(r=null==a?void 0:a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(-1===a.dirtyChildren.indexOf(t)&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=Iu.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(Id)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Iu.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.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)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Bt(e,n,r));var i=t.transformable;ie(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=Bt(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)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=Bt(e[0],e[1],e[2]||n.localScale[2]);Xt(r,n.localScale)||(Dt(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=oe(e,n,r,i));var o=t.transformable;ae(o.localRotation,e),this.dirtifyLocal(t,o)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new tt(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;r=o.localSkew,i=e,r[0]=i[0],r[1]=i[1],this.dirtifyLocal(t,o)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.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=ye(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Nd(n),n=n.parentNode;e&&t.forEach((function(t){Nd(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.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)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Cd(Ad.ATTR_MODIFIED,n,e,e,t,Cd.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return bt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return wt(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return xt(e.scaling,this.getWorldTransform(t,e))},t.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},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=bt(jt(),e),r=wt(te(),e),i=xt(jt(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},t.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])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Zl.isEmpty(r))return null;var i=n||new Zl;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new Zl},t.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 Zl).update(r.center,r.halfExtents))})),e){var a=Fh(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Zl),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=rt();t.parentNode.transformable&&(e=lt(rt(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Zl.isEmpty(n)){var r=new Zl;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Zl.isEmpty(i)||(r=new Zl).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=ye(r.getMin(),2),s=a[0],c=a[1],l=ye(r.getMax(),2),u=l[0],f=l[1];return new iu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new iu((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.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)}},t.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;r<n.length;r++)this.syncHierarchy(n[r])}},t.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?ft(e.worldTransform,r.worldTransform,e.localTransform):ot(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),Dd={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]},Fd=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,zd=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Gd=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Wd=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Gd.exec(n)&&!zd.exec(t))},this.trimByKinsokuShorui=function(t){var e=ve([],ye(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=Dd.MetricsString+Dd.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Dd.BaselineSymbol).width),c=Dd.HeightMultiplier*s;s=s*Dd.BaselineMultiplier|0,r.width=a,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,a,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,c||1).data,u=l.length,f=4*a,h=0,d=0,p=!1;for(h=0;h<s;++h){for(var g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d+=f}for(n.ascent=s-h,d=u-f,p=!1,h=c;h>s;--h){for(g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d-=f}return n.descent=h-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,c=e.textAlign,l=e.letterSpacing,u=e.textPath,f=e.leading,h=void 0===f?0:f,d=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=_(e)&&"".concat(e,"px")||"16px",s=n.split(","),c=s.length-1;c>=0;c--){var l=s[c].trim();!ad.test(l)&&od.indexOf(l)<0&&(l='"'.concat(l,'"')),s[c]=l}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),p=this.measureFont(d,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var g=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);g.font=d,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(m.length),v=0;if(!u){for(E=0;E<m.length;E++){var b=g.measureText(m[E]).width+(m[E].length-1)*l;y[E]=b,v=Math.max(v,b)}O=v+a;var x=o||p.fontSize+a,w=Math.max(x,p.fontSize+a)+(m.length-1)*(x+h),M=0;return"middle"===s?M=-w/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?M=-w:"top"!==s&&"hanging"!==s||(M=0),{font:d,width:O,height:w,lines:m,lineWidths:y,lineHeight:x+=h,maxLineWidth:v,fontProperties:p,lineMetrics:y.map((function(t,e){var n=0;return"center"===c||"middle"===c?n-=t/2:"right"!==c&&"end"!==c||(n-=t),new iu(n-a/2,M+e*x,t+a,x)}))}}u.getTotalLength();for(var E=0;E<m.length;E++)var O=g.measureText(m[E]).width+(m[E].length-1)*l},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,c=void 0===s?1/0:s,l=e.textOverflow,u=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),f=o+a,h="";"ellipsis"===l?h="...":l&&"clip"!==l&&(h=l);for(var d=[],p=0,g=0,m={},y=function(t){return r.getFromCache(t,a,m,u)},v=Array.from(h).reduce((function(t,e){return t+y(e)}),0),b=Array.from(t),x=0;x<b.length;x++){var w=b[x],M=t[x-1],E=t[x+1],O=y(w);if(this.isNewline(w)){if(++p>=c){e.isOverflowing=!0;break}g=0,d[p]=""}else{if(g>0&&g+O>f){if(p+1>=c){if(e.isOverflowing=!0,v>0&&v<=f){for(var k=d[p].length,S=0,A=k,T=0;T<k;T++){var _=y(d[p][T]);if(S+_+v>f){A=T;break}S+=_}d[p]=(d[p]||"").slice(0,A)+h}break}if(g=0,d[++p]="",this.isBreakingSpace(w))continue;this.canBreakInLastChar(w)||(d=this.trimToBreakable(d),g=this.sumTextWidthByCache(d[p]||"",m)),this.shouldBreakByKinsokuShorui(w,E)&&(d=this.trimByKinsokuShorui(d),g+=y(M||""))}g+=O,d[p]=(d[p]||"")+w}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&Dd.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&Dd.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=ve([],ye(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+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!Fd.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(!Fd.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}(),$d={},Hd=(jd=new gd,Rd=new pd,(Ld={})[Tl.CIRCLE]=new ud,Ld[Tl.ELLIPSE]=new fd,Ld[Tl.RECT]=jd,Ld[Tl.IMAGE]=jd,Ld[Tl.GROUP]=jd,Ld[Tl.LINE]=new hd,Ld[Tl.TEXT]=new md($d),Ld[Tl.POLYLINE]=Rd,Ld[Tl.POLYGON]=Rd,Ld[Tl.PATH]=new dd,Ld[Tl.HTML]=null,Ld[Tl.MESH]=null,Ld),Vd=function(){var t,e=new mh,n=new bh;return(t={})[Xu.PERCENTAGE]=null,t[Xu.NUMBER]=new Sh,t[Xu.ANGLE]=new ph,t[Xu.DEFINED_PATH]=new gh,t[Xu.PAINT]=e,t[Xu.COLOR]=e,t[Xu.FILTER]=new yh,t[Xu.LENGTH]=n,t[Xu.LENGTH_PERCENTAGE]=n,t[Xu.LENGTH_PERCENTAGE_12]=new xh,t[Xu.LENGTH_PERCENTAGE_14]=new wh,t[Xu.COORDINATE]=new Oh,t[Xu.OFFSET_DISTANCE]=new Ah,t[Xu.OPACITY_VALUE]=new Th,t[Xu.PATH]=new _h,t[Xu.LIST_OF_POINTS]=new Ph,t[Xu.SHADOW_BLUR]=new Ch,t[Xu.TEXT]=new Nh,t[Xu.TEXT_TRANSFORM]=new Lh,t[Xu.TRANSFORM]=new sd,t[Xu.TRANSFORM_ORIGIN]=new cd,t[Xu.Z_INDEX]=new ld,t[Xu.MARKER]=new kh,t}();$d.CameraContribution=pu,$d.AnimationTimeline=null,$d.EasingFunction=null,$d.offscreenCanvasCreator=new Sd,$d.nativeHTMLMap=new WeakMap,$d.sceneGraphSelector=new Pd,$d.sceneGraphService=new Bd($d),$d.textService=new Wd($d),$d.geometryUpdaterFactory=Hd,$d.CSSPropertySyntaxFactory=Vd,$d.styleValueRegistry=new dh($d),$d.layoutRegistry=null,$d.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Pc?Pc:{},$d.enableCSSParsing=!0,$d.enableDataset=!1,$d.enableStyleSyntax=!0;var Yd=0,qd=new Cd(Ad.INSERTED,null,"","","",0,"",""),Ud=new Cd(Ad.REMOVED,null,"","","",0,"",""),Xd=new Md(Ad.DESTROY),Kd=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entity=Yd++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:Ru.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=$d.enableCSSParsing?{anchor:Fu,opacity:Fu,fillOpacity:Fu,strokeOpacity:Fu,fill:Fu,stroke:Fu,transform:Fu,transformOrigin:Fu,visibility:Fu,pointerEvents:Fu,lineWidth:Fu,lineCap:Fu,lineJoin:Fu,increasedLineWidthForHitTesting:Fu,fontSize:Fu,fontFamily:Fu,fontStyle:Fu,fontWeight:Fu,fontVariant:Fu,textAlign:Fu,textBaseline:Fu,textTransform:Fu,zIndex:Fu,filter:Fu,shadowType:Fu}:null,e.parsedStyle={},e.attributes={},e}return ue(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.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}),e.prototype.cloneNode=function(t){throw new Error(ou)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return $d.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),qd.relatedNode=this,t.dispatchEvent(qd),t},e.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return Ud.relatedNode=this,t.dispatchEvent(Ud),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),$d.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}},e.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()}},e.prototype.matches=function(t){return $d.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return $d.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return $d.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return $d.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return $d.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return $d.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return $d.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if($d.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;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)}))}},e.prototype.before=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=ye(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,ve([],ye(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,ve([],ye(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,ve([],ye(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Xd),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return $d.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return $d.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return $d.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return $d.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return $d.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return $d.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Pu(t);return e=this.attributes[n],$d.enableCSSParsing&&y(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw new Error(ou)},e.prototype.getAttributeNode=function(t){throw new Error(ou)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(ou)},e.prototype.hasAttributeNS=function(t,e){throw new Error(ou)},e.prototype.removeAttributeNS=function(t,e){throw new Error(ou)},e.prototype.removeAttributeNode=function(t){throw new Error(ou)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(ou)},e.prototype.setAttributeNode=function(t){throw new Error(ou)},e.prototype.setAttributeNodeNS=function(t){throw new Error(ou)},e.prototype.toggleAttribute=function(t,e){throw new Error(ou)},e}(Od);function Zd(t){return!!(null==t?void 0:t.nodeName)}var Qd,Jd=new Cd(Ad.ATTR_MODIFIED,null,null,null,null,Cd.MODIFICATION,null,null),tp={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:""},ep={anchor:[0,0],fill:Hu,stroke:Hu,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},np=fe(fe({},ep),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),rp=ve(ve([],ye(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),ip="data-",op=function(t){function e(e){var n,r=t.call(this)||this;r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=e,r.config.interactive=null!==(n=r.config.capture)&&void 0!==n?n:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||Tl.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,$d.enableCSSParsing?ep:np,r.config.initialParsedStyle),$d.enableCSSParsing&&Object.assign(r.attributes,tp),r.initAttributes(r.config.style);var i=$d.globalThis.Proxy?$d.globalThis.Proxy:function(){};return $d.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(ip).concat(Au(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(ip).concat(Au(e)),n),!0}})),$d.enableStyleSyntax&&(r.style=new i({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return ue(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=fe({},this.attributes);for(var r in n){var i=n[r];Zd(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};$d.enableCSSParsing&&(n.usedAttributes=rp);var r={};for(var i in t){r[Pu(i)]=t[i]}$d.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=Pu(e);F(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),t.prototype.setAttribute.call(this,i,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];$d.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Jd.relatedNode=this,Jd.prevValue=o,Jd.newValue=e,Jd.attrName=t,Jd.prevParsedValue=a,Jd.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Jd):(Jd.target=this,this.ownerDocument.defaultView.dispatchEvent(Jd,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=ye(t.getMin(),2),n=e[0],r=e[1],i=ye(t.getMax(),2),o=i[0],a=i[1];return new iu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.setOrigin(this,Dl(t,e,n)),this},e.prototype.getOrigin=function(){return $d.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.setPosition(this,Dl(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.setLocalPosition(this,Dl(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.translate(this,Dl(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.translateLocal(this,Dl(t,e,n)),this},e.prototype.getPosition=function(){return $d.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return $d.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Dl(t,e=e||t,n=n||t)),$d.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Dl(t,e=e||t,n=n||t)),$d.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return $d.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return $d.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return zl(ye(Gl(jt(),$d.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return zl(ye(Gl(jt(),$d.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return $d.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return $d.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return y(e)&&y(n)?$d.sceneGraphService.rotateLocal(this,0,0,t):$d.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return y(e)&&y(n)?$d.sceneGraphService.rotate(this,0,0,t):$d.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return $d.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return $d.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return $d.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return $d.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return $d.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return $d.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return $d.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return $d.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return $d.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){$d.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.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},e.prototype.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,ve([],ye(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,ve([],ye(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=ye(e,2),i=r[0],o=r[1];return i?w(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},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=ye(bt(jt(),e),2),r=n[0],i=n[1],o=ye(xt(jt(),e),2),a=o[0],s=o[1],c=wt(te(),e),l=ye(Gl(jt(),c),3),u=l[0],f=l[2];return Wl(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=ye($l(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setEulerAngles(a).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=ye($l(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setLocalEulerAngles(a).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){$d.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){$d.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(Kd),ap=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;$d.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},sp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.CIRCLE,style:$d.enableCSSParsing?fe({cx:"",cy:"",r:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:$d.enableCSSParsing?null:[Uu,Uu]}},r))||this}return ue(e,t),e}(op),cp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);return(n=t.call(this,fe({style:$d.enableCSSParsing?fe({x:"",y:""},r):fe({},r)},i))||this).isCustomElement=!0,n}return ue(e,t),e}(op),lp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.ELLIPSE,style:$d.enableCSSParsing?fe({cx:"",cy:"",rx:"",ry:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:$d.enableCSSParsing?null:[Uu,Uu]}},r))||this}return ue(e,t),e}(op),up=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.GROUP,style:$d.enableCSSParsing?fe({x:"",y:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(op),fp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);return(n=t.call(this,fe({type:Tl.HTML,style:$d.enableCSSParsing?fe({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):fe({},r)},i))||this).cullable.enable=!1,n}return ue(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle,e=t.x,n=t.y,r=t.width,i=t.height;return new iu(e,n,r,i)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.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 Zl,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},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=lt(rt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Zl.isEmpty(e)){var n=new Zl;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(op),hp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.IMAGE,style:$d.enableCSSParsing?fe({x:"",y:"",img:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(op),dp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Tl.LINE,style:fe({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},r)},i))||this).markerStartAngle=0,n.markerEndAngle=0;var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&Zd(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&Zd(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.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&&Zd(r)&&(this.markerStartAngle=0,r.remove()),i&&Zd(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Zd(r)&&(this.markerEndAngle=0,r.remove()),i&&Zd(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=e.defX,f=e.defY,h=t?n:r;if(h&&Zd(h)){var d,p,g,m,y,v,b;t?(m=a-u,y=c-f,p=s-a,g=l-c,v=i||0,b=this.markerStartAngle):(m=s-u,y=l-f,p=a-s,g=c-l,v=o||0,b=this.markerEndAngle),d=Math.atan2(g,p),h.setLocalEulerAngles(180*d/Math.PI+b),h.setLocalPosition(m+Math.cos(d)*v,y+Math.sin(d)*v)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2,s=n.defX,c=n.defY,l=ml(r,i,o,a,t),u=l.x,f=l.y,h=qt(jt(),Bt(u-s,f-c,0),e?this.getWorldTransform():this.getLocalTransform());return new ru(h[0],h[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return gl(t.x1,t.y1,t.x2,t.y2)},e}(op),pp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Tl.PATH,style:$d.enableCSSParsing?fe({path:"",miterLimit:""},r):fe({},r),initialParsedStyle:$d.enableCSSParsing?null:{miterLimit:4,path:fe({},Ku)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Zd(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Zd(c)&&n.placeMarkerMid(c),s&&Zd(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.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&&Zd(r)&&(this.markerStartAngle=0,r.remove()),i&&Zd(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Zd(r)&&(this.markerEndAngle=0,r.remove()),i&&Zd(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.defX,s=e.defY,c=t?n:r;if(c&&Zd(c)){var l,u,f,h,d,p,g;if(t){var m=ye(this.getStartTangent(),2),y=m[0];h=(v=m[1])[0]-a,d=v[1]-s,u=y[0]-v[0],f=y[1]-v[1],p=i||0,g=this.markerStartAngle}else{var v,b=ye(this.getEndTangent(),2);y=b[0];h=(v=b[1])[0]-a,d=v[1]-s,u=y[0]-v[0],f=y[1]-v[1],p=o||0,g=this.markerEndAngle}l=Math.atan2(f,u),c.setLocalEulerAngles(180*l/Math.PI+g),c.setLocalPosition(h+Math.cos(l)*p,d+Math.sin(l)*p)}},e.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&&Zd(t))for(var o=1;o<n.length-1;o++){var a=ye(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)}},e.prototype.getTotalLength=function(){return Tf(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return Qe(t,e,fe(fe({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,c=qt(jt(),Bt(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new ru(c[0],c[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Tf(this),e)},e.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},e.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},e}(op),gp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Tl.POLYGON,style:$d.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!0},r):fe({},r),initialParsedStyle:$d.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Zd(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Zd(c)&&n.placeMarkerMid(c),s&&Zd(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.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&&Zd(r)&&(this.markerStartAngle=0,r.remove()),i&&Zd(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Zd(r)&&(this.markerEndAngle=0,r.remove()),i&&Zd(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.points.points,s=e.defX,c=e.defY,l=t?n:r;if(l&&Zd(l)){var u,f,h,d,p,g,m;if(d=a[0][0]-s,p=a[0][1]-c,t)f=a[1][0]-a[0][0],h=a[1][1]-a[0][1],g=i||0,m=this.markerStartAngle;else{var y=a.length;this.parsedStyle.isClosed?(f=a[y-1][0]-a[0][0],h=a[y-1][1]-a[0][1]):(d=a[y-1][0]-s,p=a[y-1][1]-c,f=a[y-2][0]-a[y-1][0],h=a[y-2][1]-a[y-1][1]),g=o||0,m=this.markerEndAngle}u=Math.atan2(h,f),l.setLocalEulerAngles(180*u/Math.PI+m),l.setLocalPosition(d+Math.cos(u)*g,p+Math.sin(u)*g)}},e.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&&Zd(t))for(var o=1;o<(this.parsedStyle.isClosed?n.length:n.length-1);o++){var a=n[o][0]-r,s=n[o][1]-i,c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(a,s)}},e}(op),mp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.POLYLINE,style:$d.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!1},n):fe({},n),initialParsedStyle:$d.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return ue(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.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=o.segments,c=0,l=0;s.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=ml(a[l][0],a[l][1],a[l+1][0],a[l+1][1],c),f=u.x,h=u.y,d=qt(jt(),Bt(f-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new ru(d[0],d[1])},e.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},e.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},e}(gp),yp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.RECT,style:$d.enableCSSParsing?fe({x:"",y:"",width:"",height:"",radius:""},n):fe({},n)},r))||this}return ue(e,t),e}(op),vp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.TEXT,style:$d.enableCSSParsing?fe({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},n):fe({fill:"black"},n),initialParsedStyle:$d.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}},r))||this}return ue(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(op),bp=function(){function t(){this.registry={},this.define(Tl.CIRCLE,sp),this.define(Tl.ELLIPSE,lp),this.define(Tl.RECT,yp),this.define(Tl.IMAGE,hp),this.define(Tl.LINE,dp),this.define(Tl.GROUP,up),this.define(Tl.PATH,pp),this.define(Tl.POLYGON,gp),this.define(Tl.POLYLINE,mp),this.define(Tl.TEXT,vp),this.define(Tl.HTML,fp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),xp=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new $d.AnimationTimeline(e)}catch(t){}var n={};return lh.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=Tu(i)?i(Tl.GROUP):i)})),e.documentElement=new up({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return ue(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.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?vp:up);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw new Error(ou)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return pe(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ge(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,null]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return[2,(f=h.sent().picked)&&f[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f},e.prototype.elementsFromPoint=function(t,e){return pe(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ge(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,[]]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return(f=h.sent().picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),[2,f]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(au)},e.prototype.insertBefore=function(t,e){throw new Error(au)},e.prototype.removeChild=function(t,e){throw new Error(au)},e.prototype.replaceChild=function(t,e,n){throw new Error(au)},e.prototype.append=function(){throw new Error(au)},e.prototype.prepend=function(){throw new Error(au)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(Od),wp=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Md(Ad.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),Mp=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new xd(null),this.rootWheelEvent=new wd(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 s=t.normalizeToPointerEvent(e,a);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}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,s=t.normalizeToPointerEvent(e,a);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}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=me(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.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 s=n.normalizeToPointerEvent(t,i);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=n.bootstrapEvent(n.rootPointerEvent,u,i,t);f.type+=a,n.context.eventService.mapEvent(f)}}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=me(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.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||y(r)||y(i)){var s=this.context.eventService.client2Viewport(new ru(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.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,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=Gh[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.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,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=Wh.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;r<t.changedTouches.length;r++){var i=t.changedTouches[r];F(i.button)&&(i.button=0),F(i.buttons)&&(i.buttons=1),F(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),F(i.width)&&(i.width=i.radiusX||1),F(i.height)&&(i.height=i.radiusY||1),F(i.tiltX)&&(i.tiltX=0),F(i.tiltY)&&(i.tiltY=0),F(i.pointerType)&&(i.pointerType="touch"),F(i.pointerId)&&(i.pointerId=i.identifier||0),F(i.pressure)&&(i.pressure=i.force||.5),F(i.twist)&&(i.twist=0),F(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;F(o.isPrimary)&&(o.isPrimary=!0),F(o.width)&&(o.width=1),F(o.height)&&(o.height=1),F(o.tiltX)&&(o.tiltX=0),F(o.tiltY)&&(o.tiltY=0),F(o.pointerType)&&(o.pointerType="mouse"),F(o.pointerId)&&(o.pointerId=1),F(o.pressure)&&(o.pressure=.5),F(o.twist)&&(o.twist=0),F(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),Ep=[Tl.CIRCLE,Tl.ELLIPSE,Tl.IMAGE,Tl.RECT,Tl.LINE,Tl.POLYLINE,Tl.POLYGON,Tl.TEXT,Tl.PATH,Tl.HTML],Op=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(Zl.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||Kl.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Kl.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Kl.OUTSIDE||n===Kl.INSIDE)return n;for(var i=Kl.INSIDE,o=Ep.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var c=1<<a;if(0!=(n&c)&&(!o||4!==a&&5!==a)){var l=r[a],u=l.normal,f=l.distance;if(Ht(u,e.getPositiveFarPoint(r[a]))+f<0)return Kl.OUTSIDE;Ht(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),kp=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=e.rBushRoot,a=i.root.ownerDocument.defaultView;this.rBush=o;var s=function(t){t.target.renderable.dirty=!0,r.dirtify()},c=function(t){var e=t.detail.affectChildren,i=t.target;e&&i.forEach((function(t){n.toSync.add(t)}));for(var o=i;o;)o.renderable&&n.toSync.add(o),o=o.parentElement;r.dirtify()},l=function(t){var e=t.target;$d.enableCSSParsing&&$d.styleValueRegistry.recalc(e),$d.sceneGraphService.dirtifyToRoot(e),r.dirtify()},u=function(t){var e=t.target,i=e.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(e),$d.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){a.addEventListener(Ad.MOUNTED,l),a.addEventListener(Ad.UNMOUNTED,u),a.addEventListener(Ad.ATTR_MODIFIED,s),a.addEventListener(Ad.BOUNDS_CHANGED,c)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Ad.MOUNTED,l),a.removeEventListener(Ad.UNMOUNTED,u),a.removeEventListener(Ad.ATTR_MODIFIED,s),a.removeEventListener(Ad.BOUNDS_CHANGED,c),n.toSync.clear()})),r.hooks.endFrame.tap(t.tag,(function(){n.syncRTree()}))},t.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=ye(i.getMin(),2),a=o[0],s=o[1],c=ye(i.getMax(),2),l=c[0],u=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=u}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()},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(Qd||(Qd={}));var Sp=new Md(Ad.MOUNTED),Ap=new Md(Ad.UNMOUNTED),Tp=new Md(Qd.BEFORE_RENDER),_p=new Md(Qd.RERENDER),Pp=new Md(Qd.AFTER_RENDER),Cp=function(t){function e(e){var n=t.call(this)||this;n.Element=op,n.inited=!1,n.context={},n.document=new xp,n.document.defaultView=n,n.customElements=new bp;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,c=e.devicePixelRatio,l=e.renderer,u=e.background,f=e.cursor,h=e.document,d=e.requestAnimationFrame,p=e.cancelAnimationFrame,g=e.createImage,m=e.supportsPointerEvents,y=e.supportsTouchEvents,v=e.supportsCSSTransform,b=e.supportsMutipleCanvasesInOneContainer,x=e.useNativeClickEvent,w=e.alwaysTriggerPointerEventOnCanvas,M=e.isTouchEvent,E=e.isMouseEvent;b||function(t,e){if(t){var n="string"==typeof t?t:t.id||Rh++;jh[n]&&jh[n].destroy(),jh[n]=e}}(r,n);var O=a,k=s,S=c;return i&&(S=(S=c||Ih&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,O=a||function(t){var e=zh(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=zh(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&($d.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=d?d:Jh.bind($d.globalThis),n.cancelAnimationFrame=null!=p?p:td.bind($d.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in $d.globalThis,n.supportsPointerEvents=null!=m?m:!!$d.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof $d.globalThis.TouchEvent},n.isMouseEvent=null!=E?E:function(t){return!$d.globalThis.MouseEvent||t instanceof $d.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof $d.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:O,height:k,renderer:l,offscreenCanvas:o,devicePixelRatio:S,cursor:f||"default",background:u||"transparent",createImage:g,document:h,supportsCSSTransform:v,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:w}),n.initDefaultCamera(O,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return ue(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new $d.CameraContribution;i.clipSpaceNearZ=n,i.setType(Jl.EXPLORING,tu.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(hu,(function(){r.context.renderingContext.renderReasons.add(yd.CAMERA_CHANGED)})),this.context.camera=i},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.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}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new Md(Qd.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new Md(Qd.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===eu.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Md(Qd.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(Tp),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(_p)})),this.dispatchEvent(Pp)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Pl,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Mp,new kp,new wp([new Op])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(fe(fe({},$d),this.context)),this.context.renderingService=new Td($d,this.context),this.context.eventService=new kd($d,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)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new Md(Qd.READY))})):r.dispatchEvent(new Md(Qd.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new Md(Qd.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init($d)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),ve([],ye(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy($d)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Ap):(Ap.target=t,this.dispatchEvent(Ap,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(Sp):(Sp.target=t,this.dispatchEvent(Sp,!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()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(Ed),Np=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.landmarks=[],e}return ue(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=Bl(e),this.relAzimuth=Bl(t),this.relRoll=Bl(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Jl.EXPLORING){var r=ee(te(),[1,0,0],Fl((this.rotateWorld?1:-1)*this.relElevation)),i=ee(te(),[0,1,0],Fl((this.rotateWorld?1:-1)*this.relAzimuth)),o=ee(te(),[0,0,1],Fl(this.relRoll)),a=ne(te(),i,r);a=ne(te(),a,o);var s=Et(rt(),a);ht(this.matrix,this.matrix,[0,0,-this.distance]),ft(this.matrix,this.matrix,s),ht(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=Dl(t,e,0),r=Rt(this.position);return zt(r,r,Wt(jt(),this.right,n[0])),zt(r,r,Wt(jt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Rt(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getDistance():this.type===Jl.TRACKING&&zt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.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,c=e.focalPoint,l=void 0===c?this.focalPoint:c,u=e.roll,f=e.zoom,h=new $d.CameraContribution;h.setType(this.type,void 0),h.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]),h.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:it(h.getWorldTransform()),right:Rt(h.right),up:Rt(h.up),forward:Rt(h.forward),position:Rt(h.getPosition()),focalPoint:Rt(h.getFocalPoint()),distanceVector:Rt(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=A(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=_(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,h=void 0===f?void 0:f;if(0===c)return this.syncFromLandmark(r),void(h&&h());this.cancelLandmarkAnimation();var d,p=r.position,g=r.focalPoint,m=r.zoom,y=r.roll,v=u||$d.EasingFunction(a),b=function(){n.setFocalPoint(g),n.setPosition(p),n.setRoll(y),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),h&&h()},x=function(t){void 0===d&&(d=t);var e=t-d;if(e>c)b();else{var r,i,o=v(e/c),a=jt(),s=jt();Yt(a,n.focalPoint,g,o),Yt(s,n.position,p,o),i=n.roll*(1-o)+y*o,r=n.zoom*(1-o)+m*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),Kt(a,g)+Kt(s,p)<=.01&&null==m&&null==y?b():(n.computeMatrix(),n.triggerUpdate(),e<c&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(x)))}};this.canvas.requestAnimationFrame(x)}},e.prototype.syncFromLandmark=function(t){this.matrix=ot(this.matrix,t.matrix),this.right=Dt(this.right,t.right),this.up=Dt(this.up,t.up),this.forward=Dt(this.forward,t.forward),this.position=Dt(this.position,t.position),this.focalPoint=Dt(this.focalPoint,t.focalPoint),this.distanceVector=Dt(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},e}(pu);$d.CameraContribution=Np;var Lp=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 ue(e,t),e}(vd),jp=0,Rp=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(jp++),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(new 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(new 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;t=Number(t),isNaN(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(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},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||this._playbackRate<0&&Number(this._currentTime)<=0)},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 Lp(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)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},t.prototype.persist=function(){throw new Error(ou)},t.prototype.addEventListener=function(t,e,n){throw new Error(ou)},t.prototype.removeEventListener=function(t,e,n){throw new Error(ou)},t.prototype.dispatchEvent=function(t){throw new Error(ou)},t.prototype.commitStyles=function(){throw new Error(ou)},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},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 Lp(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 Lp(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Ip=.1,Bp="function"==typeof Float32Array,Dp=function(t,e){return 1-3*e+3*t},Fp=function(t,e){return 3*e-6*t},zp=function(t){return 3*t},Gp=function(t,e,n){return((Dp(e,n)*t+Fp(e,n))*t+zp(e))*t},Wp=function(t,e,n){return 3*Dp(e,n)*t*t+2*Fp(e,n)*t+zp(e)},$p=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Bp?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Gp(o*Ip,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Ip;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Ip,s=Wp(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Wp(e,n,r);if(0===o)return e;e-=(Gp(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Gp(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+Ip,t,n)};return function(t){return 0===t||1===t?t:Gp(a(t),e,r)}},Hp=function(t){return Math.pow(t,2)},Vp=function(t){return Math.pow(t,3)},Yp=function(t){return Math.pow(t,4)},qp=function(t){return Math.pow(t,5)},Up=function(t){return Math.pow(t,6)},Xp=function(t){return 1-Math.cos(t*Math.PI/2)},Kp=function(t){return 1-Math.sqrt(1-t*t)},Zp=function(t){return t*t*(3*t-2)},Qp=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)},Jp=function(t,e){void 0===e&&(e=[]);var n=ye(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=T(Number(i),1,10),c=T(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},tg=function(t,e,n){void 0===e&&(e=[]);var r=ye(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,u=r[3],f=void 0===u?0:u;o=T(o,.1,1e3),s=T(s,.1,1e3),l=T(l,.1,1e3),f=T(f,.1,1e3);var h=Math.sqrt(s/o),d=l/(2*Math.sqrt(s*o)),p=d<1?h*Math.sqrt(1-d*d):0,g=d<1?(d*h-f)/p:-f+h,m=n?n*t/1e3:t;return m=d<1?Math.exp(-m*d*h)*(1*Math.cos(p*m)+g*Math.sin(p*m)):(1+g*m)*Math.exp(-m*h),0===t||1===t?t:1-m},eg=function(t,e){void 0===e&&(e=[]);var n=ye(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(T(t,0,1)*i)/i},ng=function(t,e){void 0===e&&(e=[]);var n=ye(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return $p(r,i,o,a)(t)},rg=$p(.42,0,1,1),ig=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},og=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},ag=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},sg={steps:eg,"step-start":function(t){return eg(t,[1,"start"])},"step-end":function(t){return eg(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":ng,ease:function(t){return ng(t,[.25,.1,.25,1])},in:rg,out:ig(rg),"in-out":og(rg),"out-in":ag(rg),"in-quad":Hp,"out-quad":ig(Hp),"in-out-quad":og(Hp),"out-in-quad":ag(Hp),"in-cubic":Vp,"out-cubic":ig(Vp),"in-out-cubic":og(Vp),"out-in-cubic":ag(Vp),"in-quart":Yp,"out-quart":ig(Yp),"in-out-quart":og(Yp),"out-in-quart":ag(Yp),"in-quint":qp,"out-quint":ig(qp),"in-out-quint":og(qp),"out-in-quint":ag(qp),"in-expo":Up,"out-expo":ig(Up),"in-out-expo":og(Up),"out-in-expo":ag(Up),"in-sine":Xp,"out-sine":ig(Xp),"in-out-sine":og(Xp),"out-in-sine":ag(Xp),"in-circ":Kp,"out-circ":ig(Kp),"in-out-circ":og(Kp),"out-in-circ":ag(Kp),"in-back":Zp,"out-back":ig(Zp),"in-out-back":og(Zp),"out-in-back":ag(Zp),"in-bounce":Qp,"out-bounce":ig(Qp),"in-out-bounce":og(Qp),"out-in-bounce":ag(Qp),"in-elastic":Jp,"out-elastic":ig(Jp),"in-out-elastic":og(Jp),"out-in-elastic":ag(Jp),spring:tg,"spring-in":tg,"spring-out":ig(tg),"spring-in-out":og(tg),"spring-out-in":ag(tg)},cg=function(t){return sg[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)]||sg.linear},lg=function(t){return t},ug=1,fg=.5,hg=0;function dg(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var pg="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",gg=new RegExp("cubic-bezier\\("+pg+","+pg+","+pg+","+pg+"\\)"),mg=/steps\(\s*(\d+)\s*\)/,yg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function vg(t){var e=gg.exec(t);if(e)return $p.apply(void 0,ve([],ye(e.slice(1).map(Number)),!1));var n=mg.exec(t);if(n)return dg(Number(n[1]),hg);var r=yg.exec(t);return r?dg(Number(r[1]),{start:ug,middle:fg,end:hg}[r[2]]):cg(t)}function bg(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 xg=0,wg=1,Mg=2,Eg=3;function Og(t,e,n){var r=function(t,e,n){if(null===e)return xg;var r=n.endTime;return e<Math.min(n.delay,r)?wg:e>=Math.min(n.delay+t+n.endDelay,r)?Mg:Eg}(t,e,n),i=function(t,e,n,r,i){switch(r){case wg:return"backwards"===e||"both"===e?0:null;case Eg:return n-i;case Mg:return"forwards"===e||"both"===e?t:null;case xg: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!==wg&&(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!==Mg||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return t===Mg&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function kg(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Sg(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:vg(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;o<i.length-1;o++){var a=o,s=o+1,c=i[a].computedOffset,l=i[s].computedOffset,u=c,f=l;0===o&&(u=-1/0,0===l&&(s=a)),o===i.length-2&&(f=1/0,1===c&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Tg(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&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:n.easingFunction(r/i);t.setAttribute(n.property,n.interpolation(o))}));else for(var n in r)Sg(n)&&t.setAttribute(n,null)}}function Sg(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Ag=function(t,e,n){return function(r){var i=_g(t,e,r);return!$d.enableCSSParsing&&_(i)?i:n(i)}};function Tg(t,e,n,r){var i=fh[t];if(i&&i.syntax&&i.int){var o=$d.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if($d.enableCSSParsing){var c=$d.styleValueRegistry.parseProperty(t,e,r),l=$d.styleValueRegistry.parseProperty(t,n,r);a=$d.styleValueRegistry.computeProperty(t,c,r),s=$d.styleValueRegistry.computeProperty(t,l,r)}else{var u=o.parserWithCSSDisabled;a=u?u(e,r):e,s=u?u(n,r):n}var f=o.mixer(a,s,r);if(f){var h=Ag.apply(void 0,ve([],ye(f),!1));return function(t){return 0===t?e:1===t?n:h(t)}}}}return Ag(!1,!0,(function(t){return t?n:e}))}function _g(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 n<.5?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;s<o;s++)a.push(_g(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Pg=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=lg,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=vg(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function Cg(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;o<i;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}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".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;o<n.length;o++){var a=n[o].offset;if(y(a))r=!1;else{if(a<i)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&&Number(t.offset)<=1})),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;a<r;a++){var s=n[a].computedOffset;if(!y(s)&&!y(o)){for(var c=1;c<a-i;c++)n[i+c].computedOffset=o+(Number(s)-o)*c/(a-i);i=a,o=Number(s)}}}(),n}var Ng="backwards|forwards|both|none".split("|"),Lg="reverse|alternate|alternate-reverse".split("|");function jg(t,e){return function(t,e){var n=new Pg;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&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===Ng.indexOf(t[e]))return;if("direction"===e&&-1===Lg.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Rg=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=jg(n,!1),this.timing.effect=this,this.timing.activeDuration=bg(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Cg(e,this.timing),this.interpolations=kg(this.normalizedKeyframes,this.timing,this.target);var i=$d.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=Og(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=Cg(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 Ig(t,e){return Number(t.id)-Number(e.id)}var Bg=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=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Ig),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 Rg(t,e,n),i=new Rp(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(Ig),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=[],c=[],l=[];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?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,ve([],ye(a),!1)),(i=this.pendingEffects).push.apply(i,ve([],ye(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();function Dg(t){return new Fg([t],null,t,t.ownerDocument)}$d.EasingFunction=vg,$d.AnimationTimeline=Bg;class Fg{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Fg(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Fg(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Fg([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,o]=Array.isArray(r)?r:[r,null],a=e(i,t);a.__data__=i,null!==o&&(a.__fromElements__=o),this._parent.appendChild(a),n.push(a)}return new Fg(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new Fg(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Fg([i],null,this._parent,this._document);const o="string"==typeof e?this.createElement(e):e();return o.id=t,n&&(o.className=n),r.appendChild(o),new Fg([o],null,this._parent,this._document)}data(t,e=(t=>t),n=(()=>null)){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,c=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=Pn(this._elements,(t=>n(t.__data__)));for(let f=0;f<t.length;f++){const h=t[f],d=e(h,f),p=n(h,f);if(c.has(d)){const t=c.get(d);t.__data__=h,t.__facet__=!1,i.push(t),o.delete(t),c.delete(d)}else if(l.has(d)){const t=l.get(d);t.__data__=h,t.__facet__=!0,i.push(t),l.delete(d)}else if(u.has(d)){const t=u.get(d);a.push([h,t]);for(const e of t)o.delete(e);u.delete(d)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(h):t.__toData__=[h],s.add(t),o.delete(t)}else r.push(h)}const f=[new Fg([],r,this._parent,this._document),new Fg(i,null,this._parent,this._document),new Fg(o,null,this._parent,this._document),new Fg([],a,this._parent,this._document),new Fg(s,null,this._parent,this._document)];return new Fg(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Fg(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Fg.registry[t];return e?new e:ar(`Unknown node type: ${t}`)}join(t=(t=>t),e=(t=>t),n=(t=>t.remove()),r=(t=>t),i=(t=>t.remove())){const o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(e){const n=Array.isArray(e)?e:[e];Promise.all(n.map((t=>t.finished))).then((()=>{this._elements[t].remove()}))}else{this._elements[t].remove()}}return new Fg([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o[t]=n(r,i,o))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o.style[t]=n(r,i,o))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r,i){n[r]=e(t,r,i)}))}on(t,e){return this.each((function(n,r,i){i.addEventListener(t,e)})),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function zg(t,e,n){return Math.max(e,Math.min(t,n))}function Gg(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Wg(t,e,n,r,i){const o=ss(is(r,e))+Math.PI,a=ss(is(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function $g(t,e,n,r="y",i="between"){const o="y"===r||!0===r?n:e,a="y"===r||!0===r?90:0,s=vr(o),[c,l]=kn(s,(t=>o[t])),u=new Zo({domain:[c,l],range:[0,100]}),f=t=>u.map(o[t]),h={between:e=>`${t[e]} ${f(e)}%`,start:e=>0===e?`${t[e]} ${f(e)}%`:`${t[e-1]} ${f(e)}%, ${t[e]} ${f(e)}%`,end:e=>e===t.length-1?`${t[e]} ${f(e)}%`:`${t[e]} ${f(e)}%, ${t[e+1]} ${f(e)}%`};return`linear-gradient(${a}deg, ${s.sort(((t,e)=>f(t)-f(e))).map(h[i]||h.between).join(",")})`}function Hg(t){const[e,n,r,i]=t;return[i,e,n,r]}function Vg(t,e,n){const[r,i,,o]=wc(t)?Hg(e):e,[a,s]=n,c=t.getCenter(),l=cs(is(r,c)),u=cs(is(i,c)),f=u===l&&a!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:as(o,c),outerRadius:as(r,c)}}function Yg(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function qg(t,e){if(!Mc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Ug(t,e,n,r,i={}){const{inset:o=0,radius:a=0,insetLeft:s=o,insetTop:c=o,insetRight:l=o,insetBottom:u=o,radiusBottomLeft:f=a,radiusBottomRight:h=a,radiusTopLeft:d=a,radiusTopRight:p=a,minWidth:g=-1/0,maxWidth:m=1/0}=i,y=he(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!Mc(r)&&!Oc(r)){const n=!!wc(r),[i,,o]=n?Hg(e):e,[a,v]=i,[b,x]=is(o,i),w=(b>0?a:a+b)+s,M=(x>0?v:v+x)+c,E=Math.abs(b)-(s+l),O=Math.abs(x)-(c+u),k=n?E:zg(E,g,m),S=n?zg(O,g,m):O,A=w-(k-E)/2,T=M-(S-O)/2;return Dg(t.createElement("rect",{})).style("x",A).style("y",T).style("width",k).style("height",S).style("radius",[d,p,h,f]).call(Gg,y).node()}const{y:v,y1:b}=n,x=r.getCenter(),w=Vg(r,e,[v,b]),M=Us().cornerRadius(a).padAngle(o*Math.PI/180);return Dg(t.createElement("path",{})).style("path",M(w)).style("transform",`translate(${x[0]}, ${x[1]})`).style("radius",a).style("inset",o).call(Gg,y).node()}Fg.registry={g:up,rect:yp,circle:sp,path:pp,text:vp,ellipse:lp,image:hp,line:dp,polygon:gp,polyline:mp,html:fp};const Xg=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=he(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=he(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:m=g,radiusTopRight:y=g,radiusBottomRight:v=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:M=x,innerRadiusBottomRight:E=x,innerRadiusBottomLeft:O=x,lineWidth:k=("stroke"===n||p?d:0),inset:S=0,insetLeft:A=S,insetRight:T=S,insetBottom:_=S,insetTop:P=S,minWidth:C,maxWidth:N}=a,L=he(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:j=u,opacity:R}=r,I=[i?m:w,i?y:M,o?v:E,o?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];wc(s)&&B.push(B.shift());const D=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map(((t,e)=>[t,I[e]])))),{inset:S,insetLeft:A,insetRight:T,insetBottom:_,insetTop:P,minWidth:C,maxWidth:N});return Dg(Ug(c,e,r,s,D)).call(Gg,h).style("fill","transparent").style(n,j).style(Yg(t),R).style("lineWidth",k).style("stroke",void 0===p?j:p).call(Gg,L).node()}};Xg.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Kg=(t,e)=>Xg(Object.assign({colorAttribute:"fill"},t),e);Kg.props=Object.assign(Object.assign({},Xg.props),{defaultMarker:"square"});const Zg=(t,e)=>Xg(Object.assign({colorAttribute:"stroke"},t),e);function Qg(t,e,n){const[r,i,o,a]=t;if(wc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}Zg.props=Object.assign(Object.assign({},Xg.props),{defaultMarker:"hollowSquare"});const Jg=(t,e)=>{const{adjustPoints:n=Qg}=t,r=he(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=he(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!wc(i),[p,g,m,y]=d?Hg(h):h,{color:v=l,opacity:b}=e,x=tc().curve(mc)([p,g,m,y]);return Dg(o.createElement("path",{})).call(Gg,u).style("path",x).style("fill",v).style("fillOpacity",b).call(Gg,r).node()}};function tm(t,e,n){const[r,i,o,a]=t;if(wc(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}Jg.props={defaultMarker:"square"};const em=(t,e)=>Jg(Object.assign({adjustPoints:tm},t),e);function nm(t){const e="function"==typeof t?t:t.render;return class extends cp{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}em.props={defaultMarker:"square"};const rm=nm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;Dg(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Gg,r),Dg(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Gg,i)}));const im=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=he(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=he(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:m,seriesX:y,seriesY:v}=e,b=r&&m?$g(m,y,v,r,i):p,x=qg(c,e),w=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),b&&{stroke:b}),g&&{lineWidth:g}),x&&{transform:x}),s);let M;if(Mc(c)){const t=c.getCenter();M=e=>oc(tc().curve(nc)).angle(((n,r)=>cs(is(e[r],t)))).radius(((n,r)=>as(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else M=tc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[E,O]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),k=ur(w,"connect"),S=!!O.length;if(!S||a&&!Object.keys(k).length)return Dg(l.createElement("path",{})).style("d",M(E)||[]).call(Gg,w).node();if(S&&!a)return Dg(l.createElement("path",{})).style("d",M(t)).call(Gg,w).node();return Dg(new rm).style("style1",Object.assign(Object.assign({},w),k)).style("style2",w).style("d1",(A=O,A.map(M).join(","))).style("d2",M(t)).node();var A}};im.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const om=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Mc(n)?mc:Zs;return im(Object.assign({curve:i},t),e)(...r)}};om.props=Object.assign(Object.assign({},im.props),{defaultMarker:"line"});const am=(t,e)=>{const{alpha:n=.5}=t,r=he(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=Mc(i)?pc:hc;return im(Object.assign({curve:o.alpha(n)},r),e)(...t)}};am.props=Object.assign(Object.assign({},im.props),{defaultMarker:"smooth"});const sm=(t,e)=>im(Object.assign({curve:xc},t),e);sm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"hv"});const cm=(t,e)=>im(Object.assign({curve:bc},t),e);cm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"vh"});const lm=(t,e)=>im(Object.assign({curve:vc},t),e);function um(t,e,n,r,i){const o=ss(is(n,e)),a=o+Math.PI/2,s=[r/2*Math.cos(a),r/2*Math.sin(a)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],u=[r/2*Math.cos(o),r/2*Math.sin(o)],f=os(e,s),h=os(n,c),d=os(h,l),p=os(n,l),g=is(p,c),m=is(n,c),y=is(e,s),v=is(y,u),b=is(e,u),x=is(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...m,i/2),t.lineTo(...y),t.arcTo(...v,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}lm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"hvh"});const fm=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=he(i,["color"]),l=zs();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=o[t],a=o[t+1];[...n,...r].every(cr)&&um(l,n,r,i,a)}return Dg(n.createElement("path",{})).call(Gg,c).style("fill",a||s).style("d",l.toString()).call(Gg,t).node()}};fm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"line"});const hm=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];hm.style=["fill"];const dm=hm.bind(void 0);dm.style=["stroke","lineWidth"];const pm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];pm.style=["fill"];const gm=pm.bind(void 0);gm.style=["fill"];const mm=pm.bind(void 0);mm.style=["stroke","lineWidth"];const ym=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};ym.style=["fill"];const vm=ym.bind(void 0);vm.style=["stroke","lineWidth"];const bm=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};bm.style=["fill"];const xm=bm.bind(void 0);xm.style=["stroke","lineWidth"];const wm=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};wm.style=["fill"];const Mm=wm.bind(void 0);Mm.style=["stroke","lineWidth"];const Em=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};Em.style=["fill"];const Om=Em.bind(void 0);Om.style=["stroke","lineWidth"];const km=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};km.style=["fill"];const Sm=km.bind(void 0);Sm.style=["stroke","lineWidth"];const Am=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];Am.style=["stroke","lineWidth"];const Tm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];Tm.style=["stroke","lineWidth"];const _m=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];_m.style=["stroke","lineWidth"];const Pm=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];Pm.style=["stroke","lineWidth"];const Cm=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Cm.style=["stroke","lineWidth"];const Nm=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Nm.style=["stroke","lineWidth"];const Lm=Nm.bind(void 0);Lm.style=["stroke","lineWidth"];const jm=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];jm.style=["stroke","lineWidth"];const Rm=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];Rm.style=["stroke","lineWidth"];const Im=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];Im.style=["stroke","lineWidth"];const Bm=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];Bm.style=["stroke","lineWidth"];const Dm=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];Dm.style=["stroke","lineWidth"];const Fm=new Map([["bowtie",km],["cross",Tm],["dash",Lm],["diamond",ym],["dot",Nm],["hexagon",Em],["hollowBowtie",Sm],["hollowDiamond",vm],["hollowHexagon",Om],["hollowPoint",dm],["hollowSquare",mm],["hollowTriangle",xm],["hollowTriangleDown",Mm],["hv",Rm],["hvh",Bm],["hyphen",Cm],["line",Am],["plus",Pm],["point",hm],["rect",gm],["smooth",jm],["square",pm],["tick",_m],["triangleDown",wm],["triangle",bm],["vh",Im],["vhv",Dm]]);const zm=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=he(t,["colorAttribute","symbol","mode"]),a=Fm.get(r)||Fm.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=o.stroke?u||1:u,{color:d=f,transform:p,opacity:g}=r,[m,y]=function(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}(e),v=function(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Sc(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}(i,e,r,s),b=v||o.r||l.r;return Dg(c.createElement("path",{})).call(Gg,l).style("fill","transparent").style("d",a(m,y,b)).style("lineWidth",h).style("transform",p).style("stroke",d).style(Yg(t),g).style(n,d).call(Gg,o).node()}};zm.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);Gm.props=Object.assign({defaultMarker:"hollowBowtie"},zm.props);const Wm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Wm.props=Object.assign({defaultMarker:"hollowDiamond"},zm.props);const $m=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);$m.props=Object.assign({defaultMarker:"hollowHexagon"},zm.props);const Hm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Hm.props=Object.assign({defaultMarker:"hollowPoint"},zm.props);const Vm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Vm.props=Object.assign({defaultMarker:"hollowSquare"},zm.props);const Ym=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Ym.props=Object.assign({defaultMarker:"hollowTriangle"},zm.props);const qm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);qm.props=Object.assign({defaultMarker:"hollowTriangleDown"},zm.props);const Um=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Um.props=Object.assign({defaultMarker:"bowtie"},zm.props);const Xm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Xm.props=Object.assign({defaultMarker:"cross"},zm.props);const Km=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Km.props=Object.assign({defaultMarker:"diamond"},zm.props);const Zm=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Zm.props=Object.assign({defaultMarker:"hexagon"},zm.props);const Qm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Qm.props=Object.assign({defaultMarker:"hyphen"},zm.props);const Jm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Jm.props=Object.assign({defaultMarker:"line"},zm.props);const ty=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);ty.props=Object.assign({defaultMarker:"plus"},zm.props);const ey=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);ey.props=Object.assign({defaultMarker:"point"},zm.props);const ny=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);ny.props=Object.assign({defaultMarker:"square"},zm.props);const ry=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);ry.props=Object.assign({defaultMarker:"tick"},zm.props);const iy=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);iy.props=Object.assign({defaultMarker:"triangle"},zm.props);const oy=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);oy.props=Object.assign({defaultMarker:"triangleDown"},zm.props);const ay=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=he(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=he(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=zs();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*as(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...h),d.lineTo(...t),d.moveTo(...h),d.lineTo(...e)}return Dg(o.createElement("path",{})).call(Gg,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Gg,i).node()}};function sy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&sy(t,e)}))}function cy(t){uy(t,!0)}function ly(t){uy(t,!1)}function uy(t,e){var n=e?"visible":"hidden";sy(t,(function(t){t.attr("visibility",n)}))}ay.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var fy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,ve([],ye(e),!1))||this;return r.addEventListener(Ad.INSERTED,(function(){ly(r)})),r}return ue(e,t),e}(up);function hy(t){var e=t.appendChild(new fy({class:"offscreen"}));return ly(e),e}var dy=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({style:fe({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return ue(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(vp);function py(t){return t*Math.PI/180}function gy(t){return Number((180*t/Math.PI).toPrecision(5))}var my=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t}();function yy(t,e){return m(t)?t.apply(void 0,ve([],ye(e),!1)):t}var vy,by=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=ye(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]})));return Object.assign(r,{prefix:n}),r},xy=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=ye(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?E(s)?(E(t[a])||(c[a]={}),n<r?xy(t[a],s,n+1,r):c[a]=e[a]):x(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)}))},wy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)xy(t,e[r]);return t},My=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},Ey=function(t,e,n){if(void 0===n&&(n=128),!m(t))throw new TypeError("Expected a function");var r=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return a.set(o,s),s};return r.cache=$(n),r}((function(t,e){var n=A(t)?t:t.style.text.toString(),r=e||Oy(t),i=r.fontSize,o=r.fontFamily,a=r.fontWeight,s=r.fontStyle,c=r.fontVariant;return vy||(vy=document.createElement("canvas").getContext("2d")),vy.font=[s,c,a,"".concat(i,"px"),o].join(" "),vy.measureText(n).width}),(function(t,e){return[A(t)?t:t.style.text.toString(),Object.values(e||Oy(t)).join()].join("")}),4096),Oy=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function ky(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Sy(t,e){var n=ky(t);n&&n.attr(e)}function Ay(t,e,n){void 0===n&&(n="..."),Sy(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Ty(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function _y(t){return"function"==typeof t?t():A(t)||_(t)?new dy({style:{text:String(t)}}):t}function Py(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function Cy(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}var Ny=function(t,e){return function(n){return t*(1-n)+e*n}};function Ly(t,e){return"number"==typeof t&&"number"==typeof e?Ny(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=Ly(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=ye(e,2),o=i[0],a=i[1];o in t?n[o]=Ly(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=ye(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function jy(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,c=a.y,l=ye([s+a.width,c+a.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new my(e,n,r-e,i-n)}var Ry=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=ye([0,0],2),g=p[0],m=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=ye([g,m],2),o=i[0],a=i[1];return e=ye([g+n*d[0],m+r*d[1]],2),g=e[0],m=e[1],new my(o,a,n,r)})),v=jy(y),b={"flex-start":0,"flex-end":f?r-v.width:i-v.height,center:f?(r-v.width)/2:(i-v.height)/2},x=y.map((function(t){var e=t.x,n=t.y,r=my.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));jy(x);var w=function(t){var e=ye(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},M=x.map((function(t){var e=t.x,n=t.y,r=my.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),E=M.map((function(e){var n,r,i=my.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return E},Iy=function(t,e,n){return[]};function By(t,e){return[t[0]*e,t[1]*e]}function Dy(t,e){return[t[0]+e[0],t[1]+e[1]]}function Fy(t,e){return[t[0]-e[0],t[1]-e[1]]}function zy(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Gy(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Wy(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function $y(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function Hy(t,e){return+t.toPrecision(e)}function Vy(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Yy(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,c,l,u=function(t,e,n,r){var i,o,a,s,c,l,u=[],f=!!r,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=ye(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=zy(h,y=t[p]),d=Gy(d,y)}p=0;for(var m=t.length;p<m;p+=1){var y=t[p];if(0!==p||n)if(p!==m-1||n){o=t[[p?p-1:m-1,p-1][n?0:1]];var v=[0,0];v=By(v=Fy(a=t[n?(p+1)%m:p+1],o),e);var b=Wy(y,o),x=Wy(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=By(v,-b),E=By(v,x);c=Dy(y,M),s=zy(s=Dy(y,E),Gy(a,y)),s=Gy(s,zy(a,y)),c=zy(c=Dy(y,M=By(M=Fy(s,y),-b/x)),Gy(o,y)),s=Dy(y,E=By(E=Fy(y,c=Gy(c,zy(o,y))),x/b)),f&&(c=zy(c=Gy(c,h),d),s=zy(s=Gy(s,h),d)),u.push(l),u.push(c),l=s}else c=y,u.push(l),u.push(c);else l=y}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,h=[];for(o=0;o<f-1;o+=1)s=u[2*o],c=u[2*o+1],l=i[o+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=ye(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var qy=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Uy(t){return qy.includes(t)}function Xy(t){var e={};for(var n in t)Uy(n)&&(e[n]=t[n]);return e}function Ky(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&t.scale(a),a}var Zy=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=ye(Array.isArray(a)?a:[a,null],2),c=s[0],l=s[1];(f=r(c,o)).__data__=c,null!==l&&(f.__fromElements__=l),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var u=this._elements[o],f=r(c=u.__data__,o);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=be(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),o=be(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,n){var i=be(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,o;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var a=[],s=[],c=new Set(this._elements),l=[],u=new Set,f=new Map(this._elements.map((function(t,n){return[e(t.__data__,n),t]}))),h=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),d=function(t,e){var n=new Map;return t.forEach((function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)})),n}(this._elements,(function(t){return r(t.__data__)})),p=0;p<t.length;p++){var g=t[p],m=e(g,p),y=r(g,p);if(f.has(m))(w=f.get(m)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(m);else if(h.has(m)){(w=h.get(m)).__data__=g,w.__facet__=!0,s.push(w),h.delete(m)}else if(d.has(m)){var v=d.get(m);l.push([g,v]);try{for(var b=(i=void 0,me(v)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(m)}else if(f.has(y)){(w=f.get(y)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var M=[new n([],a,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,M)},t.prototype.merge=function(t){var e=ve(ve([],ye(this._elements),!1),ye(t._elements),!1),r=ve(ve([],ye(this._transitions),!1),ye(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then((function(){return n.remove()})):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var o=ye(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,ve([this._parent,this],ye(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var o="string"==typeof e?this.createElement(e):e();return r.appendChild(o),new n([o],null,this._parent,this._document)},t.registry={g:up,rect:yp,circle:sp,path:pp,text:dy,ellipse:lp,image:hp,line:dp,polygon:gp,polyline:mp,html:fp},t}();function Qy(t){return new Zy([t],null,t,t.ownerDocument)}function Jy(t){if(_(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function tv(t){var e=t.getLocalBounds(),n=ye([e.min,e.max],2),r=ye(n[0],2),i=r[0],o=r[1],a=ye(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function ev(t,e){var n=ye(t,2),r=n[0],i=n[1],o=ye(e,2),a=o[0],s=o[1];return r!==a&&i===s}function nv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function rv(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var iv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function ov(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=ye(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(iv(o,"show")&&iv(rv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(nv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(nv(e)),"")]=a;else if(!iv(o,"show")&&iv(o,e)!==n){var s=rv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function av(t,e){return Object.entries(t).reduce((function(t,n){var r=ye(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(nv(i))]=o,t}),{})}function sv(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var o=ye(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function cv(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=ye([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}function lv(){uy(this,"hidden"!==this.attributes.visibility)}var uv=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,wy({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return ue(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hy(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&lv.call(this)},e.prototype.update=function(t,e){var n;return this.attr(wy({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e}(cp),fv=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},hv=fv,dv=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},pv=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},gv=pv;var mv=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function yv(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(A(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var vv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,n){var r=t.symbol,i=t.size,o=void 0===i?16:i,a=he(t,["symbol","size"]),s=yv(r);Py(!!s,Qy(n),(function(t){t.maybeAppendByClassName("marker",s).attr("className","marker ".concat(s,"-marker")).call((function(t){if("image"===s){var n=2*o;t.styles({img:r,width:n,height:n,x:-o,y:-o})}else{n=o/2;var i=m(r)?r:e.getSymbol(r);t.styles(fe({path:null==i?void 0:i(0,0,n)},a))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e}(uv);vv.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),vv.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),vv.registerSymbol("line",dv),vv.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),vv.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),vv.registerSymbol("circle",fv),vv.registerSymbol("point",hv),vv.registerSymbol("bowtie",(function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]})),vv.registerSymbol("hexagon",(function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]})),vv.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),vv.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),vv.registerSymbol("triangle",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]})),vv.registerSymbol("triangle-down",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]})),vv.registerSymbol("line",dv),vv.registerSymbol("dot",pv),vv.registerSymbol("dash",gv),vv.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),vv.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),vv.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),vv.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),vv.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));var bv=function(t){function e(e){var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,Y({},{type:"column"},fe({style:r},i)))||this).columnsGroup=new up({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes.columns;Qy(this.columnsGroup).selectAll(".column").data(t.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(wy({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(op),xv=function(t){function e(e){var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,Y({},{type:"lines"},fe({style:r},i)))||this).linesGroup=n.appendChild(new up),n.areasGroup=n.appendChild(new up),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas;e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(wy({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Qy(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){Qy(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(op);function wv(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return ve([e===n?"M":"L"],ye(t),!1)}));return e?r.reverse():r}function Mv(t,e){if(void 0===e&&(e=!1),t.length<=2)return wv(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];U(o,n.slice(-2))||n.push.apply(n,ve([],ye(o),!1))}var a=Yy(n,!1);return e?a.unshift(ve(["M"],ye(t[r-1]),!1)):a.unshift(ve(["M"],ye(t[0]),!1)),a}function Ev(t,e,n){var r=G(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function Ov(t){return 0===t.length?[0,0]:[k(L(t,(function(t){return k(t)||0}))),O(N(t,(function(t){return O(t)||0})))]}function kv(t){for(var e=G(t),n=e[0].length,r=ye([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=o[c],o[c]=s[c]);return e}var Sv=function(t){function e(e){return t.call(this,e,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return ue(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=G(t);return _(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?kv(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=ye(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=ov(this.attributes,"area"),a=ov(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=ye(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=ye([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),T(i.map(t),s,a)]}))}))}(c,{type:"line",x:l.x,y:l.y}),f=[];if(o){var h=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=Mv(o),s=void 0;if(0===i)s=Ev(a,e,n);else{var c=Mv(t[i-1],!0),l=o[0];c[0][0]="L",s=ve(ve(ve([],ye(a),!1),ye(c),!1),[ve(["M"],ye(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=wv(t[i]),a=void 0;if(0===i)a=Ev(o,e,n);else{var s=wv(t[i-1],!0);s[0][0]="L",a=ve(ve(ve([],ye(o),!1),ye(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return Ev(e?Mv(t):wv(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return fe({stroke:t.getColor(n),path:i?Mv(e):wv(e)},a)})),areas:f.map((function(e,n){return fe({path:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=ov(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=kv(s));var c=this.createScales(s),l=c.x,u=c.y,f=ye(Ov(s),2),h=f[0],d=f[1],p=new Zo({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),m=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return fe(fe({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(m[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Qy(n).select(r):Qy(n).append(i)).attr("className","container").node();var o=t.type,a="spark".concat(o),s="line"===o?this.linesStyle:this.columnsStyle;Qy(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new xv({className:a,style:s}):new bv({className:a,style:s})})).attr("className","spark ".concat(a))}),(function(t){return t.update(s)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:m(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.scale,a=r.range,s=void 0===a?[]:a,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,h=ye(Ov(t),2),d=h[0],p=h[1],g=new Zo({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-o)]});return"line"===i?{type:i,x:new Zo({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Lo({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(uv);function Av(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=ye(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,fe(fe({},t[e]),n)]:[e,n]})))}function Tv(t,e){t?t.finished.then(e):e()}function _v(t,e){"update"in t?t.update(e):t.attr(e)}function Pv(t,e,n){return 0===e.length?null:n?t.animate(e,n):(_v(t,{style:e.slice(-1)[0]}),null)}function Cv(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=ye(e,2),o=n[0],a=n[1];if(!y(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?Pv(t,[r,i],fe({fill:"both"},n)):(_v(t,i),null)}function Nv(t,e){return t.style.opacity||(t.style.opacity=1),Cv(t,{opacity:0},e)}var Lv={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},jv={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Rv={orientation:"horizontal",showLabel:!0,type:"start"},Iv=by({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Bv=by({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Dv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,e){var n=t.size,r=void 0===n?10:n,i=t.radius,o=void 0===i?r/4:i,a=t.orientation,s=he(t,["size","radius","orientation"]),c=r,l=2.4*c,u=Qy(e).maybeAppendByClassName(Bv.iconRect,"rect").styles(fe(fe({},s),{width:c,height:l,radius:o,x:-c/2,y:-l/2})),f=1/3*c,h=2/3*c,d=1/4*l,p=3/4*l;u.maybeAppendByClassName("".concat(Bv.iconLine,"-1"),"line").styles(fe({x1:f,x2:f,y1:d,y2:p},s)),u.maybeAppendByClassName("".concat(Bv.iconLine,"-2"),"line").styles(fe({x1:h,x2:h,y1:d,y2:p},s)),u.node().setOrigin(c/2,l/2),"vertical"===a?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},e}(uv),Fv=function(t){function e(e){return t.call(this,e,Rv)||this}return ue(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=ov(this.attributes,"label"),i=r.transform,o=ye(sv(he(r,["transform"]),[]),2),a=o[0],s=o[1],c=Qy(t).maybeAppendByClassName(Bv.labelGroup,"g").styles(s),l=fe(fe({},jv),a),u=l.text,f=he(l,["text"]);Py(!!n,c,(function(t){e.label=t.maybeAppendByClassName(Bv.label,"text").styles(fe(fe({},f),{transform:i,text:"".concat(u)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.orientation,r=e.type,i=fe(fe({orientation:n},Lv),ov(this.attributes,"icon")),o=this.attributes.iconShape,a=void 0===o?function(){return new Dv({style:i})}:o;Qy(t).maybeAppendByClassName(Bv.iconGroup,"g").selectAll(Bv.icon.class).data([a]).join((function(t){return t.append("string"==typeof a?a:function(){return a(r)}).attr("className",Bv.icon.name)}),(function(t){return t.update(i)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(uv),zv=function(t){function e(e){var n=t.call(this,e,fe(fe(fe({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},av(Rv,"handle")),av(Lv,"handleIcon")),av(jv,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Ty(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.getBBox(),s=a.x,c=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,o=e.type;t.stopPropagation();var a=n.getOrientVal(Ty(t)),s=a-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===o?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=a}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,o="range"===i?t:t[1],a="range"===i?n.getValues():n.getValues()[1],s=new Md("valuechange",{detail:{oldValue:o,value:a}});n.dispatchEvent(s),null==r||r(a)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return ue(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=ov(this.attributes,"sparkline");return fe(fe({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=ye(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=ye(Jy(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(Iv.selection.class).each((function(n,r){Cv(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Cv(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Cv(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=ov(this.attributes,"track");this.trackShape=Qy(t).maybeAppendByClassName(Iv.track,"rect").styles(fe(fe({},this.shape),e))},e.prototype.renderBrushArea=function(t){var e=this.attributes.brushable;this.brushArea=Qy(t).maybeAppendByClassName(Iv.brushArea,"rect").styles(fe({fill:"transparent",cursor:e?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this;Py("horizontal"===this.attributes.orientation,Qy(t).maybeAppendByClassName(Iv.sparklineGroup,"g"),(function(t){var n=e.sparklineStyle;t.maybeAppendByClassName(Iv.sparkline,(function(){return new Sv({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,o=r?"range"===i?["start","end"]:["end"]:[],a=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(Iv.handle.class).data(o.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new Fv({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Iv.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");a[n]=this,this.addEventListener("pointerdown",a.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(a.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");a[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.type,r=e.selectionType;this.foregroundGroup=Qy(t).maybeAppendByClassName(Iv.foreground,"g");var i=ov(this.attributes,"selection"),o=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===r?"grab":"invert"===r?"crosshair":"default"})).styles(i)},a=this;this.foregroundGroup.selectAll(Iv.selection.class).data("value"===n?[]:this.calcSelectionArea().map((function(t,e){return{style:fe({},t),index:e,show:"select"===r?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",Iv.selection.name).call(o).each((function(t,e){var n=this;1===e?(a.selectionShape=Qy(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),a.onDragStart("selection")(t)})),a.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),a.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),a.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","grab")}))):this.on("pointerdown",a.onDragStart("track"))}))}),(function(t){return t.call(o)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=ye(this.range,2),i=r[0],o=r[1],a=ye(this.getValues().map((function(t){return Hy(t,e)})),2),s=a[0],c=a[1],l=ye(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return Hy(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,T(f,i,o)];u>f&&(u=(n=ye([f,u],2))[0],f=n[1]);var h=f-u;return h>o-i?[i,o]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>o?c===o&&s===u?[u,o]:[o-h,o]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=ye(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:a,height:c,x:o,width:n*s},{y:a,height:c,x:n*s+o,width:(r-n)*s},{y:a,height:c,x:r*s,width:(1-r)*s}],[{x:o,width:s,y:a,height:n*c},{x:o,width:s,y:n*c+a,height:(r-n)*c},{x:o,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,o=n.width,a=n.height,s=ye(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([f,o/2]),y:i+this.getOrientVal([a/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=ov(this.attributes,"handle"),c=ov(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new dy({style:fe(fe(fe({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,m=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-m-l};var y=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-y:y,e}var v=0,b=0,x=this.availableSpace,w=x.width,M=x.height,E=this.calcSelectionArea()[1],O=E.x,k=E.y,S=E.width,A=E.height,T=l+u;if("horizontal"===i){var _=T+g/2;if("start"===t)v=O-T-g>0?-_:_;else v=w-O-S-T>g?_:-_}else{var P=m+T;b="start"===t?k-u>m?-P:T:M-(k+A)-u>m?P:-T}return{x:v,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=ov(this.attributes,"handleLabel");return fe(fe(fe({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=ov(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return fe({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,r=e.showLabelOnInteraction,i=e.orientation,o=this.calcHandlePosition(t),a=this.calcHandleText(t),s=n;return!n&&r&&(s=!!this.target),fe(fe(fe(fe({},av(this.getHandleIconStyle(),"icon")),av(fe(fe({},this.getHandleLabelStyle(t)),a),"label")),o),{orientation:i,showLabel:s,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=ye(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=this.attributes.type,i=ye(this.getValues(),2),o=[i[0]+("range"===r?t:0),i[1]+e].sort();n?this.setValues(o):this.innerSetValues(o,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new Md(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(uv),Gv=function(t){function e(e){var n=t.call(this,e,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Md("scroll",r)),n.dispatchEvent(new Md("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=ye(n.getLocalPosition(),2),r=e[0],i=e[1],o=ye(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(Ty(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Md("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Md("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Md("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Md("trackMouseleave",{detail:t.detail}))},n}return ue(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Jy(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=ye(this.range,2),n=e[0],r=e[1];return T(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=ye(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ye(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=ye(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,o=e.slidable,a=ov(this.attributes,"track"),s=ov(this.attributes,"thumb"),c=fe(fe({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:o,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},av(a,"track")),av(s,"selection"));this.slider=Qy(t).maybeAppendByClassName("scrollbar",(function(){return new zv({style:c})})).update(c).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=ye(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(T(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(uv),Wv={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new pp({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};Y({},Wv,{style:{type:"arc"}}),Y({},Wv,{style:{}});var $v=by({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Hv=by({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Vv(t){return t.reduce((function(t,e,n){return t.push(ve([0===n?"M":"L"],ye(e),!1)),t}),[])}function Yv(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return Vv(t);if(!o)return[];var a=Wy(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(ve(["M"],ye(e),!1)):t.push(ve(["A",a,a,0,0,s],ye(e),!1)),t}),[])}(t,e,n):Vv(t)}function qv(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=ye([Yv(t,n),Yv(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=ye([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return d([ve(["L"],ye(h),!1)],[ve(["L"],ye(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=ye([Wy(h,o),Wy(f,o)],2),g=p[0],m=p[1];return d([ve(["A",g,g,0,0,1],ye(h),!1),ve(["L"],ye(h),!1)],[ve(["A",m,m,0,0,0],ye(f),!1),ve(["L"],ye(f),!1)])}var Uv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,e){var n=he(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=ye(e,1)[0];return fe(fe({},t),{points:ve(ve([],ye(e),!1),[n],!1)})})):n}(t),i=Qy(e).maybeAppendByClassName(Hv.lineGroup,"g"),o=Qy(e).maybeAppendByClassName(Hv.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),path:Yv(t.points,n)}}));return t.selectAll(Hv.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=yy(Xy(fe({path:t.path},r)),[t,e,a]);this.attr(fe({class:Hv.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return Cv(this,yy(Xy(fe({path:t.path},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this,i.exit);return Tv(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},c=[],l=0;l<e.length-1;l++){var u=ye([e[l].points,e[l+1].points],2),f=qv(u[0],u[1],n);c.push({path:f,fill:s(l)})}return t.selectAll(Hv.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=yy(t,[t,e,c]);this.attr(n)})).attr("className",Hv.region.name)}),(function(t){return t.transition((function(t,e){return Cv(this,yy(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this,r.exit);return Tv(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return ve(ve([],ye(a),!1),ye(s),!1)},e}(uv);function Xv(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=ye(t,2);return[n[0],yy(n[1],e)]})))}function Kv(t,e){return e&&m(e)?t.filter(e):t}function Zv(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Qv(t,e){if("linear"===e.type){var n=ye(e.startPos,2),r=n[0],i=n[1],o=ye(e.endPos,2),a=ye([o[0]-r,o[1]-i],2);return $y([a[0],a[1]])}var s=py(Zv(t,e));return[-Math.sin(s),Math.cos(s)]}function Jv(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Qv(t,n),"positive"!==e)}function tb(t,e){return Jv(t,e.labelDirection,e)}function eb(t,e){return"linear"===e.type?function(t,e){var n=ye(e.startPos,2),r=n[0],i=n[1],o=ye(e.endPos,2),a=ye([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}(t,e):function(t,e){var n=e.radius,r=ye(e.center,2),i=r[0],o=r[1],a=py(Zv(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function nb(t){return 0===Qv(0,t)[1]}function rb(t){return 0===Qv(0,t)[0]}function ib(t,e){return e-t==360}function ob(t,e,n,r,i){var o=e-t,a=ye([i,i],2),s=a[0],c=a[1],l=ye([py(t),py(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=ye(h(u),2),p=d[0],g=d[1],m=ye(h(f),2),y=m[0],v=m[1];if(ib(t,e)){var b=ye(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,y,v]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(y,",").concat(v)}function ab(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll($v.line.class).data([{path:ob.apply(void 0,ve(ve([i,o],ye(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",$v.line.name).styles(e).styles({path:function(t){return t.path}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=Ly(e,n),s=Math.ceil(+o/16),c=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}}));return t.animate(c,fe({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return ve(ve([n,r],ye(i),!1),[o],!1)}(this),ve(ve([i,o],ye(a),!1),[s],!1),r.update);if(e){var n=function(){var e=X(t.attributes,"__keyframe_data__");t.style.path=ob.apply(void 0,ve([],ye(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function sb(t){var e=ye(t,2),n=ye(e[0],2),r=n[0],i=n[1],o=ye(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function cb(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=ye([o,a],2),u=ye(l[0],2),f=u[0],h=u[1],d=ye(l[1],2),p=d[0],g=d[1],m=ye(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=ye([t,e,n],3),i=ye(r[0],2),o=i[0],a=i[1],s=ye(r[1],2),c=s[0],l=s[1],u=ye(r[2],2),f=u[0],h=u[1],d=ye([c-o,l-a],2),p=d[0],g=d[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=ye([-f/m,h/m],2),v=y[0],b=y[1];return[v*p,v*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),y=m[0],v=m[1],b=m[2],x=m[3],w=function(e){return t.selectAll($v.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat($v.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Cv(this,sb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Cv(this,sb(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+y,h+v],[p+b,g+x]],className:$v.line.name}]);var M=ye(s,2),E=M[0],O=M[1],k=p-f,S=g-h,A=ye([f+k*E,h+S*E],2),T=A[0],_=A[1],P=ye([f+k*O,h+S*O],2),C=P[0],N=P[1];return w([{line:[[f+y,h+v],[T,_]],className:$v.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:$v.lineSecond.name}])}function lb(t,e,n){var r,i=e.type,o=ov(e,"line");return r="linear"===i?cb(t,e,Vy(o,"arrow"),n):ab(t,e,Vy(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select($v.line.class):a?t.select($v.lineSecond.class):t.select($v.line.class),!o||!s||"arc"===n.type&&ib(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=_y(s);f.attr(r),Ky(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function ub(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function fb(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=ye(eb(i,e),2),a=o[0],s=o[1],c=ye(By(function(t,e){return Jv(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function hb(t,e,n,r){var i=ov(n,"grid"),o=i.type,a=i.areaFill,s=ub(n),c=Kv(e,n.gridFilter),l="segment"===o?fb(c,n):function(t,e){var n=e.gridControlAngles,r=ub(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=ye(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=ye(eb(t.value,e),2),s=i[0],c=i[1],l=ye([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=py(t),n=ye([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+o,c=u*i+f*r+a;h.push([s,c])})),{points:h,id:r}}))}(c,n),u=fe(fe({},i),{center:s,areaFill:m(a)?c.map((function(t,e){return yy(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll($v.grid.class).data([1]).join((function(t){return t.append((function(){return new Uv({style:u})})).attr("className",$v.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var db=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*a-l*s+u,l*a+c*s+f],[c*i-l*o+u,l*i+c*o+f],[c*a-l*o+u,l*a+c*o+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function pb(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getLocalBounds(),i=ye(r.min,2),o=i[0],a=i[1],s=ye(r.max,2),c=s[0],l=s[1],u=gb(t),f=u.width,h=u.height,d=0,p=0,g=o,m=a,y=ky(t);if(y){h-=1.5;var v=y.style.textAlign,b=y.style.textBaseline;"center"===v?g=(o+c)/2:"right"!==v&&"end"!==v||(g=c),"middle"===b?m=(a+l)/2:"bottom"===b&&(m=l)}var x=ye(Jy(e),4),w=x[0],M=void 0===w?0:w,E=x[1],O=void 0===E?0:E,k=x[2],S=void 0===k?M:k,A=x[3],T=new db((d+=o)-(void 0===A?O:A),(p+=a)-M,d+f+O,p+h+S);return t.setEulerAngles(n),T.rotatedPoints(py(n),g,m)}function gb(t){return t.__bbox__?t.__bbox__:t.getBBox()}function mb(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function yb(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function vb(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var h=[t[f],t[(f+1)%n]];if(i=l,o=void 0,a=void 0,s=void 0,c=void 0,o=yb((r=h)[0],r[1],i[0]),a=yb(r[0],r[1],i[1]),s=yb(i[0],i[1],r[0]),c=yb(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&mb(r,i[0])||0===a&&mb(r,i[1])||0===s&&mb(i,r[0])||0===c&&mb(i,r[1])){if(0===yb(h[0],e,h[1]))return mb(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function bb(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return function(t,e){var n=ye(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ye(e,4),c=s[0],l=s[1],u=o-r,f=a-i,h=s[2]-c,d=s[3]-l,p=u*d-h*f;if(0===p)return!1;var g=p>0,m=r-c,y=i-l,v=u*y-f*m;if(v<0===g)return!1;var b=h*y-d*m;return b<0!==g&&v>p!==g&&b>p!==g}(e,t)}))}function xb(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=ye(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=ye(Jy(e),4),p=d[0],g=d[1],m=d[2],y=d[3];return new db(c+f-y,l+f-p,c+h+g,l+h+m)}var v=ye(t.startPos,2),b=v[0],x=v[1],w=ye(t.endPos,2),M=w[0],E=w[1],O=ye(rb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=O[0],S=O[1],A=O[2],T=O[3],_=By(tb(0,t),i),P=new db(b,x,M,E);return P.x1+=T,P.y1+=k,P.x2+=S+_[0],P.y2+=A+_[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return vb([[r,o],[i,o],[i,a],[r,a]],pb(e,n))}(c,t)},u=function(t,e){return!t||!function(t,e,n){var r,i,o=pb(t,n).flat(1),a=pb(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var c=me(s),l=c.next();!l.done;l=c.next())if(bb(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t,e,Jy(n))};try{for(var f=me(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(a.add(s),a.add(d)):a.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function wb(t,e){return void 0===e&&(e={}),y(t)?0:"number"==typeof t?t:Math.floor(Ey(t,e))}var Mb=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(ly(t),!1)}))};var Eb=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,c,l,u=Mb,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,ve([1],ye(t.map((function(t){return gb(t).width}))),!1));if("linear"===n.type&&(nb(n)||rb(n))){var m=tv(t[0]).left,y=tv(t[i-1]).right,v=Math.abs(y-m)||1;h=Math.max(Math.floor(i*g/v),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&xb((l=c?ve(ve([c],ye(p),!1),[s],!1):ve([s],ye(p),!1),l.filter(My)),n,null==e?void 0:e.margin).length;){if(c&&!s&&h%2==0)d.splice(0,1).forEach(r.hide);else if(c&&s){d.splice(0,1).forEach(r.hide)}p=u(f(d),{seq:h}),h++}}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,c=e.margin,l=e.recoverWhenFailed,u=void 0===l||l,f=t.map((function(t){return t.getLocalEulerAngles()})),h=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var d=me(s),p=d.next();!p.done;p=d.next()){if(h(p.value),xb(t,n,c).length<1)return}}catch(t){i={error:t}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}u&&h(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,u=void 0===l?" ":l,f=e.margin,h=void 0===f?[0,0,0,0]:f,d=Oy(r.getTextShape(t[0])),p=wb(u,d),g=a?wb(a,d):p,m=wb(c,d);(y(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return gb(t).width}))));var v=t.slice();ye(h,4);for(var b=function(e){if(v.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(v=xb(t,n,h)).length<1)return{value:void 0}},x=m;x>g+p;x-=p){var w=b(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,ve([],ye(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&nb(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,p)}))};if(!(d>s)){for(var m=d;m<=s;m++)if(g(m),xb(t,n,f).length<1)return;l&&g(h)}}]]);function Ob(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}function kb(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function Sb(t,e){var n=ye(t,2),r=n[0],i=n[1],o=ye(e,2),a=o[0],s=o[1],c=ye([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function Ab(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o=tb(t.value,n),a=Qv(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Cy(e,-90,90)||(e+=180),e}(gy("perpendicular"===i?Sb([1,0],o):Sb([a[0]<0?-1:1,0],a)))}function Tb(t,e,n){var r=n.type,i=n.labelAlign,o=tb(t,n),a=kb(e),s=kb(gy(Sb([1,0],o))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===a?(c="center",l=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(Cy(a,0,90,!1,!0)||Cy(a,0,90)||Cy(a,270,360))&&(c="start"):90===s?Cy(a,0,90,!1,!0)?c="start":(Cy(a,90,180)||Cy(a,270,360))&&(c="end"):270===s?Cy(a,0,90,!1,!0)?c="end":(Cy(a,90,180)||Cy(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(Cy(a,0,90)||Cy(a,270,360))&&(c="end")):c="center":"parallel"===i?l=Cy(s,0,180,!0)?"top":"bottom":"horizontal"===i?Cy(s,90,270,!1)?c="end":(Cy(s,270,360,!1)||Cy(s,0,90))&&(c="start"):"perpendicular"===i&&(c=Cy(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function _b(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=yy(s,[t,c,e]),u=ye([tb(t.value,n),Ob(a,o)],2),f=ye(Dy(By(u[0],l+(1===u[1]?yy(r?i:0,[t,c,e]):0)),eb(t.value,n)),2);return{x:f[0],y:f[1]}}function Pb(t,e){"text"===t.nodeName&&t.attr(e)}function Cb(t){!function(t,e,n){var r=e.labelOverlap,i=void 0===r?[]:r;i.length&&i.forEach((function(r){var i=r.type,o=Eb.get(i);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,i)&&(null==o||o(t,r,e,n))}))}(this.node().childNodes,t,{hide:ly,show:cy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=Tb(e.__data__.value,t,n),i=e.querySelector($v.labelItem.class);i&&Pb(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Ay(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),Sy(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function Nb(t,e,n,r,i){var o=n.indexOf(e),a=Qy(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return _y(yy(i,[t,e,n,tb(t.value,r)]))}:function(){return _y(t.label||"")}}(e,o,n,i)).attr("className",$v.labelItem.name).node(),s=ye(sv(Xv(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=he(l,["transform"]);cv(t,u);var h=Ab(e,t,i);return t.setLocalEulerAngles(+h),Pb(a,fe(fe({},Tb(e.value,h,i)),c)),cv(t,u),t.attr(f),a}function Lb(t,e,n,r){var i=Kv(e,n.labelFilter),o=ov(n,"label");return t.selectAll($v.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",$v.label.name).transition((function(t){return Nb(this,t,e,o,n),this.attr(_b(t,e,n)),this.__bbox__=t.bbox,null})).call((function(){return Cb.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&ly(t),e.isVisible()&&cy(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+a/2),u=+a/4,f=function(t){if("circle"===t.nodeName){var e=ye(t.getLocalPosition(),2),n=e[0],r=e[1],i=t.attr("r");return[n-i,r-i]}return t.getLocalPosition()},h=ye(f(t),2),d=h[0],p=h[1],g=ye(f(e),2),m=ye([(d+g[0])/2-d,(p+g[1])/2-p],2),y=m[0],v=m[1],b=t.style.opacity,x=void 0===b?1:b,w=e.style.opacity,M=void 0===w?1:w,E=t.animate([{opacity:x,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(y,", ").concat(v,")")}],fe(fe({fill:"both"},n),{duration:c+l+u})),O=e.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-v,")"),offset:.01},{opacity:M,transform:"translate(0, 0)"}],fe(fe({fill:"both"},n),{duration:l+u,delay:c+l-u}));return Tv(O,i),[E,O]}(this.querySelector($v.labelItem.class),Nb(this,t,e,o,n),r.update),a=Cv(this,_b(t,e,n),r.update);return this.__bbox__=t.bbox,ve(ve([],ye(i),!1),[a],!1)})).call((function(e){var r,i,o=X(e,"_transitions").flat().filter(My);i=function(){return Cb.call(t,n)},0===(r=o).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this.childNodes[0],r.exit);return Tv(e,(function(){return Qy(t).remove()})),e}))})).transitions()}function jb(t,e){return Jv(t,e.tickDirection,e)}function Rb(t,e,n,r,i){var o=ye(function(t,e){var n=ye(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,yy(i.tickLength,[t,e,n])),2),a=ye(o[0],2),s=a[0],c=a[1],l=ye(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function Ib(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=jb(e.value,i),s="line";return m(o)&&(s=function(){return yy(o,[e,n,r,a])}),t.append(s).attr("className",$v.tickItem.name)}(Qy(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=jb(t.value,o),c=Rb(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=ye(sv(Xv(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(fe({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=ye(eb(t.value,r),2);return Cv(this,{x:s[0],y:s[1]},o)}var Bb=by({text:"text"},"title");function Db(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Fb(t,e){var n=Object.entries(e).reduce((function(e,n){var r=ye(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var zb=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return ue(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(Bb.text.class);if(!a)return new my(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=ye(Jy(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye([0,0,+e,+n],4),m=g[0],y=g[1],v=g[2],b=g[3],x=Db(r);if(x.includes("i"))return new my(m,y,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=ye(0===r?[l+d,+n-l-d]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=ye([+e-c-p],1),v=o[0]),"b"===t&&(a=ye([+n-l-f],1),b=a[0]),"l"===t&&(s=ye(0===r?[c+h,+e-c-h]:[0,+e],2),m=s[0],v=s[1])}));var w=ye(Jy(o),4),M=w[0],E=w[1],O=w[2],k=w[3],S=ye([k+E,M+O],2),A=S[0],T=S[1];return new my(m+k,y+M,v-A,b-T)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new my(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=he(t,["width","height","position","spacing"]),i=ye(sv(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=ye([+a/2,+s/2],2),u=ye([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=Db(c);return g.includes("l")&&(f=(e=ye([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=ye([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=ye([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=ye([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;Py(!!r.text,Qy(e),(function(t){n.title=t.maybeAppendByClassName(Bb.text,"text").styles(i).call(Fb,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(uv);function Gb(t,e,n,r,i){var o=ye(sv(ov(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=he(s,["transform"]);t.styles(a),e.styles(l);var u=c||function(t,e,n){var r=t.cloneNode(!0);r.style.transform="scale(1, 1)",r.style.transform="none";var i=r.getBBox().height;if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(i/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(i/2,")")}return""}(t.node(),a.direction,a.position);cv(t.node(),u);var f=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=Db(i),s=t.node().getLocalBounds(),c=ye(s.min,2),l=c[0],u=c[1],f=ye(s.halfExtents,2),h=f[0],d=f[1],p=ye(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],y=ye([l+h,u+d],2),v=y[0],b=y[1],x=ye(Jy(o),4),w=x[0],M=x[1],E=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var k=n.startPos,S=n.endPos,A=ye("start"===i?[k,S]:[S,k],2),T=A[0],_=A[1],P=ye(By($y([-_[0]+T[0],-_[1]+T[1]]),w),2),C=P[0],N=P[1];return{x:T[0]+C,y:T[1]+N}}return a.includes("t")&&(b-=d+m+w),a.includes("r")&&(v+=h+g+M),a.includes("l")&&(v-=h+2*g+O),a.includes("b")&&(b+=d+2*m+E),{x:v,y:b}}(Qy(n._offscreen||n.querySelector($v.mainGroup.class)),e,r),h=f.x,d=f.y,p=Cv(e.node(),{x:h,y:d},i);return cv(t.node(),u),p}function Wb(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Py(i,e.maybeAppendByClassName($v.lineGroup,"g"),(function(e){return lb(e,t,r)}))||[],c=Py(o,e.maybeAppendByClassName($v.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Kv(e,n.tickFilter),o=ov(n,"tick");return t.selectAll($v.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",$v.tick.name).transition((function(t,e){return Ib.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Ib.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this.childNodes[0],r.exit);return Tv(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=Py(a,e.maybeAppendByClassName($v.labelGroup,"g"),(function(e){return Lb(e,n,t,r)}))||[];return ve(ve(ve([],ye(s),!1),ye(c),!1),ye(l),!1).filter((function(t){return!!t}))}var $b=function(t){function e(e){return t.call(this,e,Wv)||this}return ue(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(o,l).filter((function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])})),h=Av(void 0===n?a:n),d=Py(c,Qy(e).maybeAppendByClassName($v.gridGroup,"g"),(function(e){return hb(e,f,t,h)}))||[],p=Qy(e).maybeAppendByClassName($v.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Wb(t,Qy(this.offscreenGroup),f,Av(!1));var g=Wb(t,Qy(p.node()),f,h),m=Py(s,Qy(e).maybeAppendByClassName($v.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll($v.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(o){return o.append((function(){return _y(i)})).attr("className",$v.title.name).transition((function(){return Gb(Qy(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return Gb(Qy(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return ve(ve(ve([],ye(d),!1),ye(g),!1),ye(m),!1).flat().filter((function(t){return!!t}))},e}(uv),Hb=by({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Vb=function(t){function e(e){var n=t.call(this,e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:mv(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new up({class:Hb.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new up({class:Hb.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return ue(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return T(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=ye(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,ve([],ye(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new my(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=ye(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=Pv(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return Tv(f,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:T(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:T(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(Hb.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?cy(e):ly(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox().width,c=ye("horizontal"===o?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,m=p.height,y=Math.max(h,s,g),v="horizontal"===o?{offset:[[0,0],[h/2+a,0],[h+s+2*a,0]],textAlign:"start"}:{offset:[[y/2,-d-a],[y/2,0],[y/2,m+a]],textAlign:"center"},b=ye(v.offset,3),x=ye(b[0],2),w=x[0],M=x[1],E=ye(b[1],2),O=E[0],k=E[1],S=ye(b[2],2),A=S[0],T=S[1],_=v.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=_),e.setLocalPosition(w,M),r.setLocalPosition(O,k),n.setLocalPosition(A,T)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(Hb.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=ye(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=this.pageViews.length>=2,s=t.maybeAppendByClassName(Hb.controller,"g");if(uy(s.node(),a),a){var c=ov(this.attributes,"button"),l=ov(this.attributes,"pageNum"),u=ye(sv(c),2),f=u[0],h=u[1],d=f.size,p=he(f,["size"]),g=!s.select(Hb.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Hb.prevBtnGroup,"g").styles(h);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(Hb.prevBtn,"path"),v=s.maybeAppendByClassName(Hb.nextBtnGroup,"g").styles(h);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(Hb.nextBtn,"path")].forEach((function(t){t.styles(fe(fe({},p),{transformOrigin:"center"})),Ky(t.node(),d,!0)}));var b=s.maybeAppendByClassName(Hb.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Hb.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=Qy(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=W((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Ad.INSERTED,e),this.playWindow.addEventListener(Ad.REMOVED,e)},e}(uv);function Yb(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}vv.registerSymbol("hiddenHandle",(function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]})),vv.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]})),vv.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]}));var qb=by({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Ub=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new sp({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return ue(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,o=r.height,a=e.node().getBBox(),s=a.width,c=a.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,o,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=ye(Jy(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,u=ye(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=ye(this.span,2);c=(t=ye([p[0]*d,p[1]*d],2))[0],l=t[1]}return{width:o+c+l+f+h,height:a,markerWidth:o,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=ye(Jy(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,o=t.height,a=ye(this.spacing,2),s=a[0];return{height:o,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(qb.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||a||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=ov(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(qb.markerGroup,"g").style("zIndex",0),Py(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(qb.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(!function(t,e){var n,r,i=e.attributes;try{for(var o=me(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=ye(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(i,o),Qy(i).styles(r)):(i.remove(),Qy(o).attr("className",qb.marker.name).styles(r),t.appendChild(o)):(Qy(o).attr("className",qb.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),Ky(e.markerGroup.node(),e.scaleSize,!0)}))},e.prototype.renderLabel=function(t){var e=ov(this.attributes,"label"),n=e.text,r=he(e,["text"]);this.labelGroup=t.maybeAppendByClassName(qb.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(qb.label,(function(){return _y(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=ov(this.attributes,"value"),r=n.text,i=he(n,["text"]);this.valueGroup=t.maybeAppendByClassName(qb.valueGroup,"g").style("zIndex",0),Py(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(qb.value,(function(){return _y(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=ov(this.attributes,"background");this.background=t.maybeAppendByClassName(qb.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(qb.background,"rect").styles(fe({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=ye(t.position,3),o=i[0],a=i[1],s=i[2],c=r/2;this.markerGroup.styles({x:o,y:c}),this.labelGroup.styles({x:a,y:c}),Ay(this.labelGroup.select(qb.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:s,y:c}),Ay(this.valueGroup.select(qb.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Qy(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(uv),Xb=by({page:"item-page",navigator:"navigator",item:"item"},"items"),Kb=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Zb=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:Q,mouseenter:Q,mouseleave:Q})||this;return n.navigatorShape=[0,0],n}return ue(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=ov(this.attributes,"item"),i=e.map((function(t,i){var o=t.id,a=void 0===o?i:o,s=t.label,c=t.value;return{id:"".concat(a),index:i,style:fe({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=ye(n,2);return[r[0],yy(r[1],[t,i,e])]}))))}}));return i},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=ye(this.navigatorShape,1)[0],s=ye(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map((function(e,s){var h,d,p=Math.floor(s/u),g=s%u,m=t.ifHorizontal(l,c),y=[Math.floor(g/m),g%m];"vertical"===n&&y.reverse();var v=ye(y,2),b=v[0],x=v[1],w=(r-a-(l-1)*o)/l,M=e.getBBox().height,E=ye([0,0],2),O=E[0],k=E[1];return"horizontal"===n?(O=(h=ye([f,b*(M+i)],2))[0],k=h[1],f=x===l-1?0:f+w+o):(O=(d=ye([x*(w+o),f],2))[0],k=d[1],f=b===c-1?0:f+M+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:M,x:O,y:k}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=ye(this.navigatorShape,1)[0],a=ye(this.grid,2),s=a[0],c=a[1],l=ye([e-o,n],2),u=l[0],f=l[1],h=ye([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],m=h[3],y=h[4],v=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,M=h.height,E=0===b?0:i,O=b+E+w;return O<=u&&Kb(y,(function(t){return t<c}))?(n=ye([b+E,x,O],3),d=n[0],p=n[1],b=n[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(o=ye([v+1,0,0,x+M+r],4),v=o[0],y=o[1],b=o[2],(x=o[3])+M<=f&&Kb(v,(function(t){return t<s}))?(a=ye([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(l=ye([0,0,w,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],m=l[5],v=l[6],y=l[7],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Yb(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Xb.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Xb.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);Qy(t).selectAll(Xb.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Ub({style:e})})).attr("className",Xb.item.name).on("click",(function(){null==n||n(this),o("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),o("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),o("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=ye(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=ye(t,2);return{page:e[0],layouts:e[1]}})),i=ve([],ye(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new up({className:Xb.page.name}));e.forEach((function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,c=i[o];r.appendChild(c),function(t,e,n){var r=t,i=A(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=_(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(c,"__layout__",t),c.update({x:e,y:n,width:a,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=ov(this.attributes,"nav"),r=wy({orientation:e},n),i=this;return t.selectAll(Xb.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Vb({style:r})})).attr("className",Xb.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(Qy(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Md(t,{detail:e});this.dispatchEvent(n)},e}(uv),Qb=by({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Jb={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},tx=function(t){function e(e){return t.call(this,e,Jb)||this}return ue(e,t),e.prototype.render=function(t,e){var n=Qy(e).maybeAppendByClassName(Qb.markerGroup,"g");this.renderMarker(n);var r=Qy(e).maybeAppendByClassName(Qb.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?Yb(r,"horizontalHandle","verticalHandle"):i;Py(!!o,t,(function(t){var n=ov(e.attributes,"marker"),r=fe({symbol:o},n);e.marker=t.maybeAppendByClassName(Qb.marker,(function(){return new vv({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;Py(r,t,(function(t){var n,r=ov(e.attributes,"label"),o=r.text,c=he(r,["text"]),l=(null===(n=t.select(Qb.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=ye(Yb(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],m=d[2],y=d[3];t.maybeAppendByClassName(Qb.label,"text").styles(fe(fe({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(uv),ex={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},nx=wy({},ex,{}),rx=wy({},ex,av(Jb,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),ix=by({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),ox=function(t){function e(e){return t.call(this,e,nx)||this}return ue(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=ye(sv(ov(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(ix.titleGroup,"g").styles(c);var l=fe(fe({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(ix.title,(function(){return new zb({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=ye(sv(ov(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=fe(fe({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(ix.itemsGroup,"g").styles(fe({x:n,y:r},c));var u=this;this.itemsGroup.selectAll(ix.items.class).data(["items"]).join((function(t){return t.append((function(){return new Zb({style:l})})).attr("className",ix.items.name).each((function(){u.items=Qy(this)}))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().setLocalPosition(e,n)}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new my(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),c=e.getBBox(),l=Db(r),u=ye(Jy(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye(Jy(o),4),m=g[0],y=g[1],v=g[2],b=g[3],x=ye([p+h,f+d],2),w=x[0],M=x[1],E=ye([b+y,m+v],2),O=E[0],k=E[1];if("l"===l[0])return new my(s.x,s.y,c.width+s.width+w+O,Math.max(c.height+k,s.height));if("t"===l[0])return new my(s.x,s.y,Math.max(c.width+O,s.width),c.height+s.height+M+k);var S=ye([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],T=S[1];return new my(c.x,c.y,A+s.width+w+O,T+s.height+M+k)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=t.width,r=t.height,i=Qy(e);this.renderTitle(i,n,r),this.renderItems(i,this.availableSpace),this.adjustLayout()},e}(uv),ax={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},sx=by({background:"background",labelGroup:"label-group",label:"label"},"indicator"),cx=function(t){function e(e){var n=t.call(this,e,ax)||this;return n.point=[0,0],n.group=n.appendChild(new up({})),n.isMutationObserved=!0,n}return ue(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=ye(Jy(t.padding),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new my(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=ov(this.attributes,"background");this.background=Qy(this.group).maybeAppendByClassName(sx.background,"path").styles(fe(fe({},h),{path:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=ye(sv(ov(this.attributes,"label")),2),i=r[0],o=r[1],a=he(i,["text"]);(this.label=Qy(this.group).maybeAppendByClassName(sx.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(sx.label,(function(){return _y(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=ye(this.point,2),e=t[0],n=t[1];this.group.attr("x",-e).attr("y",-n)},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,o=e.width,a=e.height,s=[["M",r+n,i],["L",r+o-n,i],["A",n,n,0,0,1,r+o,i+n],["L",r+o,i+a-n],["A",n,n,0,0,1,r+o-n,i+a],["L",r+n,i+a],["A",n,n,0,0,1,r,i+a-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,ve([c+1,1],ye(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=ev.apply(void 0,ve([],ye(t),!1)),r=ye(t,2),i=ye(r[0],2),o=i[0],a=i[1],s=ye(r[1],2),c=s[0],l=s[1],u=ye(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=ye(u[1],2),d=h[0],p=h[1],g=f/2,m=e*(f/Math.abs(f)),y=m/2,v=m*Math.sqrt(3)/2*.8,b=ye([d,d+g-y,d+g,d+g+y,p],5),x=b[0],w=b[1],M=b[2],E=b[3],O=b[4];return n?(this.point=[M,a-v],[["L",x,a],["L",w,a],["L",M,a-v],["L",E,a],["L",O,a]]):(this.point=[o+v,M],[["L",o,x],["L",o,w],["L",o+v,M],["L",o,E],["L",o,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?ly(this):cy(this)},e.prototype.bindEvents=function(){this.label.on(Ad.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(uv);function lx(t,e){var n=ye(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var ux=by({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function fx(t){var e=t.orientation,n=t.size,r=t.length;return Yb(e,[r,n],[n,r])}function hx(t){var e=t.type,n=ye(fx(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function dx(t){return hx(t)}function px(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(m(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var a=e.length,s=e.map((function(t){return uf(t).toString()}));return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)}),"l(".concat(Yb(n,"0","270"),")")):""}function gx(t){var e=t.orientation,n=t.range;if(!n)return[];var r=ye(fx(t),2),i=r[0],o=r[1],a=ye(n,2),s=a[0],c=a[1],l=Yb(e,s*i,0),u=Yb(e,0,s*o),f=Yb(e,c*i,i),h=Yb(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var mx=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return ue(e,t),e.prototype.render=function(t,e){!function(t,e){var n=ov(e,"track");t.maybeAppendByClassName(ux.track,"path").styles(fe({path:hx(e)},n))}(Qy(e).maybeAppendByClassName(ux.trackGroup,"g"),t),function(t,e){var n=ov(e,"selection"),r=px(e),i=t.maybeAppendByClassName(ux.selection,"path").styles(fe({path:dx(e),fill:r},n)),o=i.maybeAppendByClassName(ux.clipPath,"path").styles({path:gx(e)}).node();i.style("clip-path",o)}(Qy(e).maybeAppendByClassName(ux.selectionGroup,"g"),t)},e}(uv);var yx=function(t){function e(e){var n=t.call(this,e,rx)||this;return n.eventToOffsetScale=new Zo({}),n.innerRibbonScale=new Zo({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=lx(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=ye(n.selection,2),i=r[0],o=r[1],a=n.getTickValue(n.getValueByCanvasPoint(t)),s=a-n.prevValue;"start"===e?i!==a&&n.updateSelection(a,o):"end"===e?o!==a&&n.updateSelection(i,a):"ribbon"===e&&0!==s&&(n.prevValue=a,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="default",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return ue(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new my(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Qy(e));var i=this.availableSpace,o=i.x,a=i.y,s=Qy(e).maybeAppendByClassName(ix.contentGroup,"g").styles({x:o,y:a});Py(!!r,s.maybeAppendByClassName(ix.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(ix.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(ix.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,ve([],ye(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,ve([],ye(t.map((function(t){return t.value}))),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=ye(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=ye(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Yb(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=ov(this.attributes,"title"),s=fe(fe({},a),{width:i,height:o,text:r}),c=this;t.selectAll(ix.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new zb({style:s})})).attr("className",ix.title.name).each((function(){c.title=this}))}),(function(t){return t.update(s)}),(function(t){return t.each((function(){c.title=void 0})).remove()}))},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new my(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new my(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector($v.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new my(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=ye(this.ifHorizontal([o,i],[i,o]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,m=0,y=this.labelPosition;m=n||(["bottom","right"].includes(y)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var v=Math.max(p,c),b=f-v,x=ye(this.ifHorizontal([b,m],[m,b]),2),w=x[0],M=x[1],E=["top","left"].includes(y)?s:0,O=ye(this.ifHorizontal([v/2,E],[E,v/2]),2),k=O[0],S=O[1];return new my(k,S,w,M)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=ov(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,g=p.length,m=p.size,y=wy({x:h,y:d,length:g,size:m,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(ix.ribbon,(function(){return new mx({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(ix.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=ov(this.attributes,"handle"),i=ye(this.selection,2),o=i[0],a=i[1],s=fe(fe({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?tx:Fv,u=this;this.handlesGroup.selectAll(ix.handle.class).data(e?[{value:o,type:"start"},{value:a,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new l({style:s})})).attr("className",(function(t){var e=t.type;return"".concat(ix.handle," ").concat(u.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))}))}),(function(t){return t.update(s).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=ye(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},e.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,n=t.orientation,r=ye(this.getElementsByClassName(ix.title.name),1)[0],i=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(r&&i&&"top-left"===e&&"horizontal"===n){var o=ye(i.getLocalBounds().min,1)[0]-ye(r.getLocalBounds().min,1)[0];r.style.x=+(this.style.x||0)+o}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new my(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=ye([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new my(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=ye(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),c=ye(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({x:l,y:u,formatter:n})},e.prototype.renderIndicator=function(t){var e=ov(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(ix.indicator,(function(){return new cx({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,i){var o,a,s=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:r.toString();if(e.push(fe(fe({},n),{id:s,index:r,type:"value",label:null!==(a=null==n?void 0:n.label)&&void 0!==a?a:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var c=i[r+1],l=ye([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(fe(fe({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(h)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=ye(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,o=e.labelFormatter,a=ov(this.attributes,"tick"),s=ov(this.attributes,"label"),c=s.align,l=wy(fe({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),av(a,"tick"),av(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter((function(t){return"value"!==t.type}))))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===c&&(!i||i(t,t.index,n.filter((function(t){return t.type===c}))))},labelFormatter:o},f=fe(fe(fe({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(ix.label,(function(){return new $b({style:f})})).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,o=this.ribbonShape.size,a=this.labelPosition,s=this.labelFixedSpacing,c=ye([0,0,0],3),l=c[0],u=c[2],f=null!=i?i:o;return e?(u=f,"positive"===n?"right"===a?(l=f,u=f):"bottom"===a&&(l=u):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:u}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=ye(this.ifHorizontal([[e,n+a],[e+r,n+a]],[[e+a,n+i],[e+a,n]]),2),u=l[0],f=l[1];this.label.update({startPos:u,endPos:f,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,o=this.ribbonBBox,a=o.x,s=o.y,c=T(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+a,s],[a,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),cy(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){ly(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=ye(this.selection,2),o=i[0],a=i[1],s=ye([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=ye(function(t,e,n,r){var i,o=ye(t,2),a=o[0],s=o[1],c=ye(e,2),l=c[0],u=c[1],f=ye(n,2),h=f[0],d=f[1],p=ye([l,u],2),g=p[0],m=p[1],y=m-g;return g>m&&(g=(i=ye([m,g],2))[0],m=i[1]),y>s-a?[a,s]:g<a?h===a&&d===m?[a,m]:[a,y+a]:m>s?d===s&&h===g?[g,s]:[s-y,s]:[g,m]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return F(e)?Hy(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?lx(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,i=n.max,o=ye(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,ve([],ye(Ty(t)),!1))-c;return T(this.getOffset(l,!0),r,i)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.dispatchSelection=function(){var t=new Md("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new Md("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(uv);function vx(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var bx={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function xx(t){var e;void 0===t&&(t="");var n=vx(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=fe({flex:1},bx),e[".".concat(n.VALUE)]=fe({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},bx),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var wx=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=vx(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:xx(o)})||this).prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}var n,r;return ue(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"position",{set:function(t){var e=ye(t,2),n=e[0],r=e[1];this.attributes.x=n,this.attributes.y=r,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=he(t,["name","color","index"]),l=fe({name:i,color:a,index:null!=s?s:e},c);return nn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=this.element.style.transition;this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout((function(){n.element.style.transition=r}),10)}this.element.style.visibility="visible"},e.prototype.hide=function(){this.element.style.visibility="hidden"},e.prototype.initShape=function(){var t=this.attributes.template;this.element=nn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=vx(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,f.replaceChildren.apply(f,ve([],ye(u),!1));var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=ye(e,2),r=n[0],i=n[1];ve([t],ye(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,c=a.height,l=[-s/2,-c/2];return i.forEach((function(t){var e=ye(l,2),n=e[0],i=e[1],a=ye(o[t],2),u=a[0],f=a[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]})),l},e.prototype.setOffsetPosition=function(t){var e=ye(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+a+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},e.prototype.autoPosition=function(t){var e=ye(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,u=l.offsetWidth,f=l.offsetHeight,h=ye([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},m=s.x,y=s.y,v={left:d<m,right:d+u>m+s.width,top:p<y,bottom:p+f>y+s.height},b=[];c.split("-").forEach((function(t){v[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.tag="tooltip",de([(n=100,r=!0,void 0===n&&(n=0),void 0===r&&(r=!1),function(t,e,i){var o,a=i.value;"function"==typeof a&&(i.value=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!o){var i=this;r&&a.apply(i,t),o=window.setTimeout((function(){a.apply(i,t),o=null}),n)}})})],e.prototype,"updatePosition",null),e}(uv),Mx=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[Ad.BOUNDS_CHANGED,Ad.INSERTED,Ad.REMOVED],n.$margin=Jy(0),n.$padding=Jy(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return ue(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Jy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Jy(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=ye(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new my(n-f,i-c,o+f+l,a+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=ye(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=ye(this.$margin,4),l=c[0],u=c[3];return new my(s+u,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=function(t,e,n){if(0===e.length)return[];var r={flex:Ry,grid:Iy},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(e,n){var r=t[n],i=r.x,o=r.y;e.attr({x:i,y:o})}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target.isMutationObserved=!0,t.layout()}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(up);function Ex(t,e,n,r){const[[i,o],[a,s]]=e,[c,l]=function(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}(t);if(i===a&&o===s)return tc()([[0,0],[c,l]]);const u=[[i-a,o-s]].concat(n.length?n:[[0,0]]),f=[r[0]-a,r[1]-s],[h,d]=u;if(((t,e,n)=>{const r=as(t,e),i=as(e,n),o=as(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(f,h,d)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=h[0]+(h[1]-f[1])*(h[1]-0)/(h[0]-f[0]);return n[0]<f[0]?Math.min(n[0],r):Math.max(e[0],r)})();u.splice(1,1,[e,0])}return tc()(u)}const Ox=nm((t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:o,labelTransform:a,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:h,background:d,connector:p,startMarker:g,endMarker:m,coordCenter:y,innerHTML:v}=e,b=he(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if([c,l,u,f].some((t=>!_(t))))return void t.children.forEach((t=>t.remove()));const x=ur(b,"background"),{padding:w}=x,M=he(x,["padding"]),E=ur(b,"connector"),{points:O=[]}=E,k=he(E,["points"]),S=[[+u,+f],[+c,+l]];let A;A=v?Dg(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(Gg,Object.assign({transform:a,transformOrigin:s},b)).node():Dg(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(Gg,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const T=Dg(t).maybeAppend("background","rect").style("zIndex",-1).call(Gg,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[h,d]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*h+o+r,height:2*d+n+i}}(A,w)).call(Gg,d?M:{}).node(),P=Ex(T,S,O,y),C=g&&new vv({id:"startMarker",style:Object.assign({x:0,y:0},ur(b,"startMarker"))}),N=m&&new vv({id:"endMarker",style:Object.assign({x:0,y:0},ur(b,"endMarker"))});Dg(t).maybeAppend("connector","path").style("zIndex",0).style("path",P).style("markerStart",C).style("markerEnd",N).call(Gg,p?k:{})})),kx=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s},[[f,h]]=e;return Dg(new Ox).style("x",f).style("y",h).call(Gg,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Gg,u).call(Gg,t).node()}};kx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sx=nm((t=>{const e=he(t.attributes,["class","x","y"]),n=ur(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),o=Dg(t).maybeAppend("marker",(()=>new vv({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[a,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(o);Dg(t).maybeAppend("text","text").style("x",a).style("y",s).call(Gg,e)})),Ax=(t,e)=>{const n=he(t,[]);return(t,e,r)=>{const{color:i}=r,o=he(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return Dg(new Sx).call(Gg,o).style("x",l).style("y",u).call(Gg,c).call(Gg,n).node()}};Ax.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Tx=nm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;Dg(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Gg,i),Dg(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Gg,r)})),_x=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=he(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,g=qg(s,e),m=r&&h?$g(h,d,p,r):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:m,fill:m}),g&&{transform:g}),a),[v,b]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),x=ur(y,"connect"),w=!!b.length,M=t=>Dg(c.createElement("path",{})).style("d",t||"").call(Gg,y).node();if(Mc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=ec().curve(nc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return oc(n())},delete t.lineX0,t.lineEndAngle=function(){return oc(r())},delete t.lineX1,t.lineInnerRadius=function(){return oc(i())},delete t.lineY0,t.lineOuterRadius=function(){return oc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(ic(t)):e()._curve},t}().angle(((t,n)=>cs(is(r[n],e)))).outerRadius(((t,n)=>as(r[n],e))).innerRadius(((t,n)=>as(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!w||o&&!Object.keys(x).length?M(e(v)):w&&!o?M(e(t)):Dg(new Tx).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},x),a)).style("areaPath",e(t)).style("connectPath",b.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return wc(s)?ec().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):ec().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!w||o&&!Object.keys(x).length?M(e(v)):w&&!o?M(e(t)):Dg(new Tx).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},x),a)).style("areaPath",e(t)).style("connectPath",b.map(e).join("")).node()}}};_x.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Px=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Mc(n)?mc:Zs;return _x(Object.assign({curve:i},t),e)(...r)}};Px.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"square"});const Cx=(t,e)=>{const{alpha:n=.5}=t,r=he(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=Mc(i)?pc:hc;return _x(Object.assign({curve:o.alpha(n)},r),e)(...t)}};Cx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"smooth"});const Nx=(t,e)=>(...n)=>_x(Object.assign({curve:vc},t),e)(...n);Nx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"hvh"});const Lx=(t,e)=>(...n)=>_x(Object.assign({curve:bc},t),e)(...n);Lx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"vh"});const jx=(t,e)=>(...n)=>_x(Object.assign({curve:xc},t),e)(...n);jx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"hv"});const Rx=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>ay(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Rx.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ix=(t,e)=>{const n=he(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=he(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=zs();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),Dg(r.createElement("path",{})).call(Gg,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Gg,n).node()}};function Bx(t,e,n,r){const i=zs();if(Mc(n)){const o=n.getCenter(),a=as(t,o),s=(as(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Wg(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return wc(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}Ix.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dx=(t,e)=>{const{cornerRatio:n=1/3}=t,r=he(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=he(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=Bx(f,h,i,n);return Dg(o.createElement("path",{})).call(Gg,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Gg,r).node()}};Dx.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fx=(t,e)=>{const n=he(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=zs();if(h.moveTo(u[0],u[1]),Mc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Wg(h,u,f,fs(u,f),as(u,f)/2)}return Dg(i.createElement("path",{})).call(Gg,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(Gg,n).node()}};function zx(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function Gx(t={}){return[...zx(t),{name:"title",scale:"identity"}]}function Wx(){return[{type:Lr,channel:"color"},{type:$r,channel:["x","y"]}]}function $x(){return[{type:Lr,channel:"x"},{type:$r,channel:["y"]}]}function Hx(t={}){return zx(t)}function Vx(){return[{type:Br}]}function Yx(t,e){return t.getBandWidth(t.invert(e))}function qx(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,h=!!(null==a?void 0:a.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?Yx(a,r[e]):0,l=d?Yx(s,i[e]):0,g=p&&o?(Yx(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function Ux(t){return parseFloat(t)/100}function Xx(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?Ux(e)*a:+e,"string"==typeof n?Ux(n)*s:+n]]}))]}Fx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Kx=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,g]]=e,[m,y]=n.getSize();h="string"==typeof h?Ux(h)*m:h,d="string"==typeof d?Ux(d)*y:d;const v=p-Number(h)/2,b=g-Number(d)/2;return Dg(r.createElement("image",{})).call(Gg,s).style("x",v).style("y",b).style("img",l).style("stroke",c).style("transform",f).call(Gg,t).style("width",h).style("height",d).node()}};function Zx(t,e){const n=zs();if(Mc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>as(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?Wg(n,s,e,r,a):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}Kx.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Qx=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=i,u=Zx(e,n);return Dg(r.createElement("path",{})).call(Gg,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Gg,t).node()}};function Jx(t,e){const[n,r,i,o]=t,a=zs();if(Mc(e)){const t=e.getCenter(),s=as(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Wg(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Wg(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}Qx.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tw=(t,e)=>{const n=he(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=e,u=Jx(t,r);return Dg(i.createElement("path",{})).call(Gg,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Gg,n).node()}};function ew(t,e){const n=zs();if(Mc(e)){const r=e.getCenter(),[i,o]=r,a=ss(is(t[0],r)),s=ss(is(t[1],r)),c=as(r,t[2]),l=as(r,t[3]),u=as(r,t[8]),f=as(r,t[10]),h=as(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,h,a,s),n.arc(i,o,h,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}tw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=he(o,["color","fill","stroke"]),h=ew(e,n);return Dg(r.createElement("path",{})).call(Gg,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Gg,t).node()}};function rw(t,e,n=4){const r=zs();if(!Mc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=as(i,t[3]),c=as(i,t[8]),l=as(i,t[10]),u=ss(is(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.arc(o,a,s,h,d),r.lineTo(Math.cos(d)*l+o,Math.sin(d)*l+a),r.arc(o,a,l,d,h,!0),r.lineTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/2;return r.moveTo(Math.cos(p)*(c+n/2)+o,Math.sin(p)*(c+n/2)+a),r.arc(Math.cos(p)*c+o,Math.sin(p)*c+a,n/2,p,2*Math.PI+p),r.closePath(),r}nw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=he(o,["color","fill","stroke"]),h=rw(e,n,4);return Dg(r.createElement("path",{})).call(Gg,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Gg,t).node()}};iw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ow=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=he(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=he(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({path:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},n)})}(a,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},ur(i,"arrow"))):null,p=function(t,e){if(!Mc(e))return tc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return Us()({startAngle:0,endAngle:2*Math.PI,outerRadius:as(t[0],n),innerRadius:as(t[1],n)})}(t,o),g=function(t,e){if(!Mc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return Dg(a.createElement("path",{})).call(Gg,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(Gg,i).node()}};function aw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}ow.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sw=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=he(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=he(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(wc(t)){const t=o+n,e=t+i;return[[t,a],[e,a],[e,c],[s+r,c]]}const l=a-n,u=l-i;return[[o,l],[o,u],[s,u],[s,c-r]]}(c,t,r,i,null!=o?o:u),g=ur(Object.assign(Object.assign({},s),n),"endMarker");return Dg(new pp).call(Gg,f).style("path",function(t){return tc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new vv({className:"marker",style:Object.assign(Object.assign({},g),{symbol:aw})}):null).call(Gg,s).node()}};function cw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function lw(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=dr(n.x,l),s=dr(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function uw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Vg(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=hw(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?fw(c,p,i):fs(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function fw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function hw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function dw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Vg(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:hw(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=fw(d,p,v);return Object.assign({x:b,y:x},g)}function pw(t){return void 0===t?null:t}function gw(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:pw(o[0]),y:pw(o[1])}}function mw(t,e,n,r){const{bounds:i}=n;if(1===i.length)return gw(0,0,n);return(Ec(r)?uw:Ac(r)?dw:lw)(t,e,n,r)}function yw(t,e,n){const r=Vg(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function vw(t,e,n){const r=Vg(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function bw(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:c=a,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),h=vw(e,n,r),d=Math.sin(h)>0?1:-1,p=hw(h,i,o),g={textAlign:d>0||Ec(r)?"start":"end",textBaseline:"middle",rotate:p},m=yw(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,E]]=function(t,e,n,r,i){const[o,a]=fw(t,e,n),[s,c]=fw(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,m,y,s?l:0),O=s?+u*d:0,k=M+O,S={connector:s,connectorPoints:[[x-k,w-E],[M-k,E-E]]};return Object.assign(Object.assign({x0:v,y0:b,x:M+O,y:E},g),S)}sw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var xw=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=Un(o,((t,e)=>Math.abs(t[1]-a[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=ss(is(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:mw,bottomLeft:mw,bottomRight:mw,inside:mw,left:mw,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?gw(0,0,n):(Ec(r)?uw:Ac(r)?bw:lw)(t,e,n,r)},right:mw,spider:function(t,e,n,r){if(!Ac(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(bw(0,e,n,r),[]),c=r.getCenter(),l=yw(e,n,r),u=vw(e,n,r),f=l+i+o,h=Math.sin(u)>0?1:-1,d=c[0]+(f+ +a)*h,{x:p}=s,g=d-p;return s.x+=g,s.connectorPoints[0][0]-=g,s},surround:function(t,e,n,r){if(!Ac(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(bw(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(Ac(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=cs([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,m]=fw(u,d,h);return s.x=g+(o+a)*p,s.y=m,s},top:mw,topLeft:mw,topRight:mw});function ww(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:Ac(e)?"inside":wc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=xw[cw(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const Mw=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o)=>{const{text:a,x:s,y:c,transform:l="",transformOrigin:u,className:f=""}=o,h=he(o,["text","x","y","transform","transformOrigin","className"]),d=ww(e,o,n,r,t),{rotate:p=0,transform:g=""}=d,m=he(d,["rotate","transform"]);return Dg(new Ox).call(Gg,m).style("text",`${a}`).style("className",`${f} g2-label`).style("innerHTML",i?i(a,o.datum,o.index):void 0).style("labelTransform",`${g} rotate(${+p}) ${l}`.trim()).style("labelTransformOrigin",u).style("coordCenter",n.getCenter()).call(Gg,h).node()}};Mw.props={defaultMarker:"point"};const Ew=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=he(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=he(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return Dg(a.createElement("path",{})).call(Gg,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(Gg,i).node()}};Ew.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ow=(t,e)=>Ew(Object.assign({colorAttribute:"fill"},t),e);Ow.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kw=(t,e)=>Ew(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);kw.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sw=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=he(i,["color"]),{color:c=a}=r,[l,...u]=e,f=zs();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),Dg(n.createElement("path",{})).call(Gg,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Gg,t).node()}};function Aw(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}Sw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$(3);const Tw=function(t,e=((...t)=>`${t[0]}`),n=16){const r=$(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=Aw(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function _w(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=Aw(a,t,e).getContext("2d"),l=function(t,e){const n=Aw(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);c.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),h=i-u,d=c-u,p=Tw(u,1-a,o),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,h,d)}}(c,n,r,i,s,a);const u=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),h=f.data,d=h.length;for(let t=3;t<d;t+=4){const e=h[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));h[t-3]=r[n],h[t-2]=r[n+1],h[t-1]=r[n+2],h[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=Aw(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const Pw=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=he(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,g]=l.getSize(),m=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),y=Xn(t,(t=>t[2])),v=qn(t,(t=>t[2])),b=p&&g?_w(p,g,y,v,m,(x={gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},w=t=>void 0===t,Object.keys(x).reduce(((t,e)=>{const n=x[e];return w(n,e)||(t[e]=n),t}),{})),u):{canvas:null};var x,w;return Dg(f.createElement("image",{})).call(Gg,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(Gg,c).node()}};Pw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Cw=(t,e)=>{const{render:n}=t,r=he(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};function Nw(t,e){return t.getBandWidth(t.invert(e))}Cw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Lw={rect:Kg,hollow:Zg,funnel:Jg,pyramid:em},jw=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),h=c?c.map((t=>+t/f)):null,d=c?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=Nw(l,i[t]),n=e*(u?Nw(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),g=+o[t],m=+a[t];return[[h,g],[p,g],[p,m],[h,m]].map((t=>r.map(t)))}));return[t,p]};jw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Lw,channels:[...Gx({shapes:Object.keys(Lw)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Vx(),{type:hn},{type:jr}],postInference:[...$x()],interaction:{shareTooltip:!0}};const Rw={rect:Kg,hollow:Zg},Iw=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};Iw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Rw,channels:[...Gx({shapes:Object.keys(Rw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx(),{type:hn}],postInference:[...$x()],interaction:{shareTooltip:!0}};const Bw={line:om,smooth:am,hv:sm,vh:cm,hvh:lm,trail:fm},Dw=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=a?Array.from(Pn(t,(t=>a[t])).values()):[t],h=f.map((t=>t[0])).filter((t=>void 0!==t)),d=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(o=null==u?void 0:u.getBandWidth)||void 0===o?void 0:o.call(u))||0)/2,g=Array.from(f,(t=>t.map((t=>r.map([+s[t]+d,+c[t]+p])))));return[h,g,f]},Fw=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o}))]},zw=()=>(t,e,n,r)=>(kc(r)?Fw:Dw)(t,e,n,r);zw.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:Bw,channels:[...Gx({shapes:Object.keys(Bw)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Vx(),{type:Ur},{type:Dr}],postInference:[...$x(),{type:Lr,channel:"color"},{type:$r,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Gw={hollow:Hm,hollowDiamond:Wm,hollowHexagon:$m,hollowSquare:Vm,hollowTriangleDown:qm,hollowTriangle:Ym,hollowBowtie:Gm,point:ey,plus:ty,diamond:Km,square:ny,triangle:iy,hexagon:Zm,cross:Xm,bowtie:Um,hyphen:Qm,line:Jm,tick:ry,triangleDown:oy},Ww=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=qx(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]};return[e,l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],o=r/h,a=r/d,s=[e-o,n-a],c=[e+o,n+a];return[i.map(p(s,t)),i.map(p(c,t))]})):Array.from(e,(t=>[i.map(p(g(t),t))]))]};Ww.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:Gw,channels:[...Gx({shapes:Object.keys(Gw)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Vx(),{type:jr},{type:Rr}],postInference:[{type:Ir},...Wx()]};const $w={text:kx,badge:Ax},Hw=t=>{const{cartesian:e=!1}=t;return e?Xx:(e,n,r,i)=>{const{x:o,y:a}=r,s=qx(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};Hw.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:$w,channels:[...Gx({shapes:Object.keys($w)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Vx(),{type:qr},{type:Vr}],postInference:[...Wx()]};const Vw={cell:Kg,hollow:Zg},Yw=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,(t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};Yw.props={defaultShape:"cell",defaultLabelShape:"label",shape:Vw,composite:!1,channels:[...Gx({shapes:Object.keys(Vw)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Vx(),{type:jr},{type:Rr},{type:Hr}],postInference:[...Wx()]};const qw={area:Px,smooth:Cx,hvh:Nx,vh:Lx,hv:jx},Uw=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(Pn(t,(t=>l[t])).values()):[t],d=h.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2;return[d,Array.from(h,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n})),h]};Uw.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:qw,channels:[...Gx({shapes:Object.keys(qw)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Vx(),{type:Dr},{type:hn},{type:Hr}],postInference:[...$x()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Xw={link:Rx,arc:Fx,smooth:Ix,vhv:Dx},Kw=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=qx(n,r,t),u=e.map((t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+c[t]],t))]));return[e,u]};Kw.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:Xw,channels:[...Gx({shapes:Object.keys(Xw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx(),{type:Gr},{type:Wr}],postInference:[...Wx()]};const Zw={image:Kx},Qw=t=>{const{cartesian:e}=t;return e?Xx:(e,n,r,i)=>{const{x:o,y:a}=r,s=qx(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};Qw.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:Zw,channels:[...Gx({shapes:Object.keys(Zw)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Vx(),{type:qr},{type:Vr}],postInference:[...Wx()]};const Jw={polygon:Qx,ribbon:tw},tM=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),a=t.map((t=>{const e=[];for(let n=0;n<i.length;n++){const a=i[n][t];if(void 0===a)break;const s=o[n][t];e.push(r.map([+a,+s]))}return e}));return[t,a]};tM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:Jw,channels:[...Gx({shapes:Object.keys(Jw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx()],postInference:[...Wx()]};const eM={box:nw,violin:iw},nM=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[g,m,y,v,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,v],[p-n/2,v],[p+n/2,v],[p+n/2,m],[p-n/2,m],[p-n/2,y],[p+n/2,y],[p,m],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};nM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:eM,channels:[...Gx({shapes:Object.keys(eM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Vx(),{type:jr}],postInference:[...$x()],interaction:{shareTooltip:!0}};const rM={vector:ay},iM=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[c,l]=r.getSize(),u=t.map((t=>{const e=+s[t]/180*Math.PI,n=+a[t],u=n/l,f=n/c*Math.cos(e),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-h/2]),r.map([+i[t]+f/2,+o[t]+h/2])]}));return[t,u]};iM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:rM,channels:[...Gx({shapes:Object.keys(rM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Vx()],postInference:[...Wx()]};const oM={line:ow},aM=t=>(e,n,r,i)=>{const{y:o}=r,a=qx(n,r,Y({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[0,o[t]],[1,o[t]]].map((e=>i.map(a(e,t))))));return[e,s]};aM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:oM,channels:[...Hx({shapes:Object.keys(oM)}),{name:"y",required:!0}],preInference:[...Vx(),{type:Fr}],postInference:[]};const sM={line:ow},cM=t=>(e,n,r,i)=>{const{x:o}=r,a=qx(n,r,Y({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[o[t],1],[o[t],0]].map((e=>i.map(a(e,t))))));return[e,s]};cM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:sM,channels:[...Hx({shapes:Object.keys(sM)}),{name:"x",required:!0}],preInference:[...Vx(),{type:zr}],postInference:[]};const lM={connector:sw},uM=(...t)=>Kw(...t);function fM(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function hM(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=fM("x",e,i,r.x),s=fM("y",n,i,r.y),c=Array.from(t,(t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>o.map(t)))}));return[t,c]}}uM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:lM,channels:[...Hx({shapes:Object.keys(lM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx()],postInference:[]};const dM={range:Kg},pM=()=>hM();pM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:dM,channels:[...Hx({shapes:Object.keys(dM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx()],postInference:[]};const gM={range:Kg},mM=()=>hM({extendY:!0});mM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:gM,channels:[...Hx({shapes:Object.keys(gM)}),{name:"x",required:!0}],preInference:[...Vx()],postInference:[]};const yM={range:Kg},vM=()=>hM({extendX:!0});vM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:yM,channels:[...Hx({shapes:Object.keys(yM)}),{name:"y",required:!0}],preInference:[...Vx()],postInference:[]};const bM={path:Ow,hollow:kw},xM=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];xM.props={defaultShape:"path",defaultLabelShape:"label",shape:bM,composite:!1,channels:[...Gx({shapes:Object.keys(bM)}),{name:"d",scale:"identity"}],preInference:[...Vx()],postInference:[]};const wM=t=>{const{cartesian:e}=t;return e?Xx:(e,n,r,i)=>{const{x:o,y:a}=r,s=qx(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};wM.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:Cw},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx(),{type:qr},{type:Vr},{type:Yr}]};var MM={},EM={};function OM(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function kM(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function SM(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function AM(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+SM(-t,6):t>9999?"+"+SM(t,6):SM(t,4)}(t.getUTCFullYear())+"-"+SM(t.getUTCMonth()+1,2)+"-"+SM(t.getUTCDate(),2)+(i?"T"+SM(e,2)+":"+SM(n,2)+":"+SM(r,2)+"."+SM(i,3)+"Z":r?"T"+SM(e,2)+":"+SM(n,2)+":"+SM(r,2)+"Z":n||e?"T"+SM(e,2)+":"+SM(n,2)+"Z":"")}function TM(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return EM;if(l)return l=!1,MM;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=u())!==EM;){for(var f=[];r!==MM&&r!==EM;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?AM(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=OM(t);return function(r,i){return e(n(r),i,t)}}(t,e):OM(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=kM(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=kM(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function _M(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;PM&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const PM=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),CM=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>pe(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return TM(r).parse(e,i?_M:rr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};CM.props={};const NM=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function LM(t){return null!=t&&!Number.isNaN(t)}NM.props={};const jM=t=>{const{callback:e=LM}=t;return t=>t.filter(e)};jM.props={};const RM=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};RM.props={};const IM=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};IM.props={};const BM=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};BM.props={};const DM=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};DM.props={};const FM=t=>{const{value:e}=t;return()=>e};FM.props={};const zM=t=>{const{callback:e=rr}=t;return t=>e(t)};zM.props={};const GM=t=>{const{callback:e=rr}=t;return t=>Array.isArray(t)?t.map(e):t};function WM(t){return"string"==typeof t?e=>e[t]:t}GM.props={};const $M=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=WM(s),l=WM(a),u=Nn(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:o,t)),{}))}))};$M.props={};const HM=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};HM.props={};var VM={exports:{}},YM={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(YM),function(t){var e=Math.log(2),n=t.exports,r=YM.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<o;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,a),p=d[a],g=d[a-1]-d[a-2],m=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,y=d[-a-1+l]||0,v=p/(p-h-y);s>0&&(m+=v*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*v*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*v*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*v*g)}}));var y=m,v=0,b=0;return f.forEach((function(t){v+=t.y,y+=v,t.y=y,b+=y})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(VM);var qM=VM.exports;const UM=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Pn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=qM.create(t.map((t=>t[e])),{min:i,max:o,size:a,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};UM.props={};const XM=()=>t=>(console.log("G2 data section:",t),t);XM.props={};const KM={density:Sw},ZM=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,(e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),f=(+(null==o?void 0:o[e])||0)*n,h=+i[e]+f+u/2;return[...a.map(((n,r)=>[h+ +s[r][e]/t.length,+a[r][e]])),...a.map(((n,r)=>[h-+s[r][e]/t.length,+a[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};ZM.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:KM,channels:[...Gx({shapes:Object.keys(KM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...Vx(),{type:hn},{type:jr}],postInference:[...$x()],interaction:{shareTooltip:!0}};const QM={heatmap:Pw},JM=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};JM.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:QM,channels:[...Gx({shapes:Object.keys(QM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Vx(),{type:jr},{type:Rr}],postInference:[...Wx()]};const tE=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];tE.props={};const eE=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];eE.props={};const nE=t=>new Lo(t);nE.props={};const rE=t=>new Zo(t);rE.props={};const iE=t=>new Po(t);iE.props={};const oE=t=>new Yo(t);oE.props={};const aE=t=>new Qo(t);aE.props={};const sE=t=>new wa(t);sE.props={};const cE=t=>new ia(t);cE.props={};const lE=t=>new ta(t);lE.props={};const uE=t=>new na(t);uE.props={};const fE=t=>new sa(t);fE.props={};const hE=t=>new oa(t);hE.props={};const dE=t=>new ea(t);dE.props={};const pE=t=>new Oa(t);pE.props={};const gE=t=>new Ro(t);function mE({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:o,padding2:a,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:h,category10:d,category20:p,sizeDefault:g=1,padding:m="auto",margin:y=16}){return{padding:m,margin:y,size:g,color:t,category10:d,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:h,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:o,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",labelAutoRotate:!1,titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelAutoRotate:!1,tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelAutoRotate:!1,labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",labelAutoRotate:!1,titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}}}gE.props={};const yE=mE({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),vE=t=>Y({},yE,t);vE.props={};const bE=t=>Y({},vE(),{category10:"category10",category20:"category20"},t);bE.props={};const xE=mE({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"#141414",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),wE=t=>Y({},xE,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),ME=t=>Object.assign({},wE(),{category10:"category10",category20:"category20"},t);ME.props={};const EE=mE({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),OE=t=>Y({},EE,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function kE(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}OE.props={};var SE,AE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function TE(t){if(!(e=AE.exec(t)))throw new Error("invalid format: "+t);var e;return new _E({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function _E(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function PE(t,e){var n=kE(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}TE.prototype=_E.prototype,_E.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var CE={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>PE(100*t,e),r:PE,s:function(t,e){var n=kE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(SE=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+kE(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function NE(t){return t}var LE,jE,RE=Array.prototype.map,IE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function BE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?NE:(e=RE.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?NE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(RE.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=TE(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):CE[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?c:"",w=CE[v],M=/[defgprs%]/.test(v);function E(t){var i,o,c,h=b,E=x;if("c"===v)E=w(t)+E,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:l:"-"===f||"("===f?"":f)+h,E=("s"===v?IE[8+SE/3]:"")+E+(O&&"("===f?")":""),M)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){E=(46===c?a+t.slice(i+1):t.slice(i))+E,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var k=h.length+t.length+E.length,S=k<p?new Array(p-k+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-E.length:1/0),S=""),n){case"<":t=h+t+E+S;break;case"=":t=h+S+t+E;break;case"^":t=S.slice(0,k=S.length>>1)+h+t+E+S.slice(k);break;default:t=S+h+t+E}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),E.toString=function(){return t+""},E}return{format:f,formatPrefix:function(t,e){var n=f(((t=TE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=kE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=IE[8+r/3];return function(t){return n(i*t)+o}}}}function DE(t,e,n){return t.querySelector(e)?Dg(t).select(e):Dg(t).append(n)}function FE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function zE(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const o={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","center"],center:["column","center","center"]};return t in o&&([n,r,i]=o[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}LE=BE({thousands:",",grouping:[3],currency:["$",""]}),jE=LE.format;class GE extends Mx{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class WE extends GE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function $E(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function HE(t){return"vertical"===t||t===-Math.PI/2}function VE(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,h=o||u||c,d=a||f||l,p=s?"horizontal":"vertical",[g,m]=s?[d,h]:[h,d];return{orientation:p,width:g,height:m,size:h,length:d}}function YE(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=he(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${B(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function qE(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function UE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function XE(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function KE(t,e,n,r,i,o,a,s){var c;void 0===n&&void 0===o||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),o&&{tickMethod:o}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=kn(e,(t=>+t)),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(Mc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],h=new Zo({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!Sc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new Zo({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new Zo({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Mc(s)||wc(s)?u.map(((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:Ec(s)&&"center"===a||wc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||wc(s)&&g(a)?1-l:l,label:f(h(XE(e),n,r)),id:String(n)}})):u.map(((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(d(t.map(e)+o));return{value:g(a)?1-s:s,label:f(h(XE(e),n,r)),id:String(n)}}))}function ZE(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function QE(t,e,n){return!function(t){return Mc(t)&&wc(t)}(e)&&!kc(e)&&(void 0===t?!!n.getTicks:t)}function JE(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${or(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${B(c)}`]||{};return Object.assign({},a,s,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:HE(o)?10:0,tick:"center"!==r&&void 0}):a}const tO=t=>e=>{const{labelFormatter:n,labelFilter:r=(()=>!0)}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,c="string"==typeof n?jE(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:a});return t(l)(i)}},eO=tO((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:o,actualPosition:a,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:h,tickMethod:d,transform:p,indexBBox:g}=t,m=he(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[i],value:y,coordinate:v,theme:b})=>{const{bbox:x}=y,{domain:w}=i.getOptions(),M=JE(i,0,b,e,s,o),E=Object.assign(Object.assign(Object.assign({},M),l),m),O=function(t,e,n="xy"){const[r,i,o]=UE(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,v,t.plane),k=function(t,e,n,r){const{x:i,y:o,width:a,height:s}=n;if("bottom"===t)return{startPos:[i,o],endPos:[i+a,o]};if("left"===t)return{startPos:[i+a,o+s],endPos:[i+a,o]};if("right"===t)return{startPos:[i,o+s],endPos:[i,o]};if("top"===t)return{startPos:[i,o+s],endPos:[i+a,o+s]};if("center"===t){if("vertical"===e)return{startPos:[i,o],endPos:[i,o+s]};if("horizontal"===e)return{startPos:[i,o],endPos:[i+a,o]};if("number"==typeof e){const[t,n]=r.getCenter(),[c,l]=Tc(r),[u,f]=_c(r),h=Math.min(a,s)/2,{insetLeft:d,insetTop:p}=r.getOptions(),g=c*h,m=l*h,[y,v]=[t+i-d,n+o-p],[b,x]=[Math.cos(e),Math.sin(e)];return{startPos:[y+m*b,v+m*x],endPos:[y+g*b,v+g*x],gridClosed:f-u==360,gridCenter:[y,v],gridControlAngles:new Array(3).fill(0).map(((t,e,n)=>(f-u)/(n.length-1)*e))}}}return{}}(s,o,x,v),S=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(v),A=KE(i,w,f,r,h,d,s,v),T=g?A.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):A,_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},E),{type:"linear",data:T,crossSize:c,titleText:FE(u),labelOverlap:ZE(p,E),grid:QE(E.grid,v,i),gridLength:O,line:!0,indexBBox:g}),E.line?null:{lineOpacity:0}),k),S),n),P=_.labelOverlap.find((t=>"hide"===t.type));return P&&(_.crossSize=!1),new $b({className:"axis",style:YE(_)})}})),nO=tO((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:o,tickFilter:a,tickCount:s,tickMethod:c,important:l={},style:u={},indexBBox:f,title:h,grid:d=!1}=t,p=he(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:g}=t.getOptions(),m=KE(t,g,s,o,a,c,r,n),y=f?m.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):m,[v,b]=Tc(n),x=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,h]=_c(i),[d,p]=UE(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,v,b,n),{axis:w,axisArc:M={}}=i,E=YE(Y({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:FE(h),grid:d},p),l)));return new $b({style:K(E,["transform"])})}}));eO.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},nO.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const rO=t=>(...e)=>{const n=eO(Object.assign({},{crossPadding:50},t))(...e);return qE(n,t),n};rO.props=Object.assign(Object.assign({},eO.props),{defaultPosition:"bottom"});const iO=t=>(...e)=>{const n=eO(Object.assign({},{crossPadding:10},t))(...e);return qE(n,t),n};function oO(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=_c(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===a,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map(((t,e)=>(c-s)/i.count*e))})}iO.props=Object.assign(Object.assign({},eO.props),{defaultPosition:"left"});const aO=t=>{const{important:e={}}=t,n=he(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return eO(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},oO(t,i,o,a)),e)}))(r)}};function sO(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=$E(t,"shape"),r=$E(t,"color"),i=n?n.clone():null,o=[];for(const[t,n]of e){const e=t.type,a=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map(((e,r)=>{var o;return i?i.map(e||"point"):(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.shape)||n.defaultShape||"point"}));"string"==typeof e&&o.push([e,a])}if(0===o.length)return["point",["point"]];if(1===o.length)return o[0];if(!n)return o[0];const{range:a}=n.getOptions();return o.map((([t,e])=>{let n=0;for(let t=0;t<o.length;t++){const r=a[t%a.length];e[t]===r&&n++}return[n/e.length,[t,e]]})).sort(((t,e)=>e[0]-t[0]))[0][1]}(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,a;const s=(null===(a=null===(i=null===(n=r[`mark.${o}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===a?void 0:a.props.defaultMarker)||function(t){if(g(t))return t[t.length-1]}(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,strokeWidth:i,path:o,stroke:a,lineWidth:s,color:c}=e,l=he(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const u=Fm.get(t)||Fm.get("point");return(...t)=>new pp({style:Object.assign(Object.assign({},l),{path:u(...t),stroke:u.style.includes("stroke")?c||a:"",fill:u.style.includes("fill")?c||r:"",lineWidth:u.style.includes("lineWidth")?s||s||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${a[t]}`;return $E(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function cO(t){const e=$E(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function lO(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=$E(t,"size");return n instanceof Yo?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:sO(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:cO(r)},s="string"==typeof n?jE(n):n,c=$E(r,"color"),l=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},a),{data:l.map((t=>({id:t,label:s(t),color:u(t)})))})}aO.props=Object.assign(Object.assign({},eO.props),{defaultPosition:"center"});const uO=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=he(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:a}=r,{width:l,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=VE(t,e,n);return{width:i,height:o}}(r,t,uO),d=zE(o,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:FE(s)}),lO(t,e)),{legendCategory:g={}}=i,m=YE(Object.assign({},g,p,u)),y=new WE({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:m})});return y.appendChild(new ox({className:"legend-category",style:m})),y}};function fO(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function hO(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],xr(e)];return[n,r]}function dO(t,e,n,r,i,o){const{length:a}=t,s=n||r,c=i.color?o.legendContinuous.ribbonFill||"black":o.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[uf(e).toString()]})),r}(s,c),[u,f]=hO(l),[h,d]=hO([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Ro))));return Object.assign(Object.assign({},t),{domain:[h,d],data:l.getTicks().map((t=>({value:t}))),color:new Array(Math.floor(a)).fill(0).map(((t,e)=>{const n=(f-u)/(a-1)*e+u,i=l.map(n),o=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${o})`))}))})}function pO(t,e,n,r,i,o){const a=$E(t,"color"),s=function(t,e,n){const{size:r}=e,i=VE(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof na){const{range:t}=a.getOptions(),[e,n]=hO(a);return a instanceof oa||a instanceof sa?fO(s,a,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,a,t)}return dO(s,a,$E(t,"size"),$E(t,"opacity"),e,o)}uO.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const gO=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=he(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:a,scale:l})=>{const{bbox:u}=i,{x:h,y:d,width:p,height:g}=u,m=zE(o,n),{legendContinuous:y={}}=a,v=YE(Object.assign({},y,Object.assign(Object.assign({titleText:FE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>jE(e)(t.label):e},pO(r,l,i,t,gO,a)),c),f)),b=new GE({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},m),{subOptions:v})});return b.appendChild(new yx({className:"legend-continuous",style:v})),b}};gO.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const mO=t=>(...e)=>gO(Object.assign({},{block:!0},t))(...e);mO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const yO=t=>e=>{const{scales:n}=e,r=$E(n,"size");return gO(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};yO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const vO=t=>yO(Object.assign({},{block:!0},t));function bO(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}vO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const xO=(wO={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left"}=t,s=he(t,["width","title","subtitle","spacing","align"]),c=ur(s,"title"),l=ur(s,"subtitle"),u=DE(e,".title","text").attr("className","title").call(Gg,Object.assign(Object.assign(Object.assign({},bO(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),c)).node().getLocalBounds();DE(e,".sub-title","text").attr("className","sub-title").call((t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},bO(0,u.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),l))}))}},class extends cp{constructor(t){super(t),this.descriptor=wO}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(Y({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var wO;const MO=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new xO({style:Y({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function EO(t){return!!t.getBandWidth}function OO(t,e,n){if(!EO(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map((t=>t+a)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(xn(s,e)+o,0,i.length-1);return i[c]}function kO(t,e,n){if(!e)return t.getOptions().domain;if(!EO(t)){const r=Rn(e);if(!n)return r;const[i]=r,{range:o}=t.getOptions(),[a,s]=o,c=a>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],o=r.indexOf(i);if(n){const t=o+Math.round(r.length*n);return r.slice(o,t)}const a=e[e.length-1],s=r.indexOf(a);return r.slice(o,s+1)}function SO(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[OO(a,n,e),OO(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[kO(a,[l[0],u[0]]),kO(s,[l[1],u[1]])]}function AO(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}MO.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const TO=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=he(t,["orientation","labelFormatter","size","style","position"]);return({scales:[t],value:r,theme:s,coordinate:c})=>{var l;const{bbox:u}=r,{width:f,height:h}=u,{slider:d={}}=s,p=(null===(l=t.getFormatter)||void 0===l?void 0:l.call(t))||(t=>t.toString()),g="string"==typeof n?jE(n):n,m="horizontal"===e,y=wc(c)&&m,{trackSize:v=d.trackSize}=i,[b,x]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(u,o,v);return new zv({className:"slider",style:Object.assign({},d,Object.assign(Object.assign({x:b,y:x,trackLength:m?f:h,orientation:e,formatter:e=>(g||p)(OO(t,y?1-e:e,!0))},i),a))})}};TO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const _O=t=>TO(Object.assign(Object.assign({},t),{orientation:"horizontal"}));_O.props=Object.assign(Object.assign({},TO.props),{defaultPosition:"bottom"});const PO=t=>TO(Object.assign(Object.assign({},t),{orientation:"vertical"}));PO.props=Object.assign(Object.assign({},TO.props),{defaultPosition:"left"});const CO=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=he(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:o})=>{const{bbox:a}=n,{x:s,y:c,width:l,height:u}=a,{scrollbar:f={}}=o,{ratio:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,g=p/h,[m,y]=d,v=y>m?0:1;return new Gv({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:v}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};CO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const NO=t=>CO(Object.assign(Object.assign({},t),{orientation:"horizontal"}));NO.props=Object.assign(Object.assign({},CO.props),{defaultPosition:"bottom"});const LO=t=>CO(Object.assign(Object.assign({},t),{orientation:"vertical"}));LO.props=Object.assign(Object.assign({},CO.props),{defaultPosition:"left"});const jO=t=>()=>new up;jO.props={};const RO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,a],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],d=[{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.01},{transform:`${s} scale(1, 1)`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},IO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,a],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],d=[{transform:`${s} scale(1, 1)`.trimStart()},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.99},{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},BO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,0],"scale(0.0001, 1)"]:[[0,a],"scale(1, 0.0001)"],d=[{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.01},{transform:`${s} scale(1, 1)`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},DO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,0],"scale(0.0001, 1)"]:[[0,a],"scale(1, 0.0001)"],d=[{transform:`${s} scale(1, 1)`.trimStart()},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.99},{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},FO=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};FO.props={};const zO=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:o,strokeOpacity:a,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};function GO(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}zO.props={};const WO=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function $O(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function HO(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function VO(t,e){const[n,r,i,o]=$O(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),c=[],l=o/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,o=r+u*l;c.push(HO([t,o,e,l]))}f-=t,u+=1}return c}function YO(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function qO(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function UO(t){const e=zf(t);if(e&&!function(t){return!qO(t,"m")||!qO(t,"M")}(e))return e}function XO(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=UO(e),s=UO(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){const[r,i,o,a]=$O(t),{transform:s}=t.style,{transform:c}=e.style;YO(e,t);const[l,u,f,h]=$O(e),d=r-l,p=i-u,g=o/f,m=a/h,y=[Object.assign({transform:`${s?s+" ":""}translate(${d}, ${p}) scale(${g}, ${m})`},GO(t,WO)),Object.assign({transform:(c?c+" ":"")+"translate(0, 0) scale(1, 1)"},GO(e,WO))];return e.animate(y,n)}(e,n,r);const c=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new pp({style:Object.assign(Object.assign({},GO(t,WO)),{d:e})});return YO(r,t),r}(t,a),l=[Object.assign({path:a},GO(e,WO)),Object.assign({path:s},GO(n,WO))],u=c.animate(l,r);return u.onfinish=()=>{c.style.transform="none",sr(c,n)},c.style.transform="none",u}const KO=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:VO}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return XO(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>XO(e,new pp({style:Object.assign({path:i[r]},GO(t,WO))}),e,n)))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>XO(t,t,new pp({style:{path:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};KO.props={};const ZO=(t,e)=>{const n=1e-4;ap({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Xu.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Mc(r))return RO(t,e)(i,o,a);const c=r.getCenter(),{__data__:l,style:u}=s,{radius:f=0,inset:h=0,fillOpacity:d=1,strokeOpacity:p=1,opacity:g=1}=u,{points:m,y:y,y1:v}=l,b=Us().cornerRadius(f).padAngle(h*Math.PI/180),x=Vg(r,m,[y,v]),{startAngle:w,endAngle:M}=x,E=new pp({}),O=t=>{E.attr({d:b(t),transform:`translate(${c[0]}, ${c[1]})`});const e=zf(E);return E.style.transform="",e},k=[{waveInArcAngle:w+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:w+n,fillOpacity:d,strokeOpacity:p,opacity:g,offset:.01},{waveInArcAngle:M,fillOpacity:d,strokeOpacity:p,opacity:g}],S=s.animate(k,Object.assign(Object.assign({},a),t));return S.onframe=function(){s.style.path=O(Object.assign(Object.assign({},x),{endAngle:Number(s.style.waveInArcAngle)}))},S.onfinish=function(){s.style.path=O(Object.assign(Object.assign({},x),{endAngle:M}))},S}};ZO.props={};const QO=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l=[{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c}],{width:u,height:f}=i.getBoundingClientRect();i.setOrigin([u/2,f/2]);const h=i.animate(l,Object.assign(Object.assign({},r),t));return h.finished.then((()=>i.setOrigin(0,0))),h},JO=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l=[{transform:`${o} scale(1)`.trimStart()},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:u,height:f}=i.getBoundingClientRect();i.setOrigin([u/2,f/2]);const h=i.animate(l,Object.assign(Object.assign({},r),t));return h.finished.then((()=>i.setOrigin(0,0))),h},tk=t=>(e,n,r)=>{var i,o;const[a]=e,s=(null===(o=(i=a).getTotalLength)||void 0===o?void 0:o.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(c,Object.assign(Object.assign({},r),t))};tk.props={};const ek=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new pp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;const l=RO(t,e)([c],r,i);return l.finished.then((()=>{c.remove(),o.style.clipPath=null})),l};ek.props={};const nk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new pp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;const l=BO(t,e)([c],r,i);return l.finished.then((()=>{c.remove(),o.style.clipPath=null})),l};nk.props={};const rk="main-layer",ik="label-layer",ok="element",ak="view",sk="plot",ck="component",lk="label",uk="area";function fk(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function hk(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(i,i,i,0,2*Math.PI)}}function dk(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.defX,l=void 0===c?0:c,u=e.defY,f=void 0===u?0:u,h=e.markerStart,d=e.markerEnd,p=e.markerStartOffset,g=e.markerEndOffset,m=0,y=0,v=0,b=0,x=0;h&&Zd(h)&&p&&(n=a-i,r=s-o,x=Math.atan2(r,n),m=Math.cos(x)*(p||0),y=Math.sin(x)*(p||0)),d&&Zd(d)&&g&&(n=i-a,r=o-s,x=Math.atan2(r,n),v=Math.cos(x)*(g||0),b=Math.sin(x)*(g||0)),t.moveTo(i-l+m,o-f+y),t.lineTo(a-l+v,s-f+b)}function pk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.path,d=h.absolutePath,p=h.segments,g=0,m=0,y=0,v=0,b=0;if(c&&Zd(c)&&u){var x=ye(c.parentNode.getStartTangent(),2),w=x[0],M=x[1];n=w[0]-M[0],r=w[1]-M[1],b=Math.atan2(r,n),g=Math.cos(b)*(u||0),m=Math.sin(b)*(u||0)}if(l&&Zd(l)&&f){var E=ye(l.parentNode.getEndTangent(),2);w=E[0],M=E[1];n=w[0]-M[0],r=w[1]-M[1],b=Math.atan2(r,n),y=Math.cos(b)*(f||0),v=Math.sin(b)*(f||0)}for(var O=0;O<d.length;O++){var k=d[O],S=k[0],A=d[O+1],T=0===O&&(0!==g||0!==m),_=(O===d.length-1||A&&("M"===A[0]||"Z"===A[0]))&&0!==y&&0!==v;switch(S){case"M":T?(t.moveTo(k[1]-o+g,k[2]-s+m),t.lineTo(k[1]-o,k[2]-s)):t.moveTo(k[1]-o,k[2]-s);break;case"L":_?t.lineTo(k[1]-o+y,k[2]-s+v):t.lineTo(k[1]-o,k[2]-s);break;case"Q":t.quadraticCurveTo(k[1]-o,k[2]-s,k[3]-o,k[4]-s),_&&t.lineTo(k[3]-o+y,k[4]-s+v);break;case"C":t.bezierCurveTo(k[1]-o,k[2]-s,k[3]-o,k[4]-s,k[5]-o,k[6]-s),_&&t.lineTo(k[5]-o+y,k[6]-s+v);break;case"A":var P=p[O].arcParams,C=P.cx,N=P.cy,L=P.rx,j=P.ry,R=P.startAngle,I=P.endAngle,B=P.xRotation,D=P.sweepFlag;if(t.ellipse)t.ellipse(C-o,N-s,L,j,B,R,I,!!(1-D));else{var F=L>j?L:j,z=L>j?1:L/j,G=L>j?j/L:1;t.translate(C-o,N-s),t.rotate(B),t.scale(z,G),t.arc(0,0,F,R,I,!!(1-D)),t.scale(1/z,1/G),t.rotate(-B),t.translate(-(C-o),-(N-s))}_&&t.lineTo(k[6]-o+y,k[7]-s+v);break;case"Z":t.closePath()}}}function gk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.points.points,d=h.length,p=h[0][0]-o,g=h[0][1]-s,m=h[d-1][0]-o,y=h[d-1][1]-s,v=0,b=0,x=0,w=0,M=0;c&&Zd(c)&&u&&(n=h[1][0]-h[0][0],r=h[1][1]-h[0][1],M=Math.atan2(r,n),v=Math.cos(M)*(u||0),b=Math.sin(M)*(u||0)),l&&Zd(l)&&f&&(n=h[d-1][0]-h[0][0],r=h[d-1][1]-h[0][1],M=Math.atan2(r,n),x=Math.cos(M)*(f||0),w=Math.sin(M)*(f||0)),t.moveTo(p+(v||x),g+(b||w));for(var E=1;E<d-1;E++){var O=h[E];t.lineTo(O[0]-o,O[1]-s)}t.lineTo(m,y)}function mk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.points.points,d=h.length,p=h[0][0]-o,g=h[0][1]-s,m=h[d-1][0]-o,y=h[d-1][1]-s,v=0,b=0,x=0,w=0,M=0;c&&Zd(c)&&u&&(n=h[1][0]-h[0][0],r=h[1][1]-h[0][1],M=Math.atan2(r,n),v=Math.cos(M)*(u||0),b=Math.sin(M)*(u||0)),l&&Zd(l)&&f&&(n=h[d-2][0]-h[d-1][0],r=h[d-2][1]-h[d-1][1],M=Math.atan2(r,n),x=Math.cos(M)*(f||0),w=Math.sin(M)*(f||0)),t.moveTo(p+v,g+b);for(var E=1;E<d-1;E++){var O=h[E];t.lineTo(O[0]-o,O[1]-s)}t.lineTo(m+x,y+w)}function yk(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i;if(n&&n.some((function(t){return 0!==t}))){var s=r>0?1:-1,c=i>0?1:-1,l=s+c===0,u=ye(n.map((function(t){return T(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),f=u[0],h=u[1],d=u[2],p=u[3];t.moveTo(s*f,0),t.lineTo(o-s*h,0),0!==h&&t.arc(o-s*h,c*h,h,-c*Math.PI/2,s>0?0:Math.PI,l),t.lineTo(o,a-c*d),0!==d&&t.arc(o-s*d,a-c*d,d,s>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(s*p,a),0!==p&&t.arc(s*p,a-c*p,p,c>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,l),t.lineTo(0,c*f),0!==f&&t.arc(s*f,c*f,f,s>0?Math.PI:0,c>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,o,a)}var vk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-path-generator",e}return ue(e,t),e.prototype.init=function(){var t,e=((t={})[Tl.CIRCLE]=fk,t[Tl.ELLIPSE]=hk,t[Tl.RECT]=yk,t[Tl.LINE]=dk,t[Tl.POLYLINE]=mk,t[Tl.POLYGON]=gk,t[Tl.PATH]=pk,t[Tl.TEXT]=void 0,t[Tl.GROUP]=void 0,t[Tl.IMAGE]=void 0,t[Tl.HTML]=void 0,t[Tl.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(Cl),bk=jt(),xk=jt(),wk=jt(),Mk=rt(),Ek=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=lt(Mk,r),s=qt(xk,Ft(wk,n[0],n[1],0),a),c=e.getGeometryBounds().halfExtents,l=e.parsedStyle.anchor;if(s[0]+=(l&&l[0]||0)*c[0]*2,s[1]+=(l&&l[1]||0)*c[1]*2,o(e,new ru(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,(function(t){return pe(i,void 0,void 0,(function(){return ge(this,(function(e){return[2,this.pick(s,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))},t.prototype.pick=function(t,e){var n,r,i=e.topmost,o=e.position,a=o.x,s=o.y,c=Ft(bk,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=me(l),h=f.next();!h.done;h=f.next()){var d=h.value,p=d.getWorldTransform();if(this.isHit(d,c,p,!1)){var g=Fh(d);if(g){var m=g.parsedStyle.clipPath;if(this.isHit(m,c,m.getWorldTransform(),!0)){if(i)return e.picked=[d],e;u.push(d)}}else{if(i)return e.picked=[d],e;u.push(d)}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return e.picked=u,e},t.tag="CanvasPicker",t}();function Ok(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.lineWidth,c=r.increasedLineWidthForHitTesting,l=r.pointerEvents,u=((s||0)+(c||0))/2,f=cl(i,i,e.x,e.y),h=ye($h(l,o,a),2),d=h[0],p=h[1];return d&&p||n?f<=i+u:d?f<=i:!!p&&(f>=i-u&&f<=i+u)}function kk(t,e,n,r){return t/(n*n)+e/(r*r)}function Sk(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.fill,s=r.stroke,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=e.x,h=e.y,d=ye($h(u,a,s),2),p=d[0],g=d[1],m=((c||0)+(l||0))/2,y=(f-i)*(f-i),v=(h-o)*(h-o);return p&&g||n?kk(y,v,i+m,o+m)<=1:p?kk(y,v,i,o)<=1:!!g&&(kk(y,v,i-m,o-m)>=1&&kk(y,v,i+m,o+m)<=1)}function Ak(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function Tk(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return cl(l.x,l.y,a,s)<=o/2}function _k(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&yl(t,e,n,r,o,a)<=i/2}function Pk(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(_k(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(_k(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var Ck=1e-6;function Nk(t){return Math.abs(t)<Ck?0:t<0?-1:1}function Lk(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function jk(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Lk(a,s,[e,n]))return!0;Nk(a[1]-n)>0!=Nk(s[1]-n)>0&&Nk(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function Rk(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=jk(t[i],e,n))break}return r}function Ik(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.defX,f=void 0===u?0:u,h=r.defY,d=void 0===h?0:h;return!(!ye($h(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!c)&&_k(i,o,a,s,(c||0)+(l||0),e.x+f,e.y+d)}function Bk(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=a.increasedLineWidthForHitTesting,l=a.stroke,u=a.fill,f=a.defX,h=void 0===f?0:f,d=a.defY,p=void 0===d?0:d,g=a.path,m=a.pointerEvents,y=g.segments,v=g.hasArc,b=g.polylines,x=g.polygons,w=ye($h(m,(null==x?void 0:x.length)&&u,l),2),M=w[0],E=w[1],O=Tf(t),k=!1;return M||n?k=v?r(t,e):Rk(x,e.x+h,e.y+p)||Rk(b,e.x+h,e.y+p):((E||n)&&(k=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||Ak(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=_k(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Sl(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=wl(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=De(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var m=wl(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],o=m<=e/2)return!0}}}return o}(y,(s||0)+(c||0),e.x+h,e.y+p,O)),k)}function Dk(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,c=r.points,l=r.defX,u=void 0===l?0:l,f=r.defY,h=void 0===f?0:f,d=ye($h(r.pointerEvents,o,i),2),p=d[0],g=!1;return(d[1]||n)&&(g=Pk(c.points,(a||0)+(s||0),e.x+u,e.y+h,!0)),g||!p&&!n||(g=jk(c.points,e.x+u,e.y+h)),g}function Fk(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,c=void 0===s?0:s,l=r.defY,u=void 0===l?0:l;return!(!ye($h(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&Pk(a.points,(i||0)+(o||0),e.x+c,e.y+u,!1)}function zk(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,u=o.increasedLineWidthForHitTesting,f=o.width,h=o.height,d=ye($h(o.pointerEvents,s,c),2),p=d[0],g=d[1],m=(l||0)+(u||0);if(a&&a.some((function(t){return 0!==t}))){var y=!1;return(g||n)&&(y=function(t,e,n,r,i,o,a,s){var c=ye(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return _k(t+l,e,t+n-u,e,o,a,s)||_k(t+n,e+u,t+n,e+r-f,o,a,s)||_k(t+n-f,e+r,t+h,e+r,o,a,s)||_k(t,e+r-h,t,e+l,o,a,s)||Tk(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||Tk(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||Tk(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||Tk(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(0,0,f,h,a.map((function(t){return T(t,0,Math.min(Math.abs(f)/2,Math.abs(h)/2))})),m,e.x,e.y)),y||!p&&!n||(y=r(t,e)),y}var v=m/2;return p&&g||n?Ak(0-v,0-v,f+v,h+v,e.x,e.y):p?Ak(0,0,f,h,e.x,e.y):!!g&&function(t,e,n,r,i,o,a){var s=i/2;return Ak(t-s,e-s,n,i,o,a)||Ak(t+n-s,e-s,i,r,o,a)||Ak(t+s,e+r-s,n,i,o,a)||Ak(t-s,e+s,i,r,o,a)}(0,0,f,h,m,e.x,e.y)}function Gk(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=a.width,l=a.height;if("non-transparent-pixel"===s){var u=i.config.offscreenCanvas,f=o.offscreenCanvasCreator.getOrCreateCanvas(u),h=o.offscreenCanvasCreator.getOrCreateContext(u,{willReadFrequently:!0});return f.width=c,f.height=l,i.defaultStyleRendererFactory[Tl.IMAGE].render(h,t.parsedStyle,t,void 0,void 0,void 0),h.getImageData(e.x,e.y,1,1).data.every((function(t){return 0!==t}))}return!0}var Wk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-picker",e}return ue(e,t),e.prototype.init=function(){var t,e=((t={})[Tl.CIRCLE]=Ok,t[Tl.ELLIPSE]=Sk,t[Tl.RECT]=zk,t[Tl.LINE]=Ik,t[Tl.POLYLINE]=Fk,t[Tl.POLYGON]=Dk,t[Tl.PATH]=Bk,t[Tl.TEXT]=function(){return!0},t[Tl.GROUP]=null,t[Tl.IMAGE]=Gk,t[Tl.HTML]=null,t[Tl.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new Ek)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Cl),$k=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=rt(),this.dprMatrix=rt(),this.tmpMat4=rt(),this.vec3a=jt(),this.vec3b=jt(),this.vec3c=jt(),this.vec3d=jt()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.rBushRoot,l=e.pathGeneratorFactory;this.rBush=c,this.pathGeneratorFactory=l;var u=e.contextService,f=s.root.ownerDocument.defaultView,h=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){f.addEventListener(Ad.UNMOUNTED,h),f.addEventListener(Ad.CULLED,d);var t=u.getDPR(),e=i.width,n=i.height,o=u.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){f.removeEventListener(Ad.UNMOUNTED,h),f.removeEventListener(Ad.CULLED,d),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t=u.getContext(),e=u.getDPR(),n=i.width,o=i.height,s=r.canvasRendererPluginOptions,c=s.dirtyObjectNumThreshold,l=s.dirtyObjectRatioThreshold,f=a.getStats(),h=f.total,d=f.rendered,p=d/h;r.clearFullScreen=a.disableDirtyRectangleRendering()||d>c&&p>l,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(t,0,0,n*e,o*e,i.background))}));var p=function(t,e){t.isVisible()&&!t.isCulled()&&(r.renderDisplayObject(t,e,r.context,r.restoreStack,n),r.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){p(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){var t=u.getContext(),e=u.getDPR();if(yt(r.dprMatrix,[e,e,1]),ft(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,ve([r.mergeDirtyAABBs(r.renderQueue)],ye(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Zl;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],Zl.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,h=c.y,d=c.width,g=c.height,m=qt(r.vec3a,[l,h,0],r.vpMatrix),y=qt(r.vec3b,[l+d,h,0],r.vpMatrix),v=qt(r.vec3c,[l,h+g,0],r.vpMatrix),b=qt(r.vec3d,[l+d,h+g,0],r.vpMatrix),x=Math.min(m[0],y[0],b[0],v[0]),w=Math.min(m[1],y[1],b[1],v[1]),M=Math.max(m[0],y[0],b[0],v[0]),E=Math.max(m[1],y[1],b[1],v[1]),O=Math.floor(x),k=Math.floor(w),S=Math.ceil(M-x),A=Math.ceil(E-w);t.save(),r.clearRect(t,O,k,S,A,i.background),t.beginPath(),t.rect(O,k,S,A),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&f.dispatchEvent(new Md(Qd.DIRTY_RECTANGLE,{dirtyRect:{x:O,y:k,width:S,height:A}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),t.nodeName!==Tl.LINE&&t.nodeName!==Tl.PATH&&t.nodeName!==Tl.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new Zl;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e=ye(t.getMin(),2),n=e[0],r=e[1],i=ye(t.getMax(),2),o=i[0],a=i[1];return this.rBush.search({minX:n,minY:r,maxX:o,maxY:a}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Zl);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),y(s)||(t.lineDashOffset=s),y(o)||(t.globalAlpha*=o),y(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),y(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var c=e.geometry.contentBounds;r=-a*(c&&2*c.halfExtents[0]||0),i=-s*(c&&2*c.halfExtents[1]||0)}n?(ot(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ht(this.tmpMat4,this.tmpMat4,this.vec3a),ft(this.tmpMat4,n,this.tmpMat4),ft(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(ot(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ht(this.tmpMat4,this.tmpMat4,this.vec3a),ft(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Zl;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),Hk=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=e.fillOpacity,u=e.stroke,f=e.strokeOpacity,h=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,m=e.shadowColor,v=e.shadowBlur,b=e.filter,x=e.miterLimit,w=!y(a)&&!a.isNone,M=!y(u)&&!u.isNone&&h>0,E=0===a.alpha,O=!(!b||!b.length),k=!y(m)&&v>0,S=n.nodeName,A="inner"===g,T=M&&k&&(S===Tl.PATH||S===Tl.LINE||S===Tl.POLYLINE||E||A);w&&(t.globalAlpha=c*l,T||Vk(n,t,k),this.fill(t,n,a,s,r,i,o),T||this.clearShadowAndFilter(t,O,k)),M&&(t.globalAlpha=c*f,t.lineWidth=h,y(x)||(t.miterLimit=x),y(d)||(t.lineCap=d),y(p)||(t.lineJoin=p),T&&(A&&(t.globalCompositeOperation="source-atop"),Vk(n,t,!0),A&&(this.stroke(t,n,u,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,O,!0))),this.stroke(t,n,u,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!y(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(cf(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(cf(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,u=c.height;s=r.contextService.getDPR();var f=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(f)).width=l*s,a.height=u*s;var h=o.offscreenCanvasCreator.getOrCreateContext(f),d=[];t.image.forEach((function(t){i.renderDisplayObject(t,h,r,d,o)})),d.forEach((function(){h.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===vu.LinearGradient||t.type===vu.RadialGradient){var i=e.getGeometryBounds(),o=i&&2*i.halfExtents[0]||1,a=i&&2*i.halfExtents[1]||1;r=this.imagePool.getOrCreateGradient(fe(fe({type:t.type},t.value),{width:o,height:a}),n)}return r},t}();function Vk(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var Yk=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.width,o=e.height,a=e.img,s=e.shadowColor,c=e.shadowBlur,l=i,u=o;if(A(a)?r=this.imagePool.getImageSync(a):(l||(l=a.width),u||(u=a.height),r=a),r){Vk(n,t,!y(s)&&c>0);try{t.drawImage(r,0,0,l,u)}catch(t){}}},t}(),qk=function(){function t(){}return t.prototype.render=function(t,e,n,r,i,o){var a=e,s=a.lineWidth,c=a.textAlign,l=a.textBaseline,u=a.lineJoin,f=a.miterLimit,h=a.letterSpacing,d=a.stroke,p=a.fill,g=a.fillOpacity,m=a.strokeOpacity,v=a.opacity,b=a.metrics,x=a.dx,w=a.dy,M=a.shadowColor,E=a.shadowBlur,O=b.font,k=b.lines,S=b.height,A=b.lineHeight,T=b.lineMetrics;t.font=O,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var _=l;o.enableCSSParsing||"alphabetic"!==_||(_="bottom"),t.lineJoin=u,y(f)||(t.miterLimit=f);var P=0;"middle"===l?P=-S/2-A/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?P=-S:"top"!==l&&"hanging"!==l||(P=-A);var C=x||0;P+=w||0,1===k.length&&("bottom"===_?(_="middle",P-=.5*S):"top"===_&&(_="middle",P+=.5*S)),t.textBaseline=_,Vk(n,t,!y(M)&&E>0);for(var N=0;N<k.length;N++){var L=s/2+C;P+=A,y(d)||d.isNone||!s||this.drawLetterSpacing(t,k[N],T[N],c,L,P,h,g,m,v,!0),y(p)||this.drawLetterSpacing(t,k[N],T[N],c,L,P,h,g,m,v)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u){if(void 0===u&&(u=!1),0!==a){var f=t.textAlign;t.textAlign="left";var h=i;"center"===r||"middle"===r?h=i-n.width/2:"right"!==r&&"end"!==r||(h=i-n.width);for(var d=Array.from(e),p=t.measureText(e).width,g=0,m=0;m<d.length;++m){var y=d[m];u?this.strokeText(t,y,h,o,c):this.fillText(t,y,h,o,s,l),h+=p-(g=t.measureText(e.substring(m+1)).width)+a,p=g}t.textAlign=f}else u?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!y(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!y(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk);var Uk=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return ue(e,t),e.prototype.init=function(){var t,e=fe({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new Hk(n),i=((t={})[Tl.CIRCLE]=r,t[Tl.ELLIPSE]=r,t[Tl.RECT]=r,t[Tl.IMAGE]=new Yk(n),t[Tl.TEXT]=new qk,t[Tl.LINE]=r,t[Tl.POLYLINE]=r,t[Tl.POLYGON]=r,t[Tl.PATH]=r,t[Tl.GROUP]=void 0,t[Tl.HTML]=void 0,t[Tl.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new $k(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Cl),Xk=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),Kk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="dom-interaction",e}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new Xk)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Cl),Zk=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform())},l=function(t){var e=t.target;if(e.nodeName===Tl.HTML){r.$camera||(r.$camera=r.createCamera(i));var o=r.getOrCreateEl(e);if(r.$camera.appendChild(o),n.enableCSSParsing){var a=e.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){o.style[t]=a[t]}))}Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),c(e,o),r.context.nativeHTMLMap.set(o,e)}},u=function(t){var e=t.target;if(e.nodeName===Tl.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),r.context.nativeHTMLMap.delete(n))}},f=function(t){var e=t.target;if(e.nodeName===Tl.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;if(e.nodeName===Tl.HTML){var n=r.getOrCreateEl(e);c(e,n)}},d=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.style.width="".concat(e||0,"px"),r.$camera.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(Qd.RESIZE,d),s.addEventListener(Ad.MOUNTED,l),s.addEventListener(Ad.UNMOUNTED,u),s.addEventListener(Ad.ATTR_MODIFIED,f),s.addEventListener(Ad.BOUNDS_CHANGED,h)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(yd.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Qd.RESIZE,d),s.removeEventListener(Ad.MOUNTED,l),s.removeEventListener(Ad.UNMOUNTED,u),s.removeEventListener(Ad.ATTR_MODIFIED,f),s.removeEventListener(Ad.BOUNDS_CHANGED,h)}))},t.prototype.createCamera=function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#"+s);if(!c){var l=(n||document).createElement("div");c=l,l.id=s,l.style.position="absolute",l.style.left="".concat(o.offsetLeft||0,"px"),l.style.top="".concat(o.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),a.appendChild(l)}return c}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform())),n},t.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;A(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);break;case"width":if(this.context.enableCSSParsing){var o=e.computedStyleMap().get("width");n.style.width=o.toString()}else{o=e.parsedStyle.width;n.style.width=_(o)?"".concat(o,"px"):o.toString()}break;case"height":if(this.context.enableCSSParsing){var a=e.computedStyleMap().get("height");n.style.height=a.toString()}else{a=e.parsedStyle.height;n.style.height=_(a)?"".concat(a,"px"):a.toString()}break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents;n.style.pointerEvents=l;break;case"opacity":var u=e.parsedStyle.opacity;n.style.opacity="".concat(u);break;case"fill":var f=e.parsedStyle.fill,h="";lf(f)?h=f.isNone?"transparent":e.getAttribute("fill"):Array.isArray(f)&&(h=e.getAttribute("fill")),n.style.background=h;break;case"stroke":var d=e.parsedStyle.stroke,p="";lf(d)?p=d.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(d)&&(p=e.getAttribute("stroke")),n.style["border-color"]=p,n.style["border-style"]="solid";break;case"lineWidth":var g=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(g||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:"x"!==t&&"y"!==t&&(y(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t]))}},t.tag="HTMLRendering",t}(),Qk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="html-renderer",e}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new Zk)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Cl),Jk=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):Ih&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var a,s=t.image,c=t.repetition,l=t.transform,u=!1;A(s)?a=this.getImageSync(s,i):n?(a=n,u=!0):a=s;var f=a&&e.createPattern(a,c);if(f){var h=void 0;h=l?Eh(Zf(l),new op({})):st(rt()),u&&dt(h,h,[1/r,1/r,1]),f.setTransform({a:h[0],b:h[1],c:h[4],d:h[5],e:h[12],f:h[13]})}return o&&f&&(this.patternCache[o]=f),f},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.width,a=t.height,s=t.angle,c=t.cx,l=t.cy,u=t.size;if(this.gradientCache[n])return this.gradientCache[n];var f=null;if(r===vu.LinearGradient){var h=function(t,e,n){var r=Fl(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}}(o,a,s),d=h.x1,p=h.y1,g=h.x2,m=h.y2;f=e.createLinearGradient(d,p,g,m)}else if(r===vu.RadialGradient){var y=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===su.kPercentage&&(o=n.value/100*t),r.unit===su.kPercentage&&(a=r.value/100*e);var s=Math.max($e([0,0],[o,a]),$e([0,e],[o,a]),$e([t,e],[o,a]),$e([t,0],[o,a]));return i&&(i instanceof Lu?s=i.value:i instanceof ku&&("closest-side"===i.value?s=Math.min(o,t-o,a,e-a):"farthest-side"===i.value?s=Math.max(o,t-o,a,e-a):"closest-corner"===i.value&&(s=Math.min($e([0,0],[o,a]),$e([0,e],[o,a]),$e([t,e],[o,a]),$e([t,0],[o,a]))))),{x:o,y:a,r:s}}(o,a,c,l,u),v=y.x,b=y.y,x=y.r;f=e.createRadialGradient(v,b,0,v,b,x)}return f&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===su.kPercentage&&(null==f||f.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=f),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,o=t.angle,a=t.cx,s=t.cy,c=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return A(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),tS=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===Tl.IMAGE){var a=o.img;A(a)&&i.getImageSync(a,(function(){e.renderable.dirty=!0,n.dirtify()}))}},s=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===Tl.IMAGE&&"img"===r&&A(o)&&i.getOrCreateImage(o).then((function(){e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(Ad.MOUNTED,a),o.addEventListener(Ad.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(Ad.MOUNTED,a),o.removeEventListener(Ad.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),eS=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="image-loader",e}return ue(e,t),e.prototype.init=function(){this.context.imagePool=new Jk(this.context.config),this.addRenderingPlugin(new tS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Cl),nS=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=A(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,e){var n=this.canvasConfig.devicePixelRatio||Ih&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Ih&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(yd.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),pe(this,void 0,void 0,(function(){var e,n;return ge(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),rS=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-context-register",e}return ue(e,t),e.prototype.init=function(){this.context.ContextService=nS},e.prototype.destroy=function(){delete this.context.ContextService},e}(Cl),iS=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new rS),n.registerPlugin(new eS),n.registerPlugin(new vk),n.registerPlugin(new Uk),n.registerPlugin(new Kk),n.registerPlugin(new Wk),n.registerPlugin(new Qk),n}return ue(e,t),e}(Nl),oS=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(t){return pe(n,void 0,void 0,(function(){var n,o,h,d,p,g;return ge(this,(function(m){switch(m.label){case 0:if(!s){if(n=t.timeStamp-c,o=$e([t.clientX,t.clientY],l),n<=this.dragndropPluginOptions.dragstartTimeThreshold||o<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];t.type="dragstart",a.dispatchEvent(t),s=!0}return t.type="drag",t.dx=t.clientX-f[0],t.dy=t.clientY-f[1],a.dispatchEvent(t),f=[t.clientX,t.clientY],r?[3,2]:(h="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(h[0],h[1])]);case 1:d=m.sent(),p=d[d.indexOf(e)+1],g=(null==p?void 0:p.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),u!==g&&(u&&(t.type="dragleave",t.target=u,u.dispatchEvent(t)),g&&(t.type="dragenter",t.target=g,g.dispatchEvent(t)),(u=g)&&(t.type="dragover",t.target=u,u.dispatchEvent(t))),m.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))},t.tag="Dragndrop",t}(),aS=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new oS(fe({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(Cl),sS=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),cS=sS;const lS={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},uS=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];function fS(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):Ui}function hS(t){return t instanceof Float32Array||t instanceof Array}var dS=window&&window.__read||function(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},pS=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function gS(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var mS=window&&window.__read||function(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},yS=function(t,e,n,r,i){var o,a,s=mS(t,2),c=s[0],l=s[1],u=et();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o},vS=window&&window.__read||function(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},bS=function(t,e,n,r,i){var o=new Zo({range:[e,e+r]}),a=new Zo({range:[n,n+i]});return{transform:function(t){var e=vS(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=vS(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},xS=window&&window.__read||function(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},wS=function(t,e,n,r,i){return(0,xS(t,1)[0])(e,n,r,i)},MS=window&&window.__read||function(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},ES=function(t,e,n,r,i){return MS(t,1)[0]},OS=window&&window.__read||function(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},kS=function(t,e,n,r,i){var o=OS(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new Zo({range:[c,l]}),f=new Zo({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=OS(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*d)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=OS(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=gS(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},SS=window&&window.__read||function(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},AS=function(t,e,n,r,i){return{transform:function(t){var e=SS(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=SS(t,2),n=e[0];return[e[1],n]}}},TS=window&&window.__read||function(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},_S=function(t,e,n,r,i){var o,a,s=TS(t,2),c=s[0],l=s[1],u=et();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},PS=window&&window.__read||function(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},CS=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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))},NS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return _S.apply(void 0,CS([[-1,-1]],PS(e),!1))},LS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return _S.apply(void 0,CS([[-1,1]],PS(e),!1))},jS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return _S.apply(void 0,CS([[1,-1]],PS(e),!1))},RS=window&&window.__read||function(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},IS=function(t,e,n,r,i){var o=RS(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(et(),o)},BS=window&&window.__read||function(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},DS=function(t,e,n,r,i){var o=BS(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new Zo({range:[c,c+.99*l]}),h=new Zo({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=BS(t,2),n=e[0],r=e[1],i=h.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=BS(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),d=gS(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*d;return[h.invert(d),f.invert(m)]}}},FS=window&&window.__read||function(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},zS=function(t,e,n,r,i){var o=FS(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new Zo({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new Qo({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},GS=window&&window.__read||function(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 WS(t){return 1/Math.tan(t)}var $S=function(t,e,n,r,i){var o=WS(GS(t,1)[0]);return{transform:function(t){var e=GS(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=GS(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},HS=function(t,e,n,r,i){var o=WS(GS(t,1)[0]);return{transform:function(t){var e=GS(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=GS(t,2),n=e[0];return[n,e[1]-n*o]}}},VS=window&&window.__read||function(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 YS(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function qS(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function US(t,e,n){return n?new Zo({range:[0,1],domain:[0,e]}).map(t):t}var XS=function(t,e,n,r,i){var o=VS(t,3),a=o[0],s=o[1],c=o[2],l=US(a,r,void 0!==c&&c);return{transform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[YS(n,l,s,0,1),r]},untransform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[qS(n,l,s,0,1),r]}}},KS=function(t,e,n,r,i){var o=VS(t,3),a=o[0],s=o[1],c=o[2],l=US(a,i,void 0!==c&&c);return{transform:function(t){var e=VS(t,2);return[e[0],YS(e[1],l,s,0,1)]},untransform:function(t){var e=VS(t,2);return[e[0],qS(e[1],l,s,0,1)]}}},ZS=function(t,e,n,r,i){var o=VS(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=US(a,r,f),d=US(s,i,f);return{transform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[YS(n,h,c,0,1),YS(r,d,l,0,1)]},untransform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[qS(n,h,c,0,1),qS(r,d,l,0,1)]}}},QS=function(t,e,n,r,i){var o=VS(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new Zo({range:[0,r]}),d=new Zo({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=VS(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=YS(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]},untransform:function(t){var e=VS(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=qS(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]}}},JS=window&&window.__read||function(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},tA=function(t,e,n,r,i,o,a){var s=new Zo({range:[e,e+i]}),c=new Zo({range:[n,n+o]}),l=new Zo({range:[r,r+a]});return{transform:function(t){var e=JS(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=JS(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},eA=window&&window.__read||function(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},nA=function(t,e,n,r,i,o,a){var s=eA(t,3),c=s[0],l=s[1],u=s[2];return mt(rt(),[c,l,u])},rA=window&&window.__read||function(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},iA=function(t,e,n,r,i,o,a){var s=rA(t,3),c=s[0],l=s[1],u=s[2];return yt(rt(),[c,l,u])},oA=window&&window.__read||function(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},aA=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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))},sA=window&&window.__values||function(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.")},cA=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:bS,translate:yS,custom:wS,matrix:ES,polar:kS,transpose:AS,scale:_S,"shear.x":$S,"shear.y":HS,reflect:NS,"reflect.x":LS,"reflect.y":jS,rotate:IS,helix:DS,parallel:zS,fisheye:ZS,"fisheye.x":XS,"fisheye.y":KS,"fisheye.circular":QS},this.update(t)}return t.prototype.update=function(t){this.options=Yi({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:aA(aA([],oA(n),!1),[aA([],oA(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?aA([],oA(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,pS([],dS(o),!1))}return n}}(t):t)};try{for(var c=sA(r),l=c.next();!l.done;l=c.next()){var u=oA(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.width,v=p.height,b=d(aA([],oA(h),!1),g,m,y,v);if(hS(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||Ui,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return fS.apply(void 0,aA([],oA(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=et();return e&&t.reverse(),t.forEach((function(t){return nt(i,i,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,h=-u*o+s*c,d=l*o-a*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(i,(n=i,(r=new tt(9))[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r)),function(t){var e=[t[0],t[1],1];return Ut(e,e,i),[e[0],e[1]]}},t}(),lA=window&&window.__read||function(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},uA=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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))},fA=window&&window.__values||function(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.")},hA=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:tA,translate3D:nA,scale3D:iA},this.update(t)}return t.prototype.update=function(t){this.options=Yi({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:uA(uA([],lA(n),!1),[uA([],lA(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?uA([],lA(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,pS([],dS(o),!1))}return n}}(t):t)};try{for(var c=fA(r),l=c.next();!l.done;l=c.next()){var u=lA(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.z,v=p.width,b=p.height,x=p.depth,w=d(uA([],lA(h),!1),g,m,y,v,b,x);if(hS(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||Ui,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return fS.apply(void 0,uA([],lA(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=rt();return e&&t.reverse(),t.forEach((function(t){return Ct(n,n,t)})),e&&lt(n,it(n)),function(t){var e=[t[0],t[1],t[2],1];return Jt(e,e,n),[e[0],e[1],e[2]]}},t}();function dA(t){return(e,...n)=>Y({},t(e,...n),e)}function pA(t){return(e,...n)=>Y({},e,t(e,...n))}function gA(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=he(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const mA=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=he(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:gA(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};mA.props={};const yA=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:o}=t,[a,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),h=r.map((t=>f*(t/u))),d=[];let p=t[a]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=he(r,["data"]),g=gA(u,o);d.push(Object.assign({[a]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};yA.props={};const vA=()=>t=>{const{children:e}=t,n=he(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=he(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=he(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:gA(e,r),scale:Y({},i,n),encode:Y({},s,f),transform:[...c,...h],axis:!(!l||!o)&&Y({},o,l),legend:!(!u||!a)&&Y({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};vA.props={};const bA=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,data:x,coordinate:w,theme:M,component:E,interaction:O,x:k,y:S,z:A,key:T,frame:_,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=he(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:k,y:S,z:A,key:T,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:M,coordinate:w,component:E,interaction:O,frame:_,labelTransform:P,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${T}-0`,data:x}),t&&{title:j})]})]};bA.props={};class xA{constructor(t){this.$value=t}static of(t){return new xA(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const wA=dA((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=Pn(n,(e=>e[t])),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),c=s.map((t=>a.has(t)?a.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}})),MA=dA((t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const t=r.shift(),{children:e,encode:n={},scale:s={},legend:c={}}=t,{color:l}=n,{color:u}=s,{color:f}=c;void 0!==l&&(i=l),void 0!==u&&(o=u),void 0!==f&&(a=f),Array.isArray(e)&&r.push(...e)}const s="string"==typeof i?i:"",[c,l]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===i)return[void 0];const o="function"==typeof i?i:t=>t[i],a=e.map(o);return a.some((t=>"number"==typeof t))?[kn(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:Y({},o,{domain:c,type:l})},legend:{color:Y({title:s},a)}}})),EA=dA((()=>({animate:{enterType:"fadeIn"}}))),OA=pA((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),kA=pA((()=>({type:"cell"}))),SA=pA((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map((t=>t[r])))):[],a=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map((t=>({[r]:t}))):a.length?a.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),AA=pA(((t,e=TA,n=PA,r=CA,i={})=>{const{data:o,encode:a,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=o,{x:p,y:g}=a,{color:m}=c,{domain:y}=m;return{children:(t,o,a)=>{const{x:c,y:m}=o,{paddingLeft:v,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:M}=c.getOptions(),{domain:E}=m.getOptions(),O=vr(t),k=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),m.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),T=A.map((t=>d.filter(t))),_=f?qn(T,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:M.indexOf(t),columnValue:t,columnValuesLength:M.length,rowField:g,rowIndex:E.indexOf(e),rowValue:e,rowValuesLength:E.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return O.flatMap((t=>{const[e,o,a,s]=k[t],c=P[t],f=T[t];return C[t].map((m=>{var M,E,{scale:O,key:k,facet:S=!0,axis:A={},legend:T={}}=m,P=he(m,["scale","key","facet","axis","legend"]);const C=(null===(M=null==O?void 0:O.y)||void 0===M?void 0:M.guide)||A.y,N=(null===(E=null==O?void 0:O.x)||void 0===E?void 0:E.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:y}},I={x:NA(N,n)(c,j),y:NA(C,r)(c,j)};return Object.assign(Object.assign({key:`${k}-${t}`,data:j,margin:0,x:e+v+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:_,scale:Y(L,O,R),axis:Y({},A,I),legend:!1},P),i)}))}))}}}));function TA(t){const{points:e}=t;return us(e)}function _A(t,e){return e.length?Y({title:!1,tick:null,label:null},t):Y({title:!1,tick:null,label:null,grid:null},t)}function PA(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return _A(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Y({title:s,grid:c},t)}}function CA(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return _A(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Y({title:o,grid:a},t)}}function NA(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const LA=()=>t=>[xA.of(t).call(kA).call(MA).call(EA).call(wA).call(OA).call(SA).call(AA).value()];LA.props={};const jA=dA((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),RA=pA((t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(t,a,s)=>{const{x:c,y:l}=a,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),m=vr(t),y=t.map((({points:t})=>us(t))),v=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=v.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return m.flatMap((t=>{const[n,a,s,c]=y[t],[l,p]=v[t],g=b[t];return x[t].map((m=>{var y,v;const{scale:b,key:x,encode:w,axis:M,interaction:E}=m,O=he(m,["scale","key","encode","axis","interaction"]),k=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,S={x:BA(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:DA(k)(g,e)};return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+h,y:a+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Y({x:{facet:!1},y:{facet:!1}},b),axis:Y({x:{tickCount:5},y:{tickCount:5}},M,S),legend:!1,encode:Y({},w,{x:l,y:p}),interaction:Y({},E,{legendFilter:!1})},O)}))}))}}})),IA=pA((t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=he(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[o].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[o].flat(1).length&&{y:{paddingInner:0}})})}));function BA(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return _A(t,n)}}function DA(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return _A(t,n)}}const FA=()=>t=>[xA.of(t).call(kA).call(MA).call(RA).call(IA).call(EA).call(OA).call(jA).value()],zA=dA((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),GA=dA((t=>({coordinate:{type:"polar"}}))),WA=t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function $A(t){return t=>null}function HA(t){const{points:e}=t,[n,r,i,o]=e,a=as(n,o),s=is(n,o),c=ls(s,is(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=cs(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d+g*Math.cos(p)-f/2,f,f]}const VA=()=>t=>[xA.of(t).call(kA).call(WA).call(MA).call(GA).call(SA).call(AA,HA,$A,$A,{frame:!1}).call(EA).call(OA).call(zA).value()];function YA(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const qA=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=Y({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=YA(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function UA(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function XA(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function KA(t,e,n,r=(t=>!0)){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=XA(o,(t=>"element"===t.className));const c=function(t){return XA(t,(t=>"component"===t.className))}(o),l=s||c;if(!l)return;const{className:u,markType:f}=l;if("element"===u){const r=Object.assign(Object.assign({},i),{nativeEvent:!0,data:{data:UA(l,e)}});n.emit(`element:${t}`,r),n.emit(`${f}:${t}`,r)}else{const e=Object.assign(Object.assign({},i),{nativeEvent:!0});n.emit(`component:${t}`,e),n.emit(`${a}:${t}`,e)}}}function ZA(){return(t,e,n)=>{const{container:r,view:i}=t,o=KA(lS.CLICK,i,n,(t=>1===t.detail)),a=KA(lS.DBLCLICK,i,n,(t=>2===t.detail)),s=KA(lS.POINTER_TAP,i,n),c=KA(lS.POINTER_DOWN,i,n),l=KA(lS.POINTER_UP,i,n),u=KA(lS.POINTER_OVER,i,n),f=KA(lS.POINTER_OUT,i,n),h=KA(lS.POINTER_MOVE,i,n),d=KA(lS.POINTER_ENTER,i,n),p=KA(lS.POINTER_LEAVE,i,n),g=KA(lS.POINTER_UPOUTSIDE,i,n),m=KA(lS.DRAG_START,i,n),y=KA(lS.DRAG,i,n),v=KA(lS.DRAG_END,i,n),b=KA(lS.DRAG_ENTER,i,n),x=KA(lS.DRAG_LEAVE,i,n),w=KA(lS.DRAG_OVER,i,n),M=KA(lS.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",m),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function QA(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":aO,"component.axisLinear":eO,"component.axisArc":nO,"component.legendContinuousBlock":mO,"component.legendContinuousBlockSize":vO,"component.legendContinuousSize":yO,"interaction.event":ZA,"composition.mark":bA,"composition.view":vA,"shape.label.label":Mw}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||ar(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=he(t,["type"]);return r(n)(i,e)},r]}function JA(t){const{canvas:e,group:n}=t;return n?n.ownerDocument:e.document}function tT(t,e){const{coordinate:n={}}=t,r=he(t,["coordinate"]),{type:i,transform:o=[]}=n,a=he(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=QA("coordinate",e),{transform:c=!1}=s(i).props||{};if(c)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function eT(t,e){return t.filter((t=>t.type===e))}function nT(t){return eT(t,"polar").length>0}function rT(t){return eT(t,"transpose").length%2==1}function iT(t){return eT(t,"theta").length>0}function oT(t){return eT(t,"radial").length>0}function aT(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}qA.props={};var sT=aT("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),cT=aT("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),lT=aT("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),uT=aT("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),fT=aT("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),hT=aT("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),dT=aT("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),pT=aT("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),gT=aT("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),mT=aT("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function yT(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function vT(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function bT(){}var xT=.7,wT=1/xT,MT="\\s*([+-]?\\d+)\\s*",ET="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",OT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kT=/^#([0-9a-f]{3,8})$/,ST=new RegExp(`^rgb\\(${MT},${MT},${MT}\\)$`),AT=new RegExp(`^rgb\\(${OT},${OT},${OT}\\)$`),TT=new RegExp(`^rgba\\(${MT},${MT},${MT},${ET}\\)$`),_T=new RegExp(`^rgba\\(${OT},${OT},${OT},${ET}\\)$`),PT=new RegExp(`^hsl\\(${ET},${OT},${OT}\\)$`),CT=new RegExp(`^hsla\\(${ET},${OT},${OT},${ET}\\)$`),NT={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 LT(){return this.rgb().formatHex()}function jT(){return this.rgb().formatRgb()}function RT(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=kT.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?IT(e):3===n?new zT(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?BT(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?BT(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=ST.exec(t))?new zT(e[1],e[2],e[3],1):(e=AT.exec(t))?new zT(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=TT.exec(t))?BT(e[1],e[2],e[3],e[4]):(e=_T.exec(t))?BT(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=PT.exec(t))?YT(e[1],e[2]/100,e[3]/100,1):(e=CT.exec(t))?YT(e[1],e[2]/100,e[3]/100,e[4]):NT.hasOwnProperty(t)?IT(NT[t]):"transparent"===t?new zT(NaN,NaN,NaN,0):null}function IT(t){return new zT(t>>16&255,t>>8&255,255&t,1)}function BT(t,e,n,r){return r<=0&&(t=e=n=NaN),new zT(t,e,n,r)}function DT(t){return t instanceof bT||(t=RT(t)),t?new zT((t=t.rgb()).r,t.g,t.b,t.opacity):new zT}function FT(t,e,n,r){return 1===arguments.length?DT(t):new zT(t,e,n,null==r?1:r)}function zT(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function GT(){return`#${VT(this.r)}${VT(this.g)}${VT(this.b)}`}function WT(){const t=$T(this.opacity);return`${1===t?"rgb(":"rgba("}${HT(this.r)}, ${HT(this.g)}, ${HT(this.b)}${1===t?")":`, ${t})`}`}function $T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function HT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function VT(t){return((t=HT(t))<16?"0":"")+t.toString(16)}function YT(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new UT(t,e,n,r)}function qT(t){if(t instanceof UT)return new UT(t.h,t.s,t.l,t.opacity);if(t instanceof bT||(t=RT(t)),!t)return new UT;if(t instanceof UT)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,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new UT(a,s,c,t.opacity)}function UT(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function XT(t){return(t=(t||0)%360)<0?t+360:t}function KT(t){return Math.max(0,Math.min(1,t||0))}function ZT(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}yT(bT,RT,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:LT,formatHex:LT,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return qT(this).formatHsl()},formatRgb:jT,toString:jT}),yT(zT,FT,vT(bT,{brighter(t){return t=null==t?wT:Math.pow(wT,t),new zT(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?xT:Math.pow(xT,t),new zT(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zT(HT(this.r),HT(this.g),HT(this.b),$T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:GT,formatHex:GT,formatHex8:function(){return`#${VT(this.r)}${VT(this.g)}${VT(this.b)}${VT(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:WT,toString:WT})),yT(UT,(function(t,e,n,r){return 1===arguments.length?qT(t):new UT(t,e,n,null==r?1:r)}),vT(bT,{brighter(t){return t=null==t?wT:Math.pow(wT,t),new UT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?xT:Math.pow(xT,t),new UT(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new zT(ZT(t>=240?t-240:t+120,i,r),ZT(t,i,r),ZT(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new UT(XT(this.h),KT(this.s),KT(this.l),$T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=$T(this.opacity);return`${1===t?"hsl(":"hsla("}${XT(this.h)}, ${100*KT(this.s)}%, ${100*KT(this.l)}%${1===t?")":`, ${t})`}`}}));const QT=Math.PI/180,JT=180/Math.PI;var t_=-.14861,e_=1.78277,n_=-.29227,r_=-.90649,i_=1.97294,o_=i_*r_,a_=i_*e_,s_=e_*n_-r_*t_;function c_(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof l_)return new l_(t.h,t.s,t.l,t.opacity);t instanceof zT||(t=DT(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(s_*r+o_*e-a_*n)/(s_+o_-a_),o=r-i,a=(i_*(n-i)-n_*o)/r_,s=Math.sqrt(a*a+o*o)/(i_*i*(1-i)),c=s?Math.atan2(a,o)*JT-120:NaN;return new l_(c<0?c+360:c,s,i,t.opacity)}(t):new l_(t,e,n,null==r?1:r)}function l_(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}yT(l_,c_,vT(bT,{brighter(t){return t=null==t?wT:Math.pow(wT,t),new l_(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?xT:Math.pow(xT,t),new l_(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*QT,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new zT(255*(e+n*(t_*r+e_*i)),255*(e+n*(n_*r+r_*i)),255*(e+n*(i_*r)),this.opacity)}}));var u_=t=>()=>t;function f_(t,e){return function(n){return t+n*e}}function h_(t){return 1==(t=+t)?d_:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):u_(isNaN(e)?n:e)}}function d_(t,e){var n=e-t;return n?f_(t,n):u_(isNaN(t)?e:t)}!function t(e){var n=h_(e);function r(t,e){var r=n((t=FT(t)).r,(e=FT(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=d_(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var p_,g_=(p_=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=FT(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=p_(i),o=p_(o),a=p_(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function m_(t){return function e(n){function r(e,r){var i=t((e=c_(e)).h,(r=c_(r)).h),o=d_(e.s,r.s),a=d_(e.l,r.l),s=d_(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}m_((function(t,e){var n=e-t;return n?f_(t,n>180||n<-180?n-360*Math.round(n/360):n):u_(isNaN(t)?e:t)}));var y_=m_(d_),v_=t=>g_(t[t.length-1]),b_=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(aT),x_=v_(b_),w_=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(aT),M_=v_(w_),E_=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(aT),O_=v_(E_),k_=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(aT),S_=v_(k_),A_=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(aT),T_=v_(A_),__=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(aT),P_=v_(__),C_=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(aT),N_=v_(C_),L_=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(aT),j_=v_(L_),R_=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(aT),I_=v_(R_),B_=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(aT),D_=v_(B_),F_=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(aT),z_=v_(F_),G_=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(aT),W_=v_(G_),$_=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(aT),H_=v_($_),V_=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(aT),Y_=v_(V_),q_=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(aT),U_=v_(q_),X_=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(aT),K_=v_(X_),Z_=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(aT),Q_=v_(Z_),J_=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(aT),tP=v_(J_),eP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(aT),nP=v_(eP),rP=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(aT),iP=v_(rP),oP=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(aT),aP=v_(oP),sP=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(aT),cP=v_(sP),lP=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(aT),uP=v_(lP),fP=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(aT),hP=v_(fP),dP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(aT),pP=v_(dP),gP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(aT),mP=v_(gP),yP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(aT),vP=v_(yP);var bP=y_(c_(300,.5,0),c_(-240,.5,1)),xP=y_(c_(-100,.75,.35),c_(80,1.5,.8)),wP=y_(c_(260,.75,.35),c_(80,1.5,.8)),MP=c_();var EP=FT(),OP=Math.PI/3,kP=2*Math.PI/3;function SP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var AP=SP(aT("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),TP=SP(aT("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),_P=SP(aT("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),PP=SP(aT("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),CP=Object.freeze({__proto__:null,schemeCategory10:sT,schemeAccent:cT,schemeDark2:lT,schemePaired:uT,schemePastel1:fT,schemePastel2:hT,schemeSet1:dT,schemeSet2:pT,schemeSet3:gT,schemeTableau10:mT,interpolateBrBG:x_,schemeBrBG:b_,interpolatePRGn:M_,schemePRGn:w_,interpolatePiYG:O_,schemePiYG:E_,interpolatePuOr:S_,schemePuOr:k_,interpolateRdBu:T_,schemeRdBu:A_,interpolateRdGy:P_,schemeRdGy:__,interpolateRdYlBu:N_,schemeRdYlBu:C_,interpolateRdYlGn:j_,schemeRdYlGn:L_,interpolateSpectral:I_,schemeSpectral:R_,interpolateBuGn:D_,schemeBuGn:B_,interpolateBuPu:z_,schemeBuPu:F_,interpolateGnBu:W_,schemeGnBu:G_,interpolateOrRd:H_,schemeOrRd:$_,interpolatePuBuGn:Y_,schemePuBuGn:V_,interpolatePuBu:U_,schemePuBu:q_,interpolatePuRd:K_,schemePuRd:X_,interpolateRdPu:Q_,schemeRdPu:Z_,interpolateYlGnBu:tP,schemeYlGnBu:J_,interpolateYlGn:nP,schemeYlGn:eP,interpolateYlOrBr:iP,schemeYlOrBr:rP,interpolateYlOrRd:aP,schemeYlOrRd:oP,interpolateBlues:cP,schemeBlues:sP,interpolateGreens:uP,schemeGreens:lP,interpolateGreys:hP,schemeGreys:fP,interpolatePurples:pP,schemePurples:dP,interpolateReds:mP,schemeReds:gP,interpolateOranges:vP,schemeOranges:yP,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:bP,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return MP.h=360*t-100,MP.s=1.5-1.5*e,MP.l=.8-.9*e,MP+""},interpolateWarm:xP,interpolateCool:wP,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,EP.r=255*(e=Math.sin(t))*e,EP.g=255*(e=Math.sin(t+OP))*e,EP.b=255*(e=Math.sin(t+kP))*e,EP+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:AP,interpolateMagma:TP,interpolateInferno:_P,interpolatePlasma:PP});function NP(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return XP(t,pr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return $P(t,s);if(void 0!==i)return qP([i])?$P(t,s):UP(e)?"time":HP(t,o,a);return qP(e)?$P(t,s):UP(e)?"time":HP(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return VP(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)cr(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return YP(n);case"quantile":return function(t){return YP(t).sort()}(n);case"sequential":return VP(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)cr(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(FP({type:t}))return function(t,e,n){const r=t.map(Number),i=new Zo({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return zP({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=xo,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?iT(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=B(e),i=CP[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:GP(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function LP(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>o.map(t)))}}return n}function jP(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e,key:i}=r.getOptions();if("string"==typeof i)i in t||(t[i]=r);else if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),o=qn(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function RP(t,e){const[n]=QA("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[rr,rr];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter((([t])=>"function"==typeof t)),a=t.filter((([t])=>"function"!=typeof t)),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(a.map((([t,e])=>[e,t]))),l=new Map(o.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function IP(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));DP(e,"x"),DP(e,"y")}function BP(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function DP(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(FP)?kn(r):n.every(zP)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function FP(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function zP(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function GP(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=WP(n,r,i,o,a),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[br(e),xr(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[c||s,l||u]}case"band":case"point":return[c||("size"===e?5:0),l||("size"===e?10:1)];case"ordinal":return WP(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function WP(t,e,n,r,i){const[o]=QA("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(t.flat()).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const r=B(t),i=CP[`scheme${r}`],o=CP[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>o(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function $P(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function HP(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function VP(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function YP(t){return Array.from(new Set(t.flat()))}function qP(t){return XP(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function UP(t){return XP(t,(t=>t instanceof Date))}function XP(t,e){for(const n of t)if(n.some(e))return!0;return!1}const KP={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},ZP={threshold:"threshold",quantize:"quantize",quantile:"quantile"},QP={ordinal:"ordinal",band:"band",point:"point"},JP={constant:"constant"};function tC(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=QA("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=QA("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?rT(n)?`${e}Y`:`${e}X`:"y"===t?rT(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t)));return[...rC(n),...oC(n,e)]}(a,r);return l.forEach((([t,e])=>{const{props:n}=o(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=Y({},...e),{guide:m,field:y}=g,v=Array.isArray(m)?m:[m];for(const n of v){const[o,g]=cC(t,i,l,n,e,a,r);if(!o&&!g)continue;const m="left"===o||"right"===o,v=m?d[1]:d[0],b=m?p[1]:p[0],{size:x,order:w=f,length:M=h,padding:E=v,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:M,position:o,plane:c,orientation:g,padding:E,order:w,crossPadding:O,size:x,type:t,scales:e}))}})),s}function eC(t,e,n,r,i){const[o]=QA("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(he(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function nC(t,e){const n=["left","right","bottom","top"],r=Cn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=nr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=qn(t,(t=>t.size)),r=qn(t,(t=>t.order)),i=qn(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function rC(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),o=Cn(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),a=new Map(o);if(0===a.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(a).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...Mr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,iC(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of uS)for(const{option:r,combination:i}of n)if(e.some((t=>U(s(t),s(r)))))return[t,i];return null})).filter(cr);return c}function iC(t){const{type:e}=t;return"string"!=typeof e?null:e in KP?"continuous":e in QP?"discrete":e in ZP?"distribution":e in JP?"constant":null}function oC(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return eT(t,"helix").length>0}(e)||iT(e))return null;if(rT(e)&&(nT(e)||oT(e)))return null;if(n.startsWith("x"))return nT(e)?["axisArc",[t]]:oT(e)?["axisLinear",[t]]:[rT(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return nT(e)?["axisLinear",[t]]:oT(e)?["axisArc",[t]]:[rT(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return eT(t,"radar").length>0}(e))return["axisRadar",[t]];if(!nT(e))return["axisY",[t]]}return null})).filter(cr)}function aC(t){const e=eT(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=eT(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=a(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function sC(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=aC(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return eT(t,"parallel").length>0}(i))return rT(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=aC(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:nT(i)||oT(i)?["center",null]:"axisX"===t&&function(t){return eT(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return eT(t,"reflectY").length>0}(i)?["top",null]:e}function cC(t,e,n,r,i,o,a){const[s]=aC(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?sC(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&nT(a)&&"center"===r.position?["center","vertical"]:c}function lC(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?pC:s.startsWith("group")?uC:s.startsWith("legendContinuous")?gC:"legendCategory"===s?mC:s.startsWith("slider")?dC:"title"===s?hC:s.startsWith("scrollbar")?fC:()=>{})(t,e,n,r,i,o)}function uC(t,e,n,r,i,o){const{children:a}=t,s=qn(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>lC(t,e,n,r,i,o)));const c=qn(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function fC(t,e,n,r,i,o){const{trackSize:a=6}=Y({},i.scrollbar,t);t.size=a}function hC(t,e,n,r,i,o){const a=Y({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=he(a,["title","subtitle","spacing"]);if(s){const e=MC(s,ur(u,"title"));t.size=e.height}if(c){const e=MC(c,ur(u,"subtitle"));t.size+=l+e.height}}function dC(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return Y({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function pC(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=xC(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0}=s,f=he(s,["tickLength","labelSpacing","titleSpacing"]),h=yC(t,o),d=vC(f,h),p=c+l;if(d&&d.length){const r=qn(d,(t=>t.width)),i=qn(d,(t=>t.height));if(a)t.size=r+p;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=nr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=wC(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const o=c[t+1];if(o){const[n]=h(o,e[t+1]);if(i>n)return!0}}return!1}(h,d,e,n,o)||a?t.size=i+p:(t.labelTransform="rotate(90)",t.size=r+p)}}else t.size=c;const g=bC(f);g&&(t.size+=a?u+g.width:u+g.height)}function gC(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return Y({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=he(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=ur(l,"ribbon"),{size:h}=f,d=ur(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const m=vC(l,yC(t,o));if(m){const e=u?"width":"height",n=qn(m,(t=>t[e]));t.size+=n+s}const y=bC(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function mC(t,e,n,r,i,o){const a=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,o]=Array.isArray(n)?[n,void 0]:[void 0,n];return Y({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=a,p=he(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:m}=t,y=t=>Math.min(t,d),v=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===m?e+(b?0:n[0]+n[1]):m,w=bC(p),M=vC(p,yC(t,o),"itemLabel"),E=Math.max(M[0].height,c)+u,O=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of M){const s=O(t);e=Math.max(e,s),n+E>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=E):(n+=E,i++)}r<=1&&(o=i,a=n),t.size=e*v(r),t.length=a+s,Y(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(M.length/g),n=qn(M,(t=>O(t.width)))*g;t.size=E*y(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of M){const i=O(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function yC(t,e){const[n]=QA("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(a.tickCount=i),void 0!==o&&(a.tickMethod=o),n(a)}function vC(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=he(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=wC(t,n),i=r.map((t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e})),o=e?"string"==typeof e?jE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=ur(a,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>MC(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function bC(t){const{title:e}=t,n=he(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=ur(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return MC(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function xC(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${or(e)}`]:s}=n;return Y({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function wC(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function MC(t,e){const n=function(t){return t instanceof op?t:new vp({style:{text:`${t}`}})}(t),r=he(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function EC(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:m=h,margin:y=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:v=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:M=n.padding,paddingBottom:E=M,paddingLeft:O=M,paddingRight:k=M,paddingTop:S=M}=function(t,e,n,r){const{coordinates:i}=e;if(!nT(i)&&!oT(i))return e;const o=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===o.length)return e;const a=o.map((t=>xC(t,"axisArc"===t.type?"arc":"linear",n))),s=qn(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>vC(a[e],yC(t,r)))).filter(cr),l=qn(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>bC(a[e]))).filter((t=>null!==t)),f=0===u.length?0:qn(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:m=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:m})}(t,e,n,r),A=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},T=t=>"auto"===t?20:null!=t?t:20,_=T(S),P=T(E),C=OC(t,s-_-P,[_+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-v-w,[R,I]=A(j,O,k,N,L),B=j-R-I,D=OC(t,B,[R+v,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=D,G=s-b-x,[W,$]=A(G,E,S,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:m,innerWidth:B,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:v,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function OC(t,e,n,r,i,o,a){const s=Pn(t,(t=>t.position)),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${or(cw(t))}`;or(cw(t));const i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=qn(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(lC(r,e,n,t,o,a),l(r)))},h="bottom"===t||"top"===t,p=Xn(i,(t=>t.order)),g=i.filter((t=>t.type.startsWith("axis")&&t.order==p));if(g.length&&(g[0].crossPadding=0),"number"==typeof c)i.forEach(l);else if(0===i.length)d[r]=0;else{const t=nC(i,h?e+n[0]+n[1]:e);t.forEach(f);const o=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);d[r]=o}}return d}function kC({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const m=n+a,y=i+s,v=r+l,b=o+c,x=t-a-l,w=[m+d,y+g,f-d-p,u-g-h,"center",null,null];return{top:[m,0,f,y,"vertical",!0,dn,a,x],right:[t-v,y,v,u,"horizontal",!1,dn],bottom:[m,e-b,f,b,"vertical",!1,dn,a,x],left:[0,y,m,u,"horizontal",!0,dn],"top-left":[m,0,f,y,"vertical",!0,dn],"top-right":[m,0,f,y,"vertical",!0,dn],"bottom-left":[m,e-b,f,b,"vertical",!1,dn],"bottom-right":[m,e-b,f,b,"vertical",!1,dn],center:w,inner:w,outer:w}}function SC(t,e,n,r){const[i,o]=wr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return kc(t)&&Mc(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Mc(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):kc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=Tc(e),l=c*(o/2),u=a-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=Tc(e),c=a/2*s/Math.sqrt(2),l=r+o/2,u=i+a/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(o,e,n)}function AC(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,m,y,v,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,M=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+y:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:o}=r,{size:a}=r;r.bbox={[h]:c?n-a-i:n+i,[p]:M(o,g,u),[m]:a,[v]:w(o,b,f)},n+=(a+i)*(c?-1:1)}const E=t.filter((t=>"group"===t.type));for(const t of E){const{bbox:e,children:n}=t,r=e[v],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-nr(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[m]:e[m],[h]:e[h],[p]:r,[v]:a[t]-c},Y(i,{layout:{justifyContent:o}}),r+=a[t]}}}function TC(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=he(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function _C(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=QA("data",t),o=function(t){if(_(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=he(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[he(o,["transform"]),...a].map(i),c=yield function(t){return t.reduce(((t,e)=>n=>pe(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),rr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?vr(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function PC(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function CC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=yr(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return cr(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:o})]}function NC(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=yr(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function LC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=QA("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:zC(n)})}(o),s=yr(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function jC(t,e,n){const{tooltip:r={}}=e;return gr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:pr(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function RC(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(gr(o))return[t,e];const a=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(pr(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?jE(c):c,u=o&&i[o],f=u&&i[o].field,h=s||f||o,d=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;d[e]={name:h,color:a,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);pr(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=he(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(c)?c.map(a):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function IC(t,e,n){const{encode:r}=e,i=he(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,o=he(n,["value"]);for(let n=0;n<i.length;n++){const o=i[n];if(Array.isArray(o))for(let i=0;i<o.length;i++){const a=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];a[1][n]=o[i],r[i]=a}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},o)]))})),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function BC(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return Y(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(a,t);return[t,Object.assign({guide:s(r,t),slider:s(o,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function DC(t,e,n){const{animate:r}=e;return r||void 0===r||Y(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function FC(t,e,n){return pe(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:r}=n,[i]=QA("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[TC,_C,PC,CC,NC,LC,IC,DC,BC,jC,...o.map(i),...s.map(i),...a.map(i),RC];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,r),{encode:a,scale:s,data:c,tooltip:l}=o;if(!1===Array.isArray(c))return null;const{channels:u}=e,f=Ln(Object.entries(a).filter((([,t])=>cr(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=u.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),h=u.filter((t=>{const{name:e,required:n}=t;if(f.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:a}=t;return f.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=s[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=he(f,["independent","key","type"]),m="constant"===p,y=m?void 0:i;return{name:t,values:e,scaleKey:h||m?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:y},g),{quantitative:o,ordinal:a})}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:h,tooltip:l})]}))}function zC(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function GC(t,e,n,r){var i,o;return pe(this,void 0,void 0,(function*(){const[a]=QA("composition",n),[s]=QA("interaction",n),c=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),l=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),u=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:c.has(e)||l.has(e)?"mark":e},f=t=>"mark"===u(t),h=t=>"standardView"===u(t),d=t=>{const{type:e}=t;return"string"==typeof e&&!!l.has(e)},p=t=>{if(h(t))return[t];const e=u(t);return a({type:e,static:d(t)})(t)},g=[],m=new Map,y=new Map,v=[t],b=[];for(;v.length;){const t=v.shift();if(h(t)){const e=y.get(t),[r,i]=e?YC(e,t,n):yield $C(t,n);m.set(r,t),g.push(r);const o=i.flatMap(p).map((t=>tT(t,n)));if(v.push(...o),o.every(h)){const t=yield Promise.all(o.map((t=>HC(t,n))));IP(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];y.set(n,r)}}}else{const e=p(f(t)?t:yield sN(t,n));Array.isArray(e)?v.push(...e):"function"==typeof e&&b.push(e())}}r.emitter.emit(lS.BEFORE_PAINT);const x=new Map,w=new Map,M=[];e.selectAll(fN(ak)).data(g,(t=>t.key)).join((t=>t.append("g").attr("className",ak).attr("id",(t=>t.key)).call(WC).each((function(t,e,i){qC(t,Dg(i),M,n,r),x.set(t,i)}))),(t=>t.call(WC).each((function(t,e,i){qC(t,Dg(i),M,n,r),w.set(t,i)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const E=t=>Array.from(t.entries()).map((([t,e])=>{const i=new Map,o=function(t,e,n){return r=>pe(this,void 0,void 0,(function*(){const i=[],[o,a]=yield $C(r,e);qC(o,t,i,e,n),function(t,e,n,r,i){var o;const[a]=QA("interaction",r),s=t.node(),c=s.nameInteraction,l=aN(e).find((([t])=>"tooltip"===t)),u=c.get("tooltip");if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=VC(n,"tooltip",l[1],a),h={options:e,view:n,container:t.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set("tooltip",{destroy:d})}(t,r,o,e,n);for(const r of a)GC(r,t,e,n);return{options:r,view:o}}))}(Dg(e),n,r),a=m.get(t);return{view:t,container:e,options:a,setState:(t,e=(t=>t))=>i.set(t,e),update:()=>pe(this,void 0,void 0,(function*(){const t=ir(Array.from(i.values()))(a);return yield o(t)}))}})),O=E(x);for(const t of O){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of aN(e)){const[e,o]=i;if(o){const i=VC(t.view,e,o,s)(t,O,r.emitter);n.set(e,{destroy:i})}}}const k=E(w);for(const t of k){const{options:e,container:n}=t,o=n.nameInteraction;for(const n of aN(e)){const[e,a]=n,c=o.get(e);if(c&&(null===(i=c.destroy)||void 0===i||i.call(c)),a){const n=VC(t.view,e,a,s)(t,k,r.emitter);o.set(e,{destroy:n})}}}const{width:S,height:A}=t,T=[];for(const t of b){const i=new Promise((i=>pe(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:S,height:A},i);yield GC(t,e,n,r)}i()}))));T.push(i)}r.views=g,null===(o=r.animations)||void 0===o||o.forEach((t=>null==t?void 0:t.cancel())),r.animations=M,r.emitter.emit(lS.AFTER_PAINT);const _=M.filter(cr).map(nN).map((t=>t.finished));return Promise.all([..._,...T])}))}function WC(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function $C(t,e){return pe(this,void 0,void 0,(function*(){const n=yield function(t,e){return pe(this,void 0,void 0,(function*(){const[n,r]=QA("mark",e),i=new Set(Object.keys(e).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),{marks:o}=t,a=[],s=[],c=[...o],{width:l,height:u}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:m=d,insetBottom:y=d}=t,v=t=>"auto"===t?20:t;return{width:n-v(i)-v(o)-l-u-p-g,height:e-v(a)-v(s)-f-h-m-y}}(t),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield sN(t,e),{type:l=ar("G2Mark type is required."),key:u}=o;if(i.has(l))s.push(o);else{const{props:t={}}=r(l),{composite:e=!0}=t;if(e){const{data:t}=o,e=Object.assign(Object.assign({},o),{data:t?Array.isArray(t)?t:t.value:t}),r=yield n(e,f),i=Array.isArray(r)?r:[r];c.unshift(...i.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else a.push(o)}}return Object.assign(Object.assign({},t),{marks:a,components:s})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=he(t,["coordinate","interaction","style","marks"]),a=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...a,e].reduceRight(((t,e)=>Y(t,e)),{}),u=[n,...s].reduce(((t,e)=>Y(t,e)),{}),f=[...c,r].reduce(((t,e)=>Y(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=tT(r,e);return YC(yield HC(i,e),i,e)}))}function HC(t,e){return pe(this,void 0,void 0,(function*(){const[n]=QA("theme",e),[,r]=QA("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(oN(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield FC(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=Pn(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>Y(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(cr))),c=Y({guide:{title:0===o.length?void 0:o},field:o[0]},n),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},NP(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function VC(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Y(o,Object.assign({type:e},n)))}function YC(t,e,n){const[r]=QA("mark",n),[i]=QA("theme",n),[o]=QA("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,h=i(oN(c)),d=Array.from(t.values()),p=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),a=new Map(o.map((t=>[t.name,t])));for(const t of r){const e=BP(t);for(const r of e){const e=a.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=Y({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:K(t,i)});o.push(e)}}}return o}(d,e),g=function(t){return t.map((t=>{const e=Y(t,t.style);return delete e.style,e}))}(tC(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(p),d,t),e,n)),m=EC(g,e,h,n),y=function(t,e,n){const[r]=QA("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-c,height:i-l-s,transformations:f.flatMap(r)});return d?new hA(p):new cA(p)}(m,e,n),v=s?Y({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=Pn(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y,height:v,width:b,depth:x}=n,w={xy:kC({width:b,height:v,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y}),yz:kC({width:x,height:v,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:v,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:kC({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=wr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&SC(a,e,o,i),s.length&&AC(n,0,o)}}(nC(g),y,m),function(t){const e=t.find((({type:t})=>"axisZ"===t));if(e){const n=t.find((({type:t})=>"axisX"===t));n.plane="xy";const r=t.find((({type:t})=>"axisY"===t));r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]}))}}(g);const b={};for(const t of g){const{scales:e=[]}=t,r=[];for(const t of e){const{name:e}=t,i=RP(t,n);r.push(i),jP(b,{[e]:i})}t.scaleInstances=r}const x=[];for(const[e,i]of t.entries()){const{children:t,dataDomain:o,modifier:s,key:c}=e,{index:l,channels:u,tooltip:f}=i,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=yr(h,(t=>RP(t,n)));jP(b,d);const p=LP(u,d),g=r(e),[v,w,M]=UC(g(l,d,p,y)),E=o||v.length,O=s?s(w,E,m):[],k=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},S=t=>f.items.map((e=>e[t])),A=v.map(((t,e)=>{const n=Object.assign({points:w[e],transform:O[e],index:t,markKey:c,viewKey:a},f&&{title:k(t),items:S(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],M&&(n[`series${B(r)}`]=M[e].map((t=>i[t])));return M&&(n.seriesIndex=M[e]),M&&f&&(n.seriesItems=M[e].map((t=>S(t))),n.seriesTitle=M[e].map((t=>k(t)))),n}));i.data=A,i.index=v;const T=null==t?void 0:t(A,d,m);x.push(...T||[])}return[{layout:m,theme:h,coordinate:y,markState:t,key:a,clip:l,scale:b,style:v,components:g,labelTransform:ir(f.map(o))},x]}function qC(t,e,n,r,i){return pe(this,void 0,void 0,(function*(){const{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:m,height:y}=s,v=he(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>fr(Object.assign({},a.view,f),t))),M=["a","margin","padding","inset"].map((t=>ur(v,t))),E=t=>t.style("x",(t=>T[t].x)).style("y",(t=>T[t].y)).style("width",(t=>T[t].width)).style("height",(t=>T[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Dg(n),w[t])}));let O=0,k=0,S=m,A=y;const T=x.map((t=>{const e=M[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return O+=n,k+=r,S-=n+o,A-=r+i,{x:O,y:k,width:S,height:A}}));e.selectAll(fN(uk)).data(x.filter((t=>cr(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",uk).style("zIndex",-2).call(E)),(t=>t.call(E)),(t=>t.remove()));const _=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:m=300,delay:y=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:v=m,exitDelay:b=y,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,v+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!_&&{duration:_[1]};for(const[,t]of Cn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(fN(ck)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",ck).append((t=>eC(Y({animate:P,scale:d},t),l,a,r,c)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=eC(Y({animate:P,scale:d},t),l,a,r,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s)})))).transitions();n.push(...C.flat().filter(cr));const N=e.selectAll(fN(sk)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",sk).call(cN).call(uN,Array.from(c.keys())).call(hN,h)),(t=>t.call(uN,Array.from(c.keys())).call((t=>_?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{x:o,y:a,width:s,height:c}=i.style,{paddingLeft:l,paddingTop:u,innerWidth:f,innerHeight:h,marginLeft:d,marginTop:p}=t,g=[{x:o,y:a,width:s,height:c},{x:l+d,y:u+p,width:f,height:h}];return i.animate(g,{delay:n,duration:r,fill:"both"})}))}(t,_):cN(t))).call(hN,h))).transitions();n.push(...N.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=QC(o,a,t,r,i),d=eN(o,a,t,r),p=rN(o,a,t,r),g=iN(o,a,t,r),m=KC(e,f,l,"element"),y=f.selectAll(fN(ok)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",ok).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=lr((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){ZC(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?sr(i,o):(i.parentNode.replaceChild(o,i),o.className=ok,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",ok)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(h).attr("className",ok).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Fg(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new Fg([],n.__toData__,n.parentNode).append(h).attr("className",ok).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=QA("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(fN(ik)).node(),l=new Map,u=new Map,f=Array.from(a.entries()).flatMap((([n,o])=>{const{labels:a=[],key:s}=n,c=function(t,e,n,r,i){const[o]=QA("shape",r),{data:a}=t,{data:s,defaultLabelShape:c}=e,l=s.map((t=>t.points)),{theme:u,coordinate:f}=n,h=Object.assign(Object.assign({},i),{document:JA(i),theme:u,coordinate:f});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=(t=>`${t}`),transform:s,style:f,render:d}=t,p=he(t,["formatter","transform","style","render"]),g=yr(Object.assign(Object.assign({},p),f),(t=>XC(t,r,e,a))),{shape:m=c,text:y}=g,v=he(g,["shape","text"]),b="string"==typeof i?jE(i):i,x=Object.assign(Object.assign({},v),{text:b(y,r,e,a),datum:r}),w=Object.assign({type:`label.${m}`,render:d},v);return o(w,h)(n,x,JC(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(fN(ok)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=he(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,c),u.set(e,t)})),i}))}))})),h=Dg(c).selectAll(fN(lk)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",lk)),(t=>t.each((function(t,e,n){sr(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Pn(h,(t=>u.get(t.__data__))),{coordinate:p}=t;for(const[t,e]of d){const{transform:n=[]}=t;ir(n.map(o))(e,p)}s&&s(h,p)}(t,e,0,r,i)}))}function UC([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const o=t[n],a=e[n];a.every((([t,e])=>cr(t)&&cr(e)))&&(r.push(o),i.push(a))}return[r,i]}function XC(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function KC(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function ZC(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-c})`),e.append(t)}function QC(t,e,n,r,i){const[o]=QA("shape",r),{data:a}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:h}=n,{type:d,style:p={}}=t,g=Object.assign(Object.assign({},i),{document:JA(i),coordinate:h,theme:f});return e=>{const{shape:n=s}=p,{shape:r=n,points:i,seriesIndex:c,index:h}=e,m=he(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},m),{index:h}),v=c?c.map((t=>a[t])):a[h],b=c||h,x=yr(p,(t=>XC(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:lN(t,r)}),g))(i,y,JC(f,d,r,s),u)}}function JC(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function tN(t,e,n,r,i){var o,a;const[,s]=QA("shape",i),[c]=QA("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${B(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(lN(e,l)).props,{[t]:g={}}=f,m=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},y={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},m);if(!l.type)return null;const u=c(l,y)(n,r,Y(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function eN(t,e,n,r){return tN("enter",t,e,n,r)}function nN(t){return t.finished.then((()=>{t.cancel()})),t}function rN(t,e,n,r){return tN("update",t,e,n,r)}function iN(t,e,n,r){return tN("exit",t,e,n,r)}function oN(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=he(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function aN(t){const{interaction:e={}}=t;return Object.entries(Y({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e))}function sN(t,e){return pe(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=he(t,["data"]);if(null==r)return t;const[,{data:o}]=yield _C(0,{data:r},n);return Object.assign({data:o},i)}))}function cN(t){t.style("x",(t=>t.paddingLeft+t.marginLeft)).style("y",(t=>t.paddingTop+t.marginTop)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function lN(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function uN(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(fN(rk)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",rk).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(fN(ik)).node()||t.append("g").attr("className",ik).style("zIndex",0)}function fN(...t){return t.map((t=>`.${t}`)).join("")}function hN(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new yp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function dN(t){const e=Y({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o<e.length;o++){const a=Y({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function pN(t,e){const n=new iS;return n.registerPlugin(new aS),new Cp({width:t,height:e,container:document.createElement("div"),renderer:n})}function gN(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=dN(t),{canvas:c=pN(i,o),emitter:l=new cS,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===o||c.resize(i,o),l.emit(lS.BEFORE_RENDER);const d=Dg(c.document.documentElement);return c.ready.then((()=>GC(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),d,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(lS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function mN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${ak}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const yN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function vN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:yN[e]}function bN(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>bN(t,e,n,r)))}function xN(t){bN(t,"visibility","hidden",!0)}function wN(t){bN(t,"visibility","visible",!0)}function MN(t){return Dg(t).selectAll(`.${ok}`).nodes().filter((t=>!t.__removed__))}function EN(t,e){return ON(t,e).flatMap((({container:t})=>MN(t)))}function ON(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function kN(t){return Dg(t).select(`.${sk}`).node()}function SN(t,e){const{offsetX:n,offsetY:r}=e,i=t.getRenderBounds(),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function AN(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function TN(t){return t=>t.__data__.color}function _N(t){const{x:e}=t.scale;return t=>{const{x:n}=t.__data__;return e.invert(n)}}function PN(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[NN(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(NN(i,r))[e]}}function CN(t,e=((t,e)=>t),n=((t,e,n)=>t.setAttribute(e,n))){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,c=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=vN(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function NN(t,e){return`${t},${e}`}function LN(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[NN(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=NN(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t}),{})}return r}function jN(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function RN(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=he(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const o=t=>t.__data__.points,a=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=Rn(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=zs(),c=r[t-1],l=r[t],[u,f,h,d]=a(o(c),o(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=yr(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,m=he(p,["fill"]),y=new pp({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},m)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(y),c.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function IN(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Mc(n)){const{points:i}=t.__data__,[o,a]=wc(n)?Hg(i):i,s=n.getCenter(),c=is(o,s),l=is(a,s),u=ss(c)+ls(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return wc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function BN(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=he(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},l=(t,n)=>{const{padding:o}=n,[a,s]=((t,e)=>{const{x:n}=r;if(!EO(n))return[0,1];const{__data__:i}=t,{x:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),[l,u]=((t,e)=>{const{y:n}=r;if(!EO(n))return[0,1];const{__data__:i}=t,{y:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),f=[[a,l],[s,l],[s,u],[a,u]].map((t=>i.map(t))),{__data__:h}=t,{y:d,y1:p}=h;return Ug(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=he(e,["transform","transformOrigin","stroke"]),a=Object.assign({transform:n,transformOrigin:r,stroke:i},o),s=t.cloneNode(!0);for(const[t,e]of Object.entries(a))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=yr(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,strokeWidth:h=0}=e,d=he(e,["fill","fillOpacity","zIndex","padding","strokeWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,strokeWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(EO)})()?l:u,m=g(t,p);m.className=s,t.parentNode.appendChild(m),t.background=m},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function DN(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function FN(t){DN(t,t.cursor)}function zN(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function GN(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Pn(h,r),g=jN(h,n),[m,y]=RN(Object.assign({elements:h,valueof:g,link:i,coordinate:c},ur(u.active,"link"))),[v,b,x]=BN(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},ur(u.active,"background"))),w=Y(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return IN(h[n],e,c)}})}),{setState:M,removeState:E,hasState:O}=CN(w,g);let k;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;k&&clearTimeout(k);const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?O(t,"active")||M(t,"active"):(M(t,"inactive"),y(t)),t!==e&&b(t);v(e),m(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},A=(t=!0)=>{for(const t of h)E(t,"active","inactive"),b(t),y(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},T=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{A(),k=null}),a)):A())},_=()=>{A()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",T),t.addEventListener("pointerleave",_);const P=t=>{const{nativeEvent:e}=t;e||A(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=zN(h,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",T),t.removeEventListener("pointerleave",_),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),y(t)}}function WN(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=he(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return GN(kN(c),Object.assign({elements:MN,datum:PN(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:LN(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function $N(t){return WN(Object.assign(Object.assign({},t),{createGroup:_N}))}function HN(t){return WN(Object.assign(Object.assign({},t),{createGroup:TN}))}function VN(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Pn(h,r),g=jN(h,n),[m,y]=RN(Object.assign({link:i,elements:h,valueof:g,coordinate:a},ur(u.selected,"link"))),[v,b]=BN(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},ur(u.selected,"background"))),x=Y(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return IN(h[n],e,a)}})}),{setState:w,removeState:M,hasState:E}=CN(x,g),O=(t=!0)=>{for(const t of h)M(t,"selected","unselected"),y(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},k=t=>{const{target:e,nativeEvent:a=!0}=t;return d.has(e)?o?((t,e,i=!0)=>{if(E(e,"selected"))O();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?w(t,"selected"):(w(t,"unselected"),y(t)),t!==e&&b(t);if(m(a),v(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}})(t,e,a):((t,e,o=!0)=>{const a=r(e),s=p.get(a),c=new Set(s);if(E(e,"selected")){if(!h.some((t=>!c.has(t)&&E(t,"selected"))))return O();for(const t of s)w(t,"unselected"),y(t),b(t)}else{const t=s.some((t=>E(t,"selected")));for(const t of h)c.has(t)?w(t,"selected"):E(t,"selected")||w(t,"unselected");!t&&i&&m(s),v(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:h.filter((t=>E(t,"selected"))).map(n)}}))})(t,e,a):O()};t.addEventListener("click",k);const S=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=o?r.data.slice(0,1):r.data;for(const t of i){const e=zN(h,t,n);k({target:e,nativeEvent:!1})}},A=()=>{O(!1)};return l.on("element:select",S),l.on("element:unselect",A),()=>{for(const t of h)y(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",A)}}function YN(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=he(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return VN(kN(s),Object.assign({elements:MN,datum:PN(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:LN(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function qN(t){return YN(Object.assign(Object.assign({},t),{createGroup:_N}))}function UN(t){return YN(Object.assign(Object.assign({},t),{createGroup:TN}))}function XN(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=he(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:a,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=a,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:m=[]}=d,y=p.map(((t,e)=>e)),v=Rn(y.map((t=>g[t]))),b=kN(s),x=s.getElementsByClassName(ok),w=Pn(s.getElementsByClassName(lk),(t=>t.__data__.key.split("-")[0])),M=new dp({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ur(o,"rule"))}),E=new vp({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ur(o,"label"))});M.append(E),b.appendChild(M);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[wn(v,i)]},k=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),E.setAttribute("text",i(e))};let S;const A=Z((t=>{const e=SN(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=O(n,r,t);k(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[gn((t=>g[+t])).center(e,o)],s=[0,i.map(1)],c=[0,i.map(p[a]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{pe(this,void 0,void 0,(function*(){const{x:e}=f,n=O(h,e,t);k(t,n),l("chartIndex",(t=>{const e=Y({},t),r=e.marks.find((t=>"line"===t.type)),i=qn(Nn(y,(t=>qn(t,(t=>+p[t]))/Xn(t,(t=>+p[t]))),(t=>m[t])).values());Y(r,{scale:{y:{domain:[1/i,i]}}});const o=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);o.groupBy="color",o.basis=(t,e)=>e[t[gn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c();S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{M.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function KN({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=kN(s),l=Z((t=>{const e=SN(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=Y({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n})),o()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function ZN(t,e,n,r,i,o,a,s={}){const c=new wx({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:Y({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function QN({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f}){const h=t.getRootNode().defaultView.getConfig().container,d=function(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}(t,u),p=a?h:t,g=f||function(t){const e=t.getBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(h,d),{tooltipElement:y=ZN(d,n,r,s,c,g,m,l)}=p,{items:v,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:v,title:b,position:s,enterable:c},void 0!==i&&{content:i(o,{items:v,title:b})})),p.tooltipElement=y}function JN({root:t,single:e,emitter:n,nativeEvent:r=!0}){r&&n.emit("tooltip:hide",{nativeEvent:r});const i=t.getRootNode().defaultView.getConfig().container,o=e?i:t,{tooltipElement:a}=o;a&&a.hide()}function tL({root:t,single:e}){const n=t.getRootNode().defaultView.getConfig().container,r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function eL(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function nL(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function rL(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function iL(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=rL(r.map((t=>t.title)),o).filter(cr),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(cr),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=nL(a)||i.color,name:o}=t,s=he(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof Lo)&&!(t instanceof Ro);if(s(r))return r.clone().invert(a);if(a&&r instanceof Lo&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(eL);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:rL(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function oL(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=he(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map((t=>t[1])),m=e.map((t=>t[0])),y=tr(g),v=tr(m),[b,x,w,M]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=ss(is([v,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,y+c,y+c]:[v+s,v+s,c,c+i]})();if(m.length>0){const e=t.ruleY||(()=>{const e=new dp({style:Object.assign({x1:b,x2:x,y1:w,y2:M},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=M,t.ruleY=e}}function aL(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function sL(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function cL(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function lL(t,e){return void 0===t?e:t}function uL(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function fL(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:c,groupName:l,emitter:u,wait:f=50,leading:h=!0,trailing:d=!1,startX:p=0,startY:g=0,body:m=!0,single:y=!0,position:v,enterable:b,mount:x,bounding:w,theme:M,disableNative:E=!1,marker:O=!0,preserve:k=!1,style:S={},css:A={}}=e,T=he(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const _=n(t),P=wc(a),C=Mc(a),N=Y(S,T),{innerWidth:L,innerHeight:j,width:R,height:B,insetLeft:D,insetTop:F}=a.getOptions(),z=[],G=[];for(const t of _){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?z.push(t):(r||i)&&G.push(t)}const W=!!(P?o.y:o.x).getBandWidth&&G.length>0;z.sort(((t,e)=>{const n=P?0:1,r=t=>t.getBounds().min[n];return P?r(e)-r(t):r(t)-r(e)}));const $=t=>{const e=P?1:0,{min:n,max:r}=t.getLocalBounds();return Rn([n[e],r[e]])};G.sort(((t,e)=>{const[n,r]=$(t),[i,o]=$(e),a=(n+r)/2,s=(i+o)/2;return P?s-a:a-s}));const H=new Map(z.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Rn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:V}=o,q=(null==V?void 0:V.getBandWidth)?V.getBandWidth()/2:0,U=t=>{const[e]=a.invert(t);return e-q},X=(t,e,n)=>{const r=U(t),[i,o]=Rn([n[0],n[n.length-1]]);if(!W&&(r<i||r>o))return null;const a=gn((t=>n[+t])).center;return e[a(e,r)]},K=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[I(t.replace("series","")),r]})))},Q=Z((e=>{const n=SN(t,e);if(!n)return;const f=t.getRenderBounds(),h=f.min[0],d=f.min[1],E=[n[0]-p,n[1]-g];if(!E)return;const k=((t,e)=>{const n=t[P?1:0],r=e.filter((t=>{const[e,r]=$(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=gn((t=>{const[e,n]=$(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(cr)})(E,G),S=[],T=[];for(const t of z){const[e,n]=H.get(t),r=X(E,e,n);if(null!==r){S.push(t);const e=K(t,r),{x:n,y:i}=e,o=a.map([(n||0)+q,i||0]);T.push([Object.assign(Object.assign({},e),{element:t}),o])}}const _=Array.from(new Set(T.map((t=>t[0].x)))),I=_[Kn(_,(t=>Math.abs(t-U(E))))],V=T.filter((t=>t[0].x===I)),Y=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],Z=[...S,...k],Q=iL(Z,o,l,Y,M);if(r&&Q.items.sort(((t,e)=>r(t)-r(e))),i&&(Q.items=Q.items.filter(i)),0===Z.length||uL(Q))J();else{if(m&&QN({root:t,data:Q,x:n[0]+h,y:n[1]+d,render:c,event:e,single:y,position:v,enterable:b,mount:x,bounding:w,css:A}),s){const e=V.map((t=>t[1])),n=ur(N,"crosshairs");oL(t,e,Object.assign(Object.assign({},n),{plotWidth:L,plotHeight:j,mainWidth:R,mainHeight:B,insetLeft:D,insetTop:F,startX:p,startY:g,transposed:P,polar:C}))}if(O){const e=ur(N,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const i=e.filter((t=>{const[{x:e,y:n}]=t;return cr(e)&&cr(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new sp({style:Object.assign({cx:o[0],cy:o[1],fill:a,r:4,stroke:"#fff",strokeWidth:2},n)})}));for(const e of i)t.appendChild(e);t.markers=i}(t,{data:V,style:e,theme:M})}u.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:OO(o.x,U(E),!0)}}}))}}),f,{leading:h,trailing:d}),J=()=>{JN({root:t,single:y,emitter:u}),s&&aL(t),O&&sL(t)},tt=()=>{tL({root:t,single:y}),s&&aL(t),O&&sL(t)},et=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=o,s=i.map(r),[c,l]=a.map([s,.5]),{min:[u,f]}=t.getRenderBounds();Q({offsetX:c+u,offsetY:l+f})},nt=()=>{JN({root:t,single:y,emitter:u,nativeEvent:!1})},rt=()=>{at(),tt()},it=()=>{ot()},ot=()=>{E||(t.addEventListener("pointerenter",Q),t.addEventListener("pointermove",Q),t.addEventListener("pointerleave",J))},at=()=>{E||(t.removeEventListener("pointerenter",Q),t.removeEventListener("pointermove",Q),t.removeEventListener("pointerleave",J))};return ot(),u.on("tooltip:show",et),u.on("tooltip:hide",nt),u.on("tooltip:disable",rt),u.on("tooltip:enable",it),()=>{at(),u.off("tooltip:show",et),u.off("tooltip:hide",nt),u.off("tooltip:disable",rt),u.off("tooltip:enable",it),k?JN({root:t,single:y,emitter:u,nativeEvent:!1}):tt()}}function hL(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:c=50,leading:l=!0,trailing:u=!1,groupKey:f=(t=>t),single:h=!0,position:d,enterable:p,datum:g,view:m,mount:y,bounding:v,theme:b,shared:x=!1,body:w=!0,disableNative:M=!1,preserve:E=!1,css:O={}}){const k=e(t),S=new Set(k),A=Pn(k,f),T=Z((e=>{const{target:c}=e;if(!S.has(c))return void JN({root:t,single:h,emitter:s});const l=f(c),u=A.get(l),g=1!==u.length||x?iL(u,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(cr).map((e=>{var{color:n=nL(t)}=e,r=he(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(eL);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(o&&g.items.sort(((t,e)=>o(t)-o(e))),a&&(g.items=g.items.filter(a)),uL(g))return void JN({root:t,single:h,emitter:s});const{offsetX:M,offsetY:E}=e;w&&QN({root:t,data:g,x:M,y:E,render:r,event:e,single:h,position:d,enterable:p,mount:y,bounding:v,css:O}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:UA(c,m)}}))}),c,{leading:l,trailing:u}),_=e=>{const{target:n}=e;S.has(n)&&JN({root:t,single:h,emitter:s})},P=()=>{M||(t.addEventListener("pointerover",T),t.addEventListener("pointermove",T),t.addEventListener("pointerout",_))},C=()=>{M||(t.removeEventListener("pointerover",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerout",_))},N=({nativeEvent:t,data:e})=>{if(t)return;const n=zN(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;T({target:n,offsetX:i+a/2,offsetY:o+s/2})},L=({nativeEvent:e}={})=>{e||JN({root:t,single:h,emitter:s,nativeEvent:!1})};return s.on("tooltip:show",N),s.on("tooltip:hide",L),s.on("tooltip:enable",(()=>{P()})),s.on("tooltip:disable",(()=>{C(),tL({root:t,single:h})})),P(),()=>{C(),s.off("tooltip:show",N),s.off("tooltip:hide",L),E?JN({root:t,single:h,emitter:s,nativeEvent:!1}):tL({root:t,single:h})}}function dL(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=he(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,c)=>{const{container:l,view:u}=t,{scale:f,markState:h,coordinate:d,theme:p}=u,g=cL(h,"seriesTooltip"),m=cL(h,"crosshairs"),y=kN(l),v=lL(r,g);if(v&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(h)&&!a)return fL(y,Object.assign(Object.assign({},s),{theme:p,elements:MN,scale:f,coordinate:d,crosshairs:lL(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=EN(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),fL(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:d,crosshairs:lL(n,m),item:o,startX:u,startY:f,emitter:c}))}return hL(y,Object.assign(Object.assign({},s),{datum:PN(u),elements:MN,scale:f,coordinate:d,groupKey:e?_N(u):void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}const pL="legend-category",gL="legend-continuous",mL="items-item",yL="legend-category-item-marker",vL="legend-category-item-label";function bL(t){return t.getElementsByClassName(yL)[0]}function xL(t){return t.getElementsByClassName(vL)[0]}function wL(t){return t.getElementsByClassName(mL)}function ML(t){return t.getElementsByClassName(pL)}function EL(t){return t.getElementsByClassName(gL)}function OL(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function kL(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return pe(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[]}=t,l=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),u=[...e];u.splice(l+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const f=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Y({},t,Object.assign(Object.assign({transform:u,scale:f},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function SL(t,e){for(const n of t)kL(n,Object.assign(Object.assign({},e),{facet:!0}))}function AL(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>OL(t).scales.map((t=>t.name)),s=[...ML(r),...EL(r)],c=s.flatMap(a),l=Z(o?SL:kL,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=OL(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===pL?function(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:ur(h,"marker")},p={unselected:ur(h,"label")},{setState:g,removeState:m}=CN(d,void 0),{setState:y,removeState:v}=CN(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(m(o,"unselected"),v(a,"unselected")):(g(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{DN(t,"pointer")},r=()=>{FN(t)},c=t=>pe(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),0===x.length&&x.push(...b.map(i)),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const M=t=>pe(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),E=t=>pe(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",M),a.on("legend:reset",E),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),a.off("legend:filter",M),a.off("legend:reset",E)}}(r,{legends:wL,marker:bL,label:xL,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function TL(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=ML(r),s=MN(r),c=t=>OL(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=LN(o,["active","inactive"]),f=jN(s,PN(i)),h=[];for(const t of a){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=wL(t),o=l(r),a=Pn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:m}=CN(u,f),y={inactive:ur(p,"marker")},v={inactive:ur(p,"label")},{setState:b,removeState:x}=CN(y),{setState:w,removeState:M}=CN(v),E=t=>{for(const e of i){const n=bL(e),r=xL(e);e===t||null===t?(x(n,"inactive"),M(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},O=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");E(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},k=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),k.set(t,e)}const S=t=>{for(const t of s)m(t,"inactive","active");E(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find((t=>e(t)===s));c&&O({nativeEvent:!1},c)},T=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",T);const _=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",T);for(const[t,e]of k)t.removeEventListener(e)};h.push(_)}return()=>h.forEach((t=>t()))}}function _L(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function PL(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function CL(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const NL=nm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=he(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=ur(hr(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=he(d,["render"]),m=ur(u,"handleE"),{render:y=h}=m,v=he(m,["render"]),b=ur(hr(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=he(b,["render"]),M=ur(u,"handleW"),{render:E=h}=M,O=he(M,["render"]),k=ur(u,"handleNW"),{render:S=h}=k,A=he(k,["render"]),T=ur(u,"handleNE"),{render:_=h}=T,P=he(T,["render"]),C=ur(u,"handleSE"),{render:N=h}=C,L=he(C,["render"]),j=ur(u,"handleSW"),{render:R=h}=j,I=he(j,["render"]),B=t=>()=>{const e=nm((e=>((t,e)=>{const{id:n}=t,r=he(t.attributes,["x","y"]),i=e(t,Object.assign({x:0,y:0},r),l);i.id=n,i.style.draggable=!0})(e,t)));return new e({})},D=Dg(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(CL,Object.assign({width:i,height:o},hr(u,"handle"))),D.maybeAppend("handle-n",B(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(CL,g),D.maybeAppend("handle-e",B(y)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(CL,v),D.maybeAppend("handle-s",B(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(CL,w),D.maybeAppend("handle-w",B(E)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(CL,O),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(CL,A),D.maybeAppend("handle-ne",B(_)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(CL,P),D.maybeAppend("handle-se",B(N)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(CL,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(CL,I)}));function LL(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=PL(t),brushRegion:c=((t,e,n,r,i)=>[t,e,n,r]),reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=he(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,m=null,y=null,v=null,b=null,x=!1;const[w,M,E,O]=s;DN(t,"crosshair"),t.style.draggable=!0;const k=(t,e,n)=>{if(o(n),v&&v.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new pp({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),v=new NL({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},A=()=>{v=new NL({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(v)},T=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,m=null,y=null,x=!1,v=null,b=null,r(t)},_=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${M}L${E},${M}L${E},${O}L${w},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===v.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=AN(t,e);if(!v||!L(n))return k(r,i,e),void(x=!0);L(n)&&(y=[r,i])},B=e=>{const{target:n}=e,r=AN(t,e);if(!g)return;if(!y)return _(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,g[0],m[0],w,E),o=e(r,g[1],m[1],M,O),a=[g[0]+i,g[1]+o],s=[m[0]+i,m[1]+o];_(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(N[a]){const[t,e,n,r]=N[a].vector;return _([g[0]+i*t,g[1]+o*e],[m[0]+i*n,m[1]+o*r])}},D=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=v.style;return g=[t,n],m=[t+r,n+i],void a(t,n,t+r,n+i,e)}m=AN(t,e);const[n,r,o,s]=_(g,m);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;v&&!L(e)&&T()},z=e=>{const{target:n}=e;v&&L(n)&&!x?R(n)?DN(t,"move"):j(n)&&DN(t,N[n.id].cursor):DN(t,"crosshair")},G=()=>{DN(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",B),t.addEventListener("dragend",D),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:v,move(t,e,n,r,i=!0){v||k(t,e,{}),g=[t,e],m=[n,r],_([t,e],[n,r],i)},remove(t=!0){v&&T(t)},destroy(){v&&T(!1),DN(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",B),t.removeEventListener("dragend",D),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function jL(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function RL(t,e,n){return jL(t,e,n).map((t=>t.options))}function IL(t,e){var{elements:n,selectedHandles:r,siblings:i=(t=>[]),datum:o,brushRegion:a,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=(t=>t),bboxOf:d=(t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}}),state:p={},emitter:g}=e,m=he(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),v=i(t),b=v.flatMap(n),x=jN(y,o),w=ur(m,"mask"),{setState:M,removeState:E}=CN(p,x),O=new Map,{width:k,height:S,x:A=0,y:T=0}=d(t),_=s||[0,0,k,S],P=()=>{for(const t of[...y,...b])E(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of v)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;_L([c,l,u,f],[t,e,n,r])?(M(i,"active"),o.add(h(i))):M(i,"inactive")}for(const t of b)o.has(h(t))?M(t,"active"):M(t,"inactive")},N=()=>{for(const t of y)E(t,"inactive");for(const t of O.values())t.remove();O.clear()},L=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e};for(const o of y){const a=O.get(o)||i(o);a.style.clipPath=new yp({style:{x:t+A,y:e+T,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},j=LL(t,Object.assign(Object.assign({},w),{extent:_,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=SO(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=SO(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushupdated:(t,e,n,r,i)=>{const o=SO(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const{x:r,y:i}=e,[o,a]=t,s=AO(o,r),c=AO(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const B=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),B()},j}function BL(t){var{facet:e,brushKey:n}=t,r=he(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=kN(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return IL(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>EN(t,i),datum:PN(ON(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:LN(ON(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=IL(l,Object.assign(Object.assign({elements:MN,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return jL(t,e,n).map((t=>kN(t.container)))}(t,i,n),datum:PN([s,...jL(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:LN([c,...RL(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function DL(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function FL(t){return BL(Object.assign(Object.assign({},t),{brushRegion:DL,selectedHandles:["handle-e","handle-w"]}))}function zL(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function GL(t){return BL(Object.assign(Object.assign({},t),{brushRegion:zL,selectedHandles:["handle-n","handle-s"]}))}const WL="axis",$L="axis-line",HL="axis-main-group",VL="axis-hot-area";function YL(t){return t.getElementsByClassName(WL)}function qL(t){return t.getElementsByClassName($L)[0]}function UL(t){return function(t){return t.getElementsByClassName(HL)[0]}(t).getLocalBounds()}function XL(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=he(e,["cross","offsetX","offsetY"]);const a=UL(t),s=qL(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:zL,hotZone:new yp({className:VL,style:Object.assign({x:n?l:c-d/2,width:n?d/2:d,y:u,height:h-u},o)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function KL(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=he(e,["offsetY","offsetX","cross"]);const a=UL(t),s=qL(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:DL,hotZone:new yp({className:VL,style:Object.assign({x:l,width:f-l,y:i?u:c-d,height:i?d:2*d},o)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function ZL(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=kN(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=o;return function(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=he(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),m=jN(p,a),{setState:y,removeState:v}=CN(u,m),b=new Map,x=ur(d,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),M=g.map((t=>t.attributes.scale)),E=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,k=()=>{O.clear();for(let t=0;t<g.length;t++){const e=M[t],{domain:n}=e.getOptions();O.set(t,E(n))}};k();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}O.set(t,T(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!_)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=M[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},T=(t,e)=>{const n=M[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return E(kO(n,i))},_=g.some(o)&&g.some((t=>!o(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?KL:XL,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:_,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=LL(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},N=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=M[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:MN,axes:YL,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:PN(o),state:LN(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function QL(t){var{hideX:e=!0,hideY:n=!0}=t,r=he(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=kN(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:m}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=ur(he(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],m=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=LL(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(u(t,e,r,i),o),y.remove()}}));function v(t){m(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",v);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{y.destroy(),s.off("brush:filter",b),t.removeEventListener("click",v)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return SO(t,e,n,r,i,o)},filter:(t,r)=>pe(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,a]=t;u("brushFilter",(t=>{const{marks:r}=t,o=r.map((t=>Y({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:a,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:o,clip:!0})})),o.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,a]}}));const s=yield l();p=s.view,d=!1,h=!0})),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,a=r.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,a]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:o,scale:g,coordinate:m},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function JL(t){return QL(Object.assign(Object.assign({hideX:!0},t),{brushRegion:DL}))}function tj(t){return QL(Object.assign(Object.assign({hideY:!0},t),{brushRegion:zL}))}const ej="slider";function nj(t,e,n,r=!1){const{marks:i}=t,o=i.map((t=>{var i,o;return Y({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(i=t[n])||void 0===i?void 0:i.x)&&{x:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(o=t[n])||void 0===o?void 0:o.y)&&{y:Object.assign({preserve:!0},r&&{ratio:null})}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:o,clip:!0,animate:!1})}function rj(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return kO(e,[OO(e,o(r),!0),OO(e,o(i),!1)])}function ij(t){return[t[0],t[t.length-1]]}function oj({channelDomain:t,className:e=ej,prefix:n="slider",setValue:r=((t,e)=>t.setValues(e)),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1}){return(c,l,u)=>{const{container:f,view:h,update:d,setState:p}=c,g=f.getElementsByClassName(e);if(!g.length)return()=>{};let m=!1;const{scale:y,coordinate:v,layout:b}=h,{paddingLeft:x,paddingTop:w,paddingBottom:M,paddingRight:E}=b,{x:O,y:k}=y,S=wc(v),A=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},T=new Map,_=new Set;t||(t={x:O.getOptions().domain,y:k.getOptions().domain});for(const e of g){const{orientation:c}=e.attributes,[l,f]=A(c),h=`${n}${B(l)}:filter`,g="x"===l,{ratio:v}=O.getOptions(),{ratio:b}=k.getOptions(),P=e=>{if(e.data){const{selection:n}=e.data,[r=ij(t.x),i=ij(t.y)]=n;return g?[kO(O,r,v),kO(k,i,b)]:[kO(k,i,b),kO(O,r,v)]}const{value:n}=e.detail;return[rj(n,y[l],S&&"horizontal"===c),t[f]]},C=Z((r=>pe(this,void 0,void 0,(function*(){if(m)return;m=!0;const{nativeEvent:o=!0}=r,[a,s]=P(r);if(t[l]=a,t[f]=s,o){const t=g?a:s,e=g?s:a;u.emit(h,Object.assign(Object.assign({},r),{nativeEvent:o,data:{selection:[ij(t),ij(e)]}}))}p(e,(t=>Object.assign(Object.assign({},nj(t,{[l]:{domain:a,nice:!1},[f]:{domain:s,nice:!1}},n,i)),{paddingLeft:x,paddingTop:w,paddingBottom:M,paddingRight:E}))),yield d(),m=!1}))),o,{leading:a,trailing:s}),N=t=>{const{nativeEvent:n}=t;if(n)return;const{data:i}=t,{selection:o}=i,[a,s]=o;e.dispatchEvent(new Md("valuechange",{data:i,nativeEvent:!1}));const c=g?AO(a,O):AO(s,k);r(e,c)};u.on(h,N),e.addEventListener("valuechange",C),T.set(e,C),_.add([h,N])}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of _)u.off(t,e)}}}const aj="g2-scrollbar";function sj(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(aj).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:s.getOptions().domain,y:c.getOptions().domain};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return oj(Object.assign(Object.assign({},t),{channelDomain:l,className:aj,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(e,n,r)}}function cj(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const lj={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function uj(t){return"text"===t.nodeName&&!!t.isOverflowing()}function fj(t){var{offsetX:e=8,offsetY:n=8}=t,r=he(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=ur(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!uj(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,h=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new fp({className:"poptip",style:{innerHTML:cj("div",d,Object.assign(Object.assign({},lj),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;uj(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}function hj(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function dj(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}const pj=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{wN(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}(hj(e),hj(t.getLocalBounds()))));r?xN(t):n.push(t)})),t}};function gj([t,e],[n,r]){return r>t&&e>n}function mj(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function yj(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const vj=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=mj(),[s,c]=mj(),[l,u]=mj(),[f,h]=mj();for(const e of t){const{min:t,max:n}=yj(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),h(e,[r,o])}for(let o=0;o<e;o++){t.sort(((t,e)=>dn(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let o,a=n+1;for(;(o=t[a])&&!gj(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function bj(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function xj(t,e,n){return.2126*bj(t)+.7152*bj(e)+.0722*bj(n)}function wj(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=xj(n,r,i),l=xj(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function Mj(t,e){const n=Un(e,(e=>wj(t,function(t){return"object"==typeof t?t:uf(t)}(e))));return e[n]}const Ej=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;wj(t.parsedStyle.fill,r)<e&&t.attr("fill",Mj(r,n))})),t)},Oj=()=>t=>(t.forEach((t=>{wN(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(dj(n,e)&&dj(r,e))}(hj(t.getLocalBounds()),e);n&&xN(t)})),t);function kj(){return{"data.fetch":CM,"data.inline":FM,"data.sortBy":DM,"data.sort":RM,"data.filter":jM,"data.pick":IM,"data.rename":BM,"data.fold":NM,"data.slice":HM,"data.custom":zM,"data.map":GM,"data.join":$M,"data.kde":UM,"data.log":XM,"transform.stackY":Nr,"transform.binX":ys,"transform.bin":ms,"transform.dodgeX":Xr,"transform.jitter":Aa,"transform.jitterX":Ta,"transform.symmetryY":_a,"transform.diffY":Pa,"transform.stackEnter":Kr,"transform.normalizeY":Zr,"transform.select":Ra,"transform.selectX":Ia,"transform.selectY":Ba,"transform.groupX":Xa,"transform.groupY":Ka,"transform.groupColor":Za,"transform.group":Ua,"transform.sortX":ts,"transform.sortY":ns,"transform.sortColor":es,"transform.flexX":rs,"transform.pack":ds,"transform.sample":bs,"transform.filter":xs,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":i,"coordinate.theta":o,"coordinate.parallel":c,"coordinate.fisheye":l,"coordinate.radial":s,"coordinate.radar":u,"encode.constant":f,"encode.field":d,"encode.transform":h,"encode.column":p,"mark.interval":jw,"mark.rect":Iw,"mark.line":zw,"mark.point":Ww,"mark.text":Hw,"mark.cell":Yw,"mark.area":Uw,"mark.link":Kw,"mark.image":Qw,"mark.polygon":tM,"mark.box":nM,"mark.vector":iM,"mark.lineX":cM,"mark.lineY":aM,"mark.connector":uM,"mark.range":pM,"mark.rangeX":mM,"mark.rangeY":vM,"mark.path":xM,"mark.shape":wM,"mark.density":ZM,"mark.heatmap":JM,"palette.category10":tE,"palette.category20":eE,"scale.linear":rE,"scale.ordinal":iE,"scale.band":nE,"scale.identity":oE,"scale.point":aE,"scale.time":sE,"scale.log":cE,"scale.pow":lE,"scale.sqrt":dE,"scale.threshold":uE,"scale.quantile":fE,"scale.quantize":hE,"scale.sequential":pE,"scale.constant":gE,"theme.classic":bE,"theme.classicDark":ME,"theme.academy":OE,"theme.light":vE,"theme.dark":wE,"component.axisX":rO,"component.axisY":iO,"component.legendCategory":uO,"component.legendContinuous":gO,"component.legends":jO,"component.title":MO,"component.sliderX":_O,"component.sliderY":PO,"component.scrollbarX":NO,"component.scrollbarY":LO,"animation.scaleInX":RO,"animation.scaleOutX":IO,"animation.scaleInY":BO,"animation.scaleOutY":DO,"animation.waveIn":ZO,"animation.fadeIn":FO,"animation.fadeOut":zO,"animation.zoomIn":QO,"animation.zoomOut":JO,"animation.pathIn":tk,"animation.morphing":KO,"animation.growInX":ek,"animation.growInY":nk,"interaction.elementHighlight":WN,"interaction.elementHighlightByX":$N,"interaction.elementHighlightByColor":HN,"interaction.elementSelect":YN,"interaction.elementSelectByX":qN,"interaction.elementSelectByColor":UN,"interaction.fisheye":KN,"interaction.chartIndex":XN,"interaction.tooltip":dL,"interaction.legendFilter":AL,"interaction.legendHighlight":TL,"interaction.brushHighlight":BL,"interaction.brushXHighlight":FL,"interaction.brushYHighlight":GL,"interaction.brushAxisHighlight":ZL,"interaction.brushFilter":QL,"interaction.brushXFilter":JL,"interaction.brushYFilter":tj,"interaction.sliderFilter":oj,"interaction.scrollbarFilter":sj,"interaction.poptip":fj,"composition.spaceLayer":mA,"composition.spaceFlex":yA,"composition.facetRect":LA,"composition.repeatMatrix":FA,"composition.facetCircle":VA,"composition.timingKeyframe":qA,"labelTransform.overlapHide":pj,"labelTransform.overlapDodgeY":vj,"labelTransform.overflowHide":Oj,"labelTransform.contrastReverse":Ej}}function Sj(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const Aj={};const Tj=t=>t?parseInt(t):0;function _j(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class Pj{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=(t=>t)){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return _j(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return _j(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return _j(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const Cj=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],Nj="__remove__",Lj="__callback__";function jj(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function Rj(t,e){const{autoFit:n}=t,{width:r=640,height:i=480}=n?function(t){const e=getComputedStyle(t),n=t.clientWidth||Tj(e.width),r=t.clientHeight||Tj(e.height);return{width:n-(Tj(e.paddingLeft)+Tj(e.paddingRight)),height:r-(Tj(e.paddingTop)+Tj(e.paddingBottom))}}(e):t,{depth:o=0}=t;return{width:r,height:i,depth:o}}function Ij(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of Cj)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,jj(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===Lj)e.children=t.value;else{const i=jj(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function Bj(t,e,n,r){const{type:i}=t,{type:o=n||i}=e;if("view"===o)return e;if(!function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r))return e;const a={type:"view"},s=Object.assign({},e);for(const t of Cj)void 0!==s[t]&&(a[t]=s[t],delete s[t]);return Object.assign(Object.assign({},a),{children:[s]})}function Dj(t,e,n){if("function"==typeof t){const e=new Pj;return e.value=t,e.type=Lj,e}const{type:r,children:i}=t,o=he(t,["type","children"]),a=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new a;return s.value=o,s.type=r,s}function Fj(t,e){const{type:n,children:r}=e,i=he(e,["type","children"]);t.type===n||void 0===n?mr(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function zj(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=Dj(e,n,r);Array.isArray(t.children)&&t.push(o);const{children:a}=e;if(Array.isArray(a))for(const t of a)i.push([o,t]);else"function"==typeof a&&i.push([o,a])}}function Gj(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function Wj(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function $j(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function Hj(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(pr(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function Vj(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function Yj(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function qj(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?Gj(e,n,r):"array"===t?Wj(e,n,r):"object"===t?$j(e,n,r):"node"===t?Vj(e,n,r):"container"===t?Yj(e,n,r):"mix"===t&&Hj(e,n)}return e}}function Uj(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const Xj={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},Kj=Object.assign(Object.assign({},Xj),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),Zj=Object.assign(Object.assign({},Xj),{labelTransform:{type:"array"}});let Qj=class extends Pj{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&wN(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&xN(t)}};Qj=de([qj(Zj)],Qj);let Jj=class extends Pj{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};Jj=de([qj(Kj)],Jj);const tR="G2_CHART_KEY";class eR extends Qj{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o}=t;super(he(t,["container","canvas","renderer","plugins","lib"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=W((()=>{this.forceFit()}),300),this._renderer=r||new iS,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[Nj]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new cS,this._context={library:Object.assign(Object.assign({},o),Aj),emitter:this._emitter,canvas:n},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>gN(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return Ij(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,Bj(t,e,n,r)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){Fj(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],a=r[i];o.push([e,a,n])}}else"function"==typeof t&&o.push([e,null,t])}else e.remove();else zj(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit(lS.BEFORE_CLEAR),this._reset(),mN(0,this._context,!1),this.emit(lS.AFTER_CLEAR)}destroy(){this.options();this.emit(lS.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),mN(0,this._context,!0),this._container[Nj]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(lS.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=Rj(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(lS.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(lS.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(lS.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(lS.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends Jj{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends Qj{constructor(){super({},e)}};return n=de([qj(Uj(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))qj(Uj(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=tR}=t,{width:n,height:r,depth:i}=Rj(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=Rj(this.options(),this._container);this._plugins.push(new aS),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new Cp({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}$d.enableCSSParsing=!1;const nR=Sj(eR,Object.assign({},kj()));t.AREA_CLASS_NAME=uk,t.COMPONENT_CLASS_NAME=ck,t.Chart=nR,t.ChartEvent=lS,t.ELEMENT_CLASS_NAME=ok,t.LABEL_CLASS_NAME=lk,t.LABEL_LAYER_CLASS_NAME=ik,t.MAIN_LAYER_CLASS_NAME=rk,t.MASK_CLASS_NAME="mask",t.PLOT_CLASS_NAME=sk,t.Runtime=eR,t.VIEW_CLASS_NAME=ak,t.corelib=kj,t.extend=Sj,t.register=function(t,e){Object.assign(Aj,{[t]:e})},t.render=gN,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480}=t,a=dN(t),{group:s=new up,emitter:c=new cS,library:l}=e;(null==s?void 0:s.parentElement)||ar("renderToMountedElement can't render chart to unmounted group.");const u=Dg(s);return e.group=s,e.emitter=c,c.emit(lS.BEFORE_RENDER),GC(Object.assign(Object.assign({},a),{width:i,height:o}),u,l,e).then((()=>{s.ownerDocument.defaultView.requestAnimationFrame((()=>{c.emit(lS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),s},Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:o}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,o]]};r.props={};const i=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];i.props={transform:!0};const o=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};o.props={};const a=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},s=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=a(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};s.props={};const c=()=>[["parallel",0,1,0,1]];c.props={};const l=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];l.props={transform:!0};const u=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:o=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};u.props={};const f=({value:t})=>e=>e.map((()=>t));f.props={};const h=({value:t})=>e=>e.map(t);h.props={};const d=({value:t})=>e=>e.map((e=>e[t]));d.props={};const p=({value:t})=>()=>t;p.props={};var g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t){return"function"==typeof t},y=function(t){return null==t},v={}.toString,b=function(t,e){return v.call(t)==="[object "+e+"]"},x=function(t){return Array.isArray?Array.isArray(t):b(t,"Array")},w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var M=function(t){return"object"==typeof t&&null!==t},E=function(t){if(!M(t)||!b(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},O=function(t){if(x(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},k=function(t){if(x(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},S=function(t,e,n){if(!x(t)&&!E(t))return t;var r=n;return function(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(w(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}(t,(function(t,n){r=e(r,t,n)})),r},A=function(t){return b(t,"String")};var T=function(t,e,n){return t<e?e:t>n?n:t},_=function(t){return b(t,"Number")},P=1e-5;function C(t,e,n){return void 0===n&&(n=P),Math.abs(t-e)<n}var N=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},L=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},j=function(t,e){return(t%e+e)%e},R=function(t){return y(t)?"":t.toString()},I=function(t){var e=R(t);return e.charAt(0).toLowerCase()+e.substring(1)};var B=function(t){var e=R(t);return e.charAt(0).toUpperCase()+e.substring(1)},D=function(t){return b(t,"Boolean")},F=function(t){return void 0===t},z=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=z(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=z(t[i]):e[i]=t[i];return e},G=z;function W(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}}function $(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function H(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function V(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(H(e,i)){var o=e[i];null!==o&&E(o)?(E(t[i])||(t[i]={}),n<r?V(t[i],o,n+1,r):t[i]=e[i]):x(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Y=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)V(t,e[r]);return t},q=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(A(t)||A(e))return!1;if(g(t)||g(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=q(t[r],e[r]));r++);return n}if(M(t)||M(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=q(t[i[r]],e[i[r]]));r++);return n}return!1},U=q,X=function(t,e,n){for(var r=0,i=A(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},K=function(t,e){return S(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},Z=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},Q=function(){},J=1e-6,tt="undefined"!=typeof Float32Array?Float32Array:Array;function et(){var t=new tt(9);return tt!=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}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var nt=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],m=n[4],y=n[5],v=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*l,t[1]=h*i+d*s+p*u,t[2]=h*o+d*c+p*f,t[3]=g*r+m*a+y*l,t[4]=g*i+m*s+y*u,t[5]=g*o+m*c+y*f,t[6]=v*r+b*a+x*l,t[7]=v*i+b*s+x*u,t[8]=v*o+b*c+x*f,t};function rt(){var t=new tt(16);return tt!=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 it(t){var e=new tt(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 ot(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 at(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function st(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 ct(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 lt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,M=r*l-o*s,E=i*l-o*c,O=u*g-f*p,k=u*m-h*p,S=u*y-d*p,A=f*m-h*g,T=f*y-d*g,_=h*y-d*m,P=v*_-b*T+x*A+w*S-M*k+E*O;return P?(P=1/P,t[0]=(s*_-c*T+l*A)*P,t[1]=(i*T-r*_-o*A)*P,t[2]=(g*E-m*M+y*w)*P,t[3]=(h*M-f*E-d*w)*P,t[4]=(c*S-a*_-l*k)*P,t[5]=(n*_-i*S+o*k)*P,t[6]=(m*x-p*E-y*b)*P,t[7]=(u*E-h*x+d*b)*P,t[8]=(a*T-s*S+l*O)*P,t[9]=(r*S-n*T-o*O)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-d*v)*P,t[12]=(s*k-a*A-c*O)*P,t[13]=(n*A-r*k+i*O)*P,t[14]=(g*b-p*w-m*v)*P,t[15]=(u*w-f*b+h*v)*P,t):null}function ut(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(f*m-h*g)-(e*s-r*o)*(u*m-h*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-h*d)-(n*c-i*a)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function ft(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],m=e[13],y=e[14],v=e[15],b=n[0],x=n[1],w=n[2],M=n[3];return t[0]=b*r+x*s+w*f+M*g,t[1]=b*i+x*c+w*h+M*m,t[2]=b*o+x*l+w*d+M*y,t[3]=b*a+x*u+w*p+M*v,b=n[4],x=n[5],w=n[6],M=n[7],t[4]=b*r+x*s+w*f+M*g,t[5]=b*i+x*c+w*h+M*m,t[6]=b*o+x*l+w*d+M*y,t[7]=b*a+x*u+w*p+M*v,b=n[8],x=n[9],w=n[10],M=n[11],t[8]=b*r+x*s+w*f+M*g,t[9]=b*i+x*c+w*h+M*m,t[10]=b*o+x*l+w*d+M*y,t[11]=b*a+x*u+w*p+M*v,b=n[12],x=n[13],w=n[14],M=n[15],t[12]=b*r+x*s+w*f+M*g,t[13]=b*i+x*c+w*h+M*m,t[14]=b*o+x*l+w*d+M*y,t[15]=b*a+x*u+w*p+M*v,t}function ht(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*y+e[12],t[13]=e[1]*g+e[5]*m+e[9]*y+e[13],t[14]=e[2]*g+e[6]*m+e[10]*y+e[14],t[15]=e[3]*g+e[7]*m+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*m+f*y+e[12],t[13]=i*g+c*m+h*y+e[13],t[14]=o*g+l*m+d*y+e[14],t[15]=a*g+u*m+p*y+e[15]),t}function dt(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 pt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=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+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function gt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=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-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function mt(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 yt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=o*l,m=a*s,y=a*c,v=a*l;return t[0]=1-(d+g),t[1]=f+v,t[2]=h-y,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=h+y,t[9]=p-m,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function bt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function wt(t,e){var n=new tt(3);xt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,g=a+u+p,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(f-d)/m,t[1]=(h-c)/m,t[2]=(s-l)/m):a>u&&a>p?(m=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(h+c)/m):u>p?(m=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/m,t[0]=(h+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function Mt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,g=a*u,m=a*f,y=s*f,v=c*l,b=c*u,x=c*f,w=r[0],M=r[1],E=r[2],O=i[0],k=i[1],S=i[2],A=(1-(g+y))*w,T=(d+x)*w,_=(p-b)*w,P=(d-x)*M,C=(1-(h+y))*M,N=(m+v)*M,L=(p+b)*E,j=(m-v)*E,R=(1-(h+g))*E;return t[0]=A,t[1]=T,t[2]=_,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+O-(A*O+P*k+L*S),t[13]=n[1]+k-(T*O+C*k+j*S),t[14]=n[2]+S-(_*O+N*k+R*S),t[15]=1,t}function Et(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,g=o*a,m=o*s,y=o*c;return t[0]=1-f-p,t[1]=u+y,t[2]=h-m,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+m,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ot(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?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var kt=Ot;function St(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var At=St;function Tt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function _t(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],m=e[2],y=r[0],v=r[1],b=r[2],x=n[0],w=n[1],M=n[2];return Math.abs(p-x)<J&&Math.abs(g-w)<J&&Math.abs(m-M)<J?st(t):(u=p-x,f=g-w,h=m-M,i=v*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),o=b*(u*=d)-y*h,a=y*f-v*u,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-u*a,l=u*o-f*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+o*g+a*m),t[13]=-(s*p+c*g+l*m),t[14]=-(u*p+f*g+h*m),t[15]=1,t)}function Pt(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 Ct=ft,Nt=Pt,Lt=Object.freeze({__proto__:null,create:rt,clone:it,copy:ot,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var m=new tt(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]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m},set:at,identity:st,transpose:ct,invert:lt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15];return t[0]=s*(h*y-d*m)-f*(c*y-l*m)+g*(c*d-l*h),t[1]=-(r*(h*y-d*m)-f*(i*y-o*m)+g*(i*d-o*h)),t[2]=r*(c*y-l*m)-s*(i*y-o*m)+g*(i*l-o*c),t[3]=-(r*(c*d-l*h)-s*(i*d-o*h)+f*(i*l-o*c)),t[4]=-(a*(h*y-d*m)-u*(c*y-l*m)+p*(c*d-l*h)),t[5]=n*(h*y-d*m)-u*(i*y-o*m)+p*(i*d-o*h),t[6]=-(n*(c*y-l*m)-a*(i*y-o*m)+p*(i*l-o*c)),t[7]=n*(c*d-l*h)-a*(i*d-o*h)+u*(i*l-o*c),t[8]=a*(f*y-d*g)-u*(s*y-l*g)+p*(s*d-l*f),t[9]=-(n*(f*y-d*g)-u*(r*y-o*g)+p*(r*d-o*f)),t[10]=n*(s*y-l*g)-a*(r*y-o*g)+p*(r*l-o*s),t[11]=-(n*(s*d-l*f)-a*(r*d-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*m-h*g)-u*(s*m-c*g)+p*(s*h-c*f)),t[13]=n*(f*m-h*g)-u*(r*m-i*g)+p*(r*h-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-a*(r*h-i*f)+u*(r*c-i*s),t},determinant:ut,multiply:ft,translate:ht,scale:dt,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,m,y,v,b,x,w,M,E,O,k,S,A,T=r[0],_=r[1],P=r[2],C=Math.hypot(T,_,P);return C<J?null:(T*=C=1/C,_*=C,P*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],m=e[9],y=e[10],v=e[11],b=T*T*a+o,x=_*T*a+P*i,w=P*T*a-_*i,M=T*_*a-P*i,E=_*_*a+o,O=P*_*a+T*i,k=T*P*a+_*i,S=_*P*a-T*i,A=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+h*x+m*w,t[2]=l*b+d*x+y*w,t[3]=u*b+p*x+v*w,t[4]=s*M+f*E+g*O,t[5]=c*M+h*E+m*O,t[6]=l*M+d*E+y*O,t[7]=u*M+p*E+v*O,t[8]=s*k+f*S+g*A,t[9]=c*k+h*S+m*A,t[10]=l*k+d*S+y*A,t[11]=u*k+p*S+v*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:pt,rotateY:gt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=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+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:mt,fromScaling:yt,fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<J?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:vt,fromQuat2:function(t,e){var n=new tt(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),vt(t,e,n),t},getTranslation:bt,getScaling:xt,getRotation:wt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,m=a*u,y=s*c,v=s*l,b=s*u,x=r[0],w=r[1],M=r[2];return t[0]=(1-(p+m))*x,t[1]=(h+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+m))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(d+v)*M,t[9]=(g-y)*M,t[10]=(1-(f+p))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Mt,fromQuat:Et,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=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*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Ot,perspective:kt,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?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:St,ortho:At,orthoZO:Tt,lookAt:_t,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],h=a-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,m=s*f-c*u;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-h*g,t[5]=h*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Pt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],m=t[14],y=t[15],v=e[0],b=e[1],x=e[2],w=e[3],M=e[4],E=e[5],O=e[6],k=e[7],S=e[8],A=e[9],T=e[10],_=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-v)<=J*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=J*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=J*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=J*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=J*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-E)<=J*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-O)<=J*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-k)<=J*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=J*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=J*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-T)<=J*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-_)<=J*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-P)<=J*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=J*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=J*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=J*Math.max(1,Math.abs(y),Math.abs(L))},mul:Ct,sub:Nt});function jt(){var t=new tt(3);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Rt(t){var e=new tt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function It(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Bt(t,e,n){var r=new tt(3);return r[0]=t,r[1]=e,r[2]=n,r}function Dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ft(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function zt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Gt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Wt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function $t(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 Ht(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function Yt(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 qt(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 a=a||1,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}function Ut(t,e,n){var r=e[0],i=e[1],o=e[2];return 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],t}function Xt(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=J*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=J*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=J*Math.max(1,Math.abs(i),Math.abs(s))}var Kt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},Zt=It;function Qt(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Jt(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 te(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ee(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function ne(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function re(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 ie(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t}jt(),function(){var t=Qt()}();var oe=function(t,e,n,r){var i=new tt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ae=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},se=ne,ce=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};jt(),Bt(1,0,0),Bt(0,1,0),te(),te(),et(),function(){var t,e=(t=new tt(2),tt!=Float32Array&&(t[0]=0,t[1]=0),t)}();var le=function(t,e){return le=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])},le(t,e)};function ue(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}le(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var fe=function(){return fe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},fe.apply(this,arguments)};function he(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function de(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function pe(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function ge(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(c){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]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){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,c])}}}function me(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 ye(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 ve(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function be(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var xe={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function we(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 Me={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ee(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Me[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Oe(t){return Ee(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ke(t){return Oe(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Se(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Me[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,Me[n]))),Me[n]););}function Ae(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 Te(t){return t>=48&&t<=57||43===t||45===t||46===t}function _e(t){return t>=48&&t<=57}function Pe(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),_e(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&_e(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&_e(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;_e(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&_e(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&_e(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'}function Ce(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(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 Ne(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Me[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,Ce(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Pe(t):Ae(t),t.err.length)return;t.data.push(t.param),Ce(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ce(t))}if(t.index>=t.max)break;if(!Te(n.charCodeAt(t.index)))break}Se(t)}else Se(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Le=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 je(t){if(Oe(t))return[].concat(t);var e=function(t){if(Ee(t))return[].concat(t);var e=new Le(t);for(Ce(e);e.index<e.max&&!e.err.length;)Ne(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],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e}))}function Re(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function Ie(t){if(ke(t))return[].concat(t);for(var e=je(t),n=fe({},xe),r=0;r<e.length;r+=1){e[r]=Re(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Be(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function De(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,m=e,y=n,v=r,b=s,x=c,w=120*Math.PI/180,M=Math.PI/180*(+i||0),E=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=Be(g,m,-M)).x,m=u.y;var O=(g-(b=(u=Be(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=O*O/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var A=y*y,T=v*v,_=(o===a?-1:1)*Math.sqrt(Math.abs((A*T-A*k*k-T*O*O)/(A*k*k+T*O*O)));d=_*y*k/v+(g+b)/2,p=_*-v*O/y+(m+x)/2,f=Math.asin(((m-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),a&&f>h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var C=h,N=b,L=x;h=f+w*(a&&h>f?1:-1),E=De(b=d+y*Math.cos(h),x=p+v*Math.sin(h),y,v,i,0,a,N,L,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),B=Math.sin(h),D=Math.tan(P/4),F=4/3*y*D,z=4/3*v*D,G=[g,m],W=[g+F*R,m-z*j],$=[b+F*B,x-z*I],H=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,H,E);for(var V=[],Y=0,q=(E=W.concat($,H,E)).length;Y<q;Y+=1)V[Y]=Y%2?Be(E[Y-1],E[Y],M).y:Be(E[Y],E[Y+1],M).x;return V}function Fe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var ze=function(t,e,n,r){return ve(ve([],Fe([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ge(t,e){var n,r,i,o,a,s,c,l,u,f=t[0],h=t.slice(1).map(Number),d=h[0],p=h[1],g=e.x1,m=e.y1,y=e.x,v=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=d,e.y=p,t;case"A":return n=[g,m].concat(h),["C"].concat(De(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=d,e.qy=p,n=[g,m].concat(h),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*o,l*i+u*a,l*s+u*o,l*c+u*a,s,c]));case"L":return["C"].concat(ze(g,m,d,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(ze(g,m,y,v))}return t}function We(t,e){if(void 0===e&&(e=!1),function(t){return ke(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=Ie(t),a=fe({},xe),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=Ge(o[f],a);o[f]=h,we(o,s,f),l=o.length,"Z"===c&&u.push(f),i=(r=o[f]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function $e(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function He(t,e,n,r,i){var o=$e([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Fe([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}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 Ve(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function Ye(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),m=u(r),y=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===m)return He(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:h(y)*v+f(y)*b,y:-f(y)*v+h(y)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=d(w),m*=d(w));var M=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(m,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(m,2)*Math.pow(x.x,2)),E=(o!==a?1:-1)*d(M=M<0?0:M),O=E*(g*x.y/m),k=E*(-m*x.x/g),S=h(y)*O-f(y)*k+(t+s)/2,A=f(y)*O+h(y)*k+(e+c)/2,T={x:(x.x-O)/g,y:(x.y-k)/m},_=Ve({x:1,y:0},T),P=Ve(T,{x:(-x.x-O)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=_+(P%=2*p)*l,N=g*h(C),L=m*f(C);return{x:h(y)*N-f(y)*L+S,y:f(y)*N+h(y)*L+A}}function qe(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,m=u.sampleSize,y=void 0===m?30:m,v="number"==typeof l,b=t,x=e,w=0,M=[b,x,w],E=[b,x],O={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(O={x:b,y:x});for(var S=0;S<=y;S+=1){if(b=(f=Ye(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,d&&k.push({x:b,y:x}),g&&(w+=$e(E,[b,x])),E=[b,x],v&&w>=l&&l>M[2]){var A=(w-l)/(w-M[2]);O={x:E[0]*(1-A)+M[0]*A,y:E[1]*(1-A)+M[1]*A}}M=[b,x,w]}return v&&l>=w&&(O={x:s,y:c}),{length:w,point:O,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function Ue(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function Xe(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,m=void 0===g?10:g,y="number"==typeof c,v=t,b=e,x=0,w=[v,b,x],M=[v,b],E={x:0,y:0},O=[{x:v,y:b}];y&&c<=0&&(E={x:v,y:b});for(var k=0;k<=m;k+=1){if(v=(u=Ue(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,h&&O.push({x:v,y:b}),p&&(x+=$e(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);E={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&c>=x&&(E={x:a,y:s}),{length:x,point:E,min:{x:Math.min.apply(null,O.map((function(t){return t.x}))),y:Math.min.apply(null,O.map((function(t){return t.y})))},max:{x:Math.max.apply(null,O.map((function(t){return t.x}))),y:Math.max.apply(null,O.map((function(t){return t.y})))}}}function Ke(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 Ze(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,m=t,y=e,v=0,b=[m,y,v],x=[m,y],w={x:0,y:0},M=[{x:m,y:y}];g&&a<=0&&(w={x:m,y:y});for(var E=0;E<=p;E+=1){if(m=(c=Ke(t,e,n,r,i,o,E/p)).x,y=c.y,u&&M.push({x:m,y:y}),h&&(v+=$e(x,[m,y])),x=[m,y],g&&v>=a&&a>b[2]){var O=(v-a)/(v-b[2]);w={x:x[0]*(1-O)+b[0]*O,y:x[1]*(1-O)+b[1]*O}}b=[m,y,v]}return g&&a>=v&&(w={x:i,y:o}),{length:v,point:w,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function Qe(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=Ie(t),d="number"==typeof e,p=[],g=0,m=0,y=0,v=0,b=[],x=[],w=0,M={x:0,y:0},E=M,O=M,k=M,S=0,A=0,T=h.length;A<T;A+=1)p=(l="M"===(u=(f=h[A])[0]))?p:[g,m].concat(f.slice(1)),l?(E=M={x:y=f[1],y:v=f[2]},w=0,d&&e<.001&&(k=M)):"L"===u?(w=(r=He(p[0],p[1],p[2],p[3],(e||0)-S)).length,M=r.min,E=r.max,O=r.point):"A"===u?(w=(i=qe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,M=i.min,E=i.max,O=i.point):"C"===u?(w=(o=Xe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,M=o.min,E=o.max,O=o.point):"Q"===u?(w=(a=Ze(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,M=a.min,E=a.max,O=a.point):"Z"===u&&(w=(s=He((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,E=s.max,O=s.point),d&&S<e&&S+w>=e&&(k=O),x.push(E),b.push(M),S+=w,g=(c="Z"!==u?f.slice(-2):[y,v])[0],m=c[1];return d&&e>=S&&(k={x:g,y:m}),{length:S,point:k,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Je(t){return function(t){var e=0,n=0,r=0;return We(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function tn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Xe(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=Fe(n,r,e),s=Fe(r,i,e),c=Fe(i,o,e),l=Fe(a,s,e),u=Fe(s,c,e),f=Fe(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function en(t,e,n){var r=tn(t),i=tn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(o,a),h=[l,u],d=[f-o,f-a],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:en(g[0],g[1],f)}function nn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function rn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function on(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function an(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function sn(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function cn(t,e){const n=[];for(const r of t)n[r]=e;return n}function ln(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function un(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=ln(t,n);if(null!==e)return[e,r]}}return[null,null]}function fn(t){return!(t instanceof Date)&&"object"==typeof t}const hn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{y1:on(cn(t,0))}})]};function dn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function gn(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=dn,n=(e,n)=>dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===dn||t===pn?t:mn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function mn(){return 0}function yn(t){return null===t?NaN:+t}hn.props={};const vn=gn(dn),bn=vn.right,xn=vn.left,wn=gn(yn).center;var Mn=bn;function En(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function On(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function kn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Sn extends Map{constructor(t,e=Tn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(An(this,t))}has(t){return super.has(An(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function An({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Tn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function _n(t){return t}function Pn(t,...e){return jn(t,_n,_n,e)}function Cn(t,...e){return jn(t,Array.from,_n,e)}function Nn(t,e,...n){return jn(t,_n,e,n)}function Ln(t,e,...n){return jn(t,Array.from,e,n)}function jn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Sn,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Rn(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const o=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),o.sort(((t,n)=>{for(const r of e){const e=Bn(r[t],r[n]);if(e)return e}}))):(n=t.map(n),o.sort(((t,e)=>Bn(n[t],n[e])))),r=t,i=o,Array.from(i,(t=>r[t]))}var r,i;return t.sort(In(n))}function In(t=dn){if(t===dn)return Bn;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Bn(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var Dn=Array.prototype.slice;function Fn(t){return()=>t}const zn=Math.sqrt(50),Gn=Math.sqrt(10),Wn=Math.sqrt(2);function $n(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=zn?10:o>=Gn?5:o>=Wn?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?$n(t,e,2*n):[s,c,l]}function Hn(t,e,n){return $n(t=+t,e=+e,n=+n)[2]}function Vn(t){return Math.max(1,Math.ceil(Math.log(En(t))/Math.LN2)+1)}function Yn(){var t=_n,e=kn,n=Vn;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===kn&&([u,f]=function(t,e,n){let r;for(;;){const i=Hn(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?$n(e,t,n):$n(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),h[0]<=u&&(a=Hn(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===kn){const t=Hn(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var m,y=new Array(d+1);for(i=0;i<=d;++i)(m=y[i]=[]).x0=i>0?h[i-1]:u,m.x1=i<d?h[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Math.min(d,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);y[Math.min(d,t+(h[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Mn(h,o,0,d)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Fn(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Fn([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Fn(Array.isArray(t)?Dn.call(t):t),r):n},r}function qn(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function Un(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Xn(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Kn(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Zn(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Bn:In(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);Zn(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(Qn(t,n,e),i(t[r],o)>0&&Qn(t,n,r);a<s;){for(Qn(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?Qn(t,n,s):(++s,Qn(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Qn(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Jn(t,e,n=yn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>yn(n(t[r],r,t)))),e<=0)return Kn(r);if(e>=1)return Un(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return Zn(i,a,0,o,((t,e)=>Bn(r[t],r[e]))),a=function(t,e=dn){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?dn(t,i)>0:0===dn(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}function tr(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function er(t,e){return function(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return Xn(t);if(e>=1)return qn(t);var r,i=(r-1)*e,o=Math.floor(i),a=qn(Zn(t,o).subarray(0,o+1));return a+(Xn(t.subarray(o+1))-a)*(i-o)}}(t,.5,e)}function nr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function rr(t){return t}function ir(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),rr)}function or(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function ar(t=""){throw new Error(t)}function sr(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||("transform"===e?(t.attr(e,""),t.attr(e,i)):t.attr(e,i))}function cr(t){return null!=t&&!Number.isNaN(t)}function lr(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function ur(t,e){return fr(t,e)||{}}function fr(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[I(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function hr(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function dr(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function pr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function gr(t){return null===t||!1===t}function mr(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];E(o)&&E(t[i])?mr(t[i],o,n,r+1):t[i]=o}return t}}function yr(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function vr(t){return t.map(((t,e)=>e))}function br(t){return t[0]}function xr(t){return t[t.length-1]}function wr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Mr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Mr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Er(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=ln(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>cr(t)));return Array.from(Pn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function Or(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:dn(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Cr((n=>t(e[n])))}(t):"series"===t?Ar:"value"===t?Tr:"sum"===t?_r:"maxIndex"===t?Pr:()=>null}function kr(t,e){for(const n of t)n.sort(e)}function Sr(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Ar(t,e,n){return Cr((t=>n[t]))}function Tr(t,e,n){return Cr((t=>e[t]))}function _r(t,e,n){const r=vr(t),i=Array.from(Pn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Cr((t=>o.get(n[t])))}function Pr(t,e,n){const r=vr(t),i=Array.from(Pn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,Un(n,(t=>e[t]))])));return Cr((t=>o.get(n[t])))}function Cr(t){return(e,n)=>dn(t(e),t(n))}const Nr=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:c,encode:l,style:u={}}=s,[f,h]=ln(l,"y"),[d,p]=ln(l,"y1"),[g]=a?un(l,"series","color"):ln(l,"color"),m=Er(e,t,s),y=Or(n)(c,f,g);y&&kr(m,y);const v=new Array(t.length),b=new Array(t.length),x=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=d?+d[t[0]]:0,n=[],i=[];for(const r of t){const t=x[r]=+f[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===f[o[s]];)s--;for(;c<a.length-1&&0===f[a[c]];)c++;w.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=x[t];l=v[t]=(b[t]=l)+e}let u=e;for(const t of n){const e=x[t];e>0?u=v[t]=(b[t]=u)+e:v[t]=b[t]=u}}const E=new Set(w),O=new Set(M),k="y"===i?v:b,S="y"===o?v:b;return[t,Y({},s,{encode:{y0:on(f,h),y:rn(k,h),y1:rn(S,p)},style:Object.assign({first:(t,e)=>E.has(e),last:(t,e)=>O.has(e)},u)})]}};Nr.props={};const Lr=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(gr(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>ln(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e])).join(", ")};return[t,Y({},n,{tooltip:{title:s}})]}};Lr.props={};const jr=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{x:on(cn(t,0))},scale:{x:{guide:null}}})]};jr.props={};const Rr=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{y:on(cn(t,0))},scale:{y:{guide:null}}})]};Rr.props={};const Ir=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{size:an(cn(t,3))}})]};Ir.props={};const Br=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=he(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map((({value:t})=>t)),a=t.map((t=>o.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,Y({},e,{encode:{key:rn(a)}})]};Br.props={};const Dr=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=ln(n,"color");return[t,Y({},e,{encode:{series:rn(o,a)}})]};Dr.props={};const Fr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{y:rn(n)}})]};Fr.props={};const zr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{x:rn(n)}})]};zr.props={};const Gr=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=ln(n,"y");return[t,Y({},e,{encode:{y1:rn([...i])}})]};Gr.props={};const Wr=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=ln(n,"x");return[t,Y({},e,{encode:{x1:rn([...i])}})]};Wr.props={};const $r=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(gr(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,Y({},n,{tooltip:{items:a}})]}};$r.props={};const Hr=()=>(t,e)=>[t,Y({scale:{x:{padding:0},y:{padding:0}}},e)];Hr.props={};const Vr=()=>(t,e)=>{const{data:n,style:r={}}=e,i=he(e,["data","style"]),{x:o,y:a}=r,s=he(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],Y({},i,{data:[0],cartesian:!0,encode:{x:rn([o||0]),y:rn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};Vr.props={};const Yr=()=>(t,e)=>{const{style:n={}}=e;return[t,Y({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};Yr.props={};const qr=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(fn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,Y({},e,{encode:{x:rn(i),y:rn(o)}})]};qr.props={};const Ur=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,Y({},e,{encode:{series:an(cn(t,void 0))}})]};Ur.props={};const Xr=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return he(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=ln(s,"y"),[f]=un(s,"series","color"),h=Sr(f,l),d=Er(e,t,o),p=Or(r)(a,u,f);p&&kr(d,p);const g=new Array(t.length);for(const t of d){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=h[e]}return[t,Y({},o,{scale:{series:{domain:h,paddingInner:i}},encode:{series:rn(g)}})]}};Xr.props={};const Kr=t=>{const{groupBy:e=["x"],reducer:n=((t,e)=>e[t[0]]),orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map((t=>[t,ln(s,t)[0]]));if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(Pn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=ln(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[cn(t,u)]:un(s,"enterDuration",cn(t,u)),[h]=un(s,"enterDelay",cn(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=qn(n,(t=>+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,Y({},a,{encode:{enterDuration:an(f),enterDelay:an(d)}})]}};Kr.props={};const Zr=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=he(i,["x"]),s=Object.entries(a).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,ln(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Er(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>Xn(t,(t=>e[+t])),max:(t,e)=>qn(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>tr(t,(t=>e[+t])),median:(t,e)=>er(t,(t=>e[+t])),sum:(t,e)=>nr(t,(t=>e[+t])),deviation:(t,e)=>On(t,(t=>e[+t]))}[t]||qn}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=gr(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,Y({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,rn(e,ln(i,t)[1])])))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Qr(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function Jr(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function ti(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}Zr.props={};const ei=Math.sqrt(50),ni=Math.sqrt(10),ri=Math.sqrt(2);function ii(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=ei?10:o>=ni?5:o>=ri?2:1)*10**i:-(10**-i)/(o>=ei?10:o>=ni?5:o>=ri?2:1)}function oi(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=ei?i*=10:o>=ni?i*=5:o>=ri&&(i*=2),e<t?-i:i}const ai=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=ii(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=ii(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=ii(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},si=1e3,ci=6e4,li=36e5,ui=864e5,fi=6048e5,hi=2592e6,di=31536e6;function pi(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);+l<+e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const gi=pi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),mi=pi(si,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+si*e)}),(t=>t.getSeconds())),yi=pi(ci,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ci*e)}),(t=>t.getMinutes())),vi=pi(li,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+li*e)}),(t=>t.getHours())),bi=pi(ui,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+ui*e)}),(t=>t.getDate()-1)),xi=pi(hi,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),wi=pi(fi,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+fi*e)}),(t=>{const e=xi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/fi)})),Mi=pi(di,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Ei={millisecond:gi,second:mi,minute:yi,hour:vi,day:bi,week:wi,month:xi,year:Mi},Oi=pi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),ki=pi(si,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+si*e)}),(t=>t.getUTCSeconds())),Si=pi(ci,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ci*e)}),(t=>t.getUTCMinutes())),Ai=pi(li,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+li*e)}),(t=>t.getUTCHours())),Ti=pi(ui,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+ui*e)}),(t=>t.getUTCDate()-1)),_i=pi(hi,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Pi=pi(fi,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+fi*e)}),(t=>{const e=_i.floor(t),n=new Date(+t);return Math.floor((+n-+e)/fi)})),Ci=pi(di,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),Ni={millisecond:Oi,second:ki,minute:Si,hour:Ai,day:Ti,week:Pi,month:_i,year:Ci};function Li(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Ni:Ei,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,h=r||(a-o)/f,d=s.length,p=ti(s,h,0,d,u);let g;if(p===d){g=[c,oi(o/c.duration,a/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(oi(o,a,f),1)]}return g}const ji=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Li(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var Ri=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Ii={}.toString,Bi=function(t,e){return Ii.call(t)==="[object "+e+"]"},Di=function(t){return null==t},Fi=function(t){return Array.isArray?Array.isArray(t):Bi(t,"Array")},zi=function(t){return"object"==typeof t&&null!==t},Gi=function(t){if(!zi(t)||!Bi(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},Wi=function(t){return Bi(t,"Number")},$i=function(t){return null===t},Hi=function(t){return void 0===t};function Vi(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&Gi(o)?(Gi(t[i])||(t[i]={}),n<r?Vi(t[i],o,n+1,r):t[i]=e[i]):Fi(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Yi=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Vi(t,e[r]);return t},qi=function(t,e){if(!Ri(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},Ui=function(t){return t};function Xi(t){return Di(t)?0:Ri(t)?t.length:Object.keys(t).length}function Ki(t){return!Hi(t)&&!$i(t)&&!Number.isNaN(t)}const Zi=t=>e=>-t(-e),Qi=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?Zi(r):r},Ji=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?Zi(n):n},to=(t,e,n,r)=>{const i=t<0,o=Qi(r,i),a=Ji(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};var eo={exports:{}},no={exports:{}},ro=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},io=Array.prototype.concat,oo=Array.prototype.slice,ao=no.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];ro(i)?e=io.call(e,oo.call(i)):e.push(i)}return e};ao.wrap=function(t){return function(){return t(ao(arguments))}};var so={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},co=no.exports,lo=Object.hasOwnProperty,uo=Object.create(null);for(var fo in so)lo.call(so,fo)&&(uo[so[fo]]=fo);var ho=eo.exports={to:{},get:{}};function po(t,e,n){return Math.min(Math.max(e,t),n)}function go(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}ho.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=ho.get.hsl(t),n="hsl";break;case"hwb":e=ho.get.hwb(t),n="hwb";break;default:e=ho.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},ho.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:lo.call(so,e[1])?((i=so[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=po(i[n],0,255);return i[3]=po(i[3],0,1),i},ho.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,po(parseFloat(e[2]),0,100),po(parseFloat(e[3]),0,100),po(isNaN(n)?1:n,0,1)]}return null},ho.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,po(parseFloat(e[2]),0,100),po(parseFloat(e[3]),0,100),po(isNaN(n)?1:n,0,1)]}return null},ho.to.hex=function(){var t=co(arguments);return"#"+go(t[0])+go(t[1])+go(t[2])+(t[3]<1?go(Math.round(255*t[3])):"")},ho.to.rgb=function(){var t=co(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},ho.to.rgb.percent=function(){var t=co(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},ho.to.hsl=function(){var t=co(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},ho.to.hwb=function(){var t=co(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},ho.to.keyword=function(t){return uo[t.slice(0,3)]};var mo=eo.exports;function yo(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function vo(t){const e=mo.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*yo(a,o,e+1/3),255*yo(a,o,e),255*yo(a,o,e-1/3),i]}(r):null}const bo=(t,e)=>n=>t*(1-n)+e*n,xo=(t,e)=>"number"==typeof t&&"number"==typeof e?bo(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=vo(t),r=vo(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,wo=(t,e)=>{const n=bo(t,e);return t=>Math.round(n(t))};function Mo({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Eo(t){return"object"==typeof t?t.valueOf():t}class Oo extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Eo,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Mo({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Mo({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class ko{constructor(t){this.options=Yi({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Yi({},this.options,t),this.rescale(t)}rescale(t){}}const So=Symbol("defaultUnknown");function Ao(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function To(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==So)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function _o(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Po extends ko{getDefaultOptions(){return{domain:[],range:[],unknown:So}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Ao(this.domainIndexMap,this.getDomain(),this.domainKey),To({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Ao(this.rangeIndexMap,this.getRange(),this.rangeKey),To({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=_o(e),this.rangeKey=_o(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Po(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Co(t){return Math.round(1e12*t)/1e12}function No(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),y=m.reduce(((t,e)=>t+e)),v=g/y,b=new Oo(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new Oo(e.map(((t,e)=>{const n=m[e]*v+p;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),M=u+(h-(w-w/c*i))*s;let E=a?Math.round(M):M;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=Co(E);const n=e[t];E+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Lo extends Po{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:So,flex:[]}}constructor(t){super(t)}clone(){return new Lo(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return No(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const jo=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=ii(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class Ro extends ko{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:jo}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return Wi(r)&&Wi(i)?t(r,i,n):[]}clone(){return new Ro(this.options)}}function Io(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Bo=[1,5,2,2.5,4,3],Do=100*Number.EPSILON;function Fo(t,e,n,r,i,o){const a=Xi(e),s=qi(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<Do||o-l<Do)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function zo(t,e,n){const r=Xi(e);return 1-qi(e,t)/(r-1)-n+1}function Go(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Wo(t,e){return t>=e?2-(t-1)/(e-1):1}function $o(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Ho(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const Vo=(t,e,n=5,r=!0,i=Bo,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=zo(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=Wo(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=Ho(t,e,h*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,m=Math.ceil(t/h)*c;if(g<=m){const n=m-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,m=Fo(l,i,c,n,d,p),y=$o(t,e,n,d),v=Go(f,a,t,e,n,d),b=1,x=o[0]*m+o[1]*y+o[2]*v+o[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=Io(s.lmax),u=Io(s.lmin),f=Io(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Io(u);for(let t=1;t<h;t+=1)d[t]=Io(d[t-1]+f);return d};class Yo extends ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Vo}}map(t){return Ki(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Yo(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return Wi(r)&&Wi(i)?n(r,i,e):[]}}const qo=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=Jr(r,i),c=n(o,a)):(s=Jr(i,r),c=n(a,o)),Qr(c,s)},Uo=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Jr(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=ti(t,e,1,r)-1,a=i[n];return Qr(o[n],a)(e)}},Xo=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Uo:qo)(t,e,r?wo:n);class Ko extends ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:bo,tickCount:5}}map(t){return Ki(t)?this.output(t):this.options.unknown}invert(t){return Ki(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return ai}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):Ui}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=Xo(n.map(t),r,o,i);this.output=Qr(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=Xo(i,r.map(t),bo);this.input=Qr(e,n,o)}}class Zo extends Ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:xo,tickMethod:jo,tickCount:5}}chooseTransforms(){return[Ui,Ui]}clone(){return new Zo(this.options)}}class Qo extends Lo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:So,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Qo(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Jo=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ta extends Ko{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:xo,tickMethod:jo,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[Ui,Ui];const e=.5===t?Jo:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new ta(this.options)}}class ea extends ta{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:xo,tickMethod:jo,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ea(this.options)}}class na extends ko{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!Ki(t))return this.options.unknown;const e=ti(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new na(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ra=(t,e,n,r=10)=>{const i=t<0,o=Ji(r,i),a=Qi(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=jo(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=jo(u,f,t).map(o)}return s?h.reverse():h};class ia extends Ko{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:xo,tickMethod:ra,tickCount:5}}chooseNice(){return to}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[Qi(t,n),Ji(t,n)]}clone(){return new ia(this.options)}}class oa extends na{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Vo}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=ai(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new oa(this.options)}}function aa(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class sa extends na{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Vo}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(aa(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new sa(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var ca=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,la=/\[([^]*?)\]/gm;function ua(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function fa(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var ha=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],da=["January","February","March","April","May","June","July","August","September","October","November","December"],pa=ua(da,3),ga=fa({},{dayNamesShort:ua(ha,3),dayNames:ha,monthNamesShort:pa,monthNames:da,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),ma=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},ya={D:function(t){return String(t.getDate())},DD:function(t){return ma(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return ma(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return ma(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return ma(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return ma(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return ma(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return ma(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return ma(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return ma(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return ma(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return ma(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ma(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ma(Math.floor(Math.abs(e)/60),2)+":"+ma(Math.abs(e)%60,2)}},va={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const ba=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Li(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function xa(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class wa extends Ko{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:ba,interpolate:bo,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return ji}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?Ni:Ei,r=e?xa:Ui;return e=>function(t,e,n){if(void 0===e&&(e=va.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=va[e]||e).replace(la,(function(t,e){return r.push(e),"@@@"}));var i=fa(fa({},ga),n);return(e=e.replace(ca,(function(e){return ya[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new wa(this.options)}}var Ma,Ea=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let Oa=Ma=class extends Zo{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Ui,tickMethod:jo,tickCount:5}}constructor(t){super(t)}clone(){return new Ma(this.options)}};function ka(t,e,n){if(null===t)return[-.5,.5];const r=Sr(t,e),i=new Lo({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Sa(t,e,n){return e*(1-t)+n*t}Oa=Ma=Ea([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return Wi(n)?Math.round(n):n})(i):i;this.output=Qr(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return Qr(bo(0,1),Jr(e,n))}))],Oa);const Aa=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=ln(o,"x"),[u]=ln(o,"y"),f=ka(l,s,n),h=ka(u,c,r),d=t.map((()=>Sa(i(),...h))),p=t.map((()=>Sa(i(),...f)));return[t,Y({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:rn(d),dx:rn(p)}})]}};Aa.props={};const Ta=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=ln(i,"x"),c=ka(s,a,e),l=t.map((()=>Sa(n(),...c)));return[t,Y({scale:{x:{padding:.5}}},r,{encode:{dx:rn(l)}})]}};Ta.props={};const _a=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=he(r,["x"]),o=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,ln(r,t)[0]])),a=o.map((([e])=>[e,new Array(t.length)])),s=Er(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap((t=>o.map((([,e])=>+e[t])))),[n,r]=kn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<o.length;n++){const[,r]=o[n],[,i]=a[n];i[t]=+r[t]+e}}return[t,Y({},n,{encode:Object.fromEntries(a.map((([t,e])=>[t,rn(e,ln(r,t)[1])])))})]}};_a.props={};const Pa=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=ln(i,"y"),[a,s]=ln(i,"y1");n?un(i,"series","color"):ln(i,"color");const c=Er(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+o[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=o[r]>i?i:o[r]}}return[t,Y({},r,{encode:{y1:rn(l,s)}})]}};function Ca(t,e){return[t[0]]}function Na(t,e){return[t[t.length-1]]}function La(t,e){return[t[Un(t,(t=>e[t]))]]}function ja(t,e){return[t[Kn(t,(t=>e[t]))]]}Pa.props={};const Ra=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=Er(e,t,i),[s]=ln(o,n),c=function(t){return"function"==typeof t?t:{first:Ca,last:Na,max:La,min:ja}[t]||Ca}(r);return[a.flatMap((t=>c(t,s))),i]}};Ra.props={};const Ia=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return Ra(Object.assign({channel:"x",selector:e},n))};Ia.props={};const Ba=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return Ra(Object.assign({channel:"y",selector:e},n))};function Da(t){return e=>null===e?t:`${t} of ${e}`}function Fa(){return[(t,e)=>tr(t,(t=>+e[t])),Da("mean")]}function za(){return[(t,e)=>er(t,(t=>+e[t])),Da("median")]}function Ga(){return[(t,e)=>qn(t,(t=>+e[t])),Da("max")]}function Wa(){return[(t,e)=>Xn(t,(t=>+e[t])),Da("min")]}function $a(){return[(t,e)=>t.length,Da("count")]}function Ha(){return[(t,e)=>nr(t,(t=>+e[t])),Da("sum")]}function Va(){return[(t,e)=>e[t[0]],Da("first")]}function Ya(){return[(t,e)=>e[t[t.length-1]],Da("last")]}Ba.props={};const qa=(t={})=>{const{groupBy:e}=t,n=he(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:Fa,max:Ga,count:$a,first:Va,last:Ya,sum:Ha,min:Wa,median:za}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=ln(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=ln(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},sn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=ln(o,t),r=a.map((t=>e[t[0]]));return[t,rn(r,n)]})),l=a.map((t=>i[t[0]]));return[vr(a),Y({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};qa.props={};const Ua=(t={})=>{const{channels:e=["x","y"]}=t,n=he(t,["channels"]);return qa(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Er(e,t,n)}))};Ua.props={};const Xa=(t={})=>Ua(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));Xa.props={};const Ka=(t={})=>Ua(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));Ka.props={};const Za=(t={})=>Ua(Object.assign(Object.assign({},t),{channels:["color"]}));function Qa(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=he(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=ln(c,a),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=ln(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>qn(t,(t=>+o[t]));if("min"===i)return t=>Xn(t,(t=>+o[t]));if("sum"===i)return t=>nr(t,(t=>+o[t]));if("median"===i)return t=>er(t,(t=>+o[t]));if("mean"===i)return t=>tr(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(a,s,c),d=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?Rn(Nn(t,e,n),(([t,e],[n,r])=>dn(e,r)||dn(t,n))):Rn(Pn(t,n),(([t,n],[r,i])=>e(n,i)||dn(t,r)))).map((([t])=>t))}(d,h,(t=>f[t]));i&&p.reverse();const g="number"==typeof o?[0,o]:o,m=o?p.slice(...g):p;return[t,Y(e,{scale:{[a]:{domain:m}}})]}Za.props={};const Ja=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=he(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?Qa(t,a,Object.assign({reverse:e,slice:n,channel:r},o)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=ln(o,i),s=Rn(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};Ja.props={};const ts=(t={})=>Ja(Object.assign(Object.assign({},t),{channel:"x"}));ts.props={};const es=(t={})=>Ja(Object.assign(Object.assign({},t),{channel:"color"}));es.props={};const ns=(t={})=>Ja(Object.assign(Object.assign({},t),{channel:"y"}));ns.props={};const rs=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=ln(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):ln(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>nr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Ln(t,l,(t=>s[t])).map((t=>t[1]));return[t,Y({},i,{scale:{x:{flex:u}}})]}};function is([t,e],[n,r]){return[t-n,e-r]}function os([t,e],[n,r]){return[t+n,e+r]}function as([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function ss([t,e]){return Math.atan2(e,t)}function cs([t,e]){return ss([t,e])+Math.PI/2}function ls(t,e){const n=ss(t),r=ss(e);return n<r?r-n:2*Math.PI-(n-r)}function us(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function fs([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function hs(t,e,n){const r=t.length;if(0===r)return[];const{innerWidth:i,innerHeight:o}=n,a=o/i;let s=Math.ceil(Math.sqrt(e/a)),c=i/s,l=Math.ceil(e/s),u=l*c;for(;u>o;)s+=1,c=i/s,l=Math.ceil(e/s),u=l*c;const f=o-l*c,h=l<=1?0:f/(l-1),[d,p]=l<=1?[(i-r*c)/(r-1),(o-c)/2]:[0,0];return t.map(((t,e)=>{const[n,r,i,o]=us(t),a=e%s,u=Math.floor(e/s);return`translate(${a*c-n+d*a}, ${(l-u-1)*c+f-r-h*u-p}) scale(${c/i}, ${c/o})`}))}rs.props={};const ds=()=>(t,e)=>[t,Y({},e,{modifier:hs,axis:!1})];ds.props={};const ps="thresholds";function gs(t){const[e,n]=kn(t);return Math.min(200,function(t,e,n){const r=En(t),i=On(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const ms=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=he(t,["groupChannels","binChannels"]),i={};return qa(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(ps))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=ln(a,t);return e})),c=ur(r,ps),l=t.filter((t=>s.every((e=>cr(e[t]))))),u=[...e.map((t=>{const[e]=ln(a,t);return e})).filter(cr).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||gs(n),o=Yn().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(Pn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};ms.props={};const ys=(t={})=>{const{thresholds:e}=t;return ms(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function vs(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const m=Math.floor((t+1)*c)+1,y=[o(h),a(h)];for(l=u=-1;g<m;g++)u=.5*Math.abs((y[0]-e)*(o(g)-y[1])-(y[0]-a(g))*(n-y[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}ys.props={};const bs=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return vs;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Kn(t,(t=>n[t]))]],max:(t,e,n)=>[t[Un(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],Jn(r,.5,i))]];var r,i}},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=Er(r,t,e),[s]=ln(o,"x"),[c]=ln(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};bs.props={};const xs=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=ln(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(cr);if(0===o.length)return[e,n];const a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e)),c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]]))})]));return[s,Y({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function ws(t){return function(){return t}}xs.props={};const Ms=Math.abs,Es=Math.atan2,Os=Math.cos,ks=Math.max,Ss=Math.min,As=Math.sin,Ts=Math.sqrt,_s=1e-12,Ps=Math.PI,Cs=Ps/2,Ns=2*Ps;function Ls(t){return t>=1?Cs:t<=-1?-Cs:Math.asin(t)}const js=Math.PI,Rs=2*js,Is=1e-6,Bs=Rs-Is;function Ds(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Fs{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ds:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ds;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>Is)if(Math.abs(u*s-c*l)>Is&&i){let h=n-o,d=r-a,p=s*s+c*c,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((js-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Is&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Is||Math.abs(this._y1-l)>Is)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%Rs+Rs),f>Bs?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>Is&&this._append`A${n},${n},0,${+(f>=js)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function zs(){return new Fs}function Gs(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Fs(e)}function Ws(t){return t.innerRadius}function $s(t){return t.outerRadius}function Hs(t){return t.startAngle}function Vs(t){return t.endAngle}function Ys(t){return t&&t.padAngle}function qs(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/Ts(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,w=i-o,M=h*g-p*d,E=(b<0?-1:1)*Ts(ks(0,w*w*x-M*M)),O=(M*b-v*E)/x,k=(-M*v-b*E)/x,S=(M*b+v*E)/x,A=(-M*v+b*E)/x,T=O-m,_=k-y,P=S-m,C=A-y;return T*T+_*_>P*P+C*C&&(O=S,k=A),{cx:O,cy:k,x01:-u,y01:-f,x11:O*(i/w-1),y11:k*(i/w-1)}}function Us(){var t=Ws,e=$s,n=ws(0),r=null,i=Hs,o=Vs,a=Ys,s=null,c=Gs(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Cs,p=o.apply(this,arguments)-Cs,g=Ms(p-d),m=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>_s)if(g>Ns-_s)s.moveTo(h*Os(d),h*As(d)),s.arc(0,0,h,d,p,!m),f>_s&&(s.moveTo(f*Os(p),f*As(p)),s.arc(0,0,f,p,d,m));else{var y,v,b=d,x=p,w=d,M=p,E=g,O=g,k=a.apply(this,arguments)/2,S=k>_s&&(r?+r.apply(this,arguments):Ts(f*f+h*h)),A=Ss(Ms(h-f)/2,+n.apply(this,arguments)),T=A,_=A;if(S>_s){var P=Ls(S/f*As(k)),C=Ls(S/h*As(k));(E-=2*P)>_s?(w+=P*=m?1:-1,M-=P):(E=0,w=M=(d+p)/2),(O-=2*C)>_s?(b+=C*=m?1:-1,x-=C):(O=0,b=x=(d+p)/2)}var N=h*Os(b),L=h*As(b),j=f*Os(M),R=f*As(M);if(A>_s){var I,B=h*Os(x),D=h*As(x),F=f*Os(w),z=f*As(w);if(g<Ps)if(I=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<_s))return[t+(h=(u*(e-o)-f*(t-i))/h)*c,e+h*l]}(N,L,F,z,B,D,j,R)){var G=N-I[0],W=L-I[1],$=B-I[0],H=D-I[1],V=1/As(function(t){return t>1?0:t<-1?Ps:Math.acos(t)}((G*$+W*H)/(Ts(G*G+W*W)*Ts($*$+H*H)))/2),Y=Ts(I[0]*I[0]+I[1]*I[1]);T=Ss(A,(f-Y)/(V-1)),_=Ss(A,(h-Y)/(V+1))}else T=_=0}O>_s?_>_s?(y=qs(F,z,N,L,h,_,m),v=qs(B,D,j,R,h,_,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),_<A?s.arc(y.cx,y.cy,_,Es(y.y01,y.x01),Es(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,_,Es(y.y01,y.x01),Es(y.y11,y.x11),!m),s.arc(0,0,h,Es(y.cy+y.y11,y.cx+y.x11),Es(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,_,Es(v.y11,v.x11),Es(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!m)):s.moveTo(N,L),f>_s&&E>_s?T>_s?(y=qs(j,R,B,D,f,-T,m),v=qs(N,L,F,z,f,-T,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),T<A?s.arc(y.cx,y.cy,T,Es(y.y01,y.x01),Es(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,Es(y.y01,y.x01),Es(y.y11,y.x11),!m),s.arc(0,0,f,Es(y.cy+y.y11,y.cx+y.x11),Es(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,T,Es(v.y11,v.x11),Es(v.y01,v.x01),!m))):s.arc(0,0,f,M,w,m):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ps/2;return[Os(r)*n,As(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ws(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ws(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ws(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:ws(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:ws(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function Xs(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Ks(t){this._context=t}function Zs(t){return new Ks(t)}function Qs(t){return t[0]}function Js(t){return t[1]}function tc(t,e){var n=ws(!0),r=null,i=Zs,o=null,a=Gs(s);function s(s){var c,l,u,f=(s=Xs(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Qs:ws(t),e="function"==typeof e?e:void 0===e?Js:ws(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:ws(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function ec(t,e,n){var r=null,i=ws(!0),o=null,a=Zs,s=null,c=Gs(l);function l(l){var u,f,h,d,p,g=(l=Xs(l)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===m)if(m=!m)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(y[h],v[h]);s.lineEnd(),s.areaEnd()}m&&(y[u]=+t(d,u,l),v[u]=+e(d,u,l),s.point(r?+r(d,u,l):y[u],n?+n(d,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return tc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Qs:ws(+t),e="function"==typeof e?e:ws(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Js:ws(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:ws(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ws(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:ws(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ws(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:ws(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}zs.prototype=Fs.prototype,Ks.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var nc=ic(Zs);function rc(t){this._curve=t}function ic(t){function e(e){return new rc(t(e))}return e._curve=t,e}function oc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(ic(t)):e()._curve},t}function ac(){}function sc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function cc(t,e){this._context=t,this._k=(1-e)/6}function lc(t,e){this._context=t,this._k=(1-e)/6}function uc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>_s){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>_s){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function fc(t,e){this._context=t,this._alpha=e}rc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},cc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:sc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:sc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new cc(t,e)}return n.tension=function(e){return t(+e)},n}(0),lc.prototype={areaStart:ac,areaEnd:ac,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:sc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new lc(t,e)}return n.tension=function(e){return t(+e)},n}(0),fc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:uc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var hc=function t(e){function n(t){return e?new fc(t,e):new cc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function dc(t,e){this._context=t,this._alpha=e}dc.prototype={areaStart:ac,areaEnd:ac,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:uc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var pc=function t(e){function n(t){return e?new dc(t,e):new lc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function gc(t){this._context=t}function mc(t){return new gc(t)}function yc(t,e){this._context=t,this._t=e}function vc(t){return new yc(t,.5)}function bc(t){return new yc(t,0)}function xc(t){return new yc(t,1)}function wc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Mc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Ec(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Oc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function kc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Sc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function Ac(t){return Oc(t)||Mc(t)}function Tc(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function _c(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}gc.prototype={areaStart:ac,areaEnd:ac,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},yc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Pc="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Cc={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),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=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=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.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 c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}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 c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&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}(Cc);var Nc=Cc.exports;function Lc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function jc(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Rc(){}var Ic=.7,Bc=1/Ic,Dc="\\s*([+-]?\\d+)\\s*",Fc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",zc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gc=/^#([0-9a-f]{3,8})$/,Wc=new RegExp("^rgb\\("+[Dc,Dc,Dc]+"\\)$"),$c=new RegExp("^rgb\\("+[zc,zc,zc]+"\\)$"),Hc=new RegExp("^rgba\\("+[Dc,Dc,Dc,Fc]+"\\)$"),Vc=new RegExp("^rgba\\("+[zc,zc,zc,Fc]+"\\)$"),Yc=new RegExp("^hsl\\("+[Fc,zc,zc]+"\\)$"),qc=new RegExp("^hsla\\("+[Fc,zc,zc,Fc]+"\\)$"),Uc={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 Xc(){return this.rgb().formatHex()}function Kc(){return this.rgb().formatRgb()}function Zc(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Gc.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Qc(e):3===n?new tl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Jc(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Jc(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=Wc.exec(t))?new tl(e[1],e[2],e[3],1):(e=$c.exec(t))?new tl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Hc.exec(t))?Jc(e[1],e[2],e[3],e[4]):(e=Vc.exec(t))?Jc(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Yc.exec(t))?il(e[1],e[2]/100,e[3]/100,1):(e=qc.exec(t))?il(e[1],e[2]/100,e[3]/100,e[4]):Uc.hasOwnProperty(t)?Qc(Uc[t]):"transparent"===t?new tl(NaN,NaN,NaN,0):null}function Qc(t){return new tl(t>>16&255,t>>8&255,255&t,1)}function Jc(t,e,n,r){return r<=0&&(t=e=n=NaN),new tl(t,e,n,r)}function tl(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function el(){return"#"+rl(this.r)+rl(this.g)+rl(this.b)}function nl(){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 rl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function il(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new al(t,e,n,r)}function ol(t){if(t instanceof al)return new al(t.h,t.s,t.l,t.opacity);if(t instanceof Rc||(t=Zc(t)),!t)return new al;if(t instanceof al)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,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new al(a,s,c,t.opacity)}function al(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function sl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function cl(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ll(t,e){var n=Math.min.apply(Math,ve([],ye(t),!1)),r=Math.min.apply(Math,ve([],ye(e),!1));return{x:n,y:r,width:Math.max.apply(Math,ve([],ye(t),!1))-n,height:Math.max.apply(Math,ve([],ye(e),!1))-r}}function ul(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function fl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function hl(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),c=1/0,l=-1/0,u=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;o<a?o<h&&h<a&&u.push(h):a<h&&h<o&&u.push(h)}for(f=0;f<u.length;f++){var d=ul(t,0,n,r,i,u[f]);d<c&&(c=d),d>l&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,y=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var v=p+f;o<a?o<v&&v<a&&y.push(v):a<v&&v<o&&y.push(v)}for(f=0;f<y.length;f++){var b=fl(0,e,n,r,i,y[f]);b<g&&(g=b),b>m&&(m=b)}return{x:c,y:g,width:l-c,height:m-g}}Lc(Rc,Zc,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Xc,formatHex:Xc,formatHsl:function(){return ol(this).formatHsl()},formatRgb:Kc,toString:Kc}),Lc(tl,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Rc||(i=Zc(i)),i?new tl((i=i.rgb()).r,i.g,i.b,i.opacity):new tl):new tl(t,e,n,null==r?1:r);var i}),jc(Rc,{brighter:function(t){return t=null==t?Bc:Math.pow(Bc,t),new tl(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Ic:Math.pow(Ic,t),new tl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:el,formatHex:el,formatRgb:nl,toString:nl})),Lc(al,(function(t,e,n,r){return 1===arguments.length?ol(t):new al(t,e,n,null==r?1:r)}),jc(Rc,{brighter:function(t){return t=null==t?Bc:Math.pow(Bc,t),new al(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Ic:Math.pow(Ic,t),new al(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new tl(sl(t>=240?t-240:t+120,i,r),sl(t,i,r),sl(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var dl=1e-4;function pl(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],l=20;o&&o>200&&(l=o/10);for(var u=1/l,f=u/10,h=0;h<=l;h++){var d=h*u,p=[i.apply(void 0,ve([],ye(t.concat([d])),!1)),i.apply(void 0,ve([],ye(e.concat([d])),!1))];(v=cl(c[0],c[1],p[0],p[1]))<s&&(a=d,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(h=0;h<32&&!(f<dl);h++){var m=a-f,y=a+f,v=(p=[i.apply(void 0,ve([],ye(t.concat([m])),!1)),i.apply(void 0,ve([],ye(e.concat([m])),!1))],cl(c[0],c[1],p[0],p[1]));if(m>=0&&v<s)a=m,s=v;else{var b=[i.apply(void 0,ve([],ye(t.concat([y])),!1)),i.apply(void 0,ve([],ye(e.concat([y])),!1))],x=cl(c[0],c[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):f*=.5}}return{x:i.apply(void 0,ve([],ye(t.concat([a])),!1)),y:i.apply(void 0,ve([],ye(e.concat([a])),!1))}}function gl(t,e,n,r){return cl(t,e,n,r)}function ml(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function yl(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function vl(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 bl(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,u=[];if(C(s,0))C(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;C(f,0)?u.push(-c/(2*s)):f>0&&(o=(-c-(a=Math.sqrt(f)))/(2*s),(i=(-c+a)/(2*s))>=0&&i<=1&&u.push(i),o>=0&&o<=1&&u.push(o))}return u}function xl(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=bl(t,n,i,a),f=bl(e,r,o,s),h=0;h<u.length;h++)c.push(vl(t,n,i,a,u[h]));for(h=0;h<f.length;h++)l.push(vl(e,r,o,s,f[h]));return ll(c,l)}function wl(t,e,n,r,i,o,a,s,c,l,u){var f=function(t,e,n,r,i,o,a,s,c,l,u){return pl([t,n,i,a],[e,r,o,s],c,l,vl,u)}(t,e,n,r,i,o,a,s,c,l,u);return cl(f.x,f.y,c,l)}function Ml(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=cl(r[0],r[1],i[0],i[1])}return e}(t)}function El(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ol(t,e,n){var r=t+n-2*e;if(C(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function kl(t,e,n,r,i,o){var a=Ol(t,n,i)[0],s=Ol(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(El(t,n,i,a)),void 0!==s&&l.push(El(e,r,o,s)),ll(c,l)}function Sl(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return pl([t,n,i],[e,r,o],a,s,El)}(t,e,n,r,i,o,a,s);return cl(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Pc||"undefined"!=typeof self&&self;var Al={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,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var h=t[r],d=i,p=o;for(n(t,i,r),a(t[o],h)>0&&n(t,i,o);d<p;){for(n(t,d,p),d++,p--;a(t[d],h)<0;)d++;for(;a(t[p],h)>0;)p--}0===a(t[i],h)?n(t,i,p):n(t,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-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;r<e.length;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=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];c(i,t.leaf?r(a):a)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(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(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;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(this.data.height<n.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=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.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(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));v(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);v(t,u,f,c,this.compareMinY);for(var h=u;h<=f;h+=c){var d=Math.min(h+c-1,f);i.children.push(this._build(t,h,d,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;s<e.children.length;s++){var c=e.children[s],l=f(c),u=d(t,c)-l;u<o?(o=u,i=l<i?l:i,a=c):u===o&&l<i&&(i=l,a=c)}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),c(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=y(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=y([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;a<=n-e;a++){var c=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),u=p(c,l),h=f(c)+f(l);u<i?(i=u,r=a,o=h<o?h:o):u===i&&h<o&&(o=h,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&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),l=h(o)+h(a),u=e;u<n-e;u++){var f=t.children[u];c(o,t.leaf?i(f):f),l+=h(o)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];c(a,t.leaf?i(p):p),l+=h(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)c(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}()}(Al);var Tl,_l,Pl=Al.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(Tl||(Tl={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(_l||(_l={}));var Cl=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);n>=0&&t.context.renderingPlugins.splice(n,1)}))},t}(),Nl=function(){function t(t){this.clipSpaceNearZ=_l.NEGATIVE_ONE,this.plugins=[],this.config=fe({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return t.prototype.registerPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function Ll(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function jl(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Rl(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Il(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Bl(t){return void 0===t?0:t>360||t<-360?t%360:t}function Dl(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Rt(t):_(t)?Bt(t,e,n):Bt(t[0],t[1]||e,t[2]||n)}function Fl(t){return t*(Math.PI/180)}function zl(t){return t*(180/Math.PI)}function Gl(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=ye(xt(jt(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return l<i?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,c=o*o,l=n*n+a+s+c,u=n*o-r*i;return u>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*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+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function Wl(t,e,n,r,i){var o,a,s,c,l,u,f,h,d,p,g=Math.cos(t),m=Math.sin(t);return o=r*g,a=i*m,s=0,c=-r*m,l=i*g,u=0,f=e,h=n,d=1,(p=new tt(9))[0]=o,p[1]=a,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=h,p[8]=d,p}function $l(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);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=zl(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Hl=rt(),Vl=rt(),Yl=Qt(),ql=[jt(),jt(),jt()],Ul=jt();function Xl(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 Kl,Zl=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){Ll(this.center,t),Ll(this.halfExtents,e),jl(this.min,this.center,this.halfExtents),Rl(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Rl(this.center,e,t),Il(this.center,this.center,.5),jl(this.halfExtents,e,t),Il(this.halfExtents,this.halfExtents,.5),Ll(this.min,t),Ll(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],c=a[1],l=a[2],u=r-s,f=r+s,h=i-c,d=i+c,p=o-l,g=o+l,m=e.center,y=m[0],v=m[1],b=m[2],x=e.halfExtents,w=x[0],M=x[1],E=x[2],O=y-w,k=y+w,S=v-M,A=v+M,T=b-E,_=b+E;O<u&&(u=O),k>f&&(f=k),S<h&&(h=S),A>d&&(d=A),T<p&&(p=T),_>g&&(g=_),n[0]=.5*(u+f),n[1]=.5*(h+d),n[2]=.5*(p+g),a[0]=.5*(f-u),a[1]=.5*(d-h),a[2]=.5*(g-p),this.min[0]=u,this.min[1]=h,this.min[2]=p,this.max[0]=f,this.max[1]=d,this.max[2]=g}},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],c=e[8],l=e[1],u=e[5],f=e[9],h=e[2],d=e[6],p=e[10],g=Math.abs(a),m=Math.abs(s),y=Math.abs(c),v=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),M=Math.abs(d),E=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+h*i[0]+d*i[1]+p*i[2],r[0]=g*o[0]+m*o[1]+y*o[2],r[1]=v*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+M*o[1]+E*o[2],jl(this.min,n,r),Rl(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]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[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?Ll([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?Ll([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}(),Ql=function(){function t(t,e){this.distance=t||0,this.normal=e||Bt(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 Ht(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/Zt(this.normal);Wt(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&&i<=1;return o&&n&&Yt(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Kl||(Kl={}));var Jl,tu,eu,nu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Ql)}return t.prototype.extractFromVPMatrix=function(t){var e=ye(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],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15];Ft(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=y-p,Ft(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=y+p,Ft(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=y+g,Ft(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=y-g,Ft(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=y-m,Ft(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),ru=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}(),iu=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}(),ou="Method not implemented.",au="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(Jl||(Jl={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(tu||(tu={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(eu||(eu={}));var su,cu,lu,uu,fu,hu="updated",du=2e-4,pu=function(){function t(){this.clipSpaceNearZ=_l.NEGATIVE_ONE,this.eventEmitter=new Nc,this.matrix=rt(),this.right=Bt(1,0,0),this.up=Bt(0,1,0),this.forward=Bt(0,0,1),this.position=Bt(0,0,1),this.focalPoint=Bt(0,0,0),this.distanceVector=Bt(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=rt(),this.projectionMatrixInverse=rt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Jl.EXPLORING,this.trackingMode=tu.DEFAULT,this.projectionMode=eu.PERSPECTIVE,this.frustum=new nu,this.orthoMatrix=rt()}return t.prototype.isOrtho=function(){return this.projectionMode===eu.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.type===Jl.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Jl.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==Jl.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return lt(rt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=mt(rt(),[t,e,0]);this.jitteredProjectionMatrix=ft(rt(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===eu.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===eu.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===eu.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},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===eu.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},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===eu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===eu.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.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=Bt(a.x-r,a.y-i,0),c=Ht(s,this.right)/It(this.right),l=Ht(s,this.up)/It(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=eu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(Fl(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,o-=this.view.offsetY*a/u,s*=this.view.width/l,a*=this.view.height/u}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var c,l,u=2*o/(n-e),f=2*o/(r-i),h=(n+e)/(n-e),d=(r+i)/(r-i);s?(c=-a/(a-o),l=-a*o/(a-o)):(c=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=h,t[9]=d,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,c,c+s,o,o-a,t,this.far,this.clipSpaceNearZ===_l.ZERO),dt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),lt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=eu.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,h=l+s,d=u+c,p=u-c;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===_l.NEGATIVE_ONE?At(this.projectionMatrix,f,h,p,d,i,o):Tt(this.projectionMatrix,f,h,p,d,i,o),dt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),lt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Dl(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=Bt(0,1,0);if(this.focalPoint=Dl(t,e,n),this.trackingMode===tu.CINEMATIC){var i=Gt(jt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=It(i),a=zl(Math.asin(e/o)),s=90+zl(Math.atan2(n,t)),c=rt();gt(c,c,Fl(s)),pt(c,c,Fl(a)),r=qt(jt(),[0,1,0],c)}return lt(this.matrix,_t(rt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<du&&(this.distance=du),this.dollyingStep=this.distance/100;var e=jt();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=Bl(t),this.computeMatrix(),this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=Bl(t),this.computeMatrix(),this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=Bl(t),this.computeMatrix(),this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=ee(te(),[0,0,1],Fl(this.roll));st(this.matrix);var e=ee(te(),[1,0,0],Fl((this.rotateWorld&&this.type!==Jl.TRACKING||this.type===Jl.TRACKING?1:-1)*this.elevation)),n=ee(te(),[0,1,0],Fl((this.rotateWorld&&this.type!==Jl.TRACKING||this.type===Jl.TRACKING?1:-1)*this.azimuth)),r=ne(te(),n,e);r=ne(te(),r,t);var i=Et(rt(),r);this.type===Jl.ORBITING||this.type===Jl.EXPLORING?(ht(this.matrix,this.matrix,this.focalPoint),ft(this.matrix,this.matrix,i),ht(this.matrix,this.matrix,[0,0,this.distance])):this.type===Jl.TRACKING&&(ht(this.matrix,this.matrix,this.position),ft(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=Dl(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()},t.prototype._getAxes=function(){Dt(this.right,Dl(Jt(Qt(),[1,0,0,0],this.matrix))),Dt(this.up,Dl(Jt(Qt(),[0,1,0,0],this.matrix))),Dt(this.forward,Dl(Jt(Qt(),[0,0,1,0],this.matrix))),$t(this.right,this.right),$t(this.up,this.up),$t(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=It(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Jl.TRACKING||this.rotateWorld?(this.elevation=zl(Math.asin(e/r)),this.azimuth=zl(Math.atan2(-t,-n))):(this.elevation=-zl(Math.asin(e/r)),this.azimuth=-zl(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Dt(this.position,Dl(Jt(Qt(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;Ut(this.distanceVector,[0,0,-this.distance],(t=et(),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)),zt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Gt(jt(),this.focalPoint,this.position),this.distance=It(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===eu.ORTHOGRAPHIC){var t=this.position,e=ee(te(),[0,0,1],-this.roll*Math.PI/180);Mt(this.orthoMatrix,e,Bt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Bt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=ft(rt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(hu)}},t.prototype.rotate=function(t,e,n){throw new Error(ou)},t.prototype.pan=function(t,e){throw new Error(ou)},t.prototype.dolly=function(t){throw new Error(ou)},t.prototype.createLandmark=function(t,e){throw new Error(ou)},t.prototype.gotoLandmark=function(t,e){throw new Error(ou)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(ou)},t}();function gu(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;i<arguments.length;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(gu.Cache||Map),n}gu.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(su||(su={})),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"}(cu||(cu={})),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"}(lu||(lu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(uu||(uu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(fu||(fu={}));var mu,yu=[{name:"em",unit_type:su.kEms},{name:"px",unit_type:su.kPixels},{name:"deg",unit_type:su.kDegrees},{name:"rad",unit_type:su.kRadians},{name:"grad",unit_type:su.kGradians},{name:"ms",unit_type:su.kMilliseconds},{name:"s",unit_type:su.kSeconds},{name:"rem",unit_type:su.kRems},{name:"turn",unit_type:su.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"}(mu||(mu={}));var vu,bu=function(t){return t?"number"===t?su.kNumber:"percent"===t||"%"===t?su.kPercentage:function(t){return yu.find((function(e){return e.name===t})).unit_type}(t):su.kUnknown},xu=function(t){var e=1;switch(t){case su.kPixels:case su.kDegrees:case su.kSeconds:break;case su.kMilliseconds:e=.001;break;case su.kRadians:e=180/Math.PI;break;case su.kGradians:e=.9;break;case su.kTurns:e=360}return e},wu=function(t){switch(t){case su.kNumber:case su.kInteger:return"";case su.kPercentage:return"%";case su.kEms:return"em";case su.kRems:return"rem";case su.kPixels:return"px";case su.kDegrees:return"deg";case su.kRadians:return"rad";case su.kGradians:return"grad";case su.kMilliseconds:return"ms";case su.kSeconds:return"s";case su.kTurns:return"turn"}return""},Mu=function(){function t(){}return t.isAngle=function(t){return t===su.kDegrees||t===su.kRadians||t===su.kGradians||t===su.kTurns},t.isLength=function(t){return t>=su.kEms&&t<su.kDegrees},t.isRelativeUnit=function(t){return t===su.kPercentage||t===su.kEms||t===su.kRems},t.isTime=function(t){return t===su.kSeconds||t===su.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(uu.kNo,fu.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=mu.kUnitType&&this.getType()<=mu.kClampType},t}(),Eu=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return ue(e,t),e.prototype.getType=function(){return mu.kColorType},e.prototype.to=function(t){return this},e}(Mu);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(vu||(vu={}));var Ou=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return ue(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 mu.kColorType},e}(Mu),ku=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return ue(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return mu.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Mu),Su=gu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Au=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Tu(t){return"function"==typeof t}var _u={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Pu=gu((function(t){var e=Su(t),n=_u[e];return e=(null==n?void 0:n.alias)||e})),Cu=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw new Error}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Nu=function(t){return function(t){switch(t){case cu.kUNumber:return su.kNumber;case cu.kULength:return su.kPixels;case cu.kUPercent:return su.kPercentage;case cu.kUTime:return su.kSeconds;case cu.kUAngle:return su.kDegrees;default:return su.kUnknown}}(function(t){switch(t){case su.kNumber:case su.kInteger:return cu.kUNumber;case su.kPercentage:return cu.kUPercent;case su.kPixels:return cu.kULength;case su.kMilliseconds:case su.kSeconds:return cu.kUTime;case su.kDegrees:case su.kRadians:case su.kGradians:case su.kTurns:return cu.kUAngle;default:return cu.kUOther}}(t))},Lu=function(t){function e(e,n){void 0===n&&(n=su.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?bu(n):n,i.unit=r,i.value=e,i}return ue(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){var e=t;return this.value===e.value&&this.unit===e.unit},e.prototype.getType=function(){return mu.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Nu(this.unit);if(n!==Nu(t)||n===su.kUnknown)return null;var r=xu(this.unit)/xu(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case su.kUnknown:break;case su.kInteger:r=Number(this.value).toFixed(0);break;case su.kNumber:case su.kPercentage:case su.kEms:case su.kRems:case su.kPixels:case su.kDegrees:case su.kRadians:case su.kGradians:case su.kMilliseconds:case su.kSeconds:case su.kTurns:var i=this.value,o=wu(this.unit);if(i<-999999||i>999999){var a=wu(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?Cu(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Mu),ju=new Lu(0,"px");new Lu(1,"px");var Ru,Iu,Bu=new Lu(0,"deg"),Du=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 ue(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}(Eu),Fu=new ku("unset"),zu=new ku("initial"),Gu=new ku("inherit"),Wu={"":Fu,unset:Fu,initial:zu,inherit:Gu},$u=function(t){return Wu[t]||(Wu[t]=new ku(t)),Wu[t]},Hu=new Du(0,0,0,0,!0),Vu=new Du(0,0,0,0),Yu=gu((function(t,e,n,r){return new Du(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),qu=function(t,e){return void 0===e&&(e=su.kNumber),new Lu(t,e)},Uu=new Lu(50,"%");!function(t){t[t.Standard=0]="Standard"}(Ru||(Ru={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(Iu||(Iu={}));var Xu,Ku={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new iu(0,0,0,0)};function Zu(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(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(Xu||(Xu={}));var Qu=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 new Error(e+": "+t)}function r(){var t=d(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,c)||o("repeating-radial-gradient",t.repeatingRadialGradient,c)||o("conic-gradient",t.conicGradient,c)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(p)}}))}function a(e,r){var i=b(e);if(i){b(t.startCall)||n("Missing (");var o=r(i);return b(t.endCall)||n("Missing )"),o}}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function c(){var n,r,i=l();return i&&((n=[]).push(i),r=e,b(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=v("shape",/^(circle)/i,0);t&&(t.style=y()||u());return t}()||function(){var t=v("shape",/^(ellipse)/i,0);t&&(t.style=m()||u());return t}();if(t)t.at=f();else{var e=u();if(e){t=e;var n=f();n&&(t.at=n)}else{var r=h();r&&(t={type:"default-radial",at:r})}}return t}function u(){return v("extent-keyword",t.extentKeywords,1)}function f(){if(v("position",/^at/,0)){var t=h();return t||n("Missing positioning value"),t}}function h(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);b(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=v("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:d(g)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:d(g)}}))||v("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function g(){return b(t.number)[1]}function m(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||y()}function y(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,n){var r=b(e);if(r)return{type:t,value:r[n]}}function b(t){var n=/^[\n\r\t\s]+/.exec(e);n&&x(n[0].length);var r=t.exec(e);return r&&x(r[0].length),r}function x(t){e=e.substring(t)}return function(t){return e=t,r()}}();var Ju=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,tf=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ef=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,nf=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var rf={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},of=gu((function(t){var e;return e="angular"===t.type?Number(t.value):rf[t.value]||0,qu(e,"deg")})),af=gu((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:qu(e,r),cy:qu(n,i)}})),sf=gu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Qu(t).map((function(t){var e=t.type,n=t.orientation,r=t.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;s<i;s++){var c=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!y(c)&&!y(a)){for(var l=1;l<s-o;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(s-o))};o=s,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:qu(Number(t.length.value),"%"),color:Zu(t)}}));if("linear-gradient"===e)return new Ou(vu.LinearGradient,{angle:n?of(n):Bu,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=af(n[0].at),a=o.cx,s=o.cy,c=void 0;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;c="extent-keyword"===u?$u(f):qu(f,u)}return new Ou(vu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Ju.exec(t);if(r){var i=(null===(e=r[2].match(nf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Ou(vu.LinearGradient,{angle:qu(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:qu(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=tf.exec(t);if(n){var r=(null===(e=n[4].match(nf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:qu(50,"%"),cy:qu(50,"%"),steps:r.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:qu(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!A(o))return[new Ou(vu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=ef.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}(t)}));function cf(t){return t&&!!t.image}function lf(t){return t&&!y(t.r)&&!y(t.g)&&!y(t.b)}var uf=gu((function(t){if(cf(t))return fe({repetition:"repeat"},t);if(y(t)&&(t=""),"transparent"===t)return Vu;"currentColor"===t&&(t="black");var e=sf(t);if(e)return e;var n=Zc(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Yu.apply(void 0,ve([],ye(r),!1))}));function ff(t,e){if(lf(t)&&lf(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;n<3;n++)e[n]=Math.round(T(e[n],0,255));return e[3]=T(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function hf(t,e){if(y(e))return qu(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return qu(Number(e),"px");if("deg".search(t)>=0)return qu(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 qu(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var df=gu((function(t){return hf(new RegExp("px","g"),t)}));gu((function(t){return hf(new RegExp("%","g"),t)}));var pf=function(t){return _(t)||isFinite(Number(t))?qu(Number(t)||0,"px"):hf(new RegExp("px|%|em|rem","g"),t)},gf=gu((function(t){return hf(new RegExp("deg|rad|grad|turn","g"),t)}));function mf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=Nu(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=wu(t.unit)):(Lu.isLength(t.unit)||Lu.isLength(e.unit))&&(a=xf(t,i,n),s=xf(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function yf(t){var e=0;return t.unit===su.kDegrees?e=t.value:t.unit===su.kRadians?e=zl(Number(t.value)):t.unit===su.kTurns&&(e=360*Number(t.value)),e}function vf(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):A(t)?n=t.split(" ").map((function(t){return Number(t)})):_(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 bf(t){return A(t)?t.split(" ").map((function(t){return pf(t)})):t.map((function(t){return pf(t.toString())}))}function xf(t,e,n){if(0===t.value)return 0;if(t.unit===su.kPixels)return Number(t.value);if(t.unit===su.kPercentage&&n){var r=n.nodeName===Tl.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var wf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Mf(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,wf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return hf(/deg|rad|grad|turn|px|%/g,t)||uf(t)}))}),n.lastIndex===t.length)return r}return[]}function Ef(t){return t.toString()}var Of=gu((function(t){return"number"==typeof t?qu(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?qu(Number(t)):qu(0)}));function kf(t,e){return[t,e,Ef]}function Sf(t,e){return function(n,r){return[n,r,function(n){return Ef(T(n,t,e))}]}}function Af(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Tf(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Qe(t.parsedStyle.path.absolutePath,void 0,fe(fe({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function _f(t,e){return t[0]===e[0]&&t[1]===e[1]}function Pf(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.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!c||0===Math.sin(c)||C(c,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(u-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function Cf(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}gu((function(t){return A(t)?t.split(" ").map(Of):t.map(Of)}));var Nf=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},Lf=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=Fl(r=j(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 l=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e=Math.sqrt(h)*e,n=Math.sqrt(h)*n);var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));d=d<0?0:d;var p=(i!==o?1:-1)*Math.sqrt(d),g=p*(e*f.y/n),m=p*(-n*f.x/e),y={x:Math.cos(c)*g-Math.sin(c)*m+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*m+(t.y+a.y)/2},v={x:(f.x-g)/e,y:(f.y-m)/n},b=Nf({x:1,y:0},v),x=Nf(v,{x:(-f.x-g)/e,y:(-f.y-m)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,M=e*Math.cos(w),E=n*Math.sin(w);return{x:Math.cos(c)*M-Math.sin(c)*E+y.x,y:Math.sin(c)*M+Math.cos(c)*E+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function jf(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,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=Lf({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=Lf({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=h.x-f.x,p=h.y-f.y,g=Math.sqrt(d*d+p*p);return{x:-d/g,y:-p/g}}function Rf(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function If(t,e){return Rf(t)*Rf(e)?(t[0]*e[0]+t[1]*e[1])/(Rf(t)*Rf(e)):1}function Bf(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(If(t,e))}function Df(t,e){var n=e[1],r=e[2],i=j(Fl(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],c=t[1],l=e[6],u=e[7],f=Math.cos(i)*(s-l)/2+Math.sin(i)*(c-u)/2,h=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(c-u)/2,d=f*f/(n*n)+h*h/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(h*h)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var m=r?g*n*h/r:0,y=n?g*-r*f/n:0,v=(s+l)/2+Math.cos(i)*m-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*m+Math.cos(i)*y,x=[(f-m)/n,(h-y)/r],w=[(-1*f-m)/n,(-1*h-y)/r],M=Bf([1,0],x),E=Bf(x,w);return If(x,w)<=-1&&(E=Math.PI),If(x,w)>=1&&(E=0),0===a&&E>0&&(E-=2*Math.PI),1===a&&E<0&&(E+=2*Math.PI),{cx:v,cy:b,rx:_f(t,[l,u])?0:n,ry:_f(t,[l,u])?0:r,startAngle:M,endAngle:M+E,xRotation:i,arcFlag:o,sweepFlag:a}}function Ff(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,c,r-a,c,r],["C",c,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function zf(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case Tl.LINE:var r=t.parsedStyle,i=r.x1,o=void 0===i?0:i,a=r.y1,s=void 0===a?0:a,c=r.x2,l=void 0===c?0:c,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(o,s,l,void 0===u?0:u);break;case Tl.CIRCLE:var f=t.parsedStyle,h=f.r,d=void 0===h?0:h,p=f.cx,g=void 0===p?0:p,m=f.cy;n=Ff(d,d,g,void 0===m?0:m);break;case Tl.ELLIPSE:var y=t.parsedStyle,v=y.rx,b=void 0===v?0:v,x=y.ry,w=void 0===x?0:x,M=y.cx,E=(g=void 0===M?0:M,y.cy);n=Ff(b,w,g,void 0===E?0:E);break;case Tl.POLYLINE:case Tl.POLYGON:n=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}(t.parsedStyle.points.points,t.nodeName===Tl.POLYGON);break;case Tl.RECT:var O=t.parsedStyle,k=O.width,S=void 0===k?0:k,A=O.height,_=void 0===A?0:A,P=O.x,C=void 0===P?0:P,N=O.y,L=void 0===N?0:N,j=O.radius,R=j&&j.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=ye(i,4),a=o[0],s=o[1],c=o[2],l=o[3],u=t>0?1:-1,f=e>0?1:-1,h=u+f!==0?1:0;return[["M",u*a+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,h,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,h,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,h,n,e+r-f*l]:null,["L",n,f*a+r],a?["A",a,a,0,0,h,u*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,_,C,L,R&&j.map((function(t){return T(t,0,Math.min(Math.abs(S)/2,Math.abs(_)/2))})));break;case Tl.PATH:n=ve([],ye(t.parsedStyle.path.absolutePath),!1)}if(n.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=Bt(e[1]-o,e[2]-s,0);n&&qt(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=Bt(e[1]-o,e[2]-s,0),c=Bt(e[3]-o,e[4]-s,0),l=Bt(e[5]-o,e[6]-s,0);n&&(qt(a,a,n),qt(c,c,n),qt(l,l,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(c[0],",").concat(c[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var u=Bt(e[6]-o,e[7]-s,0);n&&qt(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(a=Bt(e[1]-o,e[2]-s,0),c=Bt(e[3]-o,e[4]-s,0),n&&(qt(a,a,n),qt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,t,e)}var Gf=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=Ie(t)}catch(n){e=Ie(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=[r[1],r[2]],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&_f(o,a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;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;i<t.length;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;s<a;s++){var c=t[s];r=t[s+1];var l=c[0],u={command:l,prePoint:n,params:c,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[c[1],c[2]],o=s;break;case"A":var f=Df(n,c);u.arcParams=f}if("Z"===l)n=i,r=t[o+1];else{var h=c.length;n=[c[h-2],c[h-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&_f(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=d;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l)g=Cf((v=e[s-1]).currentPoint,p),"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]]);else if("C"===l){var m=[c[1],c[2]],y=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-y[0],m[1]-y[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===l){var v;m=Cf((v=e[s-1]).currentPoint,p),y=[c[1],c[2]],"C"===v.command?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="SQ",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var b=jf(u,0),x=b.x,w=b.y,M=jf(u,1,!1),E=M.x,O=M.y;u.startTangent=[x,w],u.endTangent=[E,O]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,c=g.prePoint,l=void 0;switch(g.command){case"Q":l=kl(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=xl(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=hl(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(g.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=k(n),h=k(r),d=O(n),p=O(r);if(0===i.length)return{x:f,y:h,width:d-f,height:p-h};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===f?f-=Pf(g,e).xExtra:a[0]===d&&(d+=Pf(g,e).xExtra),a[1]===h?h-=Pf(g,e).yExtra:a[1]===p&&(p+=Pf(g,e).yExtra)}return{x:f,y:h,width:d-f,height:p-h}}(a,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},Wf=gu(Gf);function $f(t){return A(t)?Wf(t):Gf(t)}function Hf(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=We(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=We(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=en(r,i));var a,s,c,l,u,f,h,d,p=Je(o[0])!==Je(o[1])?(a=o[0],s=a.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))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[p,(c=o[1],l=p,u=c.length-1,f=[],h=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(c),d.forEach((function(t,e){c.slice(1).forEach((function(t,n){h+=$e(c[(e+n)%u].slice(-2),l[n%u].slice(-2))})),f[e]=h,h=0})),d[f.indexOf(Math.min.apply(null,f))]),function(t){return t}]}function Vf(t,e){var n;n=A(t)?t.split(" ").map((function(t){var e=ye(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t;var r,i,o=[],a=0,s=Ml(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=gl(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))}));var c=Math.min.apply(Math,ve([],ye(n.map((function(t){return t[0]}))),!1)),l=Math.min.apply(Math,ve([],ye(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=c,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:o}}function Yf(t,e){return[t.points,e.points,function(t){return t}]}var qf=null;function Uf(t){return function(e){var n=0;return t.map((function(t){return t===qf?e[n++]:t}))}}function Xf(t){return t}var Kf={matrix:["NNNNNN",[qf,qf,0,0,qf,qf,0,0,0,0,1,0,qf,qf,0,1],Xf],matrix3d:["NNNNNNNNNNNNNNNN",Xf],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Uf([qf,qf,new Lu(1)]),Xf],scalex:["N",Uf([qf,new Lu(1),new Lu(1)]),Uf([qf,new Lu(1)])],scaley:["N",Uf([new Lu(1),qf,new Lu(1)]),Uf([new Lu(1),qf])],scalez:["N",Uf([new Lu(1),new Lu(1),qf])],scale3d:["NNN",Xf],skew:["Aa",null,Xf],skewx:["A",null,Uf([qf,Bu])],skewy:["A",null,Uf([Bu,qf])],translate:["Tt",Uf([qf,qf,ju]),Xf],translatex:["T",Uf([qf,ju,ju]),Uf([qf,ju])],translatey:["T",Uf([ju,qf,ju]),Uf([ju,qf])],translatez:["L",Uf([ju,ju,qf])],translate3d:["TTL",Xf]};function Zf(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=Kf[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],h=c[u],d=void 0;if(void 0===(d=f?{A:function(t){return"0"===t.trim()?Bu:gf(t)},N:Of,T:pf,L:df}[h.toUpperCase()](f):{a:Bu,n:l[0],t:ju}[h]))return[];l.push(d)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Qf(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Fl(yf(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=Fl(yf(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=Fl(yf(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=Fl(yf(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),c=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*c),2*(e*r*l-n*c),0,2*(e*n*l-r*c),1-2*(e*e+r*r)*l,2*(n*r*l+e*c),0,2*(e*r*l+n*c),2*(n*r*l-e*c),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=Fl(yf(t.d[0])),f=Fl(yf(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=Fl(yf(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=Fl(yf(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=xf(t.d[0],0,null)||0,n=xf(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xf(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=xf(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=xf(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xf(t.d[0],0,null)||0,n=xf(t.d[1],0,null)||0,r=xf(t.d[2],0,null)||0,1];case"perspective":var h=xf(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,h?-1/h: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 Jf(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 th(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;i<16;i++)t[i]=e[i]*r;return!0}(Hl,t))return!1;if(ot(Vl,Hl),Vl[3]=0,Vl[7]=0,Vl[11]=0,Vl[15]=1,Math.abs(ut(Vl))<1e-8)return!1;var a,s,c=Hl[3],l=Hl[7],u=Hl[11],f=Hl[12],h=Hl[13],d=Hl[14],p=Hl[15];if(0!==c||0!==l||0!==u){if(Yl[0]=c,Yl[1]=l,Yl[2]=u,Yl[3]=p,!lt(Vl,Vl))return!1;ct(Vl,Vl),Jt(i,Yl,Vl)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=Hl,(a=ql)[0][0]=s[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]=It(ql[0]),$t(ql[0],ql[0]),r[0]=Ht(ql[0],ql[1]),Xl(ql[1],ql[1],ql[0],1,-r[0]),n[1]=It(ql[1]),$t(ql[1],ql[1]),r[0]/=n[1],r[1]=Ht(ql[0],ql[2]),Xl(ql[2],ql[2],ql[0],1,-r[1]),r[2]=Ht(ql[1],ql[2]),Xl(ql[2],ql[2],ql[1],1,-r[2]),n[2]=It(ql[2]),$t(ql[2],ql[2]),r[1]/=n[2],r[2]/=n[2],Vt(Ul,ql[1],ql[2]),Ht(ql[0],Ul)<0)for(var g=0;g<3;g++)n[g]*=-1,ql[g][0]*=-1,ql[g][1]*=-1,ql[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+ql[0][0]-ql[1][1]-ql[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-ql[0][0]+ql[1][1]-ql[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-ql[0][0]-ql[1][1]+ql[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+ql[0][0]+ql[1][1]+ql[2][2],0)),ql[2][1]>ql[1][2]&&(o[0]=-o[0]),ql[0][2]>ql[2][0]&&(o[1]=-o[1]),ql[1][0]>ql[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(Qf).reduce(Jf)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var eh=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;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;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;s<4;s++)a[s][3]=o[s];for(s=0;s<3;s++)for(var c=0;c<3;c++)a[3][s]+=e[c]*a[c][s];var l=i[0],u=i[1],f=i[2],h=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(u*u+f*f),d[0][1]=2*(l*u-f*h),d[0][2]=2*(l*f+u*h),d[1][0]=2*(l*u+f*h),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(u*f-l*h),d[2][0]=2*(l*f-u*h),d[2][1]=2*(u*f+l*h),d[2][2]=1-2*(l*l+u*u),a=t(a,d);var p,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g)),s=0;s<3;s++)for(c=0;c<3;c++)a[s][c]*=n[s];return 0==(p=a)[0][2]&&0==p[0][3]&&0==p[1][2]&&0==p[1][3]&&0==p[2][0]&&0==p[2][1]&&1==p[2][2]&&0==p[2][3]&&0==p[3][2]&&1==p[3][3]?[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 nh(t){return t.toFixed(6).replace(".000000","")}function rh(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=th(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=th(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;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=T(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;s<4;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 eh(t[0],t[1],t[2],e,t[4]).map(nh).join(",")}])}function ih(t){return t.replace(/[xy]/,"")}function oh(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function ah(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?qu(a):qu(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=rh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];else for(o=0;o<t.length;o++){var f=t[o].t,h=e[o].t,d=t[o].d,p=e[o].d,g=Kf[f],m=Kf[h],y=void 0;if(s=h,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=rh([t[o]],[e[o]]);c.push(v[0]),l.push(v[1]),u.push(["matrix",[v[2]]])}else{if(f===h)y=f;else if(g[2]&&m[2]&&ih(f)===ih(h))y=ih(f),d=g[2](d),p=m[2](p);else{if(!g[1]||!m[1]||oh(f)!==oh(h)){c=[(v=rh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=oh(f),d=g[1](d),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<d.length;M++){v=mf(d[M],p[M],n,!1,M);b[M]=v[0],x[M]=v[1],w.push(v[2])}c.push(b),l.push(x),u.push([y,w])}}if(r){var E=c;c=l,l=E}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),u[e][0]+"("+n+")"})).join(" ")}]}var sh=gu((function(t){if(A(t)){if("text-anchor"===t)return[qu(0,"px"),qu(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:[pf(ch(e[0])),pf(ch(e[1]))]}return[qu(t[0]||0,"px"),qu(t[1]||0,"px")]}));function ch(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var lh=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Xu.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Xu.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Xu.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Xu.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Xu.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Xu.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Xu.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Xu.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Xu.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:Xu.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Xu.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Xu.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Xu.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Xu.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:Xu.FILTER},{n:"clipPath",syntax:Xu.DEFINED_PATH},{n:"textPath",syntax:Xu.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Xu.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===Tl.CIRCLE||t===Tl.ELLIPSE?"center":t===Tl.TEXT?"text-anchor":"left top"},l:!0,syntax:Xu.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===Tl.CIRCLE||t===Tl.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:Xu.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"cy",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"cz",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"y",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"z",int:!0,d:"0",syntax:Xu.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Xu.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Xu.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Xu.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:Xu.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Xu.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Xu.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Xu.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Xu.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:Xu.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Xu.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Xu.NUMBER,d:function(t){return t===Tl.PATH||t===Tl.POLYGON||t===Tl.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:Xu.MARKER},{n:"markerEnd",syntax:Xu.MARKER},{n:"markerMid",syntax:Xu.MARKER},{n:"markerStartOffset",syntax:Xu.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Xu.LENGTH,l:!0,int:!0,d:"0"}],uh=lh.filter((function(t){return!!t.l})).map((function(t){return t.n})),fh={},hh=new WeakMap,dh=function(){function t(t){var e=this;this.runtime=t,lh.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){ve([t.n],ye(t.a||[]),!1).forEach((function(e){fh[e]=t}))},t.prototype.unregisterMetadata=function(t){delete fh[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var r=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(t.attributes,e);var i=Object.keys(e),o=t.parsedStyle.clipPath,a=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var s=!!n.forceUpdateGeometry;if(!s)for(var c=0;c<uh.length;c++)if(uh[c]in e){s=!0;break}return e.fill&&(t.parsedStyle.fill=uf(e.fill)),e.stroke&&(t.parsedStyle.stroke=uf(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=uf(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Mf(e.filter)),y(e.radius)||(t.parsedStyle.radius=vf(e.radius,4)),y(e.lineDash)||(t.parsedStyle.lineDash=vf(e.lineDash,2)),e.points&&(t.parsedStyle.points=Vf(e.points,t)),""===e.path&&(t.parsedStyle.path=fe({},Ku)),e.path&&(t.parsedStyle.path=$f(e.path),t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",a,e.offsetPath,t,this.runtime),e.anchor&&(t.parsedStyle.anchor=vf(e.anchor,2)),e.transform&&(t.parsedStyle.transform=Zf(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=sh(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(t.nodeName!==Tl.CIRCLE&&t.nodeName!==Tl.ELLIPSE||y(e.cx)&&y(e.cy))&&(t.nodeName!==Tl.RECT&&t.nodeName!==Tl.IMAGE&&t.nodeName!==Tl.GROUP&&t.nodeName!==Tl.HTML&&t.nodeName!==Tl.TEXT&&t.nodeName!==Tl.MESH||y(e.x)&&y(e.y)&&y(e.z))&&(t.nodeName!==Tl.LINE||y(e.x1)&&y(e.y1)&&y(e.z1)&&y(e.x2)&&y(e.y2)&&y(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(t,i),y(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,i),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(t,i),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(t,i),y(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,i),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,i),void(s&&this.updateGeometry(t))}var l=n.skipUpdateAttribute,u=n.skipParse,f=n.forceUpdateGeometry,h=n.usedAttributes,d=f,p=Object.keys(e);p.forEach((function(n){var r;l||(t.attributes[n]=e[n]),!d&&(null===(r=fh[n])||void 0===r?void 0:r.l)&&(d=!0)})),u||p.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(null==h?void 0:h.length)&&(p=Array.from(new Set(p.concat(h)))),p.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),d&&this.updateGeometry(t),p.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t,p)})),this.runtime.enableCSSParsing&&t.children.length&&p.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},t.prototype.parseProperty=function(t,e,n){var r=fh[t],i=e;if((""===e||y(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=$u(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=$u(e):s&&s.parser&&(i=s.parser(e,n))}return i},t.prototype.computeProperty=function(t,e,n){var r=fh[t],i="g-root"===n.id,o=e;if(r){var a=r.syntax,s=r.inh,c=r.d;if(e instanceof ku){var l=e.value;if("unset"===l&&(l=s&&!i?"inherit":"initial"),"initial"===l)y(c)||(e=this.parseProperty(t,Tu(c)?c(n.nodeName):c,n));else if("inherit"===l){var u=this.tryToResolveProperty(n,t,{inherited:!0});return y(u)?void this.addUnresolveProperty(n,t):u}}var f=a&&this.getPropertySyntax(a);if(f&&f.calculator){var h=n.parsedStyle[t];o=f.calculator(t,h,e,n,this.runtime)}else o=e instanceof ku?e.value:e}return o},t.prototype.postProcessProperty=function(t,e,n){var r=fh[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=hh.get(t);n||(hh.set(t,[]),n=hh.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=hh.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}},t.prototype.recalc=function(t){var e=hh.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),hh.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Zl),r.renderBounds||(r.renderBounds=new Zl);var i=t.parsedStyle,o=n.update(i,t),a=o.width,s=o.height,c=o.depth,l=void 0===c?0:c,u=o.offsetX,f=void 0===u?0:u,h=o.offsetY,d=void 0===h?0:h,p=o.offsetZ,g=void 0===p?0:p,m=[Math.abs(a)/2,Math.abs(s)/2,l/2],y=i,v=y.stroke,b=y.lineWidth,x=y.increasedLineWidthForHitTesting,w=y.shadowType,M=y.shadowColor,E=y.filter,O=void 0===E?[]:E,k=y.transformOrigin,S=i.anchor;e===Tl.TEXT?delete i.anchor:e===Tl.MESH&&(i.anchor[2]=.5);var A=[(1-2*(S&&S[0]||0))*a/2+f,(1-2*(S&&S[1]||0))*s/2+d,(1-2*(S&&S[2]||0))*m[2]+g];r.contentBounds.update(A,m);var T=e===Tl.POLYLINE||e===Tl.POLYGON||e===Tl.PATH?Math.SQRT2:.5;if(v&&!v.isNone){var _=((b||0)+(x||0))*T;m[0]+=_,m[1]+=_}if(r.renderBounds.update(A,m),M&&w&&"inner"!==w){var P=r.renderBounds,C=P.min,N=P.max,L=i,j=L.shadowBlur||0,R=L.shadowOffsetX||0,I=L.shadowOffsetY||0,B=C[0]-j+R,D=N[0]+j+R,F=C[1]-j+I,z=N[1]+j+I;C[0]=Math.min(C[0],B),N[0]=Math.max(N[0],D),C[1]=Math.min(C[1],F),N[1]=Math.max(N[1],z),r.renderBounds.setMinMax(C,N)}O.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,Rl(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,c=r.renderBounds,l=c.min,u=c.max,f=l[0]-s+o,h=u[0]+s+o,d=l[1]-s+a,p=u[1]+s+a;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],h),l[1]=Math.min(l[1],d),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),S=i.anchor;var G=a<0,W=s<0,$=(G?-1:1)*(k?xf(k[0],0,t):0),H=(W?-1:1)*(k?xf(k[1],1,t):0);$-=(G?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,H-=(W?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2,t.setOrigin($,H),this.runtime.sceneGraphService.dirtifyToRoot(t)}},t.prototype.isPropertyInheritable=function(t){var e=fh[t];return!!e&&e.inh},t}(),ph=function(){function t(){this.parser=gf,this.parserWithCSSDisabled=null,this.mixer=kf}return t.prototype.calculator=function(t,e,n,r){return yf(n)},t}(),gh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof ku&&(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}(),mh=function(){function t(){this.parser=uf,this.parserWithCSSDisabled=uf,this.mixer=ff}return t.prototype.calculator=function(t,e,n,r){return n instanceof ku?"none"===n.value?Hu:Vu:n},t}(),yh=function(){function t(){this.parser=Mf}return t.prototype.calculator=function(t,e,n){return n instanceof ku?[]:n},t}();function vh(t){var e=t.parsedStyle.fontSize;return y(e)?null:e}var bh=function(){function t(){this.parser=pf,this.parserWithCSSDisabled=null,this.mixer=kf}return t.prototype.calculator=function(t,e,n,r,i){var o;if(_(n))return n;if(!Lu.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===su.kPercentage)return 0;if(n.unit===su.kEms){if(r.parentNode){if(s=vh(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===su.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=vh(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),xh=function(){function t(){this.mixer=Af}return t.prototype.parser=function(t){var e=bf(_(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}(),wh=function(){function t(){this.mixer=Af}return t.prototype.parser=function(t){var e=bf(_(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}(),Mh=rt();function Eh(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){var s=o||[ju,ju];e.translateLocal(s[0].value,s[1].value,0)}else if("translatex"===i){s=o||[ju];e.translateLocal(s[0].value,0,0)}else if("translatey"===i){s=o||[ju];e.translateLocal(0,s[0].value,0)}else if("translatez"===i){s=o||[ju];e.translateLocal(0,0,s[0].value)}else if("translate3d"===i){s=o||[ju,ju,ju];e.translateLocal(s[0].value,s[1].value,s[2].value)}else if("rotate"===i){var c=o||[Bu];e.rotateLocal(0,0,yf(c[0]))}else if("rotatex"===i){c=o||[Bu];e.rotateLocal(yf(c[0]),0,0)}else if("rotatey"===i){c=o||[Bu];e.rotateLocal(0,yf(c[0]),0)}else if("rotatez"===i){c=o||[Bu];e.rotateLocal(0,0,yf(c[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(Fl(l[0]),Fl(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(Fl(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],Fl(l[0]))}else if("matrix"===i){var u=ye(o.map((function(t){return t.value})),6),f=u[0],h=u[1],d=u[2],p=u[3],g=u[4],m=u[5];e.setLocalTransform(at(Mh,f,h,0,0,d,p,0,0,0,0,1,0,g+n,m+r,0,1))}else"matrix3d"===i&&(at.apply(Lt,ve([Mh],ye(o.map((function(t){return t.value}))),!1)),Mh[12]+=n,Mh[13]+=r,e.setLocalTransform(Mh))})),e.getLocalTransform()}var Oh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.postProcessor=function(t,e){var n,r,i;switch(t.nodeName){case Tl.CIRCLE:case Tl.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy,c=o.cz;y(a)||(n=a),y(s)||(r=s),y(c)||(i=c);break;case Tl.LINE:var l=t.parsedStyle,u=l.x1,f=l.x2,h=l.y1,d=l.y2;n=Math.min(u,f),r=Math.min(h,d),i=0;break;case Tl.RECT:case Tl.IMAGE:case Tl.GROUP:case Tl.HTML:case Tl.TEXT:case Tl.MESH:y(t.parsedStyle.x)||(n=t.parsedStyle.x),y(t.parsedStyle.y)||(r=t.parsedStyle.y),y(t.parsedStyle.z)||(i=t.parsedStyle.z)}if(t.nodeName!==Tl.PATH&&t.nodeName!==Tl.POLYLINE&&t.nodeName!==Tl.POLYGON&&(t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0),(!y(n)||!y(r)||!y(i))&&-1===e.indexOf("transform")){var p=t.parsedStyle.transform;if(p&&p.length)Eh(p,t);else{var g=ye(t.getLocalPosition(),3),m=g[0],v=g[1],b=g[2];t.setLocalPosition(y(n)?m:n,y(r)?v:r,y(i)?b:i)}}},e}(bh),kh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof ku&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),Sh=function(){function t(){this.mixer=kf,this.parser=Of,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Ah=function(){function t(){this.parser=Of,this.parserWithCSSDisabled=null,this.mixer=Sf(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===Tl.LINE||i===Tl.PATH||i===Tl.POLYLINE){var o=n.getPoint(r);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},t}(),Th=function(){function t(){this.parser=Of,this.parserWithCSSDisabled=null,this.mixer=Sf(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),_h=function(){function t(){this.parser=$f,this.parserWithCSSDisabled=$f,this.mixer=Hf}return t.prototype.calculator=function(t,e,n){return n instanceof ku&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new iu(0,0,0,0)}:n},t.prototype.postProcessor=function(t,e){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===Tl.PATH&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=void 0===r?0:r,o=n.defY,a=void 0===o?0:o;t.setLocalPosition(i,a)}},t}(),Ph=function(){function t(){this.parser=Vf,this.mixer=Yf}return t.prototype.postProcessor=function(t,e){if((t.nodeName===Tl.POLYGON||t.nodeName===Tl.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(r,i)}},t}(),Ch=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=Sf(0,1/0),e}return ue(e,t),e}(bh),Nh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof ku?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),Lh=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}(),jh={},Rh=0;var Ih="undefined"!=typeof window&&void 0!==window.document;function Bh(t){return!!t.getAttribute}function Dh(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 Fh(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 zh(t,e){if(Ih)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Gh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Wh="object"==typeof performance&&performance.now?performance:Date;function $h(t,e,n){var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var Hh=1,Vh="object"==typeof self&&self.self==self?self:"object"==typeof Pc&&Pc.global==Pc?Pc:{},Yh=Date.now(),qh={},Uh=Date.now(),Xh=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Uh,r=n>16?0:16-n,i=Hh++;return qh[i]=t,Object.keys(qh).length>1||setTimeout((function(){Uh=e;var t=qh;qh={},Object.keys(t).forEach((function(e){return t[e](Vh.performance&&"function"==typeof Vh.performance.now?Vh.performance.now():Date.now()-Yh)}))}),r),i},Kh=function(t){delete qh[t]},Zh=function(t){return"string"!=typeof t?Xh:""===t?Vh.requestAnimationFrame:Vh[t+"RequestAnimationFrame"]},Qh=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!!Zh(t)})),Jh=Zh(Qh),td=function(t){return"string"!=typeof t?Kh:""===t?Vh.cancelAnimationFrame:Vh[t+"CancelAnimationFrame"]||Vh[t+"CancelRequestAnimationFrame"]}(Qh);Vh.requestAnimationFrame=Jh,Vh.cancelAnimationFrame=td;var ed=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;e<arguments.length;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,ve([],ye(t),!1))})))},t}(),nd=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;e<arguments.length;e++)t[e]=arguments[e];return pe(this,void 0,void 0,(function(){var e,n,r;return ge(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,ve([],ye(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return n<this.callbacks.length-1?[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}(),rd=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}(),id=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=arguments,e=this.callbacks[0].apply(void 0,t),n=0;n<this.callbacks.length-1;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),od=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ad=/([\"\'])[^\'\"]+\1/;var sd=function(){function t(){this.parser=Zf,this.parserWithCSSDisabled=Zf,this.mixer=ah}return t.prototype.calculator=function(t,e,n,r){return n instanceof ku?[]:n},t.prototype.postProcessor=function(t){Eh(t.parsedStyle.transform,t)},t}(),cd=function(){this.parser=sh},ld=function(){function t(){this.parser=Of}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=Iu.Z_INDEX_CHANGED)}},t}(),ud=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),fd=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),hd=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}(),dd=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),pd=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,ve([],ye(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,ve([],ye(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,ve([],ye(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,ve([],ye(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:o-i}},t}(),gd=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=void 0===r?0:r,o=t.height,a=i,s=void 0===o?0:o;return n&&!A(n)&&(a||(a=n.width,t.width=a),s||(s=n.height,t.height=s)),{width:a,height:s}},t}(),md=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,o=t.fontSize,a=t.fontStyle,s=t.fontWeight,c=t.fontVariant,l=t.lineWidth;return n&&o&&a&&s&&c&&r&&i&&!y(l)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,c=t.dx,l=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 u=((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,f=this.globalRuntime.textService.measureText(i,t,u);t.metrics=f;var h=f.width,d=f.height,p=f.lineHeight,g=f.fontProperties,m=[h/2,d/2,0],y=[0,1],v=0;"center"===o||"middle"===o?(v=a/2,y=[.5,1]):"right"!==o&&"end"!==o||(v=a,y=[1,1]);var b=0;return"middle"===s?b=m[1]:"top"===s||"hanging"===s?b=2*m[1]:"alphabetic"===s?b=this.globalRuntime.enableCSSParsing?p-g.ascent:0:"bottom"!==s&&"ideographic"!==s||(b=0),c&&(v+=c),l&&(b+=l),t.anchor=[y[0],y[1],0],{width:2*m[0],height:2*m[1],offsetX:v,offsetY:b}},t}();var yd,vd=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 ru,this.page=new ru,this.canvas=new ru,this.viewport=new ru,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 new Error(ou)},t}(),bd=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new ru,e.movement=new ru,e.offset=new ru,e.global=new ru,e.screen=new ru,e}return ue(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 new Error(ou)},e}(vd),xd=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 ue(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(bd),wd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(bd),Md=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 ue(e,t),e}(vd),Ed=function(){function t(){this.emitter=new Nc}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=D(n)&&n||w(n)&&n.capture,i=w(n)&&n.once,o=Tu(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=ye(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=Tu(e)?e:e.handleEvent,a){var u=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&u.apply(void 0,ve([],ye(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=D(n)&&n||w(n)&&n.capture,i=Tu(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=Tu(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Md(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!t.type)throw new 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}(),Od=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return ue(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===Tl.TEXT&&(n+=this.style.text);try{for(var r=me(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===Tl.TEXT?n+=o.nodeValue:n+=o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Tl.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error(ou)},e.prototype.lookupNamespaceURI=function(t){throw new Error(ou)},e.prototype.lookupPrefix=function(t){throw new Error(ou)},e.prototype.normalize=function(){throw new Error(ou)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,c=s===o?a:o;if(s[s.length-c.length]===c[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)<d.indexOf(h)?c===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(Ed),kd=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new Nc,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=rt(),this.tmpVec3=jt(),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){var r=2===e.button;n.dispatchEvent(e,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=Wh.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){var o=2===i.button;n.dispatchEvent(i,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),c=s;if(s&&!i.composedPath().includes(s)){for(var l=s;l&&!i.composedPath().includes(l);){if(i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){o=2===i.button;n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")}Od.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],c=l}if(c){var u=n.clonePointerEvent(i,"click");u.target=c,u.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:u.target,timeStamp:r});var f=a.clicksByButton[t.button];f.target===u.target&&r-f.timeStamp<200?++f.clickCount:f.clickCount=1,f.target=u.target,f.timeStamp=r,u.detail=f.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}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="mousemove"===t.type?"mouseout":"pointerout",s=n.createPointerEvent(t,a,o||void 0);if(n.dispatchEvent(s,"pointerout"),r&&n.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=n.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseleave"),Od.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=n.clonePointerEvent(e,l);n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var f=o&&Od.isNode(o)&&o.parentNode;f&&f!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var h=n.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==o&&h.target!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode);)h.currentTarget=h.target,n.notifyTarget(h),r&&n.notifyTarget(h,"mouseenter"),Od.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}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!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),Od.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!==(Od.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),Od.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"),Od.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 ru(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 ru(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(),c=r.getWorldTransform(),l=ft(this.tmpMatrix,c,s),u=Ft(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return qt(u,u,l),new ru(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=ft(this.tmpMatrix,n,r),o=Ft(this.tmpVec3,t.x,t.y,0);qt(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new ru((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)},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;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else 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;r<n.length;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;r<2048&&t!==this.rootTarget;r++)Od.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,i=r.width,o=r.height,a=r.disableHitTesting;return e<0||n<0||e>i||n>o?null:!a&&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=me(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.globalRuntime.nativeHTMLMap.get(o);if(a)return a}}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(xd);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(wd);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(wd);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(xd);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=Wh.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 new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),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;i<r.length&&!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||Od.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Bh(e)&&e.getAttribute("cursor");if(n)return n;e=Od.isNode(e)&&e.parentNode}},t}(),Sd=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||$d.offscreenCanvas)this.canvas=t||$d.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}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(yd||(yd={}));var Ad,Td=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new rd,initAsync:new ed,dirtycheck:new id,cull:new id,beginFrame:new rd,beforeRender:new rd,render:new rd,afterRender:new rd,endFrame:new rd,destroy:new rd,pick:new nd,pickSync:new id,pointerDown:new rd,pointerUp:new rd,pointerMove:new rd,pointerOut:new rd,pointerOver:new rd,pointerWheel:new rd,pointerCancel:new rd,click:new rd}}return t.prototype.init=function(t){var e=this,n=fe(fe({},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()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(yd.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===r.renderReasons.size&&r.renderReasons.has(yd.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&i);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),o&&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()}},t.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=t.renderable,c=o?s.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(c){var l=a?this.hooks.cull.call(c,this.context.camera):c;l&&(this.stats.rendered++,n.renderListCurrentFrame.push(l))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable;u.dirty&&(this.sort(t,u),u.dirty=!1,u.dirtyChildren=[],u.dirtyReason=void 0),(u.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==Iu.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Dh(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Dh)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(yd.DISPLAY_OBJECT_CHANGED)},t}(),_d=/\[\s*(.*)=(.*)\s*\]/,Pd=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(_d),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 y(n)?"":n.toString?n.toString():""},t}(),Cd=function(t){function e(e,n,r,i,o,a,s,c){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=e,l}return ue(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(vd);function Nd(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(Ad||(Ad={}));var Ld,jd,Rd,Id=new Cd(Ad.REPARENT,null,"","","",0,"",""),Bd=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new Md(Ad.BOUNDS_CHANGED),this.rotate=(e=te(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=Bt(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=te();ie(a,n[0],n[1],n[2]);var s=l.getRotation(t),c=l.getRotation(t.parentNode);ae(e,c),re(e,e),ne(a,e,a),ne(o.localRotation,a,s),ce(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=te(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,r,i));var o=t.transformable;ie(n,e[0],e[1],e[2]),se(o.localRotation,o.localRotation,n),l.dirtifyLocal(t,o)}),this.setEulerAngles=(r=te(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,n,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ie(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);ae(r,re(te(),a)),se(o.localRotation,o.localRotation,r),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=Bt(e,n,r));var i=t.transformable;Xt(e,jt())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],c=e[1],l=e[2],u=i*l-o*c,f=o*s-r*l,h=r*c-i*s,d=i*h-o*f,p=o*u-r*h,g=r*f-i*u,m=2*a;u*=m,f*=m,h*=m,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,i.localRotation),zt(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(i=rt(),o=jt(),function(t,e){var n=t.transformable;if(o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,!Xt(l.getPosition(t),o)){if(Dt(n.position,o),null!==t.parentNode&&t.parentNode.transformable){var r=t.parentNode.transformable;ot(i,r.worldTransform),lt(i,i),qt(n.localPosition,o,i)}else Dt(n.localPosition,o);l.dirtifyLocal(t,n)}}),this.setLocalPosition=function(){var t=jt();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,Xt(r.localPosition,t)||(Dt(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(a=jt(),s=jt(),c=jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(s,e,n,r)),Xt(e,a)||(zt(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=te();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=oe(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);ae(t,s),re(t,t),ne(a.localRotation,t,n),ce(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=rt(),e=jt(),n=oe(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Mt(r.localTransform,r.localRotation,r.localPosition,Bt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=st(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),ft(r.localTransform,r.localTransform,i)}var o=Mt(t,n,e,r.localScale,r.origin);ft(r.localTransform,r.localTransform,o)}else Mt(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,y(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null===(r=null==a?void 0:a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(-1===a.dirtyChildren.indexOf(t)&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=Iu.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(Id)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Iu.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.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)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Bt(e,n,r));var i=t.transformable;ie(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=Bt(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)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=Bt(e[0],e[1],e[2]||n.localScale[2]);Xt(r,n.localScale)||(Dt(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=oe(e,n,r,i));var o=t.transformable;ae(o.localRotation,e),this.dirtifyLocal(t,o)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new tt(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;r=o.localSkew,i=e,r[0]=i[0],r[1]=i[1],this.dirtifyLocal(t,o)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.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=ye(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Nd(n),n=n.parentNode;e&&t.forEach((function(t){Nd(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.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)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Cd(Ad.ATTR_MODIFIED,n,e,e,t,Cd.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return bt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return wt(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return xt(e.scaling,this.getWorldTransform(t,e))},t.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},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=bt(jt(),e),r=wt(te(),e),i=xt(jt(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},t.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])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Zl.isEmpty(r))return null;var i=n||new Zl;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new Zl},t.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 Zl).update(r.center,r.halfExtents))})),e){var a=Fh(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Zl),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=rt();t.parentNode.transformable&&(e=lt(rt(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Zl.isEmpty(n)){var r=new Zl;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Zl.isEmpty(i)||(r=new Zl).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=ye(r.getMin(),2),s=a[0],c=a[1],l=ye(r.getMax(),2),u=l[0],f=l[1];return new iu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new iu((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.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)}},t.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;r<n.length;r++)this.syncHierarchy(n[r])}},t.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?ft(e.worldTransform,r.worldTransform,e.localTransform):ot(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),Dd={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]},Fd=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,zd=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Gd=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Wd=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Gd.exec(n)&&!zd.exec(t))},this.trimByKinsokuShorui=function(t){var e=ve([],ye(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=Dd.MetricsString+Dd.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Dd.BaselineSymbol).width),c=Dd.HeightMultiplier*s;s=s*Dd.BaselineMultiplier|0,r.width=a,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,a,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,c||1).data,u=l.length,f=4*a,h=0,d=0,p=!1;for(h=0;h<s;++h){for(var g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d+=f}for(n.ascent=s-h,d=u-f,p=!1,h=c;h>s;--h){for(g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d-=f}return n.descent=h-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,c=e.textAlign,l=e.letterSpacing,u=e.textPath,f=e.leading,h=void 0===f?0:f,d=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=_(e)&&"".concat(e,"px")||"16px",s=n.split(","),c=s.length-1;c>=0;c--){var l=s[c].trim();!ad.test(l)&&od.indexOf(l)<0&&(l='"'.concat(l,'"')),s[c]=l}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),p=this.measureFont(d,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var g=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);g.font=d,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(m.length),v=0;if(!u){for(E=0;E<m.length;E++){var b=g.measureText(m[E]).width+(m[E].length-1)*l;y[E]=b,v=Math.max(v,b)}O=v+a;var x=o||p.fontSize+a,w=Math.max(x,p.fontSize+a)+(m.length-1)*(x+h),M=0;return"middle"===s?M=-w/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?M=-w:"top"!==s&&"hanging"!==s||(M=0),{font:d,width:O,height:w,lines:m,lineWidths:y,lineHeight:x+=h,maxLineWidth:v,fontProperties:p,lineMetrics:y.map((function(t,e){var n=0;return"center"===c||"middle"===c?n-=t/2:"right"!==c&&"end"!==c||(n-=t),new iu(n-a/2,M+e*x,t+a,x)}))}}u.getTotalLength();for(var E=0;E<m.length;E++)var O=g.measureText(m[E]).width+(m[E].length-1)*l},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,c=void 0===s?1/0:s,l=e.textOverflow,u=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),f=o+a,h="";"ellipsis"===l?h="...":l&&"clip"!==l&&(h=l);for(var d=[],p=0,g=0,m={},y=function(t){return r.getFromCache(t,a,m,u)},v=Array.from(h).reduce((function(t,e){return t+y(e)}),0),b=Array.from(t),x=0;x<b.length;x++){var w=b[x],M=t[x-1],E=t[x+1],O=y(w);if(this.isNewline(w)){if(++p>=c){e.isOverflowing=!0;break}g=0,d[p]=""}else{if(g>0&&g+O>f){if(p+1>=c){if(e.isOverflowing=!0,v>0&&v<=f){for(var k=d[p].length,S=0,A=k,T=0;T<k;T++){var _=y(d[p][T]);if(S+_+v>f){A=T;break}S+=_}d[p]=(d[p]||"").slice(0,A)+h}break}if(g=0,d[++p]="",this.isBreakingSpace(w))continue;this.canBreakInLastChar(w)||(d=this.trimToBreakable(d),g=this.sumTextWidthByCache(d[p]||"",m)),this.shouldBreakByKinsokuShorui(w,E)&&(d=this.trimByKinsokuShorui(d),g+=y(M||""))}g+=O,d[p]=(d[p]||"")+w}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&Dd.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&Dd.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=ve([],ye(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+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!Fd.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(!Fd.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}(),$d={},Hd=(jd=new gd,Rd=new pd,(Ld={})[Tl.CIRCLE]=new ud,Ld[Tl.ELLIPSE]=new fd,Ld[Tl.RECT]=jd,Ld[Tl.IMAGE]=jd,Ld[Tl.GROUP]=jd,Ld[Tl.LINE]=new hd,Ld[Tl.TEXT]=new md($d),Ld[Tl.POLYLINE]=Rd,Ld[Tl.POLYGON]=Rd,Ld[Tl.PATH]=new dd,Ld[Tl.HTML]=null,Ld[Tl.MESH]=null,Ld),Vd=function(){var t,e=new mh,n=new bh;return(t={})[Xu.PERCENTAGE]=null,t[Xu.NUMBER]=new Sh,t[Xu.ANGLE]=new ph,t[Xu.DEFINED_PATH]=new gh,t[Xu.PAINT]=e,t[Xu.COLOR]=e,t[Xu.FILTER]=new yh,t[Xu.LENGTH]=n,t[Xu.LENGTH_PERCENTAGE]=n,t[Xu.LENGTH_PERCENTAGE_12]=new xh,t[Xu.LENGTH_PERCENTAGE_14]=new wh,t[Xu.COORDINATE]=new Oh,t[Xu.OFFSET_DISTANCE]=new Ah,t[Xu.OPACITY_VALUE]=new Th,t[Xu.PATH]=new _h,t[Xu.LIST_OF_POINTS]=new Ph,t[Xu.SHADOW_BLUR]=new Ch,t[Xu.TEXT]=new Nh,t[Xu.TEXT_TRANSFORM]=new Lh,t[Xu.TRANSFORM]=new sd,t[Xu.TRANSFORM_ORIGIN]=new cd,t[Xu.Z_INDEX]=new ld,t[Xu.MARKER]=new kh,t}();$d.CameraContribution=pu,$d.AnimationTimeline=null,$d.EasingFunction=null,$d.offscreenCanvasCreator=new Sd,$d.nativeHTMLMap=new WeakMap,$d.sceneGraphSelector=new Pd,$d.sceneGraphService=new Bd($d),$d.textService=new Wd($d),$d.geometryUpdaterFactory=Hd,$d.CSSPropertySyntaxFactory=Vd,$d.styleValueRegistry=new dh($d),$d.layoutRegistry=null,$d.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Pc?Pc:{},$d.enableCSSParsing=!0,$d.enableDataset=!1,$d.enableStyleSyntax=!0;var Yd=0,qd=new Cd(Ad.INSERTED,null,"","","",0,"",""),Ud=new Cd(Ad.REMOVED,null,"","","",0,"",""),Xd=new Md(Ad.DESTROY),Kd=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entity=Yd++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:Ru.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=$d.enableCSSParsing?{anchor:Fu,opacity:Fu,fillOpacity:Fu,strokeOpacity:Fu,fill:Fu,stroke:Fu,transform:Fu,transformOrigin:Fu,visibility:Fu,pointerEvents:Fu,lineWidth:Fu,lineCap:Fu,lineJoin:Fu,increasedLineWidthForHitTesting:Fu,fontSize:Fu,fontFamily:Fu,fontStyle:Fu,fontWeight:Fu,fontVariant:Fu,textAlign:Fu,textBaseline:Fu,textTransform:Fu,zIndex:Fu,filter:Fu,shadowType:Fu}:null,e.parsedStyle={},e.attributes={},e}return ue(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.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}),e.prototype.cloneNode=function(t){throw new Error(ou)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return $d.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),qd.relatedNode=this,t.dispatchEvent(qd),t},e.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return Ud.relatedNode=this,t.dispatchEvent(Ud),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),$d.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}},e.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()}},e.prototype.matches=function(t){return $d.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return $d.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return $d.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return $d.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return $d.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return $d.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return $d.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if($d.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;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)}))}},e.prototype.before=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=ye(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,ve([],ye(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,ve([],ye(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,ve([],ye(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Xd),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return $d.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return $d.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return $d.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return $d.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return $d.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return $d.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Pu(t);return e=this.attributes[n],$d.enableCSSParsing&&y(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw new Error(ou)},e.prototype.getAttributeNode=function(t){throw new Error(ou)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(ou)},e.prototype.hasAttributeNS=function(t,e){throw new Error(ou)},e.prototype.removeAttributeNS=function(t,e){throw new Error(ou)},e.prototype.removeAttributeNode=function(t){throw new Error(ou)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(ou)},e.prototype.setAttributeNode=function(t){throw new Error(ou)},e.prototype.setAttributeNodeNS=function(t){throw new Error(ou)},e.prototype.toggleAttribute=function(t,e){throw new Error(ou)},e}(Od);function Zd(t){return!!(null==t?void 0:t.nodeName)}var Qd,Jd=new Cd(Ad.ATTR_MODIFIED,null,null,null,null,Cd.MODIFICATION,null,null),tp={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:""},ep={anchor:[0,0],fill:Hu,stroke:Hu,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},np=fe(fe({},ep),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),rp=ve(ve([],ye(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),ip="data-",op=function(t){function e(e){var n,r=t.call(this)||this;r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=e,r.config.interactive=null!==(n=r.config.capture)&&void 0!==n?n:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||Tl.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,$d.enableCSSParsing?ep:np,r.config.initialParsedStyle),$d.enableCSSParsing&&Object.assign(r.attributes,tp),r.initAttributes(r.config.style);var i=$d.globalThis.Proxy?$d.globalThis.Proxy:function(){};return $d.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(ip).concat(Au(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(ip).concat(Au(e)),n),!0}})),$d.enableStyleSyntax&&(r.style=new i({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return ue(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=fe({},this.attributes);for(var r in n){var i=n[r];Zd(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};$d.enableCSSParsing&&(n.usedAttributes=rp);var r={};for(var i in t){r[Pu(i)]=t[i]}$d.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=Pu(e);F(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),t.prototype.setAttribute.call(this,i,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];$d.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Jd.relatedNode=this,Jd.prevValue=o,Jd.newValue=e,Jd.attrName=t,Jd.prevParsedValue=a,Jd.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Jd):(Jd.target=this,this.ownerDocument.defaultView.dispatchEvent(Jd,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=ye(t.getMin(),2),n=e[0],r=e[1],i=ye(t.getMax(),2),o=i[0],a=i[1];return new iu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.setOrigin(this,Dl(t,e,n)),this},e.prototype.getOrigin=function(){return $d.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.setPosition(this,Dl(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.setLocalPosition(this,Dl(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.translate(this,Dl(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),$d.sceneGraphService.translateLocal(this,Dl(t,e,n)),this},e.prototype.getPosition=function(){return $d.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return $d.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Dl(t,e=e||t,n=n||t)),$d.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Dl(t,e=e||t,n=n||t)),$d.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return $d.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return $d.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return zl(ye(Gl(jt(),$d.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return zl(ye(Gl(jt(),$d.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return $d.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return $d.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return y(e)&&y(n)?$d.sceneGraphService.rotateLocal(this,0,0,t):$d.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return y(e)&&y(n)?$d.sceneGraphService.rotate(this,0,0,t):$d.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return $d.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return $d.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return $d.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return $d.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return $d.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return $d.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return $d.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return $d.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return $d.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){$d.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.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},e.prototype.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,ve([],ye(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,ve([],ye(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=ye(e,2),i=r[0],o=r[1];return i?w(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},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=ye(bt(jt(),e),2),r=n[0],i=n[1],o=ye(xt(jt(),e),2),a=o[0],s=o[1],c=wt(te(),e),l=ye(Gl(jt(),c),3),u=l[0],f=l[2];return Wl(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=ye($l(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setEulerAngles(a).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=ye($l(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setLocalEulerAngles(a).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){$d.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){$d.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(Kd),ap=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;$d.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},sp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.CIRCLE,style:$d.enableCSSParsing?fe({cx:"",cy:"",r:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:$d.enableCSSParsing?null:[Uu,Uu]}},r))||this}return ue(e,t),e}(op),cp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);return(n=t.call(this,fe({style:$d.enableCSSParsing?fe({x:"",y:""},r):fe({},r)},i))||this).isCustomElement=!0,n}return ue(e,t),e}(op),lp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.ELLIPSE,style:$d.enableCSSParsing?fe({cx:"",cy:"",rx:"",ry:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:$d.enableCSSParsing?null:[Uu,Uu]}},r))||this}return ue(e,t),e}(op),up=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.GROUP,style:$d.enableCSSParsing?fe({x:"",y:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(op),fp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);return(n=t.call(this,fe({type:Tl.HTML,style:$d.enableCSSParsing?fe({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):fe({},r)},i))||this).cullable.enable=!1,n}return ue(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle,e=t.x,n=t.y,r=t.width,i=t.height;return new iu(e,n,r,i)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.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 Zl,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},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=lt(rt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Zl.isEmpty(e)){var n=new Zl;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(op),hp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.IMAGE,style:$d.enableCSSParsing?fe({x:"",y:"",img:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(op),dp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Tl.LINE,style:fe({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},r)},i))||this).markerStartAngle=0,n.markerEndAngle=0;var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&Zd(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&Zd(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.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&&Zd(r)&&(this.markerStartAngle=0,r.remove()),i&&Zd(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Zd(r)&&(this.markerEndAngle=0,r.remove()),i&&Zd(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=e.defX,f=e.defY,h=t?n:r;if(h&&Zd(h)){var d,p,g,m,y,v,b;t?(m=a-u,y=c-f,p=s-a,g=l-c,v=i||0,b=this.markerStartAngle):(m=s-u,y=l-f,p=a-s,g=c-l,v=o||0,b=this.markerEndAngle),d=Math.atan2(g,p),h.setLocalEulerAngles(180*d/Math.PI+b),h.setLocalPosition(m+Math.cos(d)*v,y+Math.sin(d)*v)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2,s=n.defX,c=n.defY,l=ml(r,i,o,a,t),u=l.x,f=l.y,h=qt(jt(),Bt(u-s,f-c,0),e?this.getWorldTransform():this.getLocalTransform());return new ru(h[0],h[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return gl(t.x1,t.y1,t.x2,t.y2)},e}(op),pp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Tl.PATH,style:$d.enableCSSParsing?fe({path:"",miterLimit:""},r):fe({},r),initialParsedStyle:$d.enableCSSParsing?null:{miterLimit:4,path:fe({},Ku)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Zd(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Zd(c)&&n.placeMarkerMid(c),s&&Zd(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.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&&Zd(r)&&(this.markerStartAngle=0,r.remove()),i&&Zd(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Zd(r)&&(this.markerEndAngle=0,r.remove()),i&&Zd(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.defX,s=e.defY,c=t?n:r;if(c&&Zd(c)){var l,u,f,h,d,p,g;if(t){var m=ye(this.getStartTangent(),2),y=m[0];h=(v=m[1])[0]-a,d=v[1]-s,u=y[0]-v[0],f=y[1]-v[1],p=i||0,g=this.markerStartAngle}else{var v,b=ye(this.getEndTangent(),2);y=b[0];h=(v=b[1])[0]-a,d=v[1]-s,u=y[0]-v[0],f=y[1]-v[1],p=o||0,g=this.markerEndAngle}l=Math.atan2(f,u),c.setLocalEulerAngles(180*l/Math.PI+g),c.setLocalPosition(h+Math.cos(l)*p,d+Math.sin(l)*p)}},e.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&&Zd(t))for(var o=1;o<n.length-1;o++){var a=ye(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)}},e.prototype.getTotalLength=function(){return Tf(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return Qe(t,e,fe(fe({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,c=qt(jt(),Bt(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new ru(c[0],c[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Tf(this),e)},e.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},e.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},e}(op),gp=function(t){function e(e){var n=this;void 0===e&&(e={});var r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Tl.POLYGON,style:$d.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!0},r):fe({},r),initialParsedStyle:$d.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Zd(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Zd(c)&&n.placeMarkerMid(c),s&&Zd(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.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&&Zd(r)&&(this.markerStartAngle=0,r.remove()),i&&Zd(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Zd(r)&&(this.markerEndAngle=0,r.remove()),i&&Zd(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.points.points,s=e.defX,c=e.defY,l=t?n:r;if(l&&Zd(l)){var u,f,h,d,p,g,m;if(d=a[0][0]-s,p=a[0][1]-c,t)f=a[1][0]-a[0][0],h=a[1][1]-a[0][1],g=i||0,m=this.markerStartAngle;else{var y=a.length;this.parsedStyle.isClosed?(f=a[y-1][0]-a[0][0],h=a[y-1][1]-a[0][1]):(d=a[y-1][0]-s,p=a[y-1][1]-c,f=a[y-2][0]-a[y-1][0],h=a[y-2][1]-a[y-1][1]),g=o||0,m=this.markerEndAngle}u=Math.atan2(h,f),l.setLocalEulerAngles(180*u/Math.PI+m),l.setLocalPosition(d+Math.cos(u)*g,p+Math.sin(u)*g)}},e.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&&Zd(t))for(var o=1;o<(this.parsedStyle.isClosed?n.length:n.length-1);o++){var a=n[o][0]-r,s=n[o][1]-i,c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(a,s)}},e}(op),mp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.POLYLINE,style:$d.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!1},n):fe({},n),initialParsedStyle:$d.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return ue(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.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=o.segments,c=0,l=0;s.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=ml(a[l][0],a[l][1],a[l+1][0],a[l+1][1],c),f=u.x,h=u.y,d=qt(jt(),Bt(f-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new ru(d[0],d[1])},e.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},e.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},e}(gp),yp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.RECT,style:$d.enableCSSParsing?fe({x:"",y:"",width:"",height:"",radius:""},n):fe({},n)},r))||this}return ue(e,t),e}(op),vp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Tl.TEXT,style:$d.enableCSSParsing?fe({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},n):fe({fill:"black"},n),initialParsedStyle:$d.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}},r))||this}return ue(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(op),bp=function(){function t(){this.registry={},this.define(Tl.CIRCLE,sp),this.define(Tl.ELLIPSE,lp),this.define(Tl.RECT,yp),this.define(Tl.IMAGE,hp),this.define(Tl.LINE,dp),this.define(Tl.GROUP,up),this.define(Tl.PATH,pp),this.define(Tl.POLYGON,gp),this.define(Tl.POLYLINE,mp),this.define(Tl.TEXT,vp),this.define(Tl.HTML,fp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),xp=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new $d.AnimationTimeline(e)}catch(t){}var n={};return lh.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=Tu(i)?i(Tl.GROUP):i)})),e.documentElement=new up({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return ue(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.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?vp:up);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw new Error(ou)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return pe(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ge(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,null]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return[2,(f=h.sent().picked)&&f[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f},e.prototype.elementsFromPoint=function(t,e){return pe(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ge(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,[]]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return(f=h.sent().picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),[2,f]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(au)},e.prototype.insertBefore=function(t,e){throw new Error(au)},e.prototype.removeChild=function(t,e){throw new Error(au)},e.prototype.replaceChild=function(t,e,n){throw new Error(au)},e.prototype.append=function(){throw new Error(au)},e.prototype.prepend=function(){throw new Error(au)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(Od),wp=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Md(Ad.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),Mp=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new xd(null),this.rootWheelEvent=new wd(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 s=t.normalizeToPointerEvent(e,a);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}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,s=t.normalizeToPointerEvent(e,a);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}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=me(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.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 s=n.normalizeToPointerEvent(t,i);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=n.bootstrapEvent(n.rootPointerEvent,u,i,t);f.type+=a,n.context.eventService.mapEvent(f)}}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=me(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.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||y(r)||y(i)){var s=this.context.eventService.client2Viewport(new ru(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.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,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=Gh[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.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,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=Wh.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;r<t.changedTouches.length;r++){var i=t.changedTouches[r];F(i.button)&&(i.button=0),F(i.buttons)&&(i.buttons=1),F(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),F(i.width)&&(i.width=i.radiusX||1),F(i.height)&&(i.height=i.radiusY||1),F(i.tiltX)&&(i.tiltX=0),F(i.tiltY)&&(i.tiltY=0),F(i.pointerType)&&(i.pointerType="touch"),F(i.pointerId)&&(i.pointerId=i.identifier||0),F(i.pressure)&&(i.pressure=i.force||.5),F(i.twist)&&(i.twist=0),F(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;F(o.isPrimary)&&(o.isPrimary=!0),F(o.width)&&(o.width=1),F(o.height)&&(o.height=1),F(o.tiltX)&&(o.tiltX=0),F(o.tiltY)&&(o.tiltY=0),F(o.pointerType)&&(o.pointerType="mouse"),F(o.pointerId)&&(o.pointerId=1),F(o.pressure)&&(o.pressure=.5),F(o.twist)&&(o.twist=0),F(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),Ep=[Tl.CIRCLE,Tl.ELLIPSE,Tl.IMAGE,Tl.RECT,Tl.LINE,Tl.POLYLINE,Tl.POLYGON,Tl.TEXT,Tl.PATH,Tl.HTML],Op=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(Zl.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||Kl.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Kl.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Kl.OUTSIDE||n===Kl.INSIDE)return n;for(var i=Kl.INSIDE,o=Ep.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var c=1<<a;if(0!=(n&c)&&(!o||4!==a&&5!==a)){var l=r[a],u=l.normal,f=l.distance;if(Ht(u,e.getPositiveFarPoint(r[a]))+f<0)return Kl.OUTSIDE;Ht(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),kp=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=e.rBushRoot,a=i.root.ownerDocument.defaultView;this.rBush=o;var s=function(t){t.target.renderable.dirty=!0,r.dirtify()},c=function(t){var e=t.detail.affectChildren,i=t.target;e&&i.forEach((function(t){n.toSync.add(t)}));for(var o=i;o;)o.renderable&&n.toSync.add(o),o=o.parentElement;r.dirtify()},l=function(t){var e=t.target;$d.enableCSSParsing&&$d.styleValueRegistry.recalc(e),$d.sceneGraphService.dirtifyToRoot(e),r.dirtify()},u=function(t){var e=t.target,i=e.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(e),$d.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){a.addEventListener(Ad.MOUNTED,l),a.addEventListener(Ad.UNMOUNTED,u),a.addEventListener(Ad.ATTR_MODIFIED,s),a.addEventListener(Ad.BOUNDS_CHANGED,c)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Ad.MOUNTED,l),a.removeEventListener(Ad.UNMOUNTED,u),a.removeEventListener(Ad.ATTR_MODIFIED,s),a.removeEventListener(Ad.BOUNDS_CHANGED,c),n.toSync.clear()})),r.hooks.endFrame.tap(t.tag,(function(){n.syncRTree()}))},t.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=ye(i.getMin(),2),a=o[0],s=o[1],c=ye(i.getMax(),2),l=c[0],u=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=u}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()},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(Qd||(Qd={}));var Sp=new Md(Ad.MOUNTED),Ap=new Md(Ad.UNMOUNTED),Tp=new Md(Qd.BEFORE_RENDER),_p=new Md(Qd.RERENDER),Pp=new Md(Qd.AFTER_RENDER),Cp=function(t){function e(e){var n=t.call(this)||this;n.Element=op,n.inited=!1,n.context={},n.document=new xp,n.document.defaultView=n,n.customElements=new bp;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,c=e.devicePixelRatio,l=e.renderer,u=e.background,f=e.cursor,h=e.document,d=e.requestAnimationFrame,p=e.cancelAnimationFrame,g=e.createImage,m=e.supportsPointerEvents,y=e.supportsTouchEvents,v=e.supportsCSSTransform,b=e.supportsMutipleCanvasesInOneContainer,x=e.useNativeClickEvent,w=e.alwaysTriggerPointerEventOnCanvas,M=e.isTouchEvent,E=e.isMouseEvent;b||function(t,e){if(t){var n="string"==typeof t?t:t.id||Rh++;jh[n]&&jh[n].destroy(),jh[n]=e}}(r,n);var O=a,k=s,S=c;return i&&(S=(S=c||Ih&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,O=a||function(t){var e=zh(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=zh(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&($d.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=d?d:Jh.bind($d.globalThis),n.cancelAnimationFrame=null!=p?p:td.bind($d.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in $d.globalThis,n.supportsPointerEvents=null!=m?m:!!$d.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof $d.globalThis.TouchEvent},n.isMouseEvent=null!=E?E:function(t){return!$d.globalThis.MouseEvent||t instanceof $d.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof $d.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:O,height:k,renderer:l,offscreenCanvas:o,devicePixelRatio:S,cursor:f||"default",background:u||"transparent",createImage:g,document:h,supportsCSSTransform:v,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:w}),n.initDefaultCamera(O,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return ue(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new $d.CameraContribution;i.clipSpaceNearZ=n,i.setType(Jl.EXPLORING,tu.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(hu,(function(){r.context.renderingContext.renderReasons.add(yd.CAMERA_CHANGED)})),this.context.camera=i},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.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}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new Md(Qd.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new Md(Qd.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===eu.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Md(Qd.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(Tp),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(_p)})),this.dispatchEvent(Pp)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Pl,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Mp,new kp,new wp([new Op])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(fe(fe({},$d),this.context)),this.context.renderingService=new Td($d,this.context),this.context.eventService=new kd($d,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)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new Md(Qd.READY))})):r.dispatchEvent(new Md(Qd.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new Md(Qd.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init($d)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),ve([],ye(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy($d)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Ap):(Ap.target=t,this.dispatchEvent(Ap,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(Sp):(Sp.target=t,this.dispatchEvent(Sp,!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()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(Ed),Np=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.landmarks=[],e}return ue(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=Bl(e),this.relAzimuth=Bl(t),this.relRoll=Bl(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Jl.EXPLORING){var r=ee(te(),[1,0,0],Fl((this.rotateWorld?1:-1)*this.relElevation)),i=ee(te(),[0,1,0],Fl((this.rotateWorld?1:-1)*this.relAzimuth)),o=ee(te(),[0,0,1],Fl(this.relRoll)),a=ne(te(),i,r);a=ne(te(),a,o);var s=Et(rt(),a);ht(this.matrix,this.matrix,[0,0,-this.distance]),ft(this.matrix,this.matrix,s),ht(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getPosition():this.type===Jl.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=Dl(t,e,0),r=Rt(this.position);return zt(r,r,Wt(jt(),this.right,n[0])),zt(r,r,Wt(jt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Rt(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===Jl.ORBITING||this.type===Jl.EXPLORING?this._getDistance():this.type===Jl.TRACKING&&zt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.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,c=e.focalPoint,l=void 0===c?this.focalPoint:c,u=e.roll,f=e.zoom,h=new $d.CameraContribution;h.setType(this.type,void 0),h.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]),h.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:it(h.getWorldTransform()),right:Rt(h.right),up:Rt(h.up),forward:Rt(h.forward),position:Rt(h.getPosition()),focalPoint:Rt(h.getFocalPoint()),distanceVector:Rt(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=A(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=_(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,h=void 0===f?void 0:f;if(0===c)return this.syncFromLandmark(r),void(h&&h());this.cancelLandmarkAnimation();var d,p=r.position,g=r.focalPoint,m=r.zoom,y=r.roll,v=u||$d.EasingFunction(a),b=function(){n.setFocalPoint(g),n.setPosition(p),n.setRoll(y),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),h&&h()},x=function(t){void 0===d&&(d=t);var e=t-d;if(e>c)b();else{var r,i,o=v(e/c),a=jt(),s=jt();Yt(a,n.focalPoint,g,o),Yt(s,n.position,p,o),i=n.roll*(1-o)+y*o,r=n.zoom*(1-o)+m*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),Kt(a,g)+Kt(s,p)<=.01&&null==m&&null==y?b():(n.computeMatrix(),n.triggerUpdate(),e<c&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(x)))}};this.canvas.requestAnimationFrame(x)}},e.prototype.syncFromLandmark=function(t){this.matrix=ot(this.matrix,t.matrix),this.right=Dt(this.right,t.right),this.up=Dt(this.up,t.up),this.forward=Dt(this.forward,t.forward),this.position=Dt(this.position,t.position),this.focalPoint=Dt(this.focalPoint,t.focalPoint),this.distanceVector=Dt(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},e}(pu);$d.CameraContribution=Np;var Lp=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 ue(e,t),e}(vd),jp=0,Rp=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(jp++),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(new 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(new 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;t=Number(t),isNaN(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(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},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||this._playbackRate<0&&Number(this._currentTime)<=0)},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 Lp(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)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},t.prototype.persist=function(){throw new Error(ou)},t.prototype.addEventListener=function(t,e,n){throw new Error(ou)},t.prototype.removeEventListener=function(t,e,n){throw new Error(ou)},t.prototype.dispatchEvent=function(t){throw new Error(ou)},t.prototype.commitStyles=function(){throw new Error(ou)},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},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 Lp(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 Lp(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Ip=.1,Bp="function"==typeof Float32Array,Dp=function(t,e){return 1-3*e+3*t},Fp=function(t,e){return 3*e-6*t},zp=function(t){return 3*t},Gp=function(t,e,n){return((Dp(e,n)*t+Fp(e,n))*t+zp(e))*t},Wp=function(t,e,n){return 3*Dp(e,n)*t*t+2*Fp(e,n)*t+zp(e)},$p=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Bp?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Gp(o*Ip,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Ip;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Ip,s=Wp(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Wp(e,n,r);if(0===o)return e;e-=(Gp(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Gp(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+Ip,t,n)};return function(t){return 0===t||1===t?t:Gp(a(t),e,r)}},Hp=function(t){return Math.pow(t,2)},Vp=function(t){return Math.pow(t,3)},Yp=function(t){return Math.pow(t,4)},qp=function(t){return Math.pow(t,5)},Up=function(t){return Math.pow(t,6)},Xp=function(t){return 1-Math.cos(t*Math.PI/2)},Kp=function(t){return 1-Math.sqrt(1-t*t)},Zp=function(t){return t*t*(3*t-2)},Qp=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)},Jp=function(t,e){void 0===e&&(e=[]);var n=ye(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=T(Number(i),1,10),c=T(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},tg=function(t,e,n){void 0===e&&(e=[]);var r=ye(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,u=r[3],f=void 0===u?0:u;o=T(o,.1,1e3),s=T(s,.1,1e3),l=T(l,.1,1e3),f=T(f,.1,1e3);var h=Math.sqrt(s/o),d=l/(2*Math.sqrt(s*o)),p=d<1?h*Math.sqrt(1-d*d):0,g=d<1?(d*h-f)/p:-f+h,m=n?n*t/1e3:t;return m=d<1?Math.exp(-m*d*h)*(1*Math.cos(p*m)+g*Math.sin(p*m)):(1+g*m)*Math.exp(-m*h),0===t||1===t?t:1-m},eg=function(t,e){void 0===e&&(e=[]);var n=ye(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(T(t,0,1)*i)/i},ng=function(t,e){void 0===e&&(e=[]);var n=ye(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return $p(r,i,o,a)(t)},rg=$p(.42,0,1,1),ig=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},og=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},ag=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},sg={steps:eg,"step-start":function(t){return eg(t,[1,"start"])},"step-end":function(t){return eg(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":ng,ease:function(t){return ng(t,[.25,.1,.25,1])},in:rg,out:ig(rg),"in-out":og(rg),"out-in":ag(rg),"in-quad":Hp,"out-quad":ig(Hp),"in-out-quad":og(Hp),"out-in-quad":ag(Hp),"in-cubic":Vp,"out-cubic":ig(Vp),"in-out-cubic":og(Vp),"out-in-cubic":ag(Vp),"in-quart":Yp,"out-quart":ig(Yp),"in-out-quart":og(Yp),"out-in-quart":ag(Yp),"in-quint":qp,"out-quint":ig(qp),"in-out-quint":og(qp),"out-in-quint":ag(qp),"in-expo":Up,"out-expo":ig(Up),"in-out-expo":og(Up),"out-in-expo":ag(Up),"in-sine":Xp,"out-sine":ig(Xp),"in-out-sine":og(Xp),"out-in-sine":ag(Xp),"in-circ":Kp,"out-circ":ig(Kp),"in-out-circ":og(Kp),"out-in-circ":ag(Kp),"in-back":Zp,"out-back":ig(Zp),"in-out-back":og(Zp),"out-in-back":ag(Zp),"in-bounce":Qp,"out-bounce":ig(Qp),"in-out-bounce":og(Qp),"out-in-bounce":ag(Qp),"in-elastic":Jp,"out-elastic":ig(Jp),"in-out-elastic":og(Jp),"out-in-elastic":ag(Jp),spring:tg,"spring-in":tg,"spring-out":ig(tg),"spring-in-out":og(tg),"spring-out-in":ag(tg)},cg=function(t){return sg[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)]||sg.linear},lg=function(t){return t},ug=1,fg=.5,hg=0;function dg(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var pg="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",gg=new RegExp("cubic-bezier\\("+pg+","+pg+","+pg+","+pg+"\\)"),mg=/steps\(\s*(\d+)\s*\)/,yg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function vg(t){var e=gg.exec(t);if(e)return $p.apply(void 0,ve([],ye(e.slice(1).map(Number)),!1));var n=mg.exec(t);if(n)return dg(Number(n[1]),hg);var r=yg.exec(t);return r?dg(Number(r[1]),{start:ug,middle:fg,end:hg}[r[2]]):cg(t)}function bg(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 xg=0,wg=1,Mg=2,Eg=3;function Og(t,e,n){var r=function(t,e,n){if(null===e)return xg;var r=n.endTime;return e<Math.min(n.delay,r)?wg:e>=Math.min(n.delay+t+n.endDelay,r)?Mg:Eg}(t,e,n),i=function(t,e,n,r,i){switch(r){case wg:return"backwards"===e||"both"===e?0:null;case Eg:return n-i;case Mg:return"forwards"===e||"both"===e?t:null;case xg: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!==wg&&(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!==Mg||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return t===Mg&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function kg(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Sg(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:vg(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;o<i.length-1;o++){var a=o,s=o+1,c=i[a].computedOffset,l=i[s].computedOffset,u=c,f=l;0===o&&(u=-1/0,0===l&&(s=a)),o===i.length-2&&(f=1/0,1===c&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Tg(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&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:n.easingFunction(r/i);t.setAttribute(n.property,n.interpolation(o))}));else for(var n in r)Sg(n)&&t.setAttribute(n,null)}}function Sg(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Ag=function(t,e,n){return function(r){var i=_g(t,e,r);return!$d.enableCSSParsing&&_(i)?i:n(i)}};function Tg(t,e,n,r){var i=fh[t];if(i&&i.syntax&&i.int){var o=$d.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if($d.enableCSSParsing){var c=$d.styleValueRegistry.parseProperty(t,e,r),l=$d.styleValueRegistry.parseProperty(t,n,r);a=$d.styleValueRegistry.computeProperty(t,c,r),s=$d.styleValueRegistry.computeProperty(t,l,r)}else{var u=o.parserWithCSSDisabled;a=u?u(e,r):e,s=u?u(n,r):n}var f=o.mixer(a,s,r);if(f){var h=Ag.apply(void 0,ve([],ye(f),!1));return function(t){return 0===t?e:1===t?n:h(t)}}}}return Ag(!1,!0,(function(t){return t?n:e}))}function _g(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 n<.5?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;s<o;s++)a.push(_g(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Pg=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=lg,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=vg(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function Cg(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;o<i;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}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".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;o<n.length;o++){var a=n[o].offset;if(y(a))r=!1;else{if(a<i)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&&Number(t.offset)<=1})),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;a<r;a++){var s=n[a].computedOffset;if(!y(s)&&!y(o)){for(var c=1;c<a-i;c++)n[i+c].computedOffset=o+(Number(s)-o)*c/(a-i);i=a,o=Number(s)}}}(),n}var Ng="backwards|forwards|both|none".split("|"),Lg="reverse|alternate|alternate-reverse".split("|");function jg(t,e){return function(t,e){var n=new Pg;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&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===Ng.indexOf(t[e]))return;if("direction"===e&&-1===Lg.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Rg=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=jg(n,!1),this.timing.effect=this,this.timing.activeDuration=bg(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Cg(e,this.timing),this.interpolations=kg(this.normalizedKeyframes,this.timing,this.target);var i=$d.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=Og(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=Cg(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 Ig(t,e){return Number(t.id)-Number(e.id)}var Bg=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=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Ig),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 Rg(t,e,n),i=new Rp(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(Ig),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=[],c=[],l=[];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?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,ve([],ye(a),!1)),(i=this.pendingEffects).push.apply(i,ve([],ye(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();function Dg(t){return new Fg([t],null,t,t.ownerDocument)}$d.EasingFunction=vg,$d.AnimationTimeline=Bg;class Fg{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Fg(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Fg(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Fg([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,o]=Array.isArray(r)?r:[r,null],a=e(i,t);a.__data__=i,null!==o&&(a.__fromElements__=o),this._parent.appendChild(a),n.push(a)}return new Fg(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new Fg(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Fg([i],null,this._parent,this._document);const o="string"==typeof e?this.createElement(e):e();return o.id=t,n&&(o.className=n),r.appendChild(o),new Fg([o],null,this._parent,this._document)}data(t,e=(t=>t),n=(()=>null)){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,c=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=Pn(this._elements,(t=>n(t.__data__)));for(let f=0;f<t.length;f++){const h=t[f],d=e(h,f),p=n(h,f);if(c.has(d)){const t=c.get(d);t.__data__=h,t.__facet__=!1,i.push(t),o.delete(t),c.delete(d)}else if(l.has(d)){const t=l.get(d);t.__data__=h,t.__facet__=!0,i.push(t),l.delete(d)}else if(u.has(d)){const t=u.get(d);a.push([h,t]);for(const e of t)o.delete(e);u.delete(d)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(h):t.__toData__=[h],s.add(t),o.delete(t)}else r.push(h)}const f=[new Fg([],r,this._parent,this._document),new Fg(i,null,this._parent,this._document),new Fg(o,null,this._parent,this._document),new Fg([],a,this._parent,this._document),new Fg(s,null,this._parent,this._document)];return new Fg(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Fg(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Fg.registry[t];return e?new e:ar(`Unknown node type: ${t}`)}join(t=(t=>t),e=(t=>t),n=(t=>t.remove()),r=(t=>t),i=(t=>t.remove())){const o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(e){const n=Array.isArray(e)?e:[e];Promise.all(n.map((t=>t.finished))).then((()=>{this._elements[t].remove()}))}else{this._elements[t].remove()}}return new Fg([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o[t]=n(r,i,o))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o.style[t]=n(r,i,o))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r,i){n[r]=e(t,r,i)}))}on(t,e){return this.each((function(n,r,i){i.addEventListener(t,e)})),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function zg(t,e,n){return Math.max(e,Math.min(t,n))}function Gg(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Wg(t,e,n,r,i){const o=ss(is(r,e))+Math.PI,a=ss(is(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function $g(t,e,n,r="y",i="between"){const o="y"===r||!0===r?n:e,a="y"===r||!0===r?90:0,s=vr(o),[c,l]=kn(s,(t=>o[t])),u=new Zo({domain:[c,l],range:[0,100]}),f=t=>u.map(o[t]),h={between:e=>`${t[e]} ${f(e)}%`,start:e=>0===e?`${t[e]} ${f(e)}%`:`${t[e-1]} ${f(e)}%, ${t[e]} ${f(e)}%`,end:e=>e===t.length-1?`${t[e]} ${f(e)}%`:`${t[e]} ${f(e)}%, ${t[e+1]} ${f(e)}%`};return`linear-gradient(${a}deg, ${s.sort(((t,e)=>f(t)-f(e))).map(h[i]||h.between).join(",")})`}function Hg(t){const[e,n,r,i]=t;return[i,e,n,r]}function Vg(t,e,n){const[r,i,,o]=wc(t)?Hg(e):e,[a,s]=n,c=t.getCenter(),l=cs(is(r,c)),u=cs(is(i,c)),f=u===l&&a!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:as(o,c),outerRadius:as(r,c)}}function Yg(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function qg(t,e){if(!Mc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Ug(t,e,n,r,i={}){const{inset:o=0,radius:a=0,insetLeft:s=o,insetTop:c=o,insetRight:l=o,insetBottom:u=o,radiusBottomLeft:f=a,radiusBottomRight:h=a,radiusTopLeft:d=a,radiusTopRight:p=a,minWidth:g=-1/0,maxWidth:m=1/0}=i,y=he(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!Mc(r)&&!Oc(r)){const n=!!wc(r),[i,,o]=n?Hg(e):e,[a,v]=i,[b,x]=is(o,i),w=(b>0?a:a+b)+s,M=(x>0?v:v+x)+c,E=Math.abs(b)-(s+l),O=Math.abs(x)-(c+u),k=n?E:zg(E,g,m),S=n?zg(O,g,m):O,A=w-(k-E)/2,T=M-(S-O)/2;return Dg(t.createElement("rect",{})).style("x",A).style("y",T).style("width",k).style("height",S).style("radius",[d,p,h,f]).call(Gg,y).node()}const{y:v,y1:b}=n,x=r.getCenter(),w=Vg(r,e,[v,b]),M=Us().cornerRadius(a).padAngle(o*Math.PI/180);return Dg(t.createElement("path",{})).style("path",M(w)).style("transform",`translate(${x[0]}, ${x[1]})`).style("radius",a).style("inset",o).call(Gg,y).node()}Fg.registry={g:up,rect:yp,circle:sp,path:pp,text:vp,ellipse:lp,image:hp,line:dp,polygon:gp,polyline:mp,html:fp};const Xg=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=he(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=he(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:m=g,radiusTopRight:y=g,radiusBottomRight:v=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:M=x,innerRadiusBottomRight:E=x,innerRadiusBottomLeft:O=x,lineWidth:k=("stroke"===n||p?d:0),inset:S=0,insetLeft:A=S,insetRight:T=S,insetBottom:_=S,insetTop:P=S,minWidth:C,maxWidth:N}=a,L=he(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:j=u,opacity:R}=r,I=[i?m:w,i?y:M,o?v:E,o?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];wc(s)&&B.push(B.shift());const D=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map(((t,e)=>[t,I[e]])))),{inset:S,insetLeft:A,insetRight:T,insetBottom:_,insetTop:P,minWidth:C,maxWidth:N});return Dg(Ug(c,e,r,s,D)).call(Gg,h).style("fill","transparent").style(n,j).style(Yg(t),R).style("lineWidth",k).style("stroke",void 0===p?j:p).call(Gg,L).node()}};Xg.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Kg=(t,e)=>Xg(Object.assign({colorAttribute:"fill"},t),e);Kg.props=Object.assign(Object.assign({},Xg.props),{defaultMarker:"square"});const Zg=(t,e)=>Xg(Object.assign({colorAttribute:"stroke"},t),e);function Qg(t,e,n){const[r,i,o,a]=t;if(wc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}Zg.props=Object.assign(Object.assign({},Xg.props),{defaultMarker:"hollowSquare"});const Jg=(t,e)=>{const{adjustPoints:n=Qg}=t,r=he(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=he(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!wc(i),[p,g,m,y]=d?Hg(h):h,{color:v=l,opacity:b}=e,x=tc().curve(mc)([p,g,m,y]);return Dg(o.createElement("path",{})).call(Gg,u).style("path",x).style("fill",v).style("fillOpacity",b).call(Gg,r).node()}};function tm(t,e,n){const[r,i,o,a]=t;if(wc(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}Jg.props={defaultMarker:"square"};const em=(t,e)=>Jg(Object.assign({adjustPoints:tm},t),e);function nm(t){const e="function"==typeof t?t:t.render;return class extends cp{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}em.props={defaultMarker:"square"};const rm=nm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;Dg(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Gg,r),Dg(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Gg,i)}));const im=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=he(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=he(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:m,seriesX:y,seriesY:v}=e,b=r&&m?$g(m,y,v,r,i):p,x=qg(c,e),w=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),b&&{stroke:b}),g&&{lineWidth:g}),x&&{transform:x}),s);let M;if(Mc(c)){const t=c.getCenter();M=e=>oc(tc().curve(nc)).angle(((n,r)=>cs(is(e[r],t)))).radius(((n,r)=>as(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else M=tc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[E,O]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),k=ur(w,"connect"),S=!!O.length;if(!S||a&&!Object.keys(k).length)return Dg(l.createElement("path",{})).style("d",M(E)||[]).call(Gg,w).node();if(S&&!a)return Dg(l.createElement("path",{})).style("d",M(t)).call(Gg,w).node();return Dg(new rm).style("style1",Object.assign(Object.assign({},w),k)).style("style2",w).style("d1",(A=O,A.map(M).join(","))).style("d2",M(t)).node();var A}};im.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const om=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Mc(n)?mc:Zs;return im(Object.assign({curve:i},t),e)(...r)}};om.props=Object.assign(Object.assign({},im.props),{defaultMarker:"line"});const am=(t,e)=>{const{alpha:n=.5}=t,r=he(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=Mc(i)?pc:hc;return im(Object.assign({curve:o.alpha(n)},r),e)(...t)}};am.props=Object.assign(Object.assign({},im.props),{defaultMarker:"smooth"});const sm=(t,e)=>im(Object.assign({curve:xc},t),e);sm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"hv"});const cm=(t,e)=>im(Object.assign({curve:bc},t),e);cm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"vh"});const lm=(t,e)=>im(Object.assign({curve:vc},t),e);function um(t,e,n,r,i){const o=ss(is(n,e)),a=o+Math.PI/2,s=[r/2*Math.cos(a),r/2*Math.sin(a)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],u=[r/2*Math.cos(o),r/2*Math.sin(o)],f=os(e,s),h=os(n,c),d=os(h,l),p=os(n,l),g=is(p,c),m=is(n,c),y=is(e,s),v=is(y,u),b=is(e,u),x=is(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...m,i/2),t.lineTo(...y),t.arcTo(...v,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}lm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"hvh"});const fm=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=he(i,["color"]),l=zs();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=o[t],a=o[t+1];[...n,...r].every(cr)&&um(l,n,r,i,a)}return Dg(n.createElement("path",{})).call(Gg,c).style("fill",a||s).style("d",l.toString()).call(Gg,t).node()}};fm.props=Object.assign(Object.assign({},im.props),{defaultMarker:"line"});const hm=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];hm.style=["fill"];const dm=hm.bind(void 0);dm.style=["stroke","lineWidth"];const pm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];pm.style=["fill"];const gm=pm.bind(void 0);gm.style=["fill"];const mm=pm.bind(void 0);mm.style=["stroke","lineWidth"];const ym=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};ym.style=["fill"];const vm=ym.bind(void 0);vm.style=["stroke","lineWidth"];const bm=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};bm.style=["fill"];const xm=bm.bind(void 0);xm.style=["stroke","lineWidth"];const wm=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};wm.style=["fill"];const Mm=wm.bind(void 0);Mm.style=["stroke","lineWidth"];const Em=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};Em.style=["fill"];const Om=Em.bind(void 0);Om.style=["stroke","lineWidth"];const km=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};km.style=["fill"];const Sm=km.bind(void 0);Sm.style=["stroke","lineWidth"];const Am=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];Am.style=["stroke","lineWidth"];const Tm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];Tm.style=["stroke","lineWidth"];const _m=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];_m.style=["stroke","lineWidth"];const Pm=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];Pm.style=["stroke","lineWidth"];const Cm=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Cm.style=["stroke","lineWidth"];const Nm=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Nm.style=["stroke","lineWidth"];const Lm=Nm.bind(void 0);Lm.style=["stroke","lineWidth"];const jm=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];jm.style=["stroke","lineWidth"];const Rm=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];Rm.style=["stroke","lineWidth"];const Im=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];Im.style=["stroke","lineWidth"];const Bm=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];Bm.style=["stroke","lineWidth"];const Dm=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];Dm.style=["stroke","lineWidth"];const Fm=new Map([["bowtie",km],["cross",Tm],["dash",Lm],["diamond",ym],["dot",Nm],["hexagon",Em],["hollowBowtie",Sm],["hollowDiamond",vm],["hollowHexagon",Om],["hollowPoint",dm],["hollowSquare",mm],["hollowTriangle",xm],["hollowTriangleDown",Mm],["hv",Rm],["hvh",Bm],["hyphen",Cm],["line",Am],["plus",Pm],["point",hm],["rect",gm],["smooth",jm],["square",pm],["tick",_m],["triangleDown",wm],["triangle",bm],["vh",Im],["vhv",Dm]]);const zm=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=he(t,["colorAttribute","symbol","mode"]),a=Fm.get(r)||Fm.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=o.stroke?u||1:u,{color:d=f,transform:p,opacity:g}=r,[m,y]=function(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}(e),v=function(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Sc(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}(i,e,r,s),b=v||o.r||l.r;return Dg(c.createElement("path",{})).call(Gg,l).style("fill","transparent").style("d",a(m,y,b)).style("lineWidth",h).style("transform",p).style("stroke",d).style(Yg(t),g).style(n,d).call(Gg,o).node()}};zm.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);Gm.props=Object.assign({defaultMarker:"hollowBowtie"},zm.props);const Wm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Wm.props=Object.assign({defaultMarker:"hollowDiamond"},zm.props);const $m=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);$m.props=Object.assign({defaultMarker:"hollowHexagon"},zm.props);const Hm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Hm.props=Object.assign({defaultMarker:"hollowPoint"},zm.props);const Vm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Vm.props=Object.assign({defaultMarker:"hollowSquare"},zm.props);const Ym=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Ym.props=Object.assign({defaultMarker:"hollowTriangle"},zm.props);const qm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);qm.props=Object.assign({defaultMarker:"hollowTriangleDown"},zm.props);const Um=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Um.props=Object.assign({defaultMarker:"bowtie"},zm.props);const Xm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Xm.props=Object.assign({defaultMarker:"cross"},zm.props);const Km=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Km.props=Object.assign({defaultMarker:"diamond"},zm.props);const Zm=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Zm.props=Object.assign({defaultMarker:"hexagon"},zm.props);const Qm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Qm.props=Object.assign({defaultMarker:"hyphen"},zm.props);const Jm=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Jm.props=Object.assign({defaultMarker:"line"},zm.props);const ty=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);ty.props=Object.assign({defaultMarker:"plus"},zm.props);const ey=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);ey.props=Object.assign({defaultMarker:"point"},zm.props);const ny=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);ny.props=Object.assign({defaultMarker:"square"},zm.props);const ry=(t,e)=>zm(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);ry.props=Object.assign({defaultMarker:"tick"},zm.props);const iy=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);iy.props=Object.assign({defaultMarker:"triangle"},zm.props);const oy=(t,e)=>zm(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);oy.props=Object.assign({defaultMarker:"triangleDown"},zm.props);const ay=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=he(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=he(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=zs();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*as(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...h),d.lineTo(...t),d.moveTo(...h),d.lineTo(...e)}return Dg(o.createElement("path",{})).call(Gg,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Gg,i).node()}};function sy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&sy(t,e)}))}function cy(t){uy(t,!0)}function ly(t){uy(t,!1)}function uy(t,e){var n=e?"visible":"hidden";sy(t,(function(t){t.attr("visibility",n)}))}ay.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var fy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,ve([],ye(e),!1))||this;return r.addEventListener(Ad.INSERTED,(function(){ly(r)})),r}return ue(e,t),e}(up);function hy(t){var e=t.appendChild(new fy({class:"offscreen"}));return ly(e),e}var dy=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({style:fe({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return ue(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(vp);function py(t){return t*Math.PI/180}function gy(t){return Number((180*t/Math.PI).toPrecision(5))}var my=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t}();function yy(t,e){return m(t)?t.apply(void 0,ve([],ye(e),!1)):t}var vy,by=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=ye(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]})));return Object.assign(r,{prefix:n}),r},xy=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=ye(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?E(s)?(E(t[a])||(c[a]={}),n<r?xy(t[a],s,n+1,r):c[a]=e[a]):x(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)}))},wy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)xy(t,e[r]);return t},My=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},Ey=function(t,e,n){if(void 0===n&&(n=128),!m(t))throw new TypeError("Expected a function");var r=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return a.set(o,s),s};return r.cache=$(n),r}((function(t,e){var n=A(t)?t:t.style.text.toString(),r=e||Oy(t),i=r.fontSize,o=r.fontFamily,a=r.fontWeight,s=r.fontStyle,c=r.fontVariant;return vy||(vy=document.createElement("canvas").getContext("2d")),vy.font=[s,c,a,"".concat(i,"px"),o].join(" "),vy.measureText(n).width}),(function(t,e){return[A(t)?t:t.style.text.toString(),Object.values(e||Oy(t)).join()].join("")}),4096),Oy=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function ky(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Sy(t,e){var n=ky(t);n&&n.attr(e)}function Ay(t,e,n){void 0===n&&(n="..."),Sy(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Ty(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function _y(t){return"function"==typeof t?t():A(t)||_(t)?new dy({style:{text:String(t)}}):t}function Py(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function Cy(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}var Ny=function(t,e){return function(n){return t*(1-n)+e*n}};function Ly(t,e){return"number"==typeof t&&"number"==typeof e?Ny(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=Ly(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=ye(e,2),o=i[0],a=i[1];o in t?n[o]=Ly(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=ye(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function jy(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,c=a.y,l=ye([s+a.width,c+a.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new my(e,n,r-e,i-n)}var Ry=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=ye([0,0],2),g=p[0],m=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=ye([g,m],2),o=i[0],a=i[1];return e=ye([g+n*d[0],m+r*d[1]],2),g=e[0],m=e[1],new my(o,a,n,r)})),v=jy(y),b={"flex-start":0,"flex-end":f?r-v.width:i-v.height,center:f?(r-v.width)/2:(i-v.height)/2},x=y.map((function(t){var e=t.x,n=t.y,r=my.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));jy(x);var w=function(t){var e=ye(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},M=x.map((function(t){var e=t.x,n=t.y,r=my.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),E=M.map((function(e){var n,r,i=my.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return E},Iy=function(t,e,n){return[]};function By(t,e){return[t[0]*e,t[1]*e]}function Dy(t,e){return[t[0]+e[0],t[1]+e[1]]}function Fy(t,e){return[t[0]-e[0],t[1]-e[1]]}function zy(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Gy(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Wy(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function $y(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function Hy(t,e){return+t.toPrecision(e)}function Vy(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Yy(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,c,l,u=function(t,e,n,r){var i,o,a,s,c,l,u=[],f=!!r,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=ye(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=zy(h,y=t[p]),d=Gy(d,y)}p=0;for(var m=t.length;p<m;p+=1){var y=t[p];if(0!==p||n)if(p!==m-1||n){o=t[[p?p-1:m-1,p-1][n?0:1]];var v=[0,0];v=By(v=Fy(a=t[n?(p+1)%m:p+1],o),e);var b=Wy(y,o),x=Wy(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=By(v,-b),E=By(v,x);c=Dy(y,M),s=zy(s=Dy(y,E),Gy(a,y)),s=Gy(s,zy(a,y)),c=zy(c=Dy(y,M=By(M=Fy(s,y),-b/x)),Gy(o,y)),s=Dy(y,E=By(E=Fy(y,c=Gy(c,zy(o,y))),x/b)),f&&(c=zy(c=Gy(c,h),d),s=zy(s=Gy(s,h),d)),u.push(l),u.push(c),l=s}else c=y,u.push(l),u.push(c);else l=y}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,h=[];for(o=0;o<f-1;o+=1)s=u[2*o],c=u[2*o+1],l=i[o+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=ye(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var qy=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Uy(t){return qy.includes(t)}function Xy(t){var e={};for(var n in t)Uy(n)&&(e[n]=t[n]);return e}function Ky(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&t.scale(a),a}var Zy=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=ye(Array.isArray(a)?a:[a,null],2),c=s[0],l=s[1];(f=r(c,o)).__data__=c,null!==l&&(f.__fromElements__=l),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var u=this._elements[o],f=r(c=u.__data__,o);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=be(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),o=be(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,n){var i=be(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,o;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var a=[],s=[],c=new Set(this._elements),l=[],u=new Set,f=new Map(this._elements.map((function(t,n){return[e(t.__data__,n),t]}))),h=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),d=function(t,e){var n=new Map;return t.forEach((function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)})),n}(this._elements,(function(t){return r(t.__data__)})),p=0;p<t.length;p++){var g=t[p],m=e(g,p),y=r(g,p);if(f.has(m))(w=f.get(m)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(m);else if(h.has(m)){(w=h.get(m)).__data__=g,w.__facet__=!0,s.push(w),h.delete(m)}else if(d.has(m)){var v=d.get(m);l.push([g,v]);try{for(var b=(i=void 0,me(v)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(m)}else if(f.has(y)){(w=f.get(y)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var M=[new n([],a,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,M)},t.prototype.merge=function(t){var e=ve(ve([],ye(this._elements),!1),ye(t._elements),!1),r=ve(ve([],ye(this._transitions),!1),ye(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then((function(){return n.remove()})):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var o=ye(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,ve([this._parent,this],ye(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var o="string"==typeof e?this.createElement(e):e();return r.appendChild(o),new n([o],null,this._parent,this._document)},t.registry={g:up,rect:yp,circle:sp,path:pp,text:dy,ellipse:lp,image:hp,line:dp,polygon:gp,polyline:mp,html:fp},t}();function Qy(t){return new Zy([t],null,t,t.ownerDocument)}function Jy(t){if(_(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function tv(t){var e=t.getLocalBounds(),n=ye([e.min,e.max],2),r=ye(n[0],2),i=r[0],o=r[1],a=ye(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function ev(t,e){var n=ye(t,2),r=n[0],i=n[1],o=ye(e,2),a=o[0],s=o[1];return r!==a&&i===s}function nv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function rv(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var iv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function ov(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=ye(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(iv(o,"show")&&iv(rv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(nv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(nv(e)),"")]=a;else if(!iv(o,"show")&&iv(o,e)!==n){var s=rv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function av(t,e){return Object.entries(t).reduce((function(t,n){var r=ye(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(nv(i))]=o,t}),{})}function sv(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var o=ye(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function cv(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=ye([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}function lv(){uy(this,"hidden"!==this.attributes.visibility)}var uv=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,wy({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return ue(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=hy(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&lv.call(this)},e.prototype.update=function(t,e){var n;return this.attr(wy({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e}(cp),fv=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},hv=fv,dv=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},pv=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},gv=pv;var mv=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function yv(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(A(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var vv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,n){var r=t.symbol,i=t.size,o=void 0===i?16:i,a=he(t,["symbol","size"]),s=yv(r);Py(!!s,Qy(n),(function(t){t.maybeAppendByClassName("marker",s).attr("className","marker ".concat(s,"-marker")).call((function(t){if("image"===s){var n=2*o;t.styles({img:r,width:n,height:n,x:-o,y:-o})}else{n=o/2;var i=m(r)?r:e.getSymbol(r);t.styles(fe({path:null==i?void 0:i(0,0,n)},a))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e}(uv);vv.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),vv.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),vv.registerSymbol("line",dv),vv.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),vv.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),vv.registerSymbol("circle",fv),vv.registerSymbol("point",hv),vv.registerSymbol("bowtie",(function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]})),vv.registerSymbol("hexagon",(function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]})),vv.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),vv.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),vv.registerSymbol("triangle",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]})),vv.registerSymbol("triangle-down",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]})),vv.registerSymbol("line",dv),vv.registerSymbol("dot",pv),vv.registerSymbol("dash",gv),vv.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),vv.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),vv.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),vv.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),vv.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));var bv=function(t){function e(e){var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,Y({},{type:"column"},fe({style:r},i)))||this).columnsGroup=new up({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes.columns;Qy(this.columnsGroup).selectAll(".column").data(t.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(wy({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(op),xv=function(t){function e(e){var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,Y({},{type:"lines"},fe({style:r},i)))||this).linesGroup=n.appendChild(new up),n.areasGroup=n.appendChild(new up),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas;e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(wy({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Qy(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){Qy(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(op);function wv(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return ve([e===n?"M":"L"],ye(t),!1)}));return e?r.reverse():r}function Mv(t,e){if(void 0===e&&(e=!1),t.length<=2)return wv(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];U(o,n.slice(-2))||n.push.apply(n,ve([],ye(o),!1))}var a=Yy(n,!1);return e?a.unshift(ve(["M"],ye(t[r-1]),!1)):a.unshift(ve(["M"],ye(t[0]),!1)),a}function Ev(t,e,n){var r=G(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function Ov(t){return 0===t.length?[0,0]:[k(L(t,(function(t){return k(t)||0}))),O(N(t,(function(t){return O(t)||0})))]}function kv(t){for(var e=G(t),n=e[0].length,r=ye([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=o[c],o[c]=s[c]);return e}var Sv=function(t){function e(e){return t.call(this,e,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return ue(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=G(t);return _(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?kv(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=ye(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=ov(this.attributes,"area"),a=ov(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=ye(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=ye([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),T(i.map(t),s,a)]}))}))}(c,{type:"line",x:l.x,y:l.y}),f=[];if(o){var h=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=Mv(o),s=void 0;if(0===i)s=Ev(a,e,n);else{var c=Mv(t[i-1],!0),l=o[0];c[0][0]="L",s=ve(ve(ve([],ye(a),!1),ye(c),!1),[ve(["M"],ye(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=wv(t[i]),a=void 0;if(0===i)a=Ev(o,e,n);else{var s=wv(t[i-1],!0);s[0][0]="L",a=ve(ve(ve([],ye(o),!1),ye(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return Ev(e?Mv(t):wv(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return fe({stroke:t.getColor(n),path:i?Mv(e):wv(e)},a)})),areas:f.map((function(e,n){return fe({path:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=ov(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=kv(s));var c=this.createScales(s),l=c.x,u=c.y,f=ye(Ov(s),2),h=f[0],d=f[1],p=new Zo({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),m=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return fe(fe({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(m[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Qy(n).select(r):Qy(n).append(i)).attr("className","container").node();var o=t.type,a="spark".concat(o),s="line"===o?this.linesStyle:this.columnsStyle;Qy(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new xv({className:a,style:s}):new bv({className:a,style:s})})).attr("className","spark ".concat(a))}),(function(t){return t.update(s)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:m(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.scale,a=r.range,s=void 0===a?[]:a,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,h=ye(Ov(t),2),d=h[0],p=h[1],g=new Zo({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-o)]});return"line"===i?{type:i,x:new Zo({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Lo({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(uv);function Av(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=ye(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,fe(fe({},t[e]),n)]:[e,n]})))}function Tv(t,e){t?t.finished.then(e):e()}function _v(t,e){"update"in t?t.update(e):t.attr(e)}function Pv(t,e,n){return 0===e.length?null:n?t.animate(e,n):(_v(t,{style:e.slice(-1)[0]}),null)}function Cv(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=ye(e,2),o=n[0],a=n[1];if(!y(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?Pv(t,[r,i],fe({fill:"both"},n)):(_v(t,i),null)}function Nv(t,e){return t.style.opacity||(t.style.opacity=1),Cv(t,{opacity:0},e)}var Lv={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},jv={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Rv={orientation:"horizontal",showLabel:!0,type:"start"},Iv=by({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Bv=by({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Dv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,e){var n=t.size,r=void 0===n?10:n,i=t.radius,o=void 0===i?r/4:i,a=t.orientation,s=he(t,["size","radius","orientation"]),c=r,l=2.4*c,u=Qy(e).maybeAppendByClassName(Bv.iconRect,"rect").styles(fe(fe({},s),{width:c,height:l,radius:o,x:-c/2,y:-l/2})),f=1/3*c,h=2/3*c,d=1/4*l,p=3/4*l;u.maybeAppendByClassName("".concat(Bv.iconLine,"-1"),"line").styles(fe({x1:f,x2:f,y1:d,y2:p},s)),u.maybeAppendByClassName("".concat(Bv.iconLine,"-2"),"line").styles(fe({x1:h,x2:h,y1:d,y2:p},s)),u.node().setOrigin(c/2,l/2),"vertical"===a?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},e}(uv),Fv=function(t){function e(e){return t.call(this,e,Rv)||this}return ue(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=ov(this.attributes,"label"),i=r.transform,o=ye(sv(he(r,["transform"]),[]),2),a=o[0],s=o[1],c=Qy(t).maybeAppendByClassName(Bv.labelGroup,"g").styles(s),l=fe(fe({},jv),a),u=l.text,f=he(l,["text"]);Py(!!n,c,(function(t){e.label=t.maybeAppendByClassName(Bv.label,"text").styles(fe(fe({},f),{transform:i,text:"".concat(u)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.orientation,r=e.type,i=fe(fe({orientation:n},Lv),ov(this.attributes,"icon")),o=this.attributes.iconShape,a=void 0===o?function(){return new Dv({style:i})}:o;Qy(t).maybeAppendByClassName(Bv.iconGroup,"g").selectAll(Bv.icon.class).data([a]).join((function(t){return t.append("string"==typeof a?a:function(){return a(r)}).attr("className",Bv.icon.name)}),(function(t){return t.update(i)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(uv),zv=function(t){function e(e){var n=t.call(this,e,fe(fe(fe({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},av(Rv,"handle")),av(Lv,"handleIcon")),av(jv,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Ty(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.getBBox(),s=a.x,c=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,o=e.type;t.stopPropagation();var a=n.getOrientVal(Ty(t)),s=a-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===o?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=a}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,o="range"===i?t:t[1],a="range"===i?n.getValues():n.getValues()[1],s=new Md("valuechange",{detail:{oldValue:o,value:a}});n.dispatchEvent(s),null==r||r(a)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return ue(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=ov(this.attributes,"sparkline");return fe(fe({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=ye(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=ye(Jy(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(Iv.selection.class).each((function(n,r){Cv(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Cv(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Cv(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=ov(this.attributes,"track");this.trackShape=Qy(t).maybeAppendByClassName(Iv.track,"rect").styles(fe(fe({},this.shape),e))},e.prototype.renderBrushArea=function(t){var e=this.attributes.brushable;this.brushArea=Qy(t).maybeAppendByClassName(Iv.brushArea,"rect").styles(fe({fill:"transparent",cursor:e?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this;Py("horizontal"===this.attributes.orientation,Qy(t).maybeAppendByClassName(Iv.sparklineGroup,"g"),(function(t){var n=e.sparklineStyle;t.maybeAppendByClassName(Iv.sparkline,(function(){return new Sv({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,o=r?"range"===i?["start","end"]:["end"]:[],a=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(Iv.handle.class).data(o.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new Fv({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Iv.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");a[n]=this,this.addEventListener("pointerdown",a.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(a.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");a[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.type,r=e.selectionType;this.foregroundGroup=Qy(t).maybeAppendByClassName(Iv.foreground,"g");var i=ov(this.attributes,"selection"),o=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===r?"grab":"invert"===r?"crosshair":"default"})).styles(i)},a=this;this.foregroundGroup.selectAll(Iv.selection.class).data("value"===n?[]:this.calcSelectionArea().map((function(t,e){return{style:fe({},t),index:e,show:"select"===r?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",Iv.selection.name).call(o).each((function(t,e){var n=this;1===e?(a.selectionShape=Qy(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),a.onDragStart("selection")(t)})),a.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),a.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),a.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","grab")}))):this.on("pointerdown",a.onDragStart("track"))}))}),(function(t){return t.call(o)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=ye(this.range,2),i=r[0],o=r[1],a=ye(this.getValues().map((function(t){return Hy(t,e)})),2),s=a[0],c=a[1],l=ye(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return Hy(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,T(f,i,o)];u>f&&(u=(n=ye([f,u],2))[0],f=n[1]);var h=f-u;return h>o-i?[i,o]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>o?c===o&&s===u?[u,o]:[o-h,o]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=ye(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:a,height:c,x:o,width:n*s},{y:a,height:c,x:n*s+o,width:(r-n)*s},{y:a,height:c,x:r*s,width:(1-r)*s}],[{x:o,width:s,y:a,height:n*c},{x:o,width:s,y:n*c+a,height:(r-n)*c},{x:o,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,o=n.width,a=n.height,s=ye(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([f,o/2]),y:i+this.getOrientVal([a/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=ov(this.attributes,"handle"),c=ov(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new dy({style:fe(fe(fe({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,m=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-m-l};var y=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-y:y,e}var v=0,b=0,x=this.availableSpace,w=x.width,M=x.height,E=this.calcSelectionArea()[1],O=E.x,k=E.y,S=E.width,A=E.height,T=l+u;if("horizontal"===i){var _=T+g/2;if("start"===t)v=O-T-g>0?-_:_;else v=w-O-S-T>g?_:-_}else{var P=m+T;b="start"===t?k-u>m?-P:T:M-(k+A)-u>m?P:-T}return{x:v,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=ov(this.attributes,"handleLabel");return fe(fe(fe({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=ov(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return fe({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,r=e.showLabelOnInteraction,i=e.orientation,o=this.calcHandlePosition(t),a=this.calcHandleText(t),s=n;return!n&&r&&(s=!!this.target),fe(fe(fe(fe({},av(this.getHandleIconStyle(),"icon")),av(fe(fe({},this.getHandleLabelStyle(t)),a),"label")),o),{orientation:i,showLabel:s,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=ye(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=this.attributes.type,i=ye(this.getValues(),2),o=[i[0]+("range"===r?t:0),i[1]+e].sort();n?this.setValues(o):this.innerSetValues(o,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new Md(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(uv),Gv=function(t){function e(e){var n=t.call(this,e,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Md("scroll",r)),n.dispatchEvent(new Md("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=ye(n.getLocalPosition(),2),r=e[0],i=e[1],o=ye(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(Ty(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Md("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Md("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Md("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Md("trackMouseleave",{detail:t.detail}))},n}return ue(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Jy(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=ye(this.range,2),n=e[0],r=e[1];return T(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=ye(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ye(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=ye(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,o=e.slidable,a=ov(this.attributes,"track"),s=ov(this.attributes,"thumb"),c=fe(fe({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:o,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},av(a,"track")),av(s,"selection"));this.slider=Qy(t).maybeAppendByClassName("scrollbar",(function(){return new zv({style:c})})).update(c).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=ye(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(T(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(uv),Wv={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new pp({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};Y({},Wv,{style:{type:"arc"}}),Y({},Wv,{style:{}});var $v=by({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Hv=by({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Vv(t){return t.reduce((function(t,e,n){return t.push(ve([0===n?"M":"L"],ye(e),!1)),t}),[])}function Yv(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return Vv(t);if(!o)return[];var a=Wy(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(ve(["M"],ye(e),!1)):t.push(ve(["A",a,a,0,0,s],ye(e),!1)),t}),[])}(t,e,n):Vv(t)}function qv(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=ye([Yv(t,n),Yv(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=ye([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return d([ve(["L"],ye(h),!1)],[ve(["L"],ye(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=ye([Wy(h,o),Wy(f,o)],2),g=p[0],m=p[1];return d([ve(["A",g,g,0,0,1],ye(h),!1),ve(["L"],ye(h),!1)],[ve(["A",m,m,0,0,0],ye(f),!1),ve(["L"],ye(f),!1)])}var Uv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,e){var n=he(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=ye(e,1)[0];return fe(fe({},t),{points:ve(ve([],ye(e),!1),[n],!1)})})):n}(t),i=Qy(e).maybeAppendByClassName(Hv.lineGroup,"g"),o=Qy(e).maybeAppendByClassName(Hv.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),path:Yv(t.points,n)}}));return t.selectAll(Hv.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=yy(Xy(fe({path:t.path},r)),[t,e,a]);this.attr(fe({class:Hv.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return Cv(this,yy(Xy(fe({path:t.path},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this,i.exit);return Tv(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},c=[],l=0;l<e.length-1;l++){var u=ye([e[l].points,e[l+1].points],2),f=qv(u[0],u[1],n);c.push({path:f,fill:s(l)})}return t.selectAll(Hv.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=yy(t,[t,e,c]);this.attr(n)})).attr("className",Hv.region.name)}),(function(t){return t.transition((function(t,e){return Cv(this,yy(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this,r.exit);return Tv(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return ve(ve([],ye(a),!1),ye(s),!1)},e}(uv);function Xv(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=ye(t,2);return[n[0],yy(n[1],e)]})))}function Kv(t,e){return e&&m(e)?t.filter(e):t}function Zv(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Qv(t,e){if("linear"===e.type){var n=ye(e.startPos,2),r=n[0],i=n[1],o=ye(e.endPos,2),a=ye([o[0]-r,o[1]-i],2);return $y([a[0],a[1]])}var s=py(Zv(t,e));return[-Math.sin(s),Math.cos(s)]}function Jv(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Qv(t,n),"positive"!==e)}function tb(t,e){return Jv(t,e.labelDirection,e)}function eb(t,e){return"linear"===e.type?function(t,e){var n=ye(e.startPos,2),r=n[0],i=n[1],o=ye(e.endPos,2),a=ye([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}(t,e):function(t,e){var n=e.radius,r=ye(e.center,2),i=r[0],o=r[1],a=py(Zv(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function nb(t){return 0===Qv(0,t)[1]}function rb(t){return 0===Qv(0,t)[0]}function ib(t,e){return e-t==360}function ob(t,e,n,r,i){var o=e-t,a=ye([i,i],2),s=a[0],c=a[1],l=ye([py(t),py(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=ye(h(u),2),p=d[0],g=d[1],m=ye(h(f),2),y=m[0],v=m[1];if(ib(t,e)){var b=ye(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,y,v]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(y,",").concat(v)}function ab(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll($v.line.class).data([{path:ob.apply(void 0,ve(ve([i,o],ye(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",$v.line.name).styles(e).styles({path:function(t){return t.path}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=Ly(e,n),s=Math.ceil(+o/16),c=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}}));return t.animate(c,fe({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return ve(ve([n,r],ye(i),!1),[o],!1)}(this),ve(ve([i,o],ye(a),!1),[s],!1),r.update);if(e){var n=function(){var e=X(t.attributes,"__keyframe_data__");t.style.path=ob.apply(void 0,ve([],ye(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function sb(t){var e=ye(t,2),n=ye(e[0],2),r=n[0],i=n[1],o=ye(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function cb(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=ye([o,a],2),u=ye(l[0],2),f=u[0],h=u[1],d=ye(l[1],2),p=d[0],g=d[1],m=ye(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=ye([t,e,n],3),i=ye(r[0],2),o=i[0],a=i[1],s=ye(r[1],2),c=s[0],l=s[1],u=ye(r[2],2),f=u[0],h=u[1],d=ye([c-o,l-a],2),p=d[0],g=d[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=ye([-f/m,h/m],2),v=y[0],b=y[1];return[v*p,v*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),y=m[0],v=m[1],b=m[2],x=m[3],w=function(e){return t.selectAll($v.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat($v.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Cv(this,sb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Cv(this,sb(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+y,h+v],[p+b,g+x]],className:$v.line.name}]);var M=ye(s,2),E=M[0],O=M[1],k=p-f,S=g-h,A=ye([f+k*E,h+S*E],2),T=A[0],_=A[1],P=ye([f+k*O,h+S*O],2),C=P[0],N=P[1];return w([{line:[[f+y,h+v],[T,_]],className:$v.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:$v.lineSecond.name}])}function lb(t,e,n){var r,i=e.type,o=ov(e,"line");return r="linear"===i?cb(t,e,Vy(o,"arrow"),n):ab(t,e,Vy(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select($v.line.class):a?t.select($v.lineSecond.class):t.select($v.line.class),!o||!s||"arc"===n.type&&ib(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=_y(s);f.attr(r),Ky(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function ub(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function fb(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=ye(eb(i,e),2),a=o[0],s=o[1],c=ye(By(function(t,e){return Jv(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function hb(t,e,n,r){var i=ov(n,"grid"),o=i.type,a=i.areaFill,s=ub(n),c=Kv(e,n.gridFilter),l="segment"===o?fb(c,n):function(t,e){var n=e.gridControlAngles,r=ub(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=ye(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=ye(eb(t.value,e),2),s=i[0],c=i[1],l=ye([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=py(t),n=ye([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+o,c=u*i+f*r+a;h.push([s,c])})),{points:h,id:r}}))}(c,n),u=fe(fe({},i),{center:s,areaFill:m(a)?c.map((function(t,e){return yy(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll($v.grid.class).data([1]).join((function(t){return t.append((function(){return new Uv({style:u})})).attr("className",$v.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var db=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*a-l*s+u,l*a+c*s+f],[c*i-l*o+u,l*i+c*o+f],[c*a-l*o+u,l*a+c*o+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function pb(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getLocalBounds(),i=ye(r.min,2),o=i[0],a=i[1],s=ye(r.max,2),c=s[0],l=s[1],u=gb(t),f=u.width,h=u.height,d=0,p=0,g=o,m=a,y=ky(t);if(y){h-=1.5;var v=y.style.textAlign,b=y.style.textBaseline;"center"===v?g=(o+c)/2:"right"!==v&&"end"!==v||(g=c),"middle"===b?m=(a+l)/2:"bottom"===b&&(m=l)}var x=ye(Jy(e),4),w=x[0],M=void 0===w?0:w,E=x[1],O=void 0===E?0:E,k=x[2],S=void 0===k?M:k,A=x[3],T=new db((d+=o)-(void 0===A?O:A),(p+=a)-M,d+f+O,p+h+S);return t.setEulerAngles(n),T.rotatedPoints(py(n),g,m)}function gb(t){return t.__bbox__?t.__bbox__:t.getBBox()}function mb(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function yb(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function vb(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var h=[t[f],t[(f+1)%n]];if(i=l,o=void 0,a=void 0,s=void 0,c=void 0,o=yb((r=h)[0],r[1],i[0]),a=yb(r[0],r[1],i[1]),s=yb(i[0],i[1],r[0]),c=yb(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&mb(r,i[0])||0===a&&mb(r,i[1])||0===s&&mb(i,r[0])||0===c&&mb(i,r[1])){if(0===yb(h[0],e,h[1]))return mb(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function bb(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return function(t,e){var n=ye(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ye(e,4),c=s[0],l=s[1],u=o-r,f=a-i,h=s[2]-c,d=s[3]-l,p=u*d-h*f;if(0===p)return!1;var g=p>0,m=r-c,y=i-l,v=u*y-f*m;if(v<0===g)return!1;var b=h*y-d*m;return b<0!==g&&v>p!==g&&b>p!==g}(e,t)}))}function xb(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=ye(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=ye(Jy(e),4),p=d[0],g=d[1],m=d[2],y=d[3];return new db(c+f-y,l+f-p,c+h+g,l+h+m)}var v=ye(t.startPos,2),b=v[0],x=v[1],w=ye(t.endPos,2),M=w[0],E=w[1],O=ye(rb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=O[0],S=O[1],A=O[2],T=O[3],_=By(tb(0,t),i),P=new db(b,x,M,E);return P.x1+=T,P.y1+=k,P.x2+=S+_[0],P.y2+=A+_[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return vb([[r,o],[i,o],[i,a],[r,a]],pb(e,n))}(c,t)},u=function(t,e){return!t||!function(t,e,n){var r,i,o=pb(t,n).flat(1),a=pb(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var c=me(s),l=c.next();!l.done;l=c.next())if(bb(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t,e,Jy(n))};try{for(var f=me(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(a.add(s),a.add(d)):a.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function wb(t,e){return void 0===e&&(e={}),y(t)?0:"number"==typeof t?t:Math.floor(Ey(t,e))}var Mb=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(ly(t),!1)}))};var Eb=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,c,l,u=Mb,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,ve([1],ye(t.map((function(t){return gb(t).width}))),!1));if("linear"===n.type&&(nb(n)||rb(n))){var m=tv(t[0]).left,y=tv(t[i-1]).right,v=Math.abs(y-m)||1;h=Math.max(Math.floor(i*g/v),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&xb((l=c?ve(ve([c],ye(p),!1),[s],!1):ve([s],ye(p),!1),l.filter(My)),n,null==e?void 0:e.margin).length;){if(c&&!s&&h%2==0)d.splice(0,1).forEach(r.hide);else if(c&&s){d.splice(0,1).forEach(r.hide)}p=u(f(d),{seq:h}),h++}}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,c=e.margin,l=e.recoverWhenFailed,u=void 0===l||l,f=t.map((function(t){return t.getLocalEulerAngles()})),h=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var d=me(s),p=d.next();!p.done;p=d.next()){if(h(p.value),xb(t,n,c).length<1)return}}catch(t){i={error:t}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}u&&h(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,u=void 0===l?" ":l,f=e.margin,h=void 0===f?[0,0,0,0]:f,d=Oy(r.getTextShape(t[0])),p=wb(u,d),g=a?wb(a,d):p,m=wb(c,d);(y(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return gb(t).width}))));var v=t.slice();ye(h,4);for(var b=function(e){if(v.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(v=xb(t,n,h)).length<1)return{value:void 0}},x=m;x>g+p;x-=p){var w=b(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,ve([],ye(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&nb(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,p)}))};if(!(d>s)){for(var m=d;m<=s;m++)if(g(m),xb(t,n,f).length<1)return;l&&g(h)}}]]);function Ob(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}function kb(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function Sb(t,e){var n=ye(t,2),r=n[0],i=n[1],o=ye(e,2),a=o[0],s=o[1],c=ye([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function Ab(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o=tb(t.value,n),a=Qv(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Cy(e,-90,90)||(e+=180),e}(gy("perpendicular"===i?Sb([1,0],o):Sb([a[0]<0?-1:1,0],a)))}function Tb(t,e,n){var r=n.type,i=n.labelAlign,o=tb(t,n),a=kb(e),s=kb(gy(Sb([1,0],o))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===a?(c="center",l=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(Cy(a,0,90,!1,!0)||Cy(a,0,90)||Cy(a,270,360))&&(c="start"):90===s?Cy(a,0,90,!1,!0)?c="start":(Cy(a,90,180)||Cy(a,270,360))&&(c="end"):270===s?Cy(a,0,90,!1,!0)?c="end":(Cy(a,90,180)||Cy(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(Cy(a,0,90)||Cy(a,270,360))&&(c="end")):c="center":"parallel"===i?l=Cy(s,0,180,!0)?"top":"bottom":"horizontal"===i?Cy(s,90,270,!1)?c="end":(Cy(s,270,360,!1)||Cy(s,0,90))&&(c="start"):"perpendicular"===i&&(c=Cy(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function _b(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=yy(s,[t,c,e]),u=ye([tb(t.value,n),Ob(a,o)],2),f=ye(Dy(By(u[0],l+(1===u[1]?yy(r?i:0,[t,c,e]):0)),eb(t.value,n)),2);return{x:f[0],y:f[1]}}function Pb(t,e){"text"===t.nodeName&&t.attr(e)}function Cb(t){!function(t,e,n){var r=e.labelOverlap,i=void 0===r?[]:r;i.length&&i.forEach((function(r){var i=r.type,o=Eb.get(i);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,i)&&(null==o||o(t,r,e,n))}))}(this.node().childNodes,t,{hide:ly,show:cy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=Tb(e.__data__.value,t,n),i=e.querySelector($v.labelItem.class);i&&Pb(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Ay(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),Sy(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function Nb(t,e,n,r,i){var o=n.indexOf(e),a=Qy(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return _y(yy(i,[t,e,n,tb(t.value,r)]))}:function(){return _y(t.label||"")}}(e,o,n,i)).attr("className",$v.labelItem.name).node(),s=ye(sv(Xv(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=he(l,["transform"]);cv(t,u);var h=Ab(e,t,i);return t.setLocalEulerAngles(+h),Pb(a,fe(fe({},Tb(e.value,h,i)),c)),cv(t,u),t.attr(f),a}function Lb(t,e,n,r){var i=Kv(e,n.labelFilter),o=ov(n,"label");return t.selectAll($v.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",$v.label.name).transition((function(t){return Nb(this,t,e,o,n),this.attr(_b(t,e,n)),this.__bbox__=t.bbox,null})).call((function(){return Cb.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&ly(t),e.isVisible()&&cy(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+a/2),u=+a/4,f=function(t){if("circle"===t.nodeName){var e=ye(t.getLocalPosition(),2),n=e[0],r=e[1],i=t.attr("r");return[n-i,r-i]}return t.getLocalPosition()},h=ye(f(t),2),d=h[0],p=h[1],g=ye(f(e),2),m=ye([(d+g[0])/2-d,(p+g[1])/2-p],2),y=m[0],v=m[1],b=t.style.opacity,x=void 0===b?1:b,w=e.style.opacity,M=void 0===w?1:w,E=t.animate([{opacity:x,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(y,", ").concat(v,")")}],fe(fe({fill:"both"},n),{duration:c+l+u})),O=e.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-v,")"),offset:.01},{opacity:M,transform:"translate(0, 0)"}],fe(fe({fill:"both"},n),{duration:l+u,delay:c+l-u}));return Tv(O,i),[E,O]}(this.querySelector($v.labelItem.class),Nb(this,t,e,o,n),r.update),a=Cv(this,_b(t,e,n),r.update);return this.__bbox__=t.bbox,ve(ve([],ye(i),!1),[a],!1)})).call((function(e){var r,i,o=X(e,"_transitions").flat().filter(My);i=function(){return Cb.call(t,n)},0===(r=o).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this.childNodes[0],r.exit);return Tv(e,(function(){return Qy(t).remove()})),e}))})).transitions()}function jb(t,e){return Jv(t,e.tickDirection,e)}function Rb(t,e,n,r,i){var o=ye(function(t,e){var n=ye(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,yy(i.tickLength,[t,e,n])),2),a=ye(o[0],2),s=a[0],c=a[1],l=ye(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function Ib(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=jb(e.value,i),s="line";return m(o)&&(s=function(){return yy(o,[e,n,r,a])}),t.append(s).attr("className",$v.tickItem.name)}(Qy(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=jb(t.value,o),c=Rb(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=ye(sv(Xv(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(fe({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=ye(eb(t.value,r),2);return Cv(this,{x:s[0],y:s[1]},o)}var Bb=by({text:"text"},"title");function Db(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Fb(t,e){var n=Object.entries(e).reduce((function(e,n){var r=ye(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var zb=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return ue(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(Bb.text.class);if(!a)return new my(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=ye(Jy(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye([0,0,+e,+n],4),m=g[0],y=g[1],v=g[2],b=g[3],x=Db(r);if(x.includes("i"))return new my(m,y,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=ye(0===r?[l+d,+n-l-d]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=ye([+e-c-p],1),v=o[0]),"b"===t&&(a=ye([+n-l-f],1),b=a[0]),"l"===t&&(s=ye(0===r?[c+h,+e-c-h]:[0,+e],2),m=s[0],v=s[1])}));var w=ye(Jy(o),4),M=w[0],E=w[1],O=w[2],k=w[3],S=ye([k+E,M+O],2),A=S[0],T=S[1];return new my(m+k,y+M,v-A,b-T)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new my(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=he(t,["width","height","position","spacing"]),i=ye(sv(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=ye([+a/2,+s/2],2),u=ye([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=Db(c);return g.includes("l")&&(f=(e=ye([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=ye([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=ye([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=ye([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;Py(!!r.text,Qy(e),(function(t){n.title=t.maybeAppendByClassName(Bb.text,"text").styles(i).call(Fb,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(uv);function Gb(t,e,n,r,i){var o=ye(sv(ov(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=he(s,["transform"]);t.styles(a),e.styles(l);var u=c||function(t,e,n){var r=t.cloneNode(!0);r.style.transform="scale(1, 1)",r.style.transform="none";var i=r.getBBox().height;if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(i/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(i/2,")")}return""}(t.node(),a.direction,a.position);cv(t.node(),u);var f=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=Db(i),s=t.node().getLocalBounds(),c=ye(s.min,2),l=c[0],u=c[1],f=ye(s.halfExtents,2),h=f[0],d=f[1],p=ye(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],y=ye([l+h,u+d],2),v=y[0],b=y[1],x=ye(Jy(o),4),w=x[0],M=x[1],E=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var k=n.startPos,S=n.endPos,A=ye("start"===i?[k,S]:[S,k],2),T=A[0],_=A[1],P=ye(By($y([-_[0]+T[0],-_[1]+T[1]]),w),2),C=P[0],N=P[1];return{x:T[0]+C,y:T[1]+N}}return a.includes("t")&&(b-=d+m+w),a.includes("r")&&(v+=h+g+M),a.includes("l")&&(v-=h+2*g+O),a.includes("b")&&(b+=d+2*m+E),{x:v,y:b}}(Qy(n._offscreen||n.querySelector($v.mainGroup.class)),e,r),h=f.x,d=f.y,p=Cv(e.node(),{x:h,y:d},i);return cv(t.node(),u),p}function Wb(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Py(i,e.maybeAppendByClassName($v.lineGroup,"g"),(function(e){return lb(e,t,r)}))||[],c=Py(o,e.maybeAppendByClassName($v.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Kv(e,n.tickFilter),o=ov(n,"tick");return t.selectAll($v.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",$v.tick.name).transition((function(t,e){return Ib.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Ib.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Nv(this.childNodes[0],r.exit);return Tv(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=Py(a,e.maybeAppendByClassName($v.labelGroup,"g"),(function(e){return Lb(e,n,t,r)}))||[];return ve(ve(ve([],ye(s),!1),ye(c),!1),ye(l),!1).filter((function(t){return!!t}))}var $b=function(t){function e(e){return t.call(this,e,Wv)||this}return ue(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(o,l).filter((function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])})),h=Av(void 0===n?a:n),d=Py(c,Qy(e).maybeAppendByClassName($v.gridGroup,"g"),(function(e){return hb(e,f,t,h)}))||[],p=Qy(e).maybeAppendByClassName($v.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Wb(t,Qy(this.offscreenGroup),f,Av(!1));var g=Wb(t,Qy(p.node()),f,h),m=Py(s,Qy(e).maybeAppendByClassName($v.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll($v.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(o){return o.append((function(){return _y(i)})).attr("className",$v.title.name).transition((function(){return Gb(Qy(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return Gb(Qy(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return ve(ve(ve([],ye(d),!1),ye(g),!1),ye(m),!1).flat().filter((function(t){return!!t}))},e}(uv),Hb=by({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Vb=function(t){function e(e){var n=t.call(this,e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:mv(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new up({class:Hb.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new up({class:Hb.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return ue(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return T(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=ye(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,ve([],ye(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new my(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=ye(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=Pv(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return Tv(f,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:T(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:T(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(Hb.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?cy(e):ly(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox().width,c=ye("horizontal"===o?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,m=p.height,y=Math.max(h,s,g),v="horizontal"===o?{offset:[[0,0],[h/2+a,0],[h+s+2*a,0]],textAlign:"start"}:{offset:[[y/2,-d-a],[y/2,0],[y/2,m+a]],textAlign:"center"},b=ye(v.offset,3),x=ye(b[0],2),w=x[0],M=x[1],E=ye(b[1],2),O=E[0],k=E[1],S=ye(b[2],2),A=S[0],T=S[1],_=v.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=_),e.setLocalPosition(w,M),r.setLocalPosition(O,k),n.setLocalPosition(A,T)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(Hb.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=ye(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=this.pageViews.length>=2,s=t.maybeAppendByClassName(Hb.controller,"g");if(uy(s.node(),a),a){var c=ov(this.attributes,"button"),l=ov(this.attributes,"pageNum"),u=ye(sv(c),2),f=u[0],h=u[1],d=f.size,p=he(f,["size"]),g=!s.select(Hb.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Hb.prevBtnGroup,"g").styles(h);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(Hb.prevBtn,"path"),v=s.maybeAppendByClassName(Hb.nextBtnGroup,"g").styles(h);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(Hb.nextBtn,"path")].forEach((function(t){t.styles(fe(fe({},p),{transformOrigin:"center"})),Ky(t.node(),d,!0)}));var b=s.maybeAppendByClassName(Hb.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Hb.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=Qy(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=W((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Ad.INSERTED,e),this.playWindow.addEventListener(Ad.REMOVED,e)},e}(uv);function Yb(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}vv.registerSymbol("hiddenHandle",(function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]})),vv.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]})),vv.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]}));var qb=by({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Ub=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new sp({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return ue(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,o=r.height,a=e.node().getBBox(),s=a.width,c=a.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,o,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=ye(Jy(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,u=ye(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=ye(this.span,2);c=(t=ye([p[0]*d,p[1]*d],2))[0],l=t[1]}return{width:o+c+l+f+h,height:a,markerWidth:o,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=ye(Jy(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,o=t.height,a=ye(this.spacing,2),s=a[0];return{height:o,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(qb.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||a||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=ov(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(qb.markerGroup,"g").style("zIndex",0),Py(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(qb.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(!function(t,e){var n,r,i=e.attributes;try{for(var o=me(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=ye(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(i,o),Qy(i).styles(r)):(i.remove(),Qy(o).attr("className",qb.marker.name).styles(r),t.appendChild(o)):(Qy(o).attr("className",qb.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),Ky(e.markerGroup.node(),e.scaleSize,!0)}))},e.prototype.renderLabel=function(t){var e=ov(this.attributes,"label"),n=e.text,r=he(e,["text"]);this.labelGroup=t.maybeAppendByClassName(qb.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(qb.label,(function(){return _y(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=ov(this.attributes,"value"),r=n.text,i=he(n,["text"]);this.valueGroup=t.maybeAppendByClassName(qb.valueGroup,"g").style("zIndex",0),Py(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(qb.value,(function(){return _y(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=ov(this.attributes,"background");this.background=t.maybeAppendByClassName(qb.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(qb.background,"rect").styles(fe({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=ye(t.position,3),o=i[0],a=i[1],s=i[2],c=r/2;this.markerGroup.styles({x:o,y:c}),this.labelGroup.styles({x:a,y:c}),Ay(this.labelGroup.select(qb.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:s,y:c}),Ay(this.valueGroup.select(qb.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Qy(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(uv),Xb=by({page:"item-page",navigator:"navigator",item:"item"},"items"),Kb=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Zb=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:Q,mouseenter:Q,mouseleave:Q})||this;return n.navigatorShape=[0,0],n}return ue(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=ov(this.attributes,"item"),i=e.map((function(t,i){var o=t.id,a=void 0===o?i:o,s=t.label,c=t.value;return{id:"".concat(a),index:i,style:fe({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=ye(n,2);return[r[0],yy(r[1],[t,i,e])]}))))}}));return i},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=ye(this.navigatorShape,1)[0],s=ye(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map((function(e,s){var h,d,p=Math.floor(s/u),g=s%u,m=t.ifHorizontal(l,c),y=[Math.floor(g/m),g%m];"vertical"===n&&y.reverse();var v=ye(y,2),b=v[0],x=v[1],w=(r-a-(l-1)*o)/l,M=e.getBBox().height,E=ye([0,0],2),O=E[0],k=E[1];return"horizontal"===n?(O=(h=ye([f,b*(M+i)],2))[0],k=h[1],f=x===l-1?0:f+w+o):(O=(d=ye([x*(w+o),f],2))[0],k=d[1],f=b===c-1?0:f+M+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:M,x:O,y:k}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=ye(this.navigatorShape,1)[0],a=ye(this.grid,2),s=a[0],c=a[1],l=ye([e-o,n],2),u=l[0],f=l[1],h=ye([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],m=h[3],y=h[4],v=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,M=h.height,E=0===b?0:i,O=b+E+w;return O<=u&&Kb(y,(function(t){return t<c}))?(n=ye([b+E,x,O],3),d=n[0],p=n[1],b=n[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(o=ye([v+1,0,0,x+M+r],4),v=o[0],y=o[1],b=o[2],(x=o[3])+M<=f&&Kb(v,(function(t){return t<s}))?(a=ye([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(l=ye([0,0,w,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],m=l[5],v=l[6],y=l[7],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Yb(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Xb.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Xb.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);Qy(t).selectAll(Xb.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Ub({style:e})})).attr("className",Xb.item.name).on("click",(function(){null==n||n(this),o("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),o("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),o("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=ye(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=ye(t,2);return{page:e[0],layouts:e[1]}})),i=ve([],ye(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new up({className:Xb.page.name}));e.forEach((function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,c=i[o];r.appendChild(c),function(t,e,n){var r=t,i=A(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=_(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(c,"__layout__",t),c.update({x:e,y:n,width:a,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=ov(this.attributes,"nav"),r=wy({orientation:e},n),i=this;return t.selectAll(Xb.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Vb({style:r})})).attr("className",Xb.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(Qy(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Md(t,{detail:e});this.dispatchEvent(n)},e}(uv),Qb=by({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Jb={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},tx=function(t){function e(e){return t.call(this,e,Jb)||this}return ue(e,t),e.prototype.render=function(t,e){var n=Qy(e).maybeAppendByClassName(Qb.markerGroup,"g");this.renderMarker(n);var r=Qy(e).maybeAppendByClassName(Qb.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?Yb(r,"horizontalHandle","verticalHandle"):i;Py(!!o,t,(function(t){var n=ov(e.attributes,"marker"),r=fe({symbol:o},n);e.marker=t.maybeAppendByClassName(Qb.marker,(function(){return new vv({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;Py(r,t,(function(t){var n,r=ov(e.attributes,"label"),o=r.text,c=he(r,["text"]),l=(null===(n=t.select(Qb.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=ye(Yb(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],m=d[2],y=d[3];t.maybeAppendByClassName(Qb.label,"text").styles(fe(fe({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(uv),ex={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},nx=wy({},ex,{}),rx=wy({},ex,av(Jb,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),ix=by({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),ox=function(t){function e(e){return t.call(this,e,nx)||this}return ue(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=ye(sv(ov(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(ix.titleGroup,"g").styles(c);var l=fe(fe({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(ix.title,(function(){return new zb({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=ye(sv(ov(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=fe(fe({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(ix.itemsGroup,"g").styles(fe({x:n,y:r},c));var u=this;this.itemsGroup.selectAll(ix.items.class).data(["items"]).join((function(t){return t.append((function(){return new Zb({style:l})})).attr("className",ix.items.name).each((function(){u.items=Qy(this)}))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().setLocalPosition(e,n)}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new my(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),c=e.getBBox(),l=Db(r),u=ye(Jy(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye(Jy(o),4),m=g[0],y=g[1],v=g[2],b=g[3],x=ye([p+h,f+d],2),w=x[0],M=x[1],E=ye([b+y,m+v],2),O=E[0],k=E[1];if("l"===l[0])return new my(s.x,s.y,c.width+s.width+w+O,Math.max(c.height+k,s.height));if("t"===l[0])return new my(s.x,s.y,Math.max(c.width+O,s.width),c.height+s.height+M+k);var S=ye([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],T=S[1];return new my(c.x,c.y,A+s.width+w+O,T+s.height+M+k)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=t.width,r=t.height,i=Qy(e);this.renderTitle(i,n,r),this.renderItems(i,this.availableSpace),this.adjustLayout()},e}(uv),ax={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},sx=by({background:"background",labelGroup:"label-group",label:"label"},"indicator"),cx=function(t){function e(e){var n=t.call(this,e,ax)||this;return n.point=[0,0],n.group=n.appendChild(new up({})),n.isMutationObserved=!0,n}return ue(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=ye(Jy(t.padding),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new my(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=ov(this.attributes,"background");this.background=Qy(this.group).maybeAppendByClassName(sx.background,"path").styles(fe(fe({},h),{path:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=ye(sv(ov(this.attributes,"label")),2),i=r[0],o=r[1],a=he(i,["text"]);(this.label=Qy(this.group).maybeAppendByClassName(sx.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(sx.label,(function(){return _y(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=ye(this.point,2),e=t[0],n=t[1];this.group.attr("x",-e).attr("y",-n)},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,o=e.width,a=e.height,s=[["M",r+n,i],["L",r+o-n,i],["A",n,n,0,0,1,r+o,i+n],["L",r+o,i+a-n],["A",n,n,0,0,1,r+o-n,i+a],["L",r+n,i+a],["A",n,n,0,0,1,r,i+a-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,ve([c+1,1],ye(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=ev.apply(void 0,ve([],ye(t),!1)),r=ye(t,2),i=ye(r[0],2),o=i[0],a=i[1],s=ye(r[1],2),c=s[0],l=s[1],u=ye(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=ye(u[1],2),d=h[0],p=h[1],g=f/2,m=e*(f/Math.abs(f)),y=m/2,v=m*Math.sqrt(3)/2*.8,b=ye([d,d+g-y,d+g,d+g+y,p],5),x=b[0],w=b[1],M=b[2],E=b[3],O=b[4];return n?(this.point=[M,a-v],[["L",x,a],["L",w,a],["L",M,a-v],["L",E,a],["L",O,a]]):(this.point=[o+v,M],[["L",o,x],["L",o,w],["L",o+v,M],["L",o,E],["L",o,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?ly(this):cy(this)},e.prototype.bindEvents=function(){this.label.on(Ad.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(uv);function lx(t,e){var n=ye(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var ux=by({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function fx(t){var e=t.orientation,n=t.size,r=t.length;return Yb(e,[r,n],[n,r])}function hx(t){var e=t.type,n=ye(fx(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function dx(t){return hx(t)}function px(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(m(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var a=e.length,s=e.map((function(t){return uf(t).toString()}));return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)}),"l(".concat(Yb(n,"0","270"),")")):""}function gx(t){var e=t.orientation,n=t.range;if(!n)return[];var r=ye(fx(t),2),i=r[0],o=r[1],a=ye(n,2),s=a[0],c=a[1],l=Yb(e,s*i,0),u=Yb(e,0,s*o),f=Yb(e,c*i,i),h=Yb(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var mx=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return ue(e,t),e.prototype.render=function(t,e){!function(t,e){var n=ov(e,"track");t.maybeAppendByClassName(ux.track,"path").styles(fe({path:hx(e)},n))}(Qy(e).maybeAppendByClassName(ux.trackGroup,"g"),t),function(t,e){var n=ov(e,"selection"),r=px(e),i=t.maybeAppendByClassName(ux.selection,"path").styles(fe({path:dx(e),fill:r},n)),o=i.maybeAppendByClassName(ux.clipPath,"path").styles({path:gx(e)}).node();i.style("clip-path",o)}(Qy(e).maybeAppendByClassName(ux.selectionGroup,"g"),t)},e}(uv);var yx=function(t){function e(e){var n=t.call(this,e,rx)||this;return n.eventToOffsetScale=new Zo({}),n.innerRibbonScale=new Zo({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=lx(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=ye(n.selection,2),i=r[0],o=r[1],a=n.getTickValue(n.getValueByCanvasPoint(t)),s=a-n.prevValue;"start"===e?i!==a&&n.updateSelection(a,o):"end"===e?o!==a&&n.updateSelection(i,a):"ribbon"===e&&0!==s&&(n.prevValue=a,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="default",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return ue(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new my(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Qy(e));var i=this.availableSpace,o=i.x,a=i.y,s=Qy(e).maybeAppendByClassName(ix.contentGroup,"g").styles({x:o,y:a});Py(!!r,s.maybeAppendByClassName(ix.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(ix.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(ix.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,ve([],ye(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,ve([],ye(t.map((function(t){return t.value}))),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=ye(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=ye(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Yb(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=ov(this.attributes,"title"),s=fe(fe({},a),{width:i,height:o,text:r}),c=this;t.selectAll(ix.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new zb({style:s})})).attr("className",ix.title.name).each((function(){c.title=this}))}),(function(t){return t.update(s)}),(function(t){return t.each((function(){c.title=void 0})).remove()}))},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new my(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new my(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector($v.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new my(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=ye(this.ifHorizontal([o,i],[i,o]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,m=0,y=this.labelPosition;m=n||(["bottom","right"].includes(y)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var v=Math.max(p,c),b=f-v,x=ye(this.ifHorizontal([b,m],[m,b]),2),w=x[0],M=x[1],E=["top","left"].includes(y)?s:0,O=ye(this.ifHorizontal([v/2,E],[E,v/2]),2),k=O[0],S=O[1];return new my(k,S,w,M)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=ov(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,g=p.length,m=p.size,y=wy({x:h,y:d,length:g,size:m,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(ix.ribbon,(function(){return new mx({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(ix.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=ov(this.attributes,"handle"),i=ye(this.selection,2),o=i[0],a=i[1],s=fe(fe({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?tx:Fv,u=this;this.handlesGroup.selectAll(ix.handle.class).data(e?[{value:o,type:"start"},{value:a,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new l({style:s})})).attr("className",(function(t){var e=t.type;return"".concat(ix.handle," ").concat(u.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))}))}),(function(t){return t.update(s).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=ye(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},e.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,n=t.orientation,r=ye(this.getElementsByClassName(ix.title.name),1)[0],i=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(r&&i&&"top-left"===e&&"horizontal"===n){var o=ye(i.getLocalBounds().min,1)[0]-ye(r.getLocalBounds().min,1)[0];r.style.x=+(this.style.x||0)+o}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new my(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=ye([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new my(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=ye(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),c=ye(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({x:l,y:u,formatter:n})},e.prototype.renderIndicator=function(t){var e=ov(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(ix.indicator,(function(){return new cx({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,i){var o,a,s=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:r.toString();if(e.push(fe(fe({},n),{id:s,index:r,type:"value",label:null!==(a=null==n?void 0:n.label)&&void 0!==a?a:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var c=i[r+1],l=ye([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(fe(fe({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(h)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=ye(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,o=e.labelFormatter,a=ov(this.attributes,"tick"),s=ov(this.attributes,"label"),c=s.align,l=wy(fe({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),av(a,"tick"),av(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter((function(t){return"value"!==t.type}))))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===c&&(!i||i(t,t.index,n.filter((function(t){return t.type===c}))))},labelFormatter:o},f=fe(fe(fe({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(ix.label,(function(){return new $b({style:f})})).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,o=this.ribbonShape.size,a=this.labelPosition,s=this.labelFixedSpacing,c=ye([0,0,0],3),l=c[0],u=c[2],f=null!=i?i:o;return e?(u=f,"positive"===n?"right"===a?(l=f,u=f):"bottom"===a&&(l=u):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:u}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=ye(this.ifHorizontal([[e,n+a],[e+r,n+a]],[[e+a,n+i],[e+a,n]]),2),u=l[0],f=l[1];this.label.update({startPos:u,endPos:f,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,o=this.ribbonBBox,a=o.x,s=o.y,c=T(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+a,s],[a,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),cy(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){ly(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=ye(this.selection,2),o=i[0],a=i[1],s=ye([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=ye(function(t,e,n,r){var i,o=ye(t,2),a=o[0],s=o[1],c=ye(e,2),l=c[0],u=c[1],f=ye(n,2),h=f[0],d=f[1],p=ye([l,u],2),g=p[0],m=p[1],y=m-g;return g>m&&(g=(i=ye([m,g],2))[0],m=i[1]),y>s-a?[a,s]:g<a?h===a&&d===m?[a,m]:[a,y+a]:m>s?d===s&&h===g?[g,s]:[s-y,s]:[g,m]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return F(e)?Hy(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?lx(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,i=n.max,o=ye(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,ve([],ye(Ty(t)),!1))-c;return T(this.getOffset(l,!0),r,i)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.dispatchSelection=function(){var t=new Md("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new Md("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(uv);function vx(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var bx={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function xx(t){var e;void 0===t&&(t="");var n=vx(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=fe({flex:1},bx),e[".".concat(n.VALUE)]=fe({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},bx),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var wx=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=vx(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:xx(o)})||this).prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}var n,r;return ue(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"position",{set:function(t){var e=ye(t,2),n=e[0],r=e[1];this.attributes.x=n,this.attributes.y=r,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=he(t,["name","color","index"]),l=fe({name:i,color:a,index:null!=s?s:e},c);return nn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=this.element.style.transition;this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout((function(){n.element.style.transition=r}),10)}this.element.style.visibility="visible"},e.prototype.hide=function(){this.element.style.visibility="hidden"},e.prototype.initShape=function(){var t=this.attributes.template;this.element=nn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=vx(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,f.replaceChildren.apply(f,ve([],ye(u),!1));var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=ye(e,2),r=n[0],i=n[1];ve([t],ye(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,c=a.height,l=[-s/2,-c/2];return i.forEach((function(t){var e=ye(l,2),n=e[0],i=e[1],a=ye(o[t],2),u=a[0],f=a[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]})),l},e.prototype.setOffsetPosition=function(t){var e=ye(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+a+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},e.prototype.autoPosition=function(t){var e=ye(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,u=l.offsetWidth,f=l.offsetHeight,h=ye([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},m=s.x,y=s.y,v={left:d<m,right:d+u>m+s.width,top:p<y,bottom:p+f>y+s.height},b=[];c.split("-").forEach((function(t){v[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.tag="tooltip",de([(n=100,r=!0,void 0===n&&(n=0),void 0===r&&(r=!1),function(t,e,i){var o,a=i.value;"function"==typeof a&&(i.value=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!o){var i=this;r&&a.apply(i,t),o=window.setTimeout((function(){a.apply(i,t),o=null}),n)}})})],e.prototype,"updatePosition",null),e}(uv),Mx=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[Ad.BOUNDS_CHANGED,Ad.INSERTED,Ad.REMOVED],n.$margin=Jy(0),n.$padding=Jy(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return ue(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Jy(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Jy(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=ye(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new my(n-f,i-c,o+f+l,a+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=ye(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=ye(this.$margin,4),l=c[0],u=c[3];return new my(s+u,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=function(t,e,n){if(0===e.length)return[];var r={flex:Ry,grid:Iy},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(e,n){var r=t[n],i=r.x,o=r.y;e.attr({x:i,y:o})}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target.isMutationObserved=!0,t.layout()}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(up);function Ex(t,e,n,r){const[[i,o],[a,s]]=e,[c,l]=function(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}(t);if(i===a&&o===s)return tc()([[0,0],[c,l]]);const u=[[i-a,o-s]].concat(n.length?n:[[0,0]]),f=[r[0]-a,r[1]-s],[h,d]=u;if(((t,e,n)=>{const r=as(t,e),i=as(e,n),o=as(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(f,h,d)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=h[0]+(h[1]-f[1])*(h[1]-0)/(h[0]-f[0]);return n[0]<f[0]?Math.min(n[0],r):Math.max(e[0],r)})();u.splice(1,1,[e,0])}return tc()(u)}const Ox=nm((t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:o,labelTransform:a,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:h,background:d,connector:p,startMarker:g,endMarker:m,coordCenter:y,innerHTML:v}=e,b=he(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if([c,l,u,f].some((t=>!_(t))))return void t.children.forEach((t=>t.remove()));const x=ur(b,"background"),{padding:w}=x,M=he(x,["padding"]),E=ur(b,"connector"),{points:O=[]}=E,k=he(E,["points"]),S=[[+u,+f],[+c,+l]];let A;A=v?Dg(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(Gg,Object.assign({transform:a,transformOrigin:s},b)).node():Dg(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(Gg,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const T=Dg(t).maybeAppend("background","rect").style("zIndex",-1).call(Gg,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[h,d]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*h+o+r,height:2*d+n+i}}(A,w)).call(Gg,d?M:{}).node(),P=Ex(T,S,O,y),C=g&&new vv({id:"startMarker",style:Object.assign({x:0,y:0},ur(b,"startMarker"))}),N=m&&new vv({id:"endMarker",style:Object.assign({x:0,y:0},ur(b,"endMarker"))});Dg(t).maybeAppend("connector","path").style("zIndex",0).style("path",P).style("markerStart",C).style("markerEnd",N).call(Gg,p?k:{})})),kx=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s},[[f,h]]=e;return Dg(new Ox).style("x",f).style("y",h).call(Gg,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Gg,u).call(Gg,t).node()}};kx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sx=nm((t=>{const e=he(t.attributes,["class","x","y"]),n=ur(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),o=Dg(t).maybeAppend("marker",(()=>new vv({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[a,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(o);Dg(t).maybeAppend("text","text").style("x",a).style("y",s).call(Gg,e)})),Ax=(t,e)=>{const n=he(t,[]);return(t,e,r)=>{const{color:i}=r,o=he(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return Dg(new Sx).call(Gg,o).style("x",l).style("y",u).call(Gg,c).call(Gg,n).node()}};Ax.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Tx=nm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;Dg(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Gg,i),Dg(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Gg,r)})),_x=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=he(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,g=qg(s,e),m=r&&h?$g(h,d,p,r):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:m,fill:m}),g&&{transform:g}),a),[v,b]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),x=ur(y,"connect"),w=!!b.length,M=t=>Dg(c.createElement("path",{})).style("d",t||"").call(Gg,y).node();if(Mc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=ec().curve(nc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return oc(n())},delete t.lineX0,t.lineEndAngle=function(){return oc(r())},delete t.lineX1,t.lineInnerRadius=function(){return oc(i())},delete t.lineY0,t.lineOuterRadius=function(){return oc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(ic(t)):e()._curve},t}().angle(((t,n)=>cs(is(r[n],e)))).outerRadius(((t,n)=>as(r[n],e))).innerRadius(((t,n)=>as(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!w||o&&!Object.keys(x).length?M(e(v)):w&&!o?M(e(t)):Dg(new Tx).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},x),a)).style("areaPath",e(t)).style("connectPath",b.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return wc(s)?ec().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):ec().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!w||o&&!Object.keys(x).length?M(e(v)):w&&!o?M(e(t)):Dg(new Tx).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},x),a)).style("areaPath",e(t)).style("connectPath",b.map(e).join("")).node()}}};_x.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Px=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Mc(n)?mc:Zs;return _x(Object.assign({curve:i},t),e)(...r)}};Px.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"square"});const Cx=(t,e)=>{const{alpha:n=.5}=t,r=he(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=Mc(i)?pc:hc;return _x(Object.assign({curve:o.alpha(n)},r),e)(...t)}};Cx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"smooth"});const Nx=(t,e)=>(...n)=>_x(Object.assign({curve:vc},t),e)(...n);Nx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"hvh"});const Lx=(t,e)=>(...n)=>_x(Object.assign({curve:bc},t),e)(...n);Lx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"vh"});const jx=(t,e)=>(...n)=>_x(Object.assign({curve:xc},t),e)(...n);jx.props=Object.assign(Object.assign({},_x.props),{defaultMarker:"hv"});const Rx=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>ay(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Rx.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ix=(t,e)=>{const n=he(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=he(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=zs();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),Dg(r.createElement("path",{})).call(Gg,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Gg,n).node()}};function Bx(t,e,n,r){const i=zs();if(Mc(n)){const o=n.getCenter(),a=as(t,o),s=(as(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Wg(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return wc(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}Ix.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dx=(t,e)=>{const{cornerRatio:n=1/3}=t,r=he(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=he(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=Bx(f,h,i,n);return Dg(o.createElement("path",{})).call(Gg,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Gg,r).node()}};Dx.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fx=(t,e)=>{const n=he(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=zs();if(h.moveTo(u[0],u[1]),Mc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Wg(h,u,f,fs(u,f),as(u,f)/2)}return Dg(i.createElement("path",{})).call(Gg,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(Gg,n).node()}};function zx(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function Gx(t={}){return[...zx(t),{name:"title",scale:"identity"}]}function Wx(){return[{type:Lr,channel:"color"},{type:$r,channel:["x","y"]}]}function $x(){return[{type:Lr,channel:"x"},{type:$r,channel:["y"]}]}function Hx(t={}){return zx(t)}function Vx(){return[{type:Br}]}function Yx(t,e){return t.getBandWidth(t.invert(e))}function qx(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,h=!!(null==a?void 0:a.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?Yx(a,r[e]):0,l=d?Yx(s,i[e]):0,g=p&&o?(Yx(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function Ux(t){return parseFloat(t)/100}function Xx(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?Ux(e)*a:+e,"string"==typeof n?Ux(n)*s:+n]]}))]}Fx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Kx=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,g]]=e,[m,y]=n.getSize();h="string"==typeof h?Ux(h)*m:h,d="string"==typeof d?Ux(d)*y:d;const v=p-Number(h)/2,b=g-Number(d)/2;return Dg(r.createElement("image",{})).call(Gg,s).style("x",v).style("y",b).style("img",l).style("stroke",c).style("transform",f).call(Gg,t).style("width",h).style("height",d).node()}};function Zx(t,e){const n=zs();if(Mc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>as(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?Wg(n,s,e,r,a):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}Kx.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Qx=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=i,u=Zx(e,n);return Dg(r.createElement("path",{})).call(Gg,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Gg,t).node()}};function Jx(t,e){const[n,r,i,o]=t,a=zs();if(Mc(e)){const t=e.getCenter(),s=as(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Wg(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Wg(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}Qx.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tw=(t,e)=>{const n=he(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=e,u=Jx(t,r);return Dg(i.createElement("path",{})).call(Gg,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Gg,n).node()}};function ew(t,e){const n=zs();if(Mc(e)){const r=e.getCenter(),[i,o]=r,a=ss(is(t[0],r)),s=ss(is(t[1],r)),c=as(r,t[2]),l=as(r,t[3]),u=as(r,t[8]),f=as(r,t[10]),h=as(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,h,a,s),n.arc(i,o,h,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}tw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=he(o,["color","fill","stroke"]),h=ew(e,n);return Dg(r.createElement("path",{})).call(Gg,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Gg,t).node()}};function rw(t,e,n=4){const r=zs();if(!Mc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=as(i,t[3]),c=as(i,t[8]),l=as(i,t[10]),u=ss(is(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.arc(o,a,s,h,d),r.lineTo(Math.cos(d)*l+o,Math.sin(d)*l+a),r.arc(o,a,l,d,h,!0),r.lineTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/2;return r.moveTo(Math.cos(p)*(c+n/2)+o,Math.sin(p)*(c+n/2)+a),r.arc(Math.cos(p)*c+o,Math.sin(p)*c+a,n/2,p,2*Math.PI+p),r.closePath(),r}nw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=he(o,["color","fill","stroke"]),h=rw(e,n,4);return Dg(r.createElement("path",{})).call(Gg,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Gg,t).node()}};iw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ow=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=he(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=he(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({path:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},n)})}(a,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},ur(i,"arrow"))):null,p=function(t,e){if(!Mc(e))return tc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return Us()({startAngle:0,endAngle:2*Math.PI,outerRadius:as(t[0],n),innerRadius:as(t[1],n)})}(t,o),g=function(t,e){if(!Mc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return Dg(a.createElement("path",{})).call(Gg,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(Gg,i).node()}};function aw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}ow.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sw=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=he(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=he(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(wc(t)){const t=o+n,e=t+i;return[[t,a],[e,a],[e,c],[s+r,c]]}const l=a-n,u=l-i;return[[o,l],[o,u],[s,u],[s,c-r]]}(c,t,r,i,null!=o?o:u),g=ur(Object.assign(Object.assign({},s),n),"endMarker");return Dg(new pp).call(Gg,f).style("path",function(t){return tc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new vv({className:"marker",style:Object.assign(Object.assign({},g),{symbol:aw})}):null).call(Gg,s).node()}};function cw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function lw(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=dr(n.x,l),s=dr(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function uw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Vg(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=hw(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?fw(c,p,i):fs(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function fw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function hw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function dw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Vg(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:hw(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=fw(d,p,v);return Object.assign({x:b,y:x},g)}function pw(t){return void 0===t?null:t}function gw(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:pw(o[0]),y:pw(o[1])}}function mw(t,e,n,r){const{bounds:i}=n;if(1===i.length)return gw(0,0,n);return(Ec(r)?uw:Ac(r)?dw:lw)(t,e,n,r)}function yw(t,e,n){const r=Vg(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function vw(t,e,n){const r=Vg(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function bw(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:c=a,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),h=vw(e,n,r),d=Math.sin(h)>0?1:-1,p=hw(h,i,o),g={textAlign:d>0||Ec(r)?"start":"end",textBaseline:"middle",rotate:p},m=yw(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,E]]=function(t,e,n,r,i){const[o,a]=fw(t,e,n),[s,c]=fw(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,m,y,s?l:0),O=s?+u*d:0,k=M+O,S={connector:s,connectorPoints:[[x-k,w-E],[M-k,E-E]]};return Object.assign(Object.assign({x0:v,y0:b,x:M+O,y:E},g),S)}sw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var xw=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=Un(o,((t,e)=>Math.abs(t[1]-a[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=ss(is(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:mw,bottomLeft:mw,bottomRight:mw,inside:mw,left:mw,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?gw(0,0,n):(Ec(r)?uw:Ac(r)?bw:lw)(t,e,n,r)},right:mw,spider:function(t,e,n,r){if(!Ac(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(bw(0,e,n,r),[]),c=r.getCenter(),l=yw(e,n,r),u=vw(e,n,r),f=l+i+o,h=Math.sin(u)>0?1:-1,d=c[0]+(f+ +a)*h,{x:p}=s,g=d-p;return s.x+=g,s.connectorPoints[0][0]-=g,s},surround:function(t,e,n,r){if(!Ac(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(bw(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(Ac(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=cs([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,m]=fw(u,d,h);return s.x=g+(o+a)*p,s.y=m,s},top:mw,topLeft:mw,topRight:mw});function ww(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:Ac(e)?"inside":wc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=xw[cw(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const Mw=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o)=>{const{text:a,x:s,y:c,transform:l="",transformOrigin:u,className:f=""}=o,h=he(o,["text","x","y","transform","transformOrigin","className"]),d=ww(e,o,n,r,t),{rotate:p=0,transform:g=""}=d,m=he(d,["rotate","transform"]);return Dg(new Ox).call(Gg,m).style("text",`${a}`).style("className",`${f} g2-label`).style("innerHTML",i?i(a,o.datum,o.index):void 0).style("labelTransform",`${g} rotate(${+p}) ${l}`.trim()).style("labelTransformOrigin",u).style("coordCenter",n.getCenter()).call(Gg,h).node()}};Mw.props={defaultMarker:"point"};const Ew=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=he(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=he(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return Dg(a.createElement("path",{})).call(Gg,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(Gg,i).node()}};Ew.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ow=(t,e)=>Ew(Object.assign({colorAttribute:"fill"},t),e);Ow.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kw=(t,e)=>Ew(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);kw.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sw=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=he(i,["color"]),{color:c=a}=r,[l,...u]=e,f=zs();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),Dg(n.createElement("path",{})).call(Gg,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Gg,t).node()}};function Aw(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}Sw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$(3);const Tw=function(t,e=((...t)=>`${t[0]}`),n=16){const r=$(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=Aw(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function _w(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=Aw(a,t,e).getContext("2d"),l=function(t,e){const n=Aw(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);c.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),h=i-u,d=c-u,p=Tw(u,1-a,o),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,h,d)}}(c,n,r,i,s,a);const u=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),h=f.data,d=h.length;for(let t=3;t<d;t+=4){const e=h[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));h[t-3]=r[n],h[t-2]=r[n+1],h[t-1]=r[n+2],h[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=Aw(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const Pw=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=he(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,g]=l.getSize(),m=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),y=Xn(t,(t=>t[2])),v=qn(t,(t=>t[2])),b=p&&g?_w(p,g,y,v,m,(x={gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},w=t=>void 0===t,Object.keys(x).reduce(((t,e)=>{const n=x[e];return w(n,e)||(t[e]=n),t}),{})),u):{canvas:null};var x,w;return Dg(f.createElement("image",{})).call(Gg,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(Gg,c).node()}};Pw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Cw=(t,e)=>{const{render:n}=t,r=he(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};function Nw(t,e){return t.getBandWidth(t.invert(e))}Cw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Lw={rect:Kg,hollow:Zg,funnel:Jg,pyramid:em},jw=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),h=c?c.map((t=>+t/f)):null,d=c?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=Nw(l,i[t]),n=e*(u?Nw(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),g=+o[t],m=+a[t];return[[h,g],[p,g],[p,m],[h,m]].map((t=>r.map(t)))}));return[t,p]};jw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Lw,channels:[...Gx({shapes:Object.keys(Lw)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Vx(),{type:hn},{type:jr}],postInference:[...$x()],interaction:{shareTooltip:!0}};const Rw={rect:Kg,hollow:Zg},Iw=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};Iw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Rw,channels:[...Gx({shapes:Object.keys(Rw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx(),{type:hn}],postInference:[...$x()],interaction:{shareTooltip:!0}};const Bw={line:om,smooth:am,hv:sm,vh:cm,hvh:lm,trail:fm},Dw=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=a?Array.from(Pn(t,(t=>a[t])).values()):[t],h=f.map((t=>t[0])).filter((t=>void 0!==t)),d=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(o=null==u?void 0:u.getBandWidth)||void 0===o?void 0:o.call(u))||0)/2,g=Array.from(f,(t=>t.map((t=>r.map([+s[t]+d,+c[t]+p])))));return[h,g,f]},Fw=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o}))]},zw=()=>(t,e,n,r)=>(kc(r)?Fw:Dw)(t,e,n,r);zw.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:Bw,channels:[...Gx({shapes:Object.keys(Bw)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Vx(),{type:Ur},{type:Dr}],postInference:[...$x(),{type:Lr,channel:"color"},{type:$r,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Gw={hollow:Hm,hollowDiamond:Wm,hollowHexagon:$m,hollowSquare:Vm,hollowTriangleDown:qm,hollowTriangle:Ym,hollowBowtie:Gm,point:ey,plus:ty,diamond:Km,square:ny,triangle:iy,hexagon:Zm,cross:Xm,bowtie:Um,hyphen:Qm,line:Jm,tick:ry,triangleDown:oy},Ww=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=qx(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]};return[e,l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],o=r/h,a=r/d,s=[e-o,n-a],c=[e+o,n+a];return[i.map(p(s,t)),i.map(p(c,t))]})):Array.from(e,(t=>[i.map(p(g(t),t))]))]};Ww.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:Gw,channels:[...Gx({shapes:Object.keys(Gw)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Vx(),{type:jr},{type:Rr}],postInference:[{type:Ir},...Wx()]};const $w={text:kx,badge:Ax},Hw=t=>{const{cartesian:e=!1}=t;return e?Xx:(e,n,r,i)=>{const{x:o,y:a}=r,s=qx(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};Hw.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:$w,channels:[...Gx({shapes:Object.keys($w)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Vx(),{type:qr},{type:Vr}],postInference:[...Wx()]};const Vw={cell:Kg,hollow:Zg},Yw=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,(t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};Yw.props={defaultShape:"cell",defaultLabelShape:"label",shape:Vw,composite:!1,channels:[...Gx({shapes:Object.keys(Vw)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Vx(),{type:jr},{type:Rr},{type:Hr}],postInference:[...Wx()]};const qw={area:Px,smooth:Cx,hvh:Nx,vh:Lx,hv:jx},Uw=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(Pn(t,(t=>l[t])).values()):[t],d=h.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2;return[d,Array.from(h,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n})),h]};Uw.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:qw,channels:[...Gx({shapes:Object.keys(qw)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Vx(),{type:Dr},{type:hn},{type:Hr}],postInference:[...$x()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Xw={link:Rx,arc:Fx,smooth:Ix,vhv:Dx},Kw=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=qx(n,r,t),u=e.map((t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+c[t]],t))]));return[e,u]};Kw.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:Xw,channels:[...Gx({shapes:Object.keys(Xw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx(),{type:Gr},{type:Wr}],postInference:[...Wx()]};const Zw={image:Kx},Qw=t=>{const{cartesian:e}=t;return e?Xx:(e,n,r,i)=>{const{x:o,y:a}=r,s=qx(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};Qw.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:Zw,channels:[...Gx({shapes:Object.keys(Zw)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Vx(),{type:qr},{type:Vr}],postInference:[...Wx()]};const Jw={polygon:Qx,ribbon:tw},tM=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),a=t.map((t=>{const e=[];for(let n=0;n<i.length;n++){const a=i[n][t];if(void 0===a)break;const s=o[n][t];e.push(r.map([+a,+s]))}return e}));return[t,a]};tM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:Jw,channels:[...Gx({shapes:Object.keys(Jw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx()],postInference:[...Wx()]};const eM={box:nw,violin:iw},nM=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[g,m,y,v,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,v],[p-n/2,v],[p+n/2,v],[p+n/2,m],[p-n/2,m],[p-n/2,y],[p+n/2,y],[p,m],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};nM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:eM,channels:[...Gx({shapes:Object.keys(eM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Vx(),{type:jr}],postInference:[...$x()],interaction:{shareTooltip:!0}};const rM={vector:ay},iM=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[c,l]=r.getSize(),u=t.map((t=>{const e=+s[t]/180*Math.PI,n=+a[t],u=n/l,f=n/c*Math.cos(e),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-h/2]),r.map([+i[t]+f/2,+o[t]+h/2])]}));return[t,u]};iM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:rM,channels:[...Gx({shapes:Object.keys(rM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Vx()],postInference:[...Wx()]};const oM={line:ow},aM=t=>(e,n,r,i)=>{const{y:o}=r,a=qx(n,r,Y({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[0,o[t]],[1,o[t]]].map((e=>i.map(a(e,t))))));return[e,s]};aM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:oM,channels:[...Hx({shapes:Object.keys(oM)}),{name:"y",required:!0}],preInference:[...Vx(),{type:Fr}],postInference:[]};const sM={line:ow},cM=t=>(e,n,r,i)=>{const{x:o}=r,a=qx(n,r,Y({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[o[t],1],[o[t],0]].map((e=>i.map(a(e,t))))));return[e,s]};cM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:sM,channels:[...Hx({shapes:Object.keys(sM)}),{name:"x",required:!0}],preInference:[...Vx(),{type:zr}],postInference:[]};const lM={connector:sw},uM=(...t)=>Kw(...t);function fM(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function hM(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=fM("x",e,i,r.x),s=fM("y",n,i,r.y),c=Array.from(t,(t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>o.map(t)))}));return[t,c]}}uM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:lM,channels:[...Hx({shapes:Object.keys(lM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx()],postInference:[]};const dM={range:Kg},pM=()=>hM();pM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:dM,channels:[...Hx({shapes:Object.keys(dM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx()],postInference:[]};const gM={range:Kg},mM=()=>hM({extendY:!0});mM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:gM,channels:[...Hx({shapes:Object.keys(gM)}),{name:"x",required:!0}],preInference:[...Vx()],postInference:[]};const yM={range:Kg},vM=()=>hM({extendX:!0});vM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:yM,channels:[...Hx({shapes:Object.keys(yM)}),{name:"y",required:!0}],preInference:[...Vx()],postInference:[]};const bM={path:Ow,hollow:kw},xM=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];xM.props={defaultShape:"path",defaultLabelShape:"label",shape:bM,composite:!1,channels:[...Gx({shapes:Object.keys(bM)}),{name:"d",scale:"identity"}],preInference:[...Vx()],postInference:[]};const wM=t=>{const{cartesian:e}=t;return e?Xx:(e,n,r,i)=>{const{x:o,y:a}=r,s=qx(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};wM.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:Cw},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Vx(),{type:qr},{type:Vr},{type:Yr}]};var MM={},EM={};function OM(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function kM(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function SM(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function AM(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+SM(-t,6):t>9999?"+"+SM(t,6):SM(t,4)}(t.getUTCFullYear())+"-"+SM(t.getUTCMonth()+1,2)+"-"+SM(t.getUTCDate(),2)+(i?"T"+SM(e,2)+":"+SM(n,2)+":"+SM(r,2)+"."+SM(i,3)+"Z":r?"T"+SM(e,2)+":"+SM(n,2)+":"+SM(r,2)+"Z":n||e?"T"+SM(e,2)+":"+SM(n,2)+"Z":"")}function TM(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return EM;if(l)return l=!1,MM;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=u())!==EM;){for(var f=[];r!==MM&&r!==EM;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?AM(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=OM(t);return function(r,i){return e(n(r),i,t)}}(t,e):OM(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=kM(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=kM(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function _M(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;PM&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const PM=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),CM=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>pe(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return TM(r).parse(e,i?_M:rr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};CM.props={};const NM=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function LM(t){return null!=t&&!Number.isNaN(t)}NM.props={};const jM=t=>{const{callback:e=LM}=t;return t=>t.filter(e)};jM.props={};const RM=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};RM.props={};const IM=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};IM.props={};const BM=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};BM.props={};const DM=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};DM.props={};const FM=t=>{const{value:e}=t;return()=>e};FM.props={};const zM=t=>{const{callback:e=rr}=t;return t=>e(t)};zM.props={};const GM=t=>{const{callback:e=rr}=t;return t=>Array.isArray(t)?t.map(e):t};function WM(t){return"string"==typeof t?e=>e[t]:t}GM.props={};const $M=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=WM(s),l=WM(a),u=Nn(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:o,t)),{}))}))};$M.props={};const HM=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};HM.props={};var VM={exports:{}},YM={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(YM),function(t){var e=Math.log(2),n=t.exports,r=YM.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<o;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,a),p=d[a],g=d[a-1]-d[a-2],m=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,y=d[-a-1+l]||0,v=p/(p-h-y);s>0&&(m+=v*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*v*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*v*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*v*g)}}));var y=m,v=0,b=0;return f.forEach((function(t){v+=t.y,y+=v,t.y=y,b+=y})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(VM);var qM=VM.exports;const UM=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Pn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=qM.create(t.map((t=>t[e])),{min:i,max:o,size:a,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};UM.props={};const XM=()=>t=>(console.log("G2 data section:",t),t);XM.props={};const KM={density:Sw},ZM=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,(e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),f=(+(null==o?void 0:o[e])||0)*n,h=+i[e]+f+u/2;return[...a.map(((n,r)=>[h+ +s[r][e]/t.length,+a[r][e]])),...a.map(((n,r)=>[h-+s[r][e]/t.length,+a[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};ZM.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:KM,channels:[...Gx({shapes:Object.keys(KM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...Vx(),{type:hn},{type:jr}],postInference:[...$x()],interaction:{shareTooltip:!0}};const QM={heatmap:Pw},JM=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};JM.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:QM,channels:[...Gx({shapes:Object.keys(QM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Vx(),{type:jr},{type:Rr}],postInference:[...Wx()]};const tE=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];tE.props={};const eE=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];eE.props={};const nE=t=>new Lo(t);nE.props={};const rE=t=>new Zo(t);rE.props={};const iE=t=>new Po(t);iE.props={};const oE=t=>new Yo(t);oE.props={};const aE=t=>new Qo(t);aE.props={};const sE=t=>new wa(t);sE.props={};const cE=t=>new ia(t);cE.props={};const lE=t=>new ta(t);lE.props={};const uE=t=>new na(t);uE.props={};const fE=t=>new sa(t);fE.props={};const hE=t=>new oa(t);hE.props={};const dE=t=>new ea(t);dE.props={};const pE=t=>new Oa(t);pE.props={};const gE=t=>new Ro(t);function mE({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:o,padding2:a,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:h,category10:d,category20:p,sizeDefault:g=1,padding:m="auto",margin:y=16}){return{padding:m,margin:y,size:g,color:t,category10:d,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:h,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:o,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",labelAutoRotate:!1,titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelAutoRotate:!1,tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelAutoRotate:!1,labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",labelAutoRotate:!1,titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}}}gE.props={};const yE=mE({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),vE=t=>Y({},yE,t);vE.props={};const bE=t=>Y({},vE(),{category10:"category10",category20:"category20"},t);bE.props={};const xE=mE({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"#141414",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),wE=t=>Y({},xE,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),ME=t=>Object.assign({},wE(),{category10:"category10",category20:"category20"},t);ME.props={};const EE=mE({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),OE=t=>Y({},EE,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function kE(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}OE.props={};var SE,AE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function TE(t){if(!(e=AE.exec(t)))throw new Error("invalid format: "+t);var e;return new _E({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function _E(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function PE(t,e){var n=kE(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}TE.prototype=_E.prototype,_E.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var CE={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>PE(100*t,e),r:PE,s:function(t,e){var n=kE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(SE=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+kE(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function NE(t){return t}var LE,jE,RE=Array.prototype.map,IE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function BE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?NE:(e=RE.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?NE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(RE.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=TE(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):CE[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?c:"",w=CE[v],M=/[defgprs%]/.test(v);function E(t){var i,o,c,h=b,E=x;if("c"===v)E=w(t)+E,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:l:"-"===f||"("===f?"":f)+h,E=("s"===v?IE[8+SE/3]:"")+E+(O&&"("===f?")":""),M)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){E=(46===c?a+t.slice(i+1):t.slice(i))+E,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var k=h.length+t.length+E.length,S=k<p?new Array(p-k+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-E.length:1/0),S=""),n){case"<":t=h+t+E+S;break;case"=":t=h+S+t+E;break;case"^":t=S.slice(0,k=S.length>>1)+h+t+E+S.slice(k);break;default:t=S+h+t+E}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),E.toString=function(){return t+""},E}return{format:f,formatPrefix:function(t,e){var n=f(((t=TE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=kE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=IE[8+r/3];return function(t){return n(i*t)+o}}}}function DE(t,e,n){return t.querySelector(e)?Dg(t).select(e):Dg(t).append(n)}function FE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function zE(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const o={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","center"],center:["column","center","center"]};return t in o&&([n,r,i]=o[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}LE=BE({thousands:",",grouping:[3],currency:["$",""]}),jE=LE.format;class GE extends Mx{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class WE extends GE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function $E(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function HE(t){return"vertical"===t||t===-Math.PI/2}function VE(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,h=o||u||c,d=a||f||l,p=s?"horizontal":"vertical",[g,m]=s?[d,h]:[h,d];return{orientation:p,width:g,height:m,size:h,length:d}}function YE(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=he(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${B(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function qE(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function UE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function XE(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function KE(t,e,n,r,i,o,a,s){var c;void 0===n&&void 0===o||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),o&&{tickMethod:o}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=kn(e,(t=>+t)),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(Mc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],h=new Zo({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!Sc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new Zo({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new Zo({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Mc(s)||wc(s)?u.map(((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:Ec(s)&&"center"===a||wc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||wc(s)&&g(a)?1-l:l,label:f(h(XE(e),n,r)),id:String(n)}})):u.map(((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(d(t.map(e)+o));return{value:g(a)?1-s:s,label:f(h(XE(e),n,r)),id:String(n)}}))}function ZE(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function QE(t,e,n){return!function(t){return Mc(t)&&wc(t)}(e)&&!kc(e)&&(void 0===t?!!n.getTicks:t)}function JE(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${or(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${B(c)}`]||{};return Object.assign({},a,s,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:HE(o)?10:0,tick:"center"!==r&&void 0}):a}const tO=t=>e=>{const{labelFormatter:n,labelFilter:r=(()=>!0)}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,c="string"==typeof n?jE(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:a});return t(l)(i)}},eO=tO((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:o,actualPosition:a,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:h,tickMethod:d,transform:p,indexBBox:g}=t,m=he(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[i],value:y,coordinate:v,theme:b})=>{const{bbox:x}=y,{domain:w}=i.getOptions(),M=JE(i,0,b,e,s,o),E=Object.assign(Object.assign(Object.assign({},M),l),m),O=function(t,e,n="xy"){const[r,i,o]=UE(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,v,t.plane),k=function(t,e,n,r){const{x:i,y:o,width:a,height:s}=n;if("bottom"===t)return{startPos:[i,o],endPos:[i+a,o]};if("left"===t)return{startPos:[i+a,o+s],endPos:[i+a,o]};if("right"===t)return{startPos:[i,o+s],endPos:[i,o]};if("top"===t)return{startPos:[i,o+s],endPos:[i+a,o+s]};if("center"===t){if("vertical"===e)return{startPos:[i,o],endPos:[i,o+s]};if("horizontal"===e)return{startPos:[i,o],endPos:[i+a,o]};if("number"==typeof e){const[t,n]=r.getCenter(),[c,l]=Tc(r),[u,f]=_c(r),h=Math.min(a,s)/2,{insetLeft:d,insetTop:p}=r.getOptions(),g=c*h,m=l*h,[y,v]=[t+i-d,n+o-p],[b,x]=[Math.cos(e),Math.sin(e)];return{startPos:[y+m*b,v+m*x],endPos:[y+g*b,v+g*x],gridClosed:f-u==360,gridCenter:[y,v],gridControlAngles:new Array(3).fill(0).map(((t,e,n)=>(f-u)/(n.length-1)*e))}}}return{}}(s,o,x,v),S=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(v),A=KE(i,w,f,r,h,d,s,v),T=g?A.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):A,_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},E),{type:"linear",data:T,crossSize:c,titleText:FE(u),labelOverlap:ZE(p,E),grid:QE(E.grid,v,i),gridLength:O,line:!0,indexBBox:g}),E.line?null:{lineOpacity:0}),k),S),n),P=_.labelOverlap.find((t=>"hide"===t.type));return P&&(_.crossSize=!1),new $b({className:"axis",style:YE(_)})}})),nO=tO((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:o,tickFilter:a,tickCount:s,tickMethod:c,important:l={},style:u={},indexBBox:f,title:h,grid:d=!1}=t,p=he(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:g}=t.getOptions(),m=KE(t,g,s,o,a,c,r,n),y=f?m.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):m,[v,b]=Tc(n),x=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,h]=_c(i),[d,p]=UE(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,v,b,n),{axis:w,axisArc:M={}}=i,E=YE(Y({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:FE(h),grid:d},p),l)));return new $b({style:K(E,["transform"])})}}));eO.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},nO.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const rO=t=>(...e)=>{const n=eO(Object.assign({},{crossPadding:50},t))(...e);return qE(n,t),n};rO.props=Object.assign(Object.assign({},eO.props),{defaultPosition:"bottom"});const iO=t=>(...e)=>{const n=eO(Object.assign({},{crossPadding:10},t))(...e);return qE(n,t),n};function oO(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=_c(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===a,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map(((t,e)=>(c-s)/i.count*e))})}iO.props=Object.assign(Object.assign({},eO.props),{defaultPosition:"left"});const aO=t=>{const{important:e={}}=t,n=he(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return eO(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},oO(t,i,o,a)),e)}))(r)}};function sO(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=$E(t,"shape"),r=$E(t,"color"),i=n?n.clone():null,o=[];for(const[t,n]of e){const e=t.type,a=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map(((e,r)=>{var o;return i?i.map(e||"point"):(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.shape)||n.defaultShape||"point"}));"string"==typeof e&&o.push([e,a])}if(0===o.length)return["point",["point"]];if(1===o.length)return o[0];if(!n)return o[0];const{range:a}=n.getOptions();return o.map((([t,e])=>{let n=0;for(let t=0;t<o.length;t++){const r=a[t%a.length];e[t]===r&&n++}return[n/e.length,[t,e]]})).sort(((t,e)=>e[0]-t[0]))[0][1]}(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,a;const s=(null===(a=null===(i=null===(n=r[`mark.${o}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===a?void 0:a.props.defaultMarker)||function(t){if(g(t))return t[t.length-1]}(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,strokeWidth:i,path:o,stroke:a,lineWidth:s,color:c}=e,l=he(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const u=Fm.get(t)||Fm.get("point");return(...t)=>new pp({style:Object.assign(Object.assign({},l),{path:u(...t),stroke:u.style.includes("stroke")?c||a:"",fill:u.style.includes("fill")?c||r:"",lineWidth:u.style.includes("lineWidth")?s||s||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${a[t]}`;return $E(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function cO(t){const e=$E(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function lO(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=$E(t,"size");return n instanceof Yo?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:sO(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:cO(r)},s="string"==typeof n?jE(n):n,c=$E(r,"color"),l=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},a),{data:l.map((t=>({id:t,label:s(t),color:u(t)})))})}aO.props=Object.assign(Object.assign({},eO.props),{defaultPosition:"center"});const uO=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=he(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:a}=r,{width:l,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=VE(t,e,n);return{width:i,height:o}}(r,t,uO),d=zE(o,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:FE(s)}),lO(t,e)),{legendCategory:g={}}=i,m=YE(Object.assign({},g,p,u)),y=new WE({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:m})});return y.appendChild(new ox({className:"legend-category",style:m})),y}};function fO(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function hO(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],xr(e)];return[n,r]}function dO(t,e,n,r,i,o){const{length:a}=t,s=n||r,c=i.color?o.legendContinuous.ribbonFill||"black":o.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[uf(e).toString()]})),r}(s,c),[u,f]=hO(l),[h,d]=hO([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Ro))));return Object.assign(Object.assign({},t),{domain:[h,d],data:l.getTicks().map((t=>({value:t}))),color:new Array(Math.floor(a)).fill(0).map(((t,e)=>{const n=(f-u)/(a-1)*e+u,i=l.map(n),o=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${o})`))}))})}function pO(t,e,n,r,i,o){const a=$E(t,"color"),s=function(t,e,n){const{size:r}=e,i=VE(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof na){const{range:t}=a.getOptions(),[e,n]=hO(a);return a instanceof oa||a instanceof sa?fO(s,a,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,a,t)}return dO(s,a,$E(t,"size"),$E(t,"opacity"),e,o)}uO.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const gO=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=he(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:a,scale:l})=>{const{bbox:u}=i,{x:h,y:d,width:p,height:g}=u,m=zE(o,n),{legendContinuous:y={}}=a,v=YE(Object.assign({},y,Object.assign(Object.assign({titleText:FE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>jE(e)(t.label):e},pO(r,l,i,t,gO,a)),c),f)),b=new GE({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},m),{subOptions:v})});return b.appendChild(new yx({className:"legend-continuous",style:v})),b}};gO.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const mO=t=>(...e)=>gO(Object.assign({},{block:!0},t))(...e);mO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const yO=t=>e=>{const{scales:n}=e,r=$E(n,"size");return gO(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};yO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const vO=t=>yO(Object.assign({},{block:!0},t));function bO(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}vO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const xO=(wO={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left"}=t,s=he(t,["width","title","subtitle","spacing","align"]),c=ur(s,"title"),l=ur(s,"subtitle"),u=DE(e,".title","text").attr("className","title").call(Gg,Object.assign(Object.assign(Object.assign({},bO(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),c)).node().getLocalBounds();DE(e,".sub-title","text").attr("className","sub-title").call((t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},bO(0,u.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),l))}))}},class extends cp{constructor(t){super(t),this.descriptor=wO}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(Y({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var wO;const MO=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new xO({style:Y({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function EO(t){return!!t.getBandWidth}function OO(t,e,n){if(!EO(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map((t=>t+a)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(xn(s,e)+o,0,i.length-1);return i[c]}function kO(t,e,n){if(!e)return t.getOptions().domain;if(!EO(t)){const r=Rn(e);if(!n)return r;const[i]=r,{range:o}=t.getOptions(),[a,s]=o,c=a>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],o=r.indexOf(i);if(n){const t=o+Math.round(r.length*n);return r.slice(o,t)}const a=e[e.length-1],s=r.indexOf(a);return r.slice(o,s+1)}function SO(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[OO(a,n,e),OO(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[kO(a,[l[0],u[0]]),kO(s,[l[1],u[1]])]}function AO(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}MO.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const TO=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=he(t,["orientation","labelFormatter","size","style","position"]);return({scales:[t],value:r,theme:s,coordinate:c})=>{var l;const{bbox:u}=r,{width:f,height:h}=u,{slider:d={}}=s,p=(null===(l=t.getFormatter)||void 0===l?void 0:l.call(t))||(t=>t.toString()),g="string"==typeof n?jE(n):n,m="horizontal"===e,y=wc(c)&&m,{trackSize:v=d.trackSize}=i,[b,x]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(u,o,v);return new zv({className:"slider",style:Object.assign({},d,Object.assign(Object.assign({x:b,y:x,trackLength:m?f:h,orientation:e,formatter:e=>(g||p)(OO(t,y?1-e:e,!0))},i),a))})}};TO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const _O=t=>TO(Object.assign(Object.assign({},t),{orientation:"horizontal"}));_O.props=Object.assign(Object.assign({},TO.props),{defaultPosition:"bottom"});const PO=t=>TO(Object.assign(Object.assign({},t),{orientation:"vertical"}));PO.props=Object.assign(Object.assign({},TO.props),{defaultPosition:"left"});const CO=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=he(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:o})=>{const{bbox:a}=n,{x:s,y:c,width:l,height:u}=a,{scrollbar:f={}}=o,{ratio:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,g=p/h,[m,y]=d,v=y>m?0:1;return new Gv({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:v}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};CO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const NO=t=>CO(Object.assign(Object.assign({},t),{orientation:"horizontal"}));NO.props=Object.assign(Object.assign({},CO.props),{defaultPosition:"bottom"});const LO=t=>CO(Object.assign(Object.assign({},t),{orientation:"vertical"}));LO.props=Object.assign(Object.assign({},CO.props),{defaultPosition:"left"});const jO=t=>()=>new up;jO.props={};const RO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,a],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],d=[{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.01},{transform:`${s} scale(1, 1)`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},IO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,a],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],d=[{transform:`${s} scale(1, 1)`.trimStart()},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.99},{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},BO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,0],"scale(0.0001, 1)"]:[[0,a],"scale(1, 0.0001)"],d=[{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.01},{transform:`${s} scale(1, 1)`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},DO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,h]=wc(n)?[[0,0],"scale(0.0001, 1)"]:[[0,a],"scale(1, 0.0001)"],d=[{transform:`${s} scale(1, 1)`.trimStart()},{transform:`${s} ${h}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.99},{transform:`${s} ${h}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];o.setOrigin(f);const p=o.animate(d,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},FO=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};FO.props={};const zO=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:o,strokeOpacity:a,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};function GO(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}zO.props={};const WO=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function $O(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function HO(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function VO(t,e){const[n,r,i,o]=$O(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),c=[],l=o/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,o=r+u*l;c.push(HO([t,o,e,l]))}f-=t,u+=1}return c}function YO(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function qO(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function UO(t){const e=zf(t);if(e&&!function(t){return!qO(t,"m")||!qO(t,"M")}(e))return e}function XO(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=UO(e),s=UO(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){const[r,i,o,a]=$O(t),{transform:s}=t.style,{transform:c}=e.style;YO(e,t);const[l,u,f,h]=$O(e),d=r-l,p=i-u,g=o/f,m=a/h,y=[Object.assign({transform:`${s?s+" ":""}translate(${d}, ${p}) scale(${g}, ${m})`},GO(t,WO)),Object.assign({transform:(c?c+" ":"")+"translate(0, 0) scale(1, 1)"},GO(e,WO))];return e.animate(y,n)}(e,n,r);const c=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new pp({style:Object.assign(Object.assign({},GO(t,WO)),{d:e})});return YO(r,t),r}(t,a),l=[Object.assign({path:a},GO(e,WO)),Object.assign({path:s},GO(n,WO))],u=c.animate(l,r);return u.onfinish=()=>{c.style.transform="none",sr(c,n)},c.style.transform="none",u}const KO=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:VO}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return XO(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>XO(e,new pp({style:Object.assign({path:i[r]},GO(t,WO))}),e,n)))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>XO(t,t,new pp({style:{path:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};KO.props={};const ZO=(t,e)=>{const n=1e-4;ap({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Xu.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Mc(r))return RO(t,e)(i,o,a);const c=r.getCenter(),{__data__:l,style:u}=s,{radius:f=0,inset:h=0,fillOpacity:d=1,strokeOpacity:p=1,opacity:g=1}=u,{points:m,y:y,y1:v}=l,b=Us().cornerRadius(f).padAngle(h*Math.PI/180),x=Vg(r,m,[y,v]),{startAngle:w,endAngle:M}=x,E=new pp({}),O=t=>{E.attr({d:b(t),transform:`translate(${c[0]}, ${c[1]})`});const e=zf(E);return E.style.transform="",e},k=[{waveInArcAngle:w+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:w+n,fillOpacity:d,strokeOpacity:p,opacity:g,offset:.01},{waveInArcAngle:M,fillOpacity:d,strokeOpacity:p,opacity:g}],S=s.animate(k,Object.assign(Object.assign({},a),t));return S.onframe=function(){s.style.path=O(Object.assign(Object.assign({},x),{endAngle:Number(s.style.waveInArcAngle)}))},S.onfinish=function(){s.style.path=O(Object.assign(Object.assign({},x),{endAngle:M}))},S}};ZO.props={};const QO=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l=[{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c}],{width:u,height:f}=i.getBoundingClientRect();i.setOrigin([u/2,f/2]);const h=i.animate(l,Object.assign(Object.assign({},r),t));return h.finished.then((()=>i.setOrigin(0,0))),h},JO=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l=[{transform:`${o} scale(1)`.trimStart()},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:u,height:f}=i.getBoundingClientRect();i.setOrigin([u/2,f/2]);const h=i.animate(l,Object.assign(Object.assign({},r),t));return h.finished.then((()=>i.setOrigin(0,0))),h},tk=t=>(e,n,r)=>{var i,o;const[a]=e,s=(null===(o=(i=a).getTotalLength)||void 0===o?void 0:o.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(c,Object.assign(Object.assign({},r),t))};tk.props={};const ek=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new pp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;const l=RO(t,e)([c],r,i);return l.finished.then((()=>{c.remove(),o.style.clipPath=null})),l};ek.props={};const nk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new pp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;const l=BO(t,e)([c],r,i);return l.finished.then((()=>{c.remove(),o.style.clipPath=null})),l};nk.props={};const rk="main-layer",ik="label-layer",ok="element",ak="view",sk="plot",ck="component",lk="label",uk="area";function fk(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function hk(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(i,i,i,0,2*Math.PI)}}function dk(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.defX,l=void 0===c?0:c,u=e.defY,f=void 0===u?0:u,h=e.markerStart,d=e.markerEnd,p=e.markerStartOffset,g=e.markerEndOffset,m=0,y=0,v=0,b=0,x=0;h&&Zd(h)&&p&&(n=a-i,r=s-o,x=Math.atan2(r,n),m=Math.cos(x)*(p||0),y=Math.sin(x)*(p||0)),d&&Zd(d)&&g&&(n=i-a,r=o-s,x=Math.atan2(r,n),v=Math.cos(x)*(g||0),b=Math.sin(x)*(g||0)),t.moveTo(i-l+m,o-f+y),t.lineTo(a-l+v,s-f+b)}function pk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.path,d=h.absolutePath,p=h.segments,g=0,m=0,y=0,v=0,b=0;if(c&&Zd(c)&&u){var x=ye(c.parentNode.getStartTangent(),2),w=x[0],M=x[1];n=w[0]-M[0],r=w[1]-M[1],b=Math.atan2(r,n),g=Math.cos(b)*(u||0),m=Math.sin(b)*(u||0)}if(l&&Zd(l)&&f){var E=ye(l.parentNode.getEndTangent(),2);w=E[0],M=E[1];n=w[0]-M[0],r=w[1]-M[1],b=Math.atan2(r,n),y=Math.cos(b)*(f||0),v=Math.sin(b)*(f||0)}for(var O=0;O<d.length;O++){var k=d[O],S=k[0],A=d[O+1],T=0===O&&(0!==g||0!==m),_=(O===d.length-1||A&&("M"===A[0]||"Z"===A[0]))&&0!==y&&0!==v;switch(S){case"M":T?(t.moveTo(k[1]-o+g,k[2]-s+m),t.lineTo(k[1]-o,k[2]-s)):t.moveTo(k[1]-o,k[2]-s);break;case"L":_?t.lineTo(k[1]-o+y,k[2]-s+v):t.lineTo(k[1]-o,k[2]-s);break;case"Q":t.quadraticCurveTo(k[1]-o,k[2]-s,k[3]-o,k[4]-s),_&&t.lineTo(k[3]-o+y,k[4]-s+v);break;case"C":t.bezierCurveTo(k[1]-o,k[2]-s,k[3]-o,k[4]-s,k[5]-o,k[6]-s),_&&t.lineTo(k[5]-o+y,k[6]-s+v);break;case"A":var P=p[O].arcParams,C=P.cx,N=P.cy,L=P.rx,j=P.ry,R=P.startAngle,I=P.endAngle,B=P.xRotation,D=P.sweepFlag;if(t.ellipse)t.ellipse(C-o,N-s,L,j,B,R,I,!!(1-D));else{var F=L>j?L:j,z=L>j?1:L/j,G=L>j?j/L:1;t.translate(C-o,N-s),t.rotate(B),t.scale(z,G),t.arc(0,0,F,R,I,!!(1-D)),t.scale(1/z,1/G),t.rotate(-B),t.translate(-(C-o),-(N-s))}_&&t.lineTo(k[6]-o+y,k[7]-s+v);break;case"Z":t.closePath()}}}function gk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.points.points,d=h.length,p=h[0][0]-o,g=h[0][1]-s,m=h[d-1][0]-o,y=h[d-1][1]-s,v=0,b=0,x=0,w=0,M=0;c&&Zd(c)&&u&&(n=h[1][0]-h[0][0],r=h[1][1]-h[0][1],M=Math.atan2(r,n),v=Math.cos(M)*(u||0),b=Math.sin(M)*(u||0)),l&&Zd(l)&&f&&(n=h[d-1][0]-h[0][0],r=h[d-1][1]-h[0][1],M=Math.atan2(r,n),x=Math.cos(M)*(f||0),w=Math.sin(M)*(f||0)),t.moveTo(p+(v||x),g+(b||w));for(var E=1;E<d-1;E++){var O=h[E];t.lineTo(O[0]-o,O[1]-s)}t.lineTo(m,y)}function mk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.points.points,d=h.length,p=h[0][0]-o,g=h[0][1]-s,m=h[d-1][0]-o,y=h[d-1][1]-s,v=0,b=0,x=0,w=0,M=0;c&&Zd(c)&&u&&(n=h[1][0]-h[0][0],r=h[1][1]-h[0][1],M=Math.atan2(r,n),v=Math.cos(M)*(u||0),b=Math.sin(M)*(u||0)),l&&Zd(l)&&f&&(n=h[d-2][0]-h[d-1][0],r=h[d-2][1]-h[d-1][1],M=Math.atan2(r,n),x=Math.cos(M)*(f||0),w=Math.sin(M)*(f||0)),t.moveTo(p+v,g+b);for(var E=1;E<d-1;E++){var O=h[E];t.lineTo(O[0]-o,O[1]-s)}t.lineTo(m+x,y+w)}function yk(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i;if(n&&n.some((function(t){return 0!==t}))){var s=r>0?1:-1,c=i>0?1:-1,l=s+c===0,u=ye(n.map((function(t){return T(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),f=u[0],h=u[1],d=u[2],p=u[3];t.moveTo(s*f,0),t.lineTo(o-s*h,0),0!==h&&t.arc(o-s*h,c*h,h,-c*Math.PI/2,s>0?0:Math.PI,l),t.lineTo(o,a-c*d),0!==d&&t.arc(o-s*d,a-c*d,d,s>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(s*p,a),0!==p&&t.arc(s*p,a-c*p,p,c>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,l),t.lineTo(0,c*f),0!==f&&t.arc(s*f,c*f,f,s>0?Math.PI:0,c>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,o,a)}var vk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-path-generator",e}return ue(e,t),e.prototype.init=function(){var t,e=((t={})[Tl.CIRCLE]=fk,t[Tl.ELLIPSE]=hk,t[Tl.RECT]=yk,t[Tl.LINE]=dk,t[Tl.POLYLINE]=mk,t[Tl.POLYGON]=gk,t[Tl.PATH]=pk,t[Tl.TEXT]=void 0,t[Tl.GROUP]=void 0,t[Tl.IMAGE]=void 0,t[Tl.HTML]=void 0,t[Tl.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(Cl),bk=jt(),xk=jt(),wk=jt(),Mk=rt(),Ek=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=lt(Mk,r),s=qt(xk,Ft(wk,n[0],n[1],0),a),c=e.getGeometryBounds().halfExtents,l=e.parsedStyle.anchor;if(s[0]+=(l&&l[0]||0)*c[0]*2,s[1]+=(l&&l[1]||0)*c[1]*2,o(e,new ru(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,(function(t){return pe(i,void 0,void 0,(function(){return ge(this,(function(e){return[2,this.pick(s,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))},t.prototype.pick=function(t,e){var n,r,i=e.topmost,o=e.position,a=o.x,s=o.y,c=Ft(bk,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=me(l),h=f.next();!h.done;h=f.next()){var d=h.value,p=d.getWorldTransform();if(this.isHit(d,c,p,!1)){var g=Fh(d);if(g){var m=g.parsedStyle.clipPath;if(this.isHit(m,c,m.getWorldTransform(),!0)){if(i)return e.picked=[d],e;u.push(d)}}else{if(i)return e.picked=[d],e;u.push(d)}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return e.picked=u,e},t.tag="CanvasPicker",t}();function Ok(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.lineWidth,c=r.increasedLineWidthForHitTesting,l=r.pointerEvents,u=((s||0)+(c||0))/2,f=cl(i,i,e.x,e.y),h=ye($h(l,o,a),2),d=h[0],p=h[1];return d&&p||n?f<=i+u:d?f<=i:!!p&&(f>=i-u&&f<=i+u)}function kk(t,e,n,r){return t/(n*n)+e/(r*r)}function Sk(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.fill,s=r.stroke,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=e.x,h=e.y,d=ye($h(u,a,s),2),p=d[0],g=d[1],m=((c||0)+(l||0))/2,y=(f-i)*(f-i),v=(h-o)*(h-o);return p&&g||n?kk(y,v,i+m,o+m)<=1:p?kk(y,v,i,o)<=1:!!g&&(kk(y,v,i-m,o-m)>=1&&kk(y,v,i+m,o+m)<=1)}function Ak(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function Tk(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return cl(l.x,l.y,a,s)<=o/2}function _k(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&yl(t,e,n,r,o,a)<=i/2}function Pk(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(_k(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(_k(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var Ck=1e-6;function Nk(t){return Math.abs(t)<Ck?0:t<0?-1:1}function Lk(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function jk(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Lk(a,s,[e,n]))return!0;Nk(a[1]-n)>0!=Nk(s[1]-n)>0&&Nk(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function Rk(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=jk(t[i],e,n))break}return r}function Ik(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.defX,f=void 0===u?0:u,h=r.defY,d=void 0===h?0:h;return!(!ye($h(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!c)&&_k(i,o,a,s,(c||0)+(l||0),e.x+f,e.y+d)}function Bk(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=a.increasedLineWidthForHitTesting,l=a.stroke,u=a.fill,f=a.defX,h=void 0===f?0:f,d=a.defY,p=void 0===d?0:d,g=a.path,m=a.pointerEvents,y=g.segments,v=g.hasArc,b=g.polylines,x=g.polygons,w=ye($h(m,(null==x?void 0:x.length)&&u,l),2),M=w[0],E=w[1],O=Tf(t),k=!1;return M||n?k=v?r(t,e):Rk(x,e.x+h,e.y+p)||Rk(b,e.x+h,e.y+p):((E||n)&&(k=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||Ak(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=_k(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Sl(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=wl(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=De(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var m=wl(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],o=m<=e/2)return!0}}}return o}(y,(s||0)+(c||0),e.x+h,e.y+p,O)),k)}function Dk(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,c=r.points,l=r.defX,u=void 0===l?0:l,f=r.defY,h=void 0===f?0:f,d=ye($h(r.pointerEvents,o,i),2),p=d[0],g=!1;return(d[1]||n)&&(g=Pk(c.points,(a||0)+(s||0),e.x+u,e.y+h,!0)),g||!p&&!n||(g=jk(c.points,e.x+u,e.y+h)),g}function Fk(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,c=void 0===s?0:s,l=r.defY,u=void 0===l?0:l;return!(!ye($h(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&Pk(a.points,(i||0)+(o||0),e.x+c,e.y+u,!1)}function zk(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,u=o.increasedLineWidthForHitTesting,f=o.width,h=o.height,d=ye($h(o.pointerEvents,s,c),2),p=d[0],g=d[1],m=(l||0)+(u||0);if(a&&a.some((function(t){return 0!==t}))){var y=!1;return(g||n)&&(y=function(t,e,n,r,i,o,a,s){var c=ye(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return _k(t+l,e,t+n-u,e,o,a,s)||_k(t+n,e+u,t+n,e+r-f,o,a,s)||_k(t+n-f,e+r,t+h,e+r,o,a,s)||_k(t,e+r-h,t,e+l,o,a,s)||Tk(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||Tk(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||Tk(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||Tk(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(0,0,f,h,a.map((function(t){return T(t,0,Math.min(Math.abs(f)/2,Math.abs(h)/2))})),m,e.x,e.y)),y||!p&&!n||(y=r(t,e)),y}var v=m/2;return p&&g||n?Ak(0-v,0-v,f+v,h+v,e.x,e.y):p?Ak(0,0,f,h,e.x,e.y):!!g&&function(t,e,n,r,i,o,a){var s=i/2;return Ak(t-s,e-s,n,i,o,a)||Ak(t+n-s,e-s,i,r,o,a)||Ak(t+s,e+r-s,n,i,o,a)||Ak(t-s,e+s,i,r,o,a)}(0,0,f,h,m,e.x,e.y)}function Gk(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=a.width,l=a.height;if("non-transparent-pixel"===s){var u=i.config.offscreenCanvas,f=o.offscreenCanvasCreator.getOrCreateCanvas(u),h=o.offscreenCanvasCreator.getOrCreateContext(u,{willReadFrequently:!0});return f.width=c,f.height=l,i.defaultStyleRendererFactory[Tl.IMAGE].render(h,t.parsedStyle,t,void 0,void 0,void 0),h.getImageData(e.x,e.y,1,1).data.every((function(t){return 0!==t}))}return!0}var Wk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-picker",e}return ue(e,t),e.prototype.init=function(){var t,e=((t={})[Tl.CIRCLE]=Ok,t[Tl.ELLIPSE]=Sk,t[Tl.RECT]=zk,t[Tl.LINE]=Ik,t[Tl.POLYLINE]=Fk,t[Tl.POLYGON]=Dk,t[Tl.PATH]=Bk,t[Tl.TEXT]=function(){return!0},t[Tl.GROUP]=null,t[Tl.IMAGE]=Gk,t[Tl.HTML]=null,t[Tl.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new Ek)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Cl),$k=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=rt(),this.dprMatrix=rt(),this.tmpMat4=rt(),this.vec3a=jt(),this.vec3b=jt(),this.vec3c=jt(),this.vec3d=jt()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.rBushRoot,l=e.pathGeneratorFactory;this.rBush=c,this.pathGeneratorFactory=l;var u=e.contextService,f=s.root.ownerDocument.defaultView,h=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){f.addEventListener(Ad.UNMOUNTED,h),f.addEventListener(Ad.CULLED,d);var t=u.getDPR(),e=i.width,n=i.height,o=u.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){f.removeEventListener(Ad.UNMOUNTED,h),f.removeEventListener(Ad.CULLED,d),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t=u.getContext(),e=u.getDPR(),n=i.width,o=i.height,s=r.canvasRendererPluginOptions,c=s.dirtyObjectNumThreshold,l=s.dirtyObjectRatioThreshold,f=a.getStats(),h=f.total,d=f.rendered,p=d/h;r.clearFullScreen=a.disableDirtyRectangleRendering()||d>c&&p>l,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(t,0,0,n*e,o*e,i.background))}));var p=function(t,e){t.isVisible()&&!t.isCulled()&&(r.renderDisplayObject(t,e,r.context,r.restoreStack,n),r.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){p(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){var t=u.getContext(),e=u.getDPR();if(yt(r.dprMatrix,[e,e,1]),ft(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,ve([r.mergeDirtyAABBs(r.renderQueue)],ye(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Zl;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],Zl.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,h=c.y,d=c.width,g=c.height,m=qt(r.vec3a,[l,h,0],r.vpMatrix),y=qt(r.vec3b,[l+d,h,0],r.vpMatrix),v=qt(r.vec3c,[l,h+g,0],r.vpMatrix),b=qt(r.vec3d,[l+d,h+g,0],r.vpMatrix),x=Math.min(m[0],y[0],b[0],v[0]),w=Math.min(m[1],y[1],b[1],v[1]),M=Math.max(m[0],y[0],b[0],v[0]),E=Math.max(m[1],y[1],b[1],v[1]),O=Math.floor(x),k=Math.floor(w),S=Math.ceil(M-x),A=Math.ceil(E-w);t.save(),r.clearRect(t,O,k,S,A,i.background),t.beginPath(),t.rect(O,k,S,A),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&f.dispatchEvent(new Md(Qd.DIRTY_RECTANGLE,{dirtyRect:{x:O,y:k,width:S,height:A}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),t.nodeName!==Tl.LINE&&t.nodeName!==Tl.PATH&&t.nodeName!==Tl.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new Zl;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e=ye(t.getMin(),2),n=e[0],r=e[1],i=ye(t.getMax(),2),o=i[0],a=i[1];return this.rBush.search({minX:n,minY:r,maxX:o,maxY:a}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Zl);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),y(s)||(t.lineDashOffset=s),y(o)||(t.globalAlpha*=o),y(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),y(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var c=e.geometry.contentBounds;r=-a*(c&&2*c.halfExtents[0]||0),i=-s*(c&&2*c.halfExtents[1]||0)}n?(ot(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ht(this.tmpMat4,this.tmpMat4,this.vec3a),ft(this.tmpMat4,n,this.tmpMat4),ft(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(ot(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ht(this.tmpMat4,this.tmpMat4,this.vec3a),ft(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Zl;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),Hk=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=e.fillOpacity,u=e.stroke,f=e.strokeOpacity,h=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,m=e.shadowColor,v=e.shadowBlur,b=e.filter,x=e.miterLimit,w=!y(a)&&!a.isNone,M=!y(u)&&!u.isNone&&h>0,E=0===a.alpha,O=!(!b||!b.length),k=!y(m)&&v>0,S=n.nodeName,A="inner"===g,T=M&&k&&(S===Tl.PATH||S===Tl.LINE||S===Tl.POLYLINE||E||A);w&&(t.globalAlpha=c*l,T||Vk(n,t,k),this.fill(t,n,a,s,r,i,o),T||this.clearShadowAndFilter(t,O,k)),M&&(t.globalAlpha=c*f,t.lineWidth=h,y(x)||(t.miterLimit=x),y(d)||(t.lineCap=d),y(p)||(t.lineJoin=p),T&&(A&&(t.globalCompositeOperation="source-atop"),Vk(n,t,!0),A&&(this.stroke(t,n,u,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,O,!0))),this.stroke(t,n,u,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!y(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(cf(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(cf(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,u=c.height;s=r.contextService.getDPR();var f=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(f)).width=l*s,a.height=u*s;var h=o.offscreenCanvasCreator.getOrCreateContext(f),d=[];t.image.forEach((function(t){i.renderDisplayObject(t,h,r,d,o)})),d.forEach((function(){h.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===vu.LinearGradient||t.type===vu.RadialGradient){var i=e.getGeometryBounds(),o=i&&2*i.halfExtents[0]||1,a=i&&2*i.halfExtents[1]||1;r=this.imagePool.getOrCreateGradient(fe(fe({type:t.type},t.value),{width:o,height:a}),n)}return r},t}();function Vk(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var Yk=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.width,o=e.height,a=e.img,s=e.shadowColor,c=e.shadowBlur,l=i,u=o;if(A(a)?r=this.imagePool.getImageSync(a):(l||(l=a.width),u||(u=a.height),r=a),r){Vk(n,t,!y(s)&&c>0);try{t.drawImage(r,0,0,l,u)}catch(t){}}},t}(),qk=function(){function t(){}return t.prototype.render=function(t,e,n,r,i,o){var a=e,s=a.lineWidth,c=a.textAlign,l=a.textBaseline,u=a.lineJoin,f=a.miterLimit,h=a.letterSpacing,d=a.stroke,p=a.fill,g=a.fillOpacity,m=a.strokeOpacity,v=a.opacity,b=a.metrics,x=a.dx,w=a.dy,M=a.shadowColor,E=a.shadowBlur,O=b.font,k=b.lines,S=b.height,A=b.lineHeight,T=b.lineMetrics;t.font=O,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var _=l;o.enableCSSParsing||"alphabetic"!==_||(_="bottom"),t.lineJoin=u,y(f)||(t.miterLimit=f);var P=0;"middle"===l?P=-S/2-A/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?P=-S:"top"!==l&&"hanging"!==l||(P=-A);var C=x||0;P+=w||0,1===k.length&&("bottom"===_?(_="middle",P-=.5*S):"top"===_&&(_="middle",P+=.5*S)),t.textBaseline=_,Vk(n,t,!y(M)&&E>0);for(var N=0;N<k.length;N++){var L=s/2+C;P+=A,y(d)||d.isNone||!s||this.drawLetterSpacing(t,k[N],T[N],c,L,P,h,g,m,v,!0),y(p)||this.drawLetterSpacing(t,k[N],T[N],c,L,P,h,g,m,v)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u){if(void 0===u&&(u=!1),0!==a){var f=t.textAlign;t.textAlign="left";var h=i;"center"===r||"middle"===r?h=i-n.width/2:"right"!==r&&"end"!==r||(h=i-n.width);for(var d=Array.from(e),p=t.measureText(e).width,g=0,m=0;m<d.length;++m){var y=d[m];u?this.strokeText(t,y,h,o,c):this.fillText(t,y,h,o,s,l),h+=p-(g=t.measureText(e.substring(m+1)).width)+a,p=g}t.textAlign=f}else u?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!y(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!y(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(Hk);var Uk=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return ue(e,t),e.prototype.init=function(){var t,e=fe({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new Hk(n),i=((t={})[Tl.CIRCLE]=r,t[Tl.ELLIPSE]=r,t[Tl.RECT]=r,t[Tl.IMAGE]=new Yk(n),t[Tl.TEXT]=new qk,t[Tl.LINE]=r,t[Tl.POLYLINE]=r,t[Tl.POLYGON]=r,t[Tl.PATH]=r,t[Tl.GROUP]=void 0,t[Tl.HTML]=void 0,t[Tl.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new $k(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Cl),Xk=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),Kk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="dom-interaction",e}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new Xk)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Cl),Zk=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform())},l=function(t){var e=t.target;if(e.nodeName===Tl.HTML){r.$camera||(r.$camera=r.createCamera(i));var o=r.getOrCreateEl(e);if(r.$camera.appendChild(o),n.enableCSSParsing){var a=e.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){o.style[t]=a[t]}))}Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),c(e,o),r.context.nativeHTMLMap.set(o,e)}},u=function(t){var e=t.target;if(e.nodeName===Tl.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),r.context.nativeHTMLMap.delete(n))}},f=function(t){var e=t.target;if(e.nodeName===Tl.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;if(e.nodeName===Tl.HTML){var n=r.getOrCreateEl(e);c(e,n)}},d=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.style.width="".concat(e||0,"px"),r.$camera.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(Qd.RESIZE,d),s.addEventListener(Ad.MOUNTED,l),s.addEventListener(Ad.UNMOUNTED,u),s.addEventListener(Ad.ATTR_MODIFIED,f),s.addEventListener(Ad.BOUNDS_CHANGED,h)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(yd.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Qd.RESIZE,d),s.removeEventListener(Ad.MOUNTED,l),s.removeEventListener(Ad.UNMOUNTED,u),s.removeEventListener(Ad.ATTR_MODIFIED,f),s.removeEventListener(Ad.BOUNDS_CHANGED,h)}))},t.prototype.createCamera=function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#"+s);if(!c){var l=(n||document).createElement("div");c=l,l.id=s,l.style.position="absolute",l.style.left="".concat(o.offsetLeft||0,"px"),l.style.top="".concat(o.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),a.appendChild(l)}return c}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform())),n},t.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;A(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);break;case"width":if(this.context.enableCSSParsing){var o=e.computedStyleMap().get("width");n.style.width=o.toString()}else{o=e.parsedStyle.width;n.style.width=_(o)?"".concat(o,"px"):o.toString()}break;case"height":if(this.context.enableCSSParsing){var a=e.computedStyleMap().get("height");n.style.height=a.toString()}else{a=e.parsedStyle.height;n.style.height=_(a)?"".concat(a,"px"):a.toString()}break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents;n.style.pointerEvents=l;break;case"opacity":var u=e.parsedStyle.opacity;n.style.opacity="".concat(u);break;case"fill":var f=e.parsedStyle.fill,h="";lf(f)?h=f.isNone?"transparent":e.getAttribute("fill"):Array.isArray(f)&&(h=e.getAttribute("fill")),n.style.background=h;break;case"stroke":var d=e.parsedStyle.stroke,p="";lf(d)?p=d.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(d)&&(p=e.getAttribute("stroke")),n.style["border-color"]=p,n.style["border-style"]="solid";break;case"lineWidth":var g=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(g||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:"x"!==t&&"y"!==t&&(y(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t]))}},t.tag="HTMLRendering",t}(),Qk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="html-renderer",e}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new Zk)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Cl),Jk=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):Ih&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var a,s=t.image,c=t.repetition,l=t.transform,u=!1;A(s)?a=this.getImageSync(s,i):n?(a=n,u=!0):a=s;var f=a&&e.createPattern(a,c);if(f){var h=void 0;h=l?Eh(Zf(l),new op({})):st(rt()),u&&dt(h,h,[1/r,1/r,1]),f.setTransform({a:h[0],b:h[1],c:h[4],d:h[5],e:h[12],f:h[13]})}return o&&f&&(this.patternCache[o]=f),f},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.width,a=t.height,s=t.angle,c=t.cx,l=t.cy,u=t.size;if(this.gradientCache[n])return this.gradientCache[n];var f=null;if(r===vu.LinearGradient){var h=function(t,e,n){var r=Fl(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}}(o,a,s),d=h.x1,p=h.y1,g=h.x2,m=h.y2;f=e.createLinearGradient(d,p,g,m)}else if(r===vu.RadialGradient){var y=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===su.kPercentage&&(o=n.value/100*t),r.unit===su.kPercentage&&(a=r.value/100*e);var s=Math.max($e([0,0],[o,a]),$e([0,e],[o,a]),$e([t,e],[o,a]),$e([t,0],[o,a]));return i&&(i instanceof Lu?s=i.value:i instanceof ku&&("closest-side"===i.value?s=Math.min(o,t-o,a,e-a):"farthest-side"===i.value?s=Math.max(o,t-o,a,e-a):"closest-corner"===i.value&&(s=Math.min($e([0,0],[o,a]),$e([0,e],[o,a]),$e([t,e],[o,a]),$e([t,0],[o,a]))))),{x:o,y:a,r:s}}(o,a,c,l,u),v=y.x,b=y.y,x=y.r;f=e.createRadialGradient(v,b,0,v,b,x)}return f&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===su.kPercentage&&(null==f||f.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=f),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,o=t.angle,a=t.cx,s=t.cy,c=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return A(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),tS=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===Tl.IMAGE){var a=o.img;A(a)&&i.getImageSync(a,(function(){e.renderable.dirty=!0,n.dirtify()}))}},s=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===Tl.IMAGE&&"img"===r&&A(o)&&i.getOrCreateImage(o).then((function(){e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(Ad.MOUNTED,a),o.addEventListener(Ad.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(Ad.MOUNTED,a),o.removeEventListener(Ad.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),eS=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="image-loader",e}return ue(e,t),e.prototype.init=function(){this.context.imagePool=new Jk(this.context.config),this.addRenderingPlugin(new tS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Cl),nS=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=A(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,e){var n=this.canvasConfig.devicePixelRatio||Ih&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Ih&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(yd.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),pe(this,void 0,void 0,(function(){var e,n;return ge(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),rS=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-context-register",e}return ue(e,t),e.prototype.init=function(){this.context.ContextService=nS},e.prototype.destroy=function(){delete this.context.ContextService},e}(Cl),iS=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new rS),n.registerPlugin(new eS),n.registerPlugin(new vk),n.registerPlugin(new Uk),n.registerPlugin(new Kk),n.registerPlugin(new Wk),n.registerPlugin(new Qk),n}return ue(e,t),e}(Nl),oS=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(t){return pe(n,void 0,void 0,(function(){var n,o,h,d,p,g;return ge(this,(function(m){switch(m.label){case 0:if(!s){if(n=t.timeStamp-c,o=$e([t.clientX,t.clientY],l),n<=this.dragndropPluginOptions.dragstartTimeThreshold||o<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];t.type="dragstart",a.dispatchEvent(t),s=!0}return t.type="drag",t.dx=t.clientX-f[0],t.dy=t.clientY-f[1],a.dispatchEvent(t),f=[t.clientX,t.clientY],r?[3,2]:(h="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(h[0],h[1])]);case 1:d=m.sent(),p=d[d.indexOf(e)+1],g=(null==p?void 0:p.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),u!==g&&(u&&(t.type="dragleave",t.target=u,u.dispatchEvent(t)),g&&(t.type="dragenter",t.target=g,g.dispatchEvent(t)),(u=g)&&(t.type="dragover",t.target=u,u.dispatchEvent(t))),m.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))},t.tag="Dragndrop",t}(),aS=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new oS(fe({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(Cl),sS=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),cS=sS;const lS={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},uS=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];function fS(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):Ui}function hS(t){return t instanceof Float32Array||t instanceof Array}var dS=window&&window.__read||function(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},pS=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function gS(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var mS=window&&window.__read||function(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},yS=function(t,e,n,r,i){var o,a,s=mS(t,2),c=s[0],l=s[1],u=et();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o},vS=window&&window.__read||function(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},bS=function(t,e,n,r,i){var o=new Zo({range:[e,e+r]}),a=new Zo({range:[n,n+i]});return{transform:function(t){var e=vS(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=vS(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},xS=window&&window.__read||function(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},wS=function(t,e,n,r,i){return(0,xS(t,1)[0])(e,n,r,i)},MS=window&&window.__read||function(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},ES=function(t,e,n,r,i){return MS(t,1)[0]},OS=window&&window.__read||function(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},kS=function(t,e,n,r,i){var o=OS(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new Zo({range:[c,l]}),f=new Zo({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=OS(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*d)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=OS(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=gS(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},SS=window&&window.__read||function(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},AS=function(t,e,n,r,i){return{transform:function(t){var e=SS(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=SS(t,2),n=e[0];return[e[1],n]}}},TS=window&&window.__read||function(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},_S=function(t,e,n,r,i){var o,a,s=TS(t,2),c=s[0],l=s[1],u=et();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},PS=window&&window.__read||function(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},CS=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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))},NS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return _S.apply(void 0,CS([[-1,-1]],PS(e),!1))},LS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return _S.apply(void 0,CS([[-1,1]],PS(e),!1))},jS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return _S.apply(void 0,CS([[1,-1]],PS(e),!1))},RS=window&&window.__read||function(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},IS=function(t,e,n,r,i){var o=RS(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(et(),o)},BS=window&&window.__read||function(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},DS=function(t,e,n,r,i){var o=BS(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new Zo({range:[c,c+.99*l]}),h=new Zo({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=BS(t,2),n=e[0],r=e[1],i=h.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=BS(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),d=gS(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*d;return[h.invert(d),f.invert(m)]}}},FS=window&&window.__read||function(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},zS=function(t,e,n,r,i){var o=FS(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new Zo({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new Qo({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},GS=window&&window.__read||function(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 WS(t){return 1/Math.tan(t)}var $S=function(t,e,n,r,i){var o=WS(GS(t,1)[0]);return{transform:function(t){var e=GS(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=GS(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},HS=function(t,e,n,r,i){var o=WS(GS(t,1)[0]);return{transform:function(t){var e=GS(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=GS(t,2),n=e[0];return[n,e[1]-n*o]}}},VS=window&&window.__read||function(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 YS(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function qS(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function US(t,e,n){return n?new Zo({range:[0,1],domain:[0,e]}).map(t):t}var XS=function(t,e,n,r,i){var o=VS(t,3),a=o[0],s=o[1],c=o[2],l=US(a,r,void 0!==c&&c);return{transform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[YS(n,l,s,0,1),r]},untransform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[qS(n,l,s,0,1),r]}}},KS=function(t,e,n,r,i){var o=VS(t,3),a=o[0],s=o[1],c=o[2],l=US(a,i,void 0!==c&&c);return{transform:function(t){var e=VS(t,2);return[e[0],YS(e[1],l,s,0,1)]},untransform:function(t){var e=VS(t,2);return[e[0],qS(e[1],l,s,0,1)]}}},ZS=function(t,e,n,r,i){var o=VS(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=US(a,r,f),d=US(s,i,f);return{transform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[YS(n,h,c,0,1),YS(r,d,l,0,1)]},untransform:function(t){var e=VS(t,2),n=e[0],r=e[1];return[qS(n,h,c,0,1),qS(r,d,l,0,1)]}}},QS=function(t,e,n,r,i){var o=VS(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new Zo({range:[0,r]}),d=new Zo({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=VS(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=YS(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]},untransform:function(t){var e=VS(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=qS(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]}}},JS=window&&window.__read||function(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},tA=function(t,e,n,r,i,o,a){var s=new Zo({range:[e,e+i]}),c=new Zo({range:[n,n+o]}),l=new Zo({range:[r,r+a]});return{transform:function(t){var e=JS(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=JS(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},eA=window&&window.__read||function(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},nA=function(t,e,n,r,i,o,a){var s=eA(t,3),c=s[0],l=s[1],u=s[2];return mt(rt(),[c,l,u])},rA=window&&window.__read||function(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},iA=function(t,e,n,r,i,o,a){var s=rA(t,3),c=s[0],l=s[1],u=s[2];return yt(rt(),[c,l,u])},oA=window&&window.__read||function(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},aA=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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))},sA=window&&window.__values||function(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.")},cA=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:bS,translate:yS,custom:wS,matrix:ES,polar:kS,transpose:AS,scale:_S,"shear.x":$S,"shear.y":HS,reflect:NS,"reflect.x":LS,"reflect.y":jS,rotate:IS,helix:DS,parallel:zS,fisheye:ZS,"fisheye.x":XS,"fisheye.y":KS,"fisheye.circular":QS},this.update(t)}return t.prototype.update=function(t){this.options=Yi({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:aA(aA([],oA(n),!1),[aA([],oA(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?aA([],oA(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,pS([],dS(o),!1))}return n}}(t):t)};try{for(var c=sA(r),l=c.next();!l.done;l=c.next()){var u=oA(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.width,v=p.height,b=d(aA([],oA(h),!1),g,m,y,v);if(hS(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||Ui,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return fS.apply(void 0,aA([],oA(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=et();return e&&t.reverse(),t.forEach((function(t){return nt(i,i,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,h=-u*o+s*c,d=l*o-a*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(i,(n=i,(r=new tt(9))[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r)),function(t){var e=[t[0],t[1],1];return Ut(e,e,i),[e[0],e[1]]}},t}(),lA=window&&window.__read||function(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},uA=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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))},fA=window&&window.__values||function(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.")},hA=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:tA,translate3D:nA,scale3D:iA},this.update(t)}return t.prototype.update=function(t){this.options=Yi({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:uA(uA([],lA(n),!1),[uA([],lA(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?uA([],lA(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,pS([],dS(o),!1))}return n}}(t):t)};try{for(var c=fA(r),l=c.next();!l.done;l=c.next()){var u=lA(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.z,v=p.width,b=p.height,x=p.depth,w=d(uA([],lA(h),!1),g,m,y,v,b,x);if(hS(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||Ui,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return fS.apply(void 0,uA([],lA(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=rt();return e&&t.reverse(),t.forEach((function(t){return Ct(n,n,t)})),e&&lt(n,it(n)),function(t){var e=[t[0],t[1],t[2],1];return Jt(e,e,n),[e[0],e[1],e[2]]}},t}();function dA(t){return(e,...n)=>Y({},t(e,...n),e)}function pA(t){return(e,...n)=>Y({},e,t(e,...n))}function gA(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=he(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const mA=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=he(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:gA(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};mA.props={};const yA=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:o}=t,[a,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),h=r.map((t=>f*(t/u))),d=[];let p=t[a]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=he(r,["data"]),g=gA(u,o);d.push(Object.assign({[a]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};yA.props={};const vA=()=>t=>{const{children:e}=t,n=he(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=he(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=he(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:gA(e,r),scale:Y({},i,n),encode:Y({},s,f),transform:[...c,...h],axis:!(!l||!o)&&Y({},o,l),legend:!(!u||!a)&&Y({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};vA.props={};const bA=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,data:x,coordinate:w,theme:M,component:E,interaction:O,x:k,y:S,z:A,key:T,frame:_,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=he(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:k,y:S,z:A,key:T,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:M,coordinate:w,component:E,interaction:O,frame:_,labelTransform:P,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${T}-0`,data:x}),t&&{title:j})]})]};bA.props={};class xA{constructor(t){this.$value=t}static of(t){return new xA(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const wA=dA((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=Pn(n,(e=>e[t])),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),c=s.map((t=>a.has(t)?a.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}})),MA=dA((t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const t=r.shift(),{children:e,encode:n={},scale:s={},legend:c={}}=t,{color:l}=n,{color:u}=s,{color:f}=c;void 0!==l&&(i=l),void 0!==u&&(o=u),void 0!==f&&(a=f),Array.isArray(e)&&r.push(...e)}const s="string"==typeof i?i:"",[c,l]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===i)return[void 0];const o="function"==typeof i?i:t=>t[i],a=e.map(o);return a.some((t=>"number"==typeof t))?[kn(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:Y({},o,{domain:c,type:l})},legend:{color:Y({title:s},a)}}})),EA=dA((()=>({animate:{enterType:"fadeIn"}}))),OA=pA((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),kA=pA((()=>({type:"cell"}))),SA=pA((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map((t=>t[r])))):[],a=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map((t=>({[r]:t}))):a.length?a.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),AA=pA(((t,e=TA,n=PA,r=CA,i={})=>{const{data:o,encode:a,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=o,{x:p,y:g}=a,{color:m}=c,{domain:y}=m;return{children:(t,o,a)=>{const{x:c,y:m}=o,{paddingLeft:v,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:M}=c.getOptions(),{domain:E}=m.getOptions(),O=vr(t),k=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),m.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),T=A.map((t=>d.filter(t))),_=f?qn(T,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:M.indexOf(t),columnValue:t,columnValuesLength:M.length,rowField:g,rowIndex:E.indexOf(e),rowValue:e,rowValuesLength:E.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return O.flatMap((t=>{const[e,o,a,s]=k[t],c=P[t],f=T[t];return C[t].map((m=>{var M,E,{scale:O,key:k,facet:S=!0,axis:A={},legend:T={}}=m,P=he(m,["scale","key","facet","axis","legend"]);const C=(null===(M=null==O?void 0:O.y)||void 0===M?void 0:M.guide)||A.y,N=(null===(E=null==O?void 0:O.x)||void 0===E?void 0:E.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:y}},I={x:NA(N,n)(c,j),y:NA(C,r)(c,j)};return Object.assign(Object.assign({key:`${k}-${t}`,data:j,margin:0,x:e+v+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:_,scale:Y(L,O,R),axis:Y({},A,I),legend:!1},P),i)}))}))}}}));function TA(t){const{points:e}=t;return us(e)}function _A(t,e){return e.length?Y({title:!1,tick:null,label:null},t):Y({title:!1,tick:null,label:null,grid:null},t)}function PA(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return _A(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Y({title:s,grid:c},t)}}function CA(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return _A(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Y({title:o,grid:a},t)}}function NA(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const LA=()=>t=>[xA.of(t).call(kA).call(MA).call(EA).call(wA).call(OA).call(SA).call(AA).value()];LA.props={};const jA=dA((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),RA=pA((t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(t,a,s)=>{const{x:c,y:l}=a,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),m=vr(t),y=t.map((({points:t})=>us(t))),v=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=v.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return m.flatMap((t=>{const[n,a,s,c]=y[t],[l,p]=v[t],g=b[t];return x[t].map((m=>{var y,v;const{scale:b,key:x,encode:w,axis:M,interaction:E}=m,O=he(m,["scale","key","encode","axis","interaction"]),k=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,S={x:BA(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:DA(k)(g,e)};return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+h,y:a+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Y({x:{facet:!1},y:{facet:!1}},b),axis:Y({x:{tickCount:5},y:{tickCount:5}},M,S),legend:!1,encode:Y({},w,{x:l,y:p}),interaction:Y({},E,{legendFilter:!1})},O)}))}))}}})),IA=pA((t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=he(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[o].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[o].flat(1).length&&{y:{paddingInner:0}})})}));function BA(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return _A(t,n)}}function DA(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return _A(t,n)}}const FA=()=>t=>[xA.of(t).call(kA).call(MA).call(RA).call(IA).call(EA).call(OA).call(jA).value()],zA=dA((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),GA=dA((t=>({coordinate:{type:"polar"}}))),WA=t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function $A(t){return t=>null}function HA(t){const{points:e}=t,[n,r,i,o]=e,a=as(n,o),s=is(n,o),c=ls(s,is(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=cs(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d+g*Math.cos(p)-f/2,f,f]}const VA=()=>t=>[xA.of(t).call(kA).call(WA).call(MA).call(GA).call(SA).call(AA,HA,$A,$A,{frame:!1}).call(EA).call(OA).call(zA).value()];function YA(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const qA=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=Y({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=YA(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function UA(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function XA(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function KA(t,e,n,r=(t=>!0)){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=XA(o,(t=>"element"===t.className));const c=function(t){return XA(t,(t=>"component"===t.className))}(o),l=s||c;if(!l)return;const{className:u,markType:f}=l;if("element"===u){const r=Object.assign(Object.assign({},i),{nativeEvent:!0,data:{data:UA(l,e)}});n.emit(`element:${t}`,r),n.emit(`${f}:${t}`,r)}else{const e=Object.assign(Object.assign({},i),{nativeEvent:!0});n.emit(`component:${t}`,e),n.emit(`${a}:${t}`,e)}}}function ZA(){return(t,e,n)=>{const{container:r,view:i}=t,o=KA(lS.CLICK,i,n,(t=>1===t.detail)),a=KA(lS.DBLCLICK,i,n,(t=>2===t.detail)),s=KA(lS.POINTER_TAP,i,n),c=KA(lS.POINTER_DOWN,i,n),l=KA(lS.POINTER_UP,i,n),u=KA(lS.POINTER_OVER,i,n),f=KA(lS.POINTER_OUT,i,n),h=KA(lS.POINTER_MOVE,i,n),d=KA(lS.POINTER_ENTER,i,n),p=KA(lS.POINTER_LEAVE,i,n),g=KA(lS.POINTER_UPOUTSIDE,i,n),m=KA(lS.DRAG_START,i,n),y=KA(lS.DRAG,i,n),v=KA(lS.DRAG_END,i,n),b=KA(lS.DRAG_ENTER,i,n),x=KA(lS.DRAG_LEAVE,i,n),w=KA(lS.DRAG_OVER,i,n),M=KA(lS.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",m),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function QA(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":aO,"component.axisLinear":eO,"component.axisArc":nO,"component.legendContinuousBlock":mO,"component.legendContinuousBlockSize":vO,"component.legendContinuousSize":yO,"interaction.event":ZA,"composition.mark":bA,"composition.view":vA,"shape.label.label":Mw}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||ar(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=he(t,["type"]);return r(n)(i,e)},r]}function JA(t){const{canvas:e,group:n}=t;return n?n.ownerDocument:e.document}function tT(t,e){const{coordinate:n={}}=t,r=he(t,["coordinate"]),{type:i,transform:o=[]}=n,a=he(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=QA("coordinate",e),{transform:c=!1}=s(i).props||{};if(c)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function eT(t,e){return t.filter((t=>t.type===e))}function nT(t){return eT(t,"polar").length>0}function rT(t){return eT(t,"transpose").length%2==1}function iT(t){return eT(t,"theta").length>0}function oT(t){return eT(t,"radial").length>0}function aT(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}qA.props={};var sT=aT("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),cT=aT("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),lT=aT("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),uT=aT("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),fT=aT("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),hT=aT("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),dT=aT("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),pT=aT("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),gT=aT("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),mT=aT("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function yT(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function vT(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function bT(){}var xT=.7,wT=1/xT,MT="\\s*([+-]?\\d+)\\s*",ET="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",OT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kT=/^#([0-9a-f]{3,8})$/,ST=new RegExp(`^rgb\\(${MT},${MT},${MT}\\)$`),AT=new RegExp(`^rgb\\(${OT},${OT},${OT}\\)$`),TT=new RegExp(`^rgba\\(${MT},${MT},${MT},${ET}\\)$`),_T=new RegExp(`^rgba\\(${OT},${OT},${OT},${ET}\\)$`),PT=new RegExp(`^hsl\\(${ET},${OT},${OT}\\)$`),CT=new RegExp(`^hsla\\(${ET},${OT},${OT},${ET}\\)$`),NT={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 LT(){return this.rgb().formatHex()}function jT(){return this.rgb().formatRgb()}function RT(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=kT.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?IT(e):3===n?new zT(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?BT(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?BT(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=ST.exec(t))?new zT(e[1],e[2],e[3],1):(e=AT.exec(t))?new zT(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=TT.exec(t))?BT(e[1],e[2],e[3],e[4]):(e=_T.exec(t))?BT(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=PT.exec(t))?YT(e[1],e[2]/100,e[3]/100,1):(e=CT.exec(t))?YT(e[1],e[2]/100,e[3]/100,e[4]):NT.hasOwnProperty(t)?IT(NT[t]):"transparent"===t?new zT(NaN,NaN,NaN,0):null}function IT(t){return new zT(t>>16&255,t>>8&255,255&t,1)}function BT(t,e,n,r){return r<=0&&(t=e=n=NaN),new zT(t,e,n,r)}function DT(t){return t instanceof bT||(t=RT(t)),t?new zT((t=t.rgb()).r,t.g,t.b,t.opacity):new zT}function FT(t,e,n,r){return 1===arguments.length?DT(t):new zT(t,e,n,null==r?1:r)}function zT(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function GT(){return`#${VT(this.r)}${VT(this.g)}${VT(this.b)}`}function WT(){const t=$T(this.opacity);return`${1===t?"rgb(":"rgba("}${HT(this.r)}, ${HT(this.g)}, ${HT(this.b)}${1===t?")":`, ${t})`}`}function $T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function HT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function VT(t){return((t=HT(t))<16?"0":"")+t.toString(16)}function YT(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new UT(t,e,n,r)}function qT(t){if(t instanceof UT)return new UT(t.h,t.s,t.l,t.opacity);if(t instanceof bT||(t=RT(t)),!t)return new UT;if(t instanceof UT)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,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new UT(a,s,c,t.opacity)}function UT(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function XT(t){return(t=(t||0)%360)<0?t+360:t}function KT(t){return Math.max(0,Math.min(1,t||0))}function ZT(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}yT(bT,RT,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:LT,formatHex:LT,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return qT(this).formatHsl()},formatRgb:jT,toString:jT}),yT(zT,FT,vT(bT,{brighter(t){return t=null==t?wT:Math.pow(wT,t),new zT(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?xT:Math.pow(xT,t),new zT(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zT(HT(this.r),HT(this.g),HT(this.b),$T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:GT,formatHex:GT,formatHex8:function(){return`#${VT(this.r)}${VT(this.g)}${VT(this.b)}${VT(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:WT,toString:WT})),yT(UT,(function(t,e,n,r){return 1===arguments.length?qT(t):new UT(t,e,n,null==r?1:r)}),vT(bT,{brighter(t){return t=null==t?wT:Math.pow(wT,t),new UT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?xT:Math.pow(xT,t),new UT(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new zT(ZT(t>=240?t-240:t+120,i,r),ZT(t,i,r),ZT(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new UT(XT(this.h),KT(this.s),KT(this.l),$T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=$T(this.opacity);return`${1===t?"hsl(":"hsla("}${XT(this.h)}, ${100*KT(this.s)}%, ${100*KT(this.l)}%${1===t?")":`, ${t})`}`}}));const QT=Math.PI/180,JT=180/Math.PI;var t_=-.14861,e_=1.78277,n_=-.29227,r_=-.90649,i_=1.97294,o_=i_*r_,a_=i_*e_,s_=e_*n_-r_*t_;function c_(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof l_)return new l_(t.h,t.s,t.l,t.opacity);t instanceof zT||(t=DT(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(s_*r+o_*e-a_*n)/(s_+o_-a_),o=r-i,a=(i_*(n-i)-n_*o)/r_,s=Math.sqrt(a*a+o*o)/(i_*i*(1-i)),c=s?Math.atan2(a,o)*JT-120:NaN;return new l_(c<0?c+360:c,s,i,t.opacity)}(t):new l_(t,e,n,null==r?1:r)}function l_(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}yT(l_,c_,vT(bT,{brighter(t){return t=null==t?wT:Math.pow(wT,t),new l_(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?xT:Math.pow(xT,t),new l_(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*QT,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new zT(255*(e+n*(t_*r+e_*i)),255*(e+n*(n_*r+r_*i)),255*(e+n*(i_*r)),this.opacity)}}));var u_=t=>()=>t;function f_(t,e){return function(n){return t+n*e}}function h_(t){return 1==(t=+t)?d_:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):u_(isNaN(e)?n:e)}}function d_(t,e){var n=e-t;return n?f_(t,n):u_(isNaN(t)?e:t)}!function t(e){var n=h_(e);function r(t,e){var r=n((t=FT(t)).r,(e=FT(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=d_(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var p_,g_=(p_=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=FT(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=p_(i),o=p_(o),a=p_(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function m_(t){return function e(n){function r(e,r){var i=t((e=c_(e)).h,(r=c_(r)).h),o=d_(e.s,r.s),a=d_(e.l,r.l),s=d_(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}m_((function(t,e){var n=e-t;return n?f_(t,n>180||n<-180?n-360*Math.round(n/360):n):u_(isNaN(t)?e:t)}));var y_=m_(d_),v_=t=>g_(t[t.length-1]),b_=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(aT),x_=v_(b_),w_=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(aT),M_=v_(w_),E_=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(aT),O_=v_(E_),k_=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(aT),S_=v_(k_),A_=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(aT),T_=v_(A_),__=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(aT),P_=v_(__),C_=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(aT),N_=v_(C_),L_=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(aT),j_=v_(L_),R_=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(aT),I_=v_(R_),B_=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(aT),D_=v_(B_),F_=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(aT),z_=v_(F_),G_=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(aT),W_=v_(G_),$_=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(aT),H_=v_($_),V_=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(aT),Y_=v_(V_),q_=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(aT),U_=v_(q_),X_=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(aT),K_=v_(X_),Z_=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(aT),Q_=v_(Z_),J_=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(aT),tP=v_(J_),eP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(aT),nP=v_(eP),rP=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(aT),iP=v_(rP),oP=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(aT),aP=v_(oP),sP=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(aT),cP=v_(sP),lP=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(aT),uP=v_(lP),fP=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(aT),hP=v_(fP),dP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(aT),pP=v_(dP),gP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(aT),mP=v_(gP),yP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(aT),vP=v_(yP);var bP=y_(c_(300,.5,0),c_(-240,.5,1)),xP=y_(c_(-100,.75,.35),c_(80,1.5,.8)),wP=y_(c_(260,.75,.35),c_(80,1.5,.8)),MP=c_();var EP=FT(),OP=Math.PI/3,kP=2*Math.PI/3;function SP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var AP=SP(aT("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),TP=SP(aT("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),_P=SP(aT("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),PP=SP(aT("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),CP=Object.freeze({__proto__:null,schemeCategory10:sT,schemeAccent:cT,schemeDark2:lT,schemePaired:uT,schemePastel1:fT,schemePastel2:hT,schemeSet1:dT,schemeSet2:pT,schemeSet3:gT,schemeTableau10:mT,interpolateBrBG:x_,schemeBrBG:b_,interpolatePRGn:M_,schemePRGn:w_,interpolatePiYG:O_,schemePiYG:E_,interpolatePuOr:S_,schemePuOr:k_,interpolateRdBu:T_,schemeRdBu:A_,interpolateRdGy:P_,schemeRdGy:__,interpolateRdYlBu:N_,schemeRdYlBu:C_,interpolateRdYlGn:j_,schemeRdYlGn:L_,interpolateSpectral:I_,schemeSpectral:R_,interpolateBuGn:D_,schemeBuGn:B_,interpolateBuPu:z_,schemeBuPu:F_,interpolateGnBu:W_,schemeGnBu:G_,interpolateOrRd:H_,schemeOrRd:$_,interpolatePuBuGn:Y_,schemePuBuGn:V_,interpolatePuBu:U_,schemePuBu:q_,interpolatePuRd:K_,schemePuRd:X_,interpolateRdPu:Q_,schemeRdPu:Z_,interpolateYlGnBu:tP,schemeYlGnBu:J_,interpolateYlGn:nP,schemeYlGn:eP,interpolateYlOrBr:iP,schemeYlOrBr:rP,interpolateYlOrRd:aP,schemeYlOrRd:oP,interpolateBlues:cP,schemeBlues:sP,interpolateGreens:uP,schemeGreens:lP,interpolateGreys:hP,schemeGreys:fP,interpolatePurples:pP,schemePurples:dP,interpolateReds:mP,schemeReds:gP,interpolateOranges:vP,schemeOranges:yP,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:bP,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return MP.h=360*t-100,MP.s=1.5-1.5*e,MP.l=.8-.9*e,MP+""},interpolateWarm:xP,interpolateCool:wP,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,EP.r=255*(e=Math.sin(t))*e,EP.g=255*(e=Math.sin(t+OP))*e,EP.b=255*(e=Math.sin(t+kP))*e,EP+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:AP,interpolateMagma:TP,interpolateInferno:_P,interpolatePlasma:PP});function NP(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return XP(t,pr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return $P(t,s);if(void 0!==i)return qP([i])?$P(t,s):UP(e)?"time":HP(t,o,a);return qP(e)?$P(t,s):UP(e)?"time":HP(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return VP(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)cr(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return YP(n);case"quantile":return function(t){return YP(t).sort()}(n);case"sequential":return VP(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)cr(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(FP({type:t}))return function(t,e,n){const r=t.map(Number),i=new Zo({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return zP({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=xo,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?iT(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=B(e),i=CP[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:GP(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function LP(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>o.map(t)))}}return n}function jP(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e,key:i}=r.getOptions();if("string"==typeof i)i in t||(t[i]=r);else if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),o=qn(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function RP(t,e){const[n]=QA("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[rr,rr];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter((([t])=>"function"==typeof t)),a=t.filter((([t])=>"function"!=typeof t)),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(a.map((([t,e])=>[e,t]))),l=new Map(o.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function IP(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));DP(e,"x"),DP(e,"y")}function BP(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function DP(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(FP)?kn(r):n.every(zP)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function FP(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function zP(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function GP(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=WP(n,r,i,o,a),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[br(e),xr(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[c||s,l||u]}case"band":case"point":return[c||("size"===e?5:0),l||("size"===e?10:1)];case"ordinal":return WP(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function WP(t,e,n,r,i){const[o]=QA("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(t.flat()).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const r=B(t),i=CP[`scheme${r}`],o=CP[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>o(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function $P(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function HP(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function VP(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function YP(t){return Array.from(new Set(t.flat()))}function qP(t){return XP(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function UP(t){return XP(t,(t=>t instanceof Date))}function XP(t,e){for(const n of t)if(n.some(e))return!0;return!1}const KP={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},ZP={threshold:"threshold",quantize:"quantize",quantile:"quantile"},QP={ordinal:"ordinal",band:"band",point:"point"},JP={constant:"constant"};function tC(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=QA("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=QA("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?rT(n)?`${e}Y`:`${e}X`:"y"===t?rT(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t)));return[...rC(n),...oC(n,e)]}(a,r);return l.forEach((([t,e])=>{const{props:n}=o(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=Y({},...e),{guide:m,field:y}=g,v=Array.isArray(m)?m:[m];for(const n of v){const[o,g]=cC(t,i,l,n,e,a,r);if(!o&&!g)continue;const m="left"===o||"right"===o,v=m?d[1]:d[0],b=m?p[1]:p[0],{size:x,order:w=f,length:M=h,padding:E=v,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:M,position:o,plane:c,orientation:g,padding:E,order:w,crossPadding:O,size:x,type:t,scales:e}))}})),s}function eC(t,e,n,r,i){const[o]=QA("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(he(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function nC(t,e){const n=["left","right","bottom","top"],r=Cn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=nr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=qn(t,(t=>t.size)),r=qn(t,(t=>t.order)),i=qn(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function rC(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),o=Cn(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),a=new Map(o);if(0===a.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(a).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...Mr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,iC(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of uS)for(const{option:r,combination:i}of n)if(e.some((t=>U(s(t),s(r)))))return[t,i];return null})).filter(cr);return c}function iC(t){const{type:e}=t;return"string"!=typeof e?null:e in KP?"continuous":e in QP?"discrete":e in ZP?"distribution":e in JP?"constant":null}function oC(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return eT(t,"helix").length>0}(e)||iT(e))return null;if(rT(e)&&(nT(e)||oT(e)))return null;if(n.startsWith("x"))return nT(e)?["axisArc",[t]]:oT(e)?["axisLinear",[t]]:[rT(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return nT(e)?["axisLinear",[t]]:oT(e)?["axisArc",[t]]:[rT(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return eT(t,"radar").length>0}(e))return["axisRadar",[t]];if(!nT(e))return["axisY",[t]]}return null})).filter(cr)}function aC(t){const e=eT(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=eT(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=a(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function sC(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=aC(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return eT(t,"parallel").length>0}(i))return rT(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=aC(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:nT(i)||oT(i)?["center",null]:"axisX"===t&&function(t){return eT(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return eT(t,"reflectY").length>0}(i)?["top",null]:e}function cC(t,e,n,r,i,o,a){const[s]=aC(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?sC(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&nT(a)&&"center"===r.position?["center","vertical"]:c}function lC(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?pC:s.startsWith("group")?uC:s.startsWith("legendContinuous")?gC:"legendCategory"===s?mC:s.startsWith("slider")?dC:"title"===s?hC:s.startsWith("scrollbar")?fC:()=>{})(t,e,n,r,i,o)}function uC(t,e,n,r,i,o){const{children:a}=t,s=qn(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>lC(t,e,n,r,i,o)));const c=qn(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function fC(t,e,n,r,i,o){const{trackSize:a=6}=Y({},i.scrollbar,t);t.size=a}function hC(t,e,n,r,i,o){const a=Y({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=he(a,["title","subtitle","spacing"]);if(s){const e=MC(s,ur(u,"title"));t.size=e.height}if(c){const e=MC(c,ur(u,"subtitle"));t.size+=l+e.height}}function dC(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return Y({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function pC(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=xC(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0}=s,f=he(s,["tickLength","labelSpacing","titleSpacing"]),h=yC(t,o),d=vC(f,h),p=c+l;if(d&&d.length){const r=qn(d,(t=>t.width)),i=qn(d,(t=>t.height));if(a)t.size=r+p;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=nr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=wC(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const o=c[t+1];if(o){const[n]=h(o,e[t+1]);if(i>n)return!0}}return!1}(h,d,e,n,o)||a?t.size=i+p:(t.labelTransform="rotate(90)",t.size=r+p)}}else t.size=c;const g=bC(f);g&&(t.size+=a?u+g.width:u+g.height)}function gC(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return Y({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=he(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=ur(l,"ribbon"),{size:h}=f,d=ur(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const m=vC(l,yC(t,o));if(m){const e=u?"width":"height",n=qn(m,(t=>t[e]));t.size+=n+s}const y=bC(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function mC(t,e,n,r,i,o){const a=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,o]=Array.isArray(n)?[n,void 0]:[void 0,n];return Y({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=a,p=he(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:m}=t,y=t=>Math.min(t,d),v=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===m?e+(b?0:n[0]+n[1]):m,w=bC(p),M=vC(p,yC(t,o),"itemLabel"),E=Math.max(M[0].height,c)+u,O=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of M){const s=O(t);e=Math.max(e,s),n+E>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=E):(n+=E,i++)}r<=1&&(o=i,a=n),t.size=e*v(r),t.length=a+s,Y(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(M.length/g),n=qn(M,(t=>O(t.width)))*g;t.size=E*y(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of M){const i=O(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function yC(t,e){const[n]=QA("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(a.tickCount=i),void 0!==o&&(a.tickMethod=o),n(a)}function vC(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=he(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=wC(t,n),i=r.map((t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e})),o=e?"string"==typeof e?jE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=ur(a,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>MC(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function bC(t){const{title:e}=t,n=he(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=ur(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return MC(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function xC(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${or(e)}`]:s}=n;return Y({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function wC(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function MC(t,e){const n=function(t){return t instanceof op?t:new vp({style:{text:`${t}`}})}(t),r=he(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function EC(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:m=h,margin:y=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:v=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:M=n.padding,paddingBottom:E=M,paddingLeft:O=M,paddingRight:k=M,paddingTop:S=M}=function(t,e,n,r){const{coordinates:i}=e;if(!nT(i)&&!oT(i))return e;const o=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===o.length)return e;const a=o.map((t=>xC(t,"axisArc"===t.type?"arc":"linear",n))),s=qn(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>vC(a[e],yC(t,r)))).filter(cr),l=qn(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>bC(a[e]))).filter((t=>null!==t)),f=0===u.length?0:qn(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:m=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:m})}(t,e,n,r),A=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},T=t=>"auto"===t?20:null!=t?t:20,_=T(S),P=T(E),C=OC(t,s-_-P,[_+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-v-w,[R,I]=A(j,O,k,N,L),B=j-R-I,D=OC(t,B,[R+v,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=D,G=s-b-x,[W,$]=A(G,E,S,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:m,innerWidth:B,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:v,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function OC(t,e,n,r,i,o,a){const s=Pn(t,(t=>t.position)),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${or(cw(t))}`;or(cw(t));const i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=qn(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(lC(r,e,n,t,o,a),l(r)))},h="bottom"===t||"top"===t,p=Xn(i,(t=>t.order)),g=i.filter((t=>t.type.startsWith("axis")&&t.order==p));if(g.length&&(g[0].crossPadding=0),"number"==typeof c)i.forEach(l);else if(0===i.length)d[r]=0;else{const t=nC(i,h?e+n[0]+n[1]:e);t.forEach(f);const o=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);d[r]=o}}return d}function kC({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const m=n+a,y=i+s,v=r+l,b=o+c,x=t-a-l,w=[m+d,y+g,f-d-p,u-g-h,"center",null,null];return{top:[m,0,f,y,"vertical",!0,dn,a,x],right:[t-v,y,v,u,"horizontal",!1,dn],bottom:[m,e-b,f,b,"vertical",!1,dn,a,x],left:[0,y,m,u,"horizontal",!0,dn],"top-left":[m,0,f,y,"vertical",!0,dn],"top-right":[m,0,f,y,"vertical",!0,dn],"bottom-left":[m,e-b,f,b,"vertical",!1,dn],"bottom-right":[m,e-b,f,b,"vertical",!1,dn],center:w,inner:w,outer:w}}function SC(t,e,n,r){const[i,o]=wr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return kc(t)&&Mc(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Mc(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):kc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=Tc(e),l=c*(o/2),u=a-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=Tc(e),c=a/2*s/Math.sqrt(2),l=r+o/2,u=i+a/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(o,e,n)}function AC(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,m,y,v,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,M=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+y:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:o}=r,{size:a}=r;r.bbox={[h]:c?n-a-i:n+i,[p]:M(o,g,u),[m]:a,[v]:w(o,b,f)},n+=(a+i)*(c?-1:1)}const E=t.filter((t=>"group"===t.type));for(const t of E){const{bbox:e,children:n}=t,r=e[v],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-nr(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[m]:e[m],[h]:e[h],[p]:r,[v]:a[t]-c},Y(i,{layout:{justifyContent:o}}),r+=a[t]}}}function TC(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=he(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function _C(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=QA("data",t),o=function(t){if(_(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=he(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[he(o,["transform"]),...a].map(i),c=yield function(t){return t.reduce(((t,e)=>n=>pe(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),rr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?vr(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function PC(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function CC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=yr(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return cr(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:o})]}function NC(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=yr(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function LC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=QA("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:zC(n)})}(o),s=yr(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function jC(t,e,n){const{tooltip:r={}}=e;return gr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:pr(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function RC(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(gr(o))return[t,e];const a=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(pr(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?jE(c):c,u=o&&i[o],f=u&&i[o].field,h=s||f||o,d=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;d[e]={name:h,color:a,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);pr(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=he(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(c)?c.map(a):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function IC(t,e,n){const{encode:r}=e,i=he(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,o=he(n,["value"]);for(let n=0;n<i.length;n++){const o=i[n];if(Array.isArray(o))for(let i=0;i<o.length;i++){const a=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];a[1][n]=o[i],r[i]=a}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},o)]))})),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function BC(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return Y(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(a,t);return[t,Object.assign({guide:s(r,t),slider:s(o,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function DC(t,e,n){const{animate:r}=e;return r||void 0===r||Y(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function FC(t,e,n){return pe(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:r}=n,[i]=QA("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[TC,_C,PC,CC,NC,LC,IC,DC,BC,jC,...o.map(i),...s.map(i),...a.map(i),RC];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,r),{encode:a,scale:s,data:c,tooltip:l}=o;if(!1===Array.isArray(c))return null;const{channels:u}=e,f=Ln(Object.entries(a).filter((([,t])=>cr(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=u.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),h=u.filter((t=>{const{name:e,required:n}=t;if(f.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:a}=t;return f.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=s[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=he(f,["independent","key","type"]),m="constant"===p,y=m?void 0:i;return{name:t,values:e,scaleKey:h||m?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:y},g),{quantitative:o,ordinal:a})}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:h,tooltip:l})]}))}function zC(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function GC(t,e,n,r){var i,o;return pe(this,void 0,void 0,(function*(){const[a]=QA("composition",n),[s]=QA("interaction",n),c=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),l=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),u=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:c.has(e)||l.has(e)?"mark":e},f=t=>"mark"===u(t),h=t=>"standardView"===u(t),d=t=>{const{type:e}=t;return"string"==typeof e&&!!l.has(e)},p=t=>{if(h(t))return[t];const e=u(t);return a({type:e,static:d(t)})(t)},g=[],m=new Map,y=new Map,v=[t],b=[];for(;v.length;){const t=v.shift();if(h(t)){const e=y.get(t),[r,i]=e?YC(e,t,n):yield $C(t,n);m.set(r,t),g.push(r);const o=i.flatMap(p).map((t=>tT(t,n)));if(v.push(...o),o.every(h)){const t=yield Promise.all(o.map((t=>HC(t,n))));IP(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];y.set(n,r)}}}else{const e=p(f(t)?t:yield sN(t,n));Array.isArray(e)?v.push(...e):"function"==typeof e&&b.push(e())}}r.emitter.emit(lS.BEFORE_PAINT);const x=new Map,w=new Map,M=[];e.selectAll(fN(ak)).data(g,(t=>t.key)).join((t=>t.append("g").attr("className",ak).attr("id",(t=>t.key)).call(WC).each((function(t,e,i){qC(t,Dg(i),M,n,r),x.set(t,i)}))),(t=>t.call(WC).each((function(t,e,i){qC(t,Dg(i),M,n,r),w.set(t,i)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const E=t=>Array.from(t.entries()).map((([t,e])=>{const i=new Map,o=function(t,e,n){return r=>pe(this,void 0,void 0,(function*(){const i=[],[o,a]=yield $C(r,e);qC(o,t,i,e,n),function(t,e,n,r,i){var o;const[a]=QA("interaction",r),s=t.node(),c=s.nameInteraction,l=aN(e).find((([t])=>"tooltip"===t)),u=c.get("tooltip");if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=VC(n,"tooltip",l[1],a),h={options:e,view:n,container:t.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set("tooltip",{destroy:d})}(t,r,o,e,n);for(const r of a)GC(r,t,e,n);return{options:r,view:o}}))}(Dg(e),n,r),a=m.get(t);return{view:t,container:e,options:a,setState:(t,e=(t=>t))=>i.set(t,e),update:()=>pe(this,void 0,void 0,(function*(){const t=ir(Array.from(i.values()))(a);return yield o(t)}))}})),O=E(x);for(const t of O){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of aN(e)){const[e,o]=i;if(o){const i=VC(t.view,e,o,s)(t,O,r.emitter);n.set(e,{destroy:i})}}}const k=E(w);for(const t of k){const{options:e,container:n}=t,o=n.nameInteraction;for(const n of aN(e)){const[e,a]=n,c=o.get(e);if(c&&(null===(i=c.destroy)||void 0===i||i.call(c)),a){const n=VC(t.view,e,a,s)(t,k,r.emitter);o.set(e,{destroy:n})}}}const{width:S,height:A}=t,T=[];for(const t of b){const i=new Promise((i=>pe(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:S,height:A},i);yield GC(t,e,n,r)}i()}))));T.push(i)}r.views=g,null===(o=r.animations)||void 0===o||o.forEach((t=>null==t?void 0:t.cancel())),r.animations=M,r.emitter.emit(lS.AFTER_PAINT);const _=M.filter(cr).map(nN).map((t=>t.finished));return Promise.all([..._,...T])}))}function WC(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function $C(t,e){return pe(this,void 0,void 0,(function*(){const n=yield function(t,e){return pe(this,void 0,void 0,(function*(){const[n,r]=QA("mark",e),i=new Set(Object.keys(e).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),{marks:o}=t,a=[],s=[],c=[...o],{width:l,height:u}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:m=d,insetBottom:y=d}=t,v=t=>"auto"===t?20:t;return{width:n-v(i)-v(o)-l-u-p-g,height:e-v(a)-v(s)-f-h-m-y}}(t),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield sN(t,e),{type:l=ar("G2Mark type is required."),key:u}=o;if(i.has(l))s.push(o);else{const{props:t={}}=r(l),{composite:e=!0}=t;if(e){const{data:t}=o,e=Object.assign(Object.assign({},o),{data:t?Array.isArray(t)?t:t.value:t}),r=yield n(e,f),i=Array.isArray(r)?r:[r];c.unshift(...i.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else a.push(o)}}return Object.assign(Object.assign({},t),{marks:a,components:s})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=he(t,["coordinate","interaction","style","marks"]),a=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...a,e].reduceRight(((t,e)=>Y(t,e)),{}),u=[n,...s].reduce(((t,e)=>Y(t,e)),{}),f=[...c,r].reduce(((t,e)=>Y(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=tT(r,e);return YC(yield HC(i,e),i,e)}))}function HC(t,e){return pe(this,void 0,void 0,(function*(){const[n]=QA("theme",e),[,r]=QA("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(oN(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield FC(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=Pn(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>Y(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(cr))),c=Y({guide:{title:0===o.length?void 0:o},field:o[0]},n),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},NP(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function VC(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Y(o,Object.assign({type:e},n)))}function YC(t,e,n){const[r]=QA("mark",n),[i]=QA("theme",n),[o]=QA("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,h=i(oN(c)),d=Array.from(t.values()),p=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),a=new Map(o.map((t=>[t.name,t])));for(const t of r){const e=BP(t);for(const r of e){const e=a.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=Y({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:K(t,i)});o.push(e)}}}return o}(d,e),g=function(t){return t.map((t=>{const e=Y(t,t.style);return delete e.style,e}))}(tC(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(p),d,t),e,n)),m=EC(g,e,h,n),y=function(t,e,n){const[r]=QA("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-c,height:i-l-s,transformations:f.flatMap(r)});return d?new hA(p):new cA(p)}(m,e,n),v=s?Y({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=Pn(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y,height:v,width:b,depth:x}=n,w={xy:kC({width:b,height:v,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y}),yz:kC({width:x,height:v,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:v,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:kC({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=wr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&SC(a,e,o,i),s.length&&AC(n,0,o)}}(nC(g),y,m),function(t){const e=t.find((({type:t})=>"axisZ"===t));if(e){const n=t.find((({type:t})=>"axisX"===t));n.plane="xy";const r=t.find((({type:t})=>"axisY"===t));r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]}))}}(g);const b={};for(const t of g){const{scales:e=[]}=t,r=[];for(const t of e){const{name:e}=t,i=RP(t,n);r.push(i),jP(b,{[e]:i})}t.scaleInstances=r}const x=[];for(const[e,i]of t.entries()){const{children:t,dataDomain:o,modifier:s,key:c}=e,{index:l,channels:u,tooltip:f}=i,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=yr(h,(t=>RP(t,n)));jP(b,d);const p=LP(u,d),g=r(e),[v,w,M]=UC(g(l,d,p,y)),E=o||v.length,O=s?s(w,E,m):[],k=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},S=t=>f.items.map((e=>e[t])),A=v.map(((t,e)=>{const n=Object.assign({points:w[e],transform:O[e],index:t,markKey:c,viewKey:a},f&&{title:k(t),items:S(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],M&&(n[`series${B(r)}`]=M[e].map((t=>i[t])));return M&&(n.seriesIndex=M[e]),M&&f&&(n.seriesItems=M[e].map((t=>S(t))),n.seriesTitle=M[e].map((t=>k(t)))),n}));i.data=A,i.index=v;const T=null==t?void 0:t(A,d,m);x.push(...T||[])}return[{layout:m,theme:h,coordinate:y,markState:t,key:a,clip:l,scale:b,style:v,components:g,labelTransform:ir(f.map(o))},x]}function qC(t,e,n,r,i){return pe(this,void 0,void 0,(function*(){const{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:m,height:y}=s,v=he(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>fr(Object.assign({},a.view,f),t))),M=["a","margin","padding","inset"].map((t=>ur(v,t))),E=t=>t.style("x",(t=>T[t].x)).style("y",(t=>T[t].y)).style("width",(t=>T[t].width)).style("height",(t=>T[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Dg(n),w[t])}));let O=0,k=0,S=m,A=y;const T=x.map((t=>{const e=M[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return O+=n,k+=r,S-=n+o,A-=r+i,{x:O,y:k,width:S,height:A}}));e.selectAll(fN(uk)).data(x.filter((t=>cr(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",uk).style("zIndex",-2).call(E)),(t=>t.call(E)),(t=>t.remove()));const _=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:m=300,delay:y=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:v=m,exitDelay:b=y,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,v+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!_&&{duration:_[1]};for(const[,t]of Cn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(fN(ck)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",ck).append((t=>eC(Y({animate:P,scale:d},t),l,a,r,c)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=eC(Y({animate:P,scale:d},t),l,a,r,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s)})))).transitions();n.push(...C.flat().filter(cr));const N=e.selectAll(fN(sk)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",sk).call(cN).call(uN,Array.from(c.keys())).call(hN,h)),(t=>t.call(uN,Array.from(c.keys())).call((t=>_?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{x:o,y:a,width:s,height:c}=i.style,{paddingLeft:l,paddingTop:u,innerWidth:f,innerHeight:h,marginLeft:d,marginTop:p}=t,g=[{x:o,y:a,width:s,height:c},{x:l+d,y:u+p,width:f,height:h}];return i.animate(g,{delay:n,duration:r,fill:"both"})}))}(t,_):cN(t))).call(hN,h))).transitions();n.push(...N.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=QC(o,a,t,r,i),d=eN(o,a,t,r),p=rN(o,a,t,r),g=iN(o,a,t,r),m=KC(e,f,l,"element"),y=f.selectAll(fN(ok)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",ok).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=lr((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){ZC(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?sr(i,o):(i.parentNode.replaceChild(o,i),o.className=ok,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",ok)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(h).attr("className",ok).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Fg(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new Fg([],n.__toData__,n.parentNode).append(h).attr("className",ok).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=QA("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(fN(ik)).node(),l=new Map,u=new Map,f=Array.from(a.entries()).flatMap((([n,o])=>{const{labels:a=[],key:s}=n,c=function(t,e,n,r,i){const[o]=QA("shape",r),{data:a}=t,{data:s,defaultLabelShape:c}=e,l=s.map((t=>t.points)),{theme:u,coordinate:f}=n,h=Object.assign(Object.assign({},i),{document:JA(i),theme:u,coordinate:f});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=(t=>`${t}`),transform:s,style:f,render:d}=t,p=he(t,["formatter","transform","style","render"]),g=yr(Object.assign(Object.assign({},p),f),(t=>XC(t,r,e,a))),{shape:m=c,text:y}=g,v=he(g,["shape","text"]),b="string"==typeof i?jE(i):i,x=Object.assign(Object.assign({},v),{text:b(y,r,e,a),datum:r}),w=Object.assign({type:`label.${m}`,render:d},v);return o(w,h)(n,x,JC(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(fN(ok)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=he(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,c),u.set(e,t)})),i}))}))})),h=Dg(c).selectAll(fN(lk)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",lk)),(t=>t.each((function(t,e,n){sr(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Pn(h,(t=>u.get(t.__data__))),{coordinate:p}=t;for(const[t,e]of d){const{transform:n=[]}=t;ir(n.map(o))(e,p)}s&&s(h,p)}(t,e,0,r,i)}))}function UC([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const o=t[n],a=e[n];a.every((([t,e])=>cr(t)&&cr(e)))&&(r.push(o),i.push(a))}return[r,i]}function XC(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function KC(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function ZC(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-c})`),e.append(t)}function QC(t,e,n,r,i){const[o]=QA("shape",r),{data:a}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:h}=n,{type:d,style:p={}}=t,g=Object.assign(Object.assign({},i),{document:JA(i),coordinate:h,theme:f});return e=>{const{shape:n=s}=p,{shape:r=n,points:i,seriesIndex:c,index:h}=e,m=he(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},m),{index:h}),v=c?c.map((t=>a[t])):a[h],b=c||h,x=yr(p,(t=>XC(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:lN(t,r)}),g))(i,y,JC(f,d,r,s),u)}}function JC(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function tN(t,e,n,r,i){var o,a;const[,s]=QA("shape",i),[c]=QA("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${B(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(lN(e,l)).props,{[t]:g={}}=f,m=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},y={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},m);if(!l.type)return null;const u=c(l,y)(n,r,Y(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function eN(t,e,n,r){return tN("enter",t,e,n,r)}function nN(t){return t.finished.then((()=>{t.cancel()})),t}function rN(t,e,n,r){return tN("update",t,e,n,r)}function iN(t,e,n,r){return tN("exit",t,e,n,r)}function oN(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=he(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function aN(t){const{interaction:e={}}=t;return Object.entries(Y({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e))}function sN(t,e){return pe(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=he(t,["data"]);if(null==r)return t;const[,{data:o}]=yield _C(0,{data:r},n);return Object.assign({data:o},i)}))}function cN(t){t.style("x",(t=>t.paddingLeft+t.marginLeft)).style("y",(t=>t.paddingTop+t.marginTop)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function lN(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function uN(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(fN(rk)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",rk).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(fN(ik)).node()||t.append("g").attr("className",ik).style("zIndex",0)}function fN(...t){return t.map((t=>`.${t}`)).join("")}function hN(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new yp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function dN(t){const e=Y({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o<e.length;o++){const a=Y({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function pN(t,e){const n=new iS;return n.registerPlugin(new aS),new Cp({width:t,height:e,container:document.createElement("div"),renderer:n})}function gN(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=dN(t),{canvas:c=pN(i,o),emitter:l=new cS,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===o||c.resize(i,o),l.emit(lS.BEFORE_RENDER);const d=Dg(c.document.documentElement);return c.ready.then((()=>GC(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),d,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(lS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function mN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${ak}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const yN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function vN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:yN[e]}function bN(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>bN(t,e,n,r)))}function xN(t){bN(t,"visibility","hidden",!0)}function wN(t){bN(t,"visibility","visible",!0)}function MN(t){return Dg(t).selectAll(`.${ok}`).nodes().filter((t=>!t.__removed__))}function EN(t,e){return ON(t,e).flatMap((({container:t})=>MN(t)))}function ON(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function kN(t){return Dg(t).select(`.${sk}`).node()}function SN(t,e){const{offsetX:n,offsetY:r}=e,i=t.getRenderBounds(),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function AN(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function TN(t){return t=>t.__data__.color}function _N(t){const{x:e}=t.scale;return t=>{const{x:n}=t.__data__;return e.invert(n)}}function PN(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[NN(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(NN(i,r))[e]}}function CN(t,e=((t,e)=>t),n=((t,e,n)=>t.setAttribute(e,n))){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,c=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=vN(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function NN(t,e){return`${t},${e}`}function LN(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[NN(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=NN(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t}),{})}return r}function jN(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function RN(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=he(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const o=t=>t.__data__.points,a=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=Rn(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=zs(),c=r[t-1],l=r[t],[u,f,h,d]=a(o(c),o(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=yr(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,m=he(p,["fill"]),y=new pp({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},m)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(y),c.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function IN(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Mc(n)){const{points:i}=t.__data__,[o,a]=wc(n)?Hg(i):i,s=n.getCenter(),c=is(o,s),l=is(a,s),u=ss(c)+ls(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return wc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function BN(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=he(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},l=(t,n)=>{const{padding:o}=n,[a,s]=((t,e)=>{const{x:n}=r;if(!EO(n))return[0,1];const{__data__:i}=t,{x:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),[l,u]=((t,e)=>{const{y:n}=r;if(!EO(n))return[0,1];const{__data__:i}=t,{y:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),f=[[a,l],[s,l],[s,u],[a,u]].map((t=>i.map(t))),{__data__:h}=t,{y:d,y1:p}=h;return Ug(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=he(e,["transform","transformOrigin","stroke"]),a=Object.assign({transform:n,transformOrigin:r,stroke:i},o),s=t.cloneNode(!0);for(const[t,e]of Object.entries(a))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=yr(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,strokeWidth:h=0}=e,d=he(e,["fill","fillOpacity","zIndex","padding","strokeWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,strokeWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(EO)})()?l:u,m=g(t,p);m.className=s,t.parentNode.appendChild(m),t.background=m},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function DN(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function FN(t){DN(t,t.cursor)}function zN(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function GN(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Pn(h,r),g=jN(h,n),[m,y]=RN(Object.assign({elements:h,valueof:g,link:i,coordinate:c},ur(u.active,"link"))),[v,b,x]=BN(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},ur(u.active,"background"))),w=Y(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return IN(h[n],e,c)}})}),{setState:M,removeState:E,hasState:O}=CN(w,g);let k;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;k&&clearTimeout(k);const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?O(t,"active")||M(t,"active"):(M(t,"inactive"),y(t)),t!==e&&b(t);v(e),m(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},A=(t=!0)=>{for(const t of h)E(t,"active","inactive"),b(t),y(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},T=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{A(),k=null}),a)):A())},_=()=>{A()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",T),t.addEventListener("pointerleave",_);const P=t=>{const{nativeEvent:e}=t;e||A(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=zN(h,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",T),t.removeEventListener("pointerleave",_),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),y(t)}}function WN(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=he(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return GN(kN(c),Object.assign({elements:MN,datum:PN(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:LN(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function $N(t){return WN(Object.assign(Object.assign({},t),{createGroup:_N}))}function HN(t){return WN(Object.assign(Object.assign({},t),{createGroup:TN}))}function VN(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Pn(h,r),g=jN(h,n),[m,y]=RN(Object.assign({link:i,elements:h,valueof:g,coordinate:a},ur(u.selected,"link"))),[v,b]=BN(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},ur(u.selected,"background"))),x=Y(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return IN(h[n],e,a)}})}),{setState:w,removeState:M,hasState:E}=CN(x,g),O=(t=!0)=>{for(const t of h)M(t,"selected","unselected"),y(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},k=t=>{const{target:e,nativeEvent:a=!0}=t;return d.has(e)?o?((t,e,i=!0)=>{if(E(e,"selected"))O();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?w(t,"selected"):(w(t,"unselected"),y(t)),t!==e&&b(t);if(m(a),v(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}})(t,e,a):((t,e,o=!0)=>{const a=r(e),s=p.get(a),c=new Set(s);if(E(e,"selected")){if(!h.some((t=>!c.has(t)&&E(t,"selected"))))return O();for(const t of s)w(t,"unselected"),y(t),b(t)}else{const t=s.some((t=>E(t,"selected")));for(const t of h)c.has(t)?w(t,"selected"):E(t,"selected")||w(t,"unselected");!t&&i&&m(s),v(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:h.filter((t=>E(t,"selected"))).map(n)}}))})(t,e,a):O()};t.addEventListener("click",k);const S=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=o?r.data.slice(0,1):r.data;for(const t of i){const e=zN(h,t,n);k({target:e,nativeEvent:!1})}},A=()=>{O(!1)};return l.on("element:select",S),l.on("element:unselect",A),()=>{for(const t of h)y(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",A)}}function YN(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=he(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return VN(kN(s),Object.assign({elements:MN,datum:PN(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:LN(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function qN(t){return YN(Object.assign(Object.assign({},t),{createGroup:_N}))}function UN(t){return YN(Object.assign(Object.assign({},t),{createGroup:TN}))}function XN(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=he(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:a,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=a,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:m=[]}=d,y=p.map(((t,e)=>e)),v=Rn(y.map((t=>g[t]))),b=kN(s),x=s.getElementsByClassName(ok),w=Pn(s.getElementsByClassName(lk),(t=>t.__data__.key.split("-")[0])),M=new dp({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ur(o,"rule"))}),E=new vp({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ur(o,"label"))});M.append(E),b.appendChild(M);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[wn(v,i)]},k=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),E.setAttribute("text",i(e))};let S;const A=Z((t=>{const e=SN(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=O(n,r,t);k(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[gn((t=>g[+t])).center(e,o)],s=[0,i.map(1)],c=[0,i.map(p[a]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{pe(this,void 0,void 0,(function*(){const{x:e}=f,n=O(h,e,t);k(t,n),l("chartIndex",(t=>{const e=Y({},t),r=e.marks.find((t=>"line"===t.type)),i=qn(Nn(y,(t=>qn(t,(t=>+p[t]))/Xn(t,(t=>+p[t]))),(t=>m[t])).values());Y(r,{scale:{y:{domain:[1/i,i]}}});const o=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);o.groupBy="color",o.basis=(t,e)=>e[t[gn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c();S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{M.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function KN({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=kN(s),l=Z((t=>{const e=SN(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=Y({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n})),o()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function ZN(t,e,n,r,i,o,a,s={}){const c=new wx({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:Y({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function QN({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f}){const h=t.getRootNode().defaultView.getConfig().container,d=function(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}(t,u),p=a?h:t,g=f||function(t){const e=t.getBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(h,d),{tooltipElement:y=ZN(d,n,r,s,c,g,m,l)}=p,{items:v,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:v,title:b,position:s,enterable:c},void 0!==i&&{content:i(o,{items:v,title:b})})),p.tooltipElement=y}function JN({root:t,single:e,emitter:n,nativeEvent:r=!0}){r&&n.emit("tooltip:hide",{nativeEvent:r});const i=t.getRootNode().defaultView.getConfig().container,o=e?i:t,{tooltipElement:a}=o;a&&a.hide()}function tL({root:t,single:e}){const n=t.getRootNode().defaultView.getConfig().container,r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function eL(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function nL(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function rL(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function iL(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=rL(r.map((t=>t.title)),o).filter(cr),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(cr),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=nL(a)||i.color,name:o}=t,s=he(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof Lo)&&!(t instanceof Ro);if(s(r))return r.clone().invert(a);if(a&&r instanceof Lo&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(eL);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:rL(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function oL(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=he(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map((t=>t[1])),m=e.map((t=>t[0])),y=tr(g),v=tr(m),[b,x,w,M]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=ss(is([v,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,y+c,y+c]:[v+s,v+s,c,c+i]})();if(m.length>0){const e=t.ruleY||(()=>{const e=new dp({style:Object.assign({x1:b,x2:x,y1:w,y2:M},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=M,t.ruleY=e}}function aL(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function sL(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function cL(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function lL(t,e){return void 0===t?e:t}function uL(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function fL(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:c,groupName:l,emitter:u,wait:f=50,leading:h=!0,trailing:d=!1,startX:p=0,startY:g=0,body:m=!0,single:y=!0,position:v,enterable:b,mount:x,bounding:w,theme:M,disableNative:E=!1,marker:O=!0,preserve:k=!1,style:S={},css:A={}}=e,T=he(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const _=n(t),P=wc(a),C=Mc(a),N=Y(S,T),{innerWidth:L,innerHeight:j,width:R,height:B,insetLeft:D,insetTop:F}=a.getOptions(),z=[],G=[];for(const t of _){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?z.push(t):(r||i)&&G.push(t)}const W=!!(P?o.y:o.x).getBandWidth&&G.length>0;z.sort(((t,e)=>{const n=P?0:1,r=t=>t.getBounds().min[n];return P?r(e)-r(t):r(t)-r(e)}));const $=t=>{const e=P?1:0,{min:n,max:r}=t.getLocalBounds();return Rn([n[e],r[e]])};G.sort(((t,e)=>{const[n,r]=$(t),[i,o]=$(e),a=(n+r)/2,s=(i+o)/2;return P?s-a:a-s}));const H=new Map(z.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Rn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:V}=o,q=(null==V?void 0:V.getBandWidth)?V.getBandWidth()/2:0,U=t=>{const[e]=a.invert(t);return e-q},X=(t,e,n)=>{const r=U(t),[i,o]=Rn([n[0],n[n.length-1]]);if(!W&&(r<i||r>o))return null;const a=gn((t=>n[+t])).center;return e[a(e,r)]},K=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[I(t.replace("series","")),r]})))},Q=Z((e=>{const n=SN(t,e);if(!n)return;const f=t.getRenderBounds(),h=f.min[0],d=f.min[1],E=[n[0]-p,n[1]-g];if(!E)return;const k=((t,e)=>{const n=t[P?1:0],r=e.filter((t=>{const[e,r]=$(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=gn((t=>{const[e,n]=$(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(cr)})(E,G),S=[],T=[];for(const t of z){const[e,n]=H.get(t),r=X(E,e,n);if(null!==r){S.push(t);const e=K(t,r),{x:n,y:i}=e,o=a.map([(n||0)+q,i||0]);T.push([Object.assign(Object.assign({},e),{element:t}),o])}}const _=Array.from(new Set(T.map((t=>t[0].x)))),I=_[Kn(_,(t=>Math.abs(t-U(E))))],V=T.filter((t=>t[0].x===I)),Y=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],Z=[...S,...k],Q=iL(Z,o,l,Y,M);if(r&&Q.items.sort(((t,e)=>r(t)-r(e))),i&&(Q.items=Q.items.filter(i)),0===Z.length||uL(Q))J();else{if(m&&QN({root:t,data:Q,x:n[0]+h,y:n[1]+d,render:c,event:e,single:y,position:v,enterable:b,mount:x,bounding:w,css:A}),s){const e=V.map((t=>t[1])),n=ur(N,"crosshairs");oL(t,e,Object.assign(Object.assign({},n),{plotWidth:L,plotHeight:j,mainWidth:R,mainHeight:B,insetLeft:D,insetTop:F,startX:p,startY:g,transposed:P,polar:C}))}if(O){const e=ur(N,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const i=e.filter((t=>{const[{x:e,y:n}]=t;return cr(e)&&cr(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new sp({style:Object.assign({cx:o[0],cy:o[1],fill:a,r:4,stroke:"#fff",strokeWidth:2},n)})}));for(const e of i)t.appendChild(e);t.markers=i}(t,{data:V,style:e,theme:M})}u.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:OO(o.x,U(E),!0)}}}))}}),f,{leading:h,trailing:d}),J=()=>{JN({root:t,single:y,emitter:u}),s&&aL(t),O&&sL(t)},tt=()=>{tL({root:t,single:y}),s&&aL(t),O&&sL(t)},et=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=o,s=i.map(r),[c,l]=a.map([s,.5]),{min:[u,f]}=t.getRenderBounds();Q({offsetX:c+u,offsetY:l+f})},nt=()=>{JN({root:t,single:y,emitter:u,nativeEvent:!1})},rt=()=>{at(),tt()},it=()=>{ot()},ot=()=>{E||(t.addEventListener("pointerenter",Q),t.addEventListener("pointermove",Q),t.addEventListener("pointerleave",J))},at=()=>{E||(t.removeEventListener("pointerenter",Q),t.removeEventListener("pointermove",Q),t.removeEventListener("pointerleave",J))};return ot(),u.on("tooltip:show",et),u.on("tooltip:hide",nt),u.on("tooltip:disable",rt),u.on("tooltip:enable",it),()=>{at(),u.off("tooltip:show",et),u.off("tooltip:hide",nt),u.off("tooltip:disable",rt),u.off("tooltip:enable",it),k?JN({root:t,single:y,emitter:u,nativeEvent:!1}):tt()}}function hL(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:c=50,leading:l=!0,trailing:u=!1,groupKey:f=(t=>t),single:h=!0,position:d,enterable:p,datum:g,view:m,mount:y,bounding:v,theme:b,shared:x=!1,body:w=!0,disableNative:M=!1,preserve:E=!1,css:O={}}){const k=e(t),S=new Set(k),A=Pn(k,f),T=Z((e=>{const{target:c}=e;if(!S.has(c))return void JN({root:t,single:h,emitter:s});const l=f(c),u=A.get(l),g=1!==u.length||x?iL(u,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(cr).map((e=>{var{color:n=nL(t)}=e,r=he(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(eL);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(o&&g.items.sort(((t,e)=>o(t)-o(e))),a&&(g.items=g.items.filter(a)),uL(g))return void JN({root:t,single:h,emitter:s});const{offsetX:M,offsetY:E}=e;w&&QN({root:t,data:g,x:M,y:E,render:r,event:e,single:h,position:d,enterable:p,mount:y,bounding:v,css:O}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:UA(c,m)}}))}),c,{leading:l,trailing:u}),_=e=>{const{target:n}=e;S.has(n)&&JN({root:t,single:h,emitter:s})},P=()=>{M||(t.addEventListener("pointerover",T),t.addEventListener("pointermove",T),t.addEventListener("pointerout",_))},C=()=>{M||(t.removeEventListener("pointerover",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerout",_))},N=({nativeEvent:t,data:e})=>{if(t)return;const n=zN(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;T({target:n,offsetX:i+a/2,offsetY:o+s/2})},L=({nativeEvent:e}={})=>{e||JN({root:t,single:h,emitter:s,nativeEvent:!1})};return s.on("tooltip:show",N),s.on("tooltip:hide",L),s.on("tooltip:enable",(()=>{P()})),s.on("tooltip:disable",(()=>{C(),tL({root:t,single:h})})),P(),()=>{C(),s.off("tooltip:show",N),s.off("tooltip:hide",L),E?JN({root:t,single:h,emitter:s,nativeEvent:!1}):tL({root:t,single:h})}}function dL(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=he(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,c)=>{const{container:l,view:u}=t,{scale:f,markState:h,coordinate:d,theme:p}=u,g=cL(h,"seriesTooltip"),m=cL(h,"crosshairs"),y=kN(l),v=lL(r,g);if(v&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(h)&&!a)return fL(y,Object.assign(Object.assign({},s),{theme:p,elements:MN,scale:f,coordinate:d,crosshairs:lL(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=EN(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),fL(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:d,crosshairs:lL(n,m),item:o,startX:u,startY:f,emitter:c}))}return hL(y,Object.assign(Object.assign({},s),{datum:PN(u),elements:MN,scale:f,coordinate:d,groupKey:e?_N(u):void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}const pL="legend-category",gL="legend-continuous",mL="items-item",yL="legend-category-item-marker",vL="legend-category-item-label";function bL(t){return t.getElementsByClassName(yL)[0]}function xL(t){return t.getElementsByClassName(vL)[0]}function wL(t){return t.getElementsByClassName(mL)}function ML(t){return t.getElementsByClassName(pL)}function EL(t){return t.getElementsByClassName(gL)}function OL(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function kL(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return pe(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[]}=t,l=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),u=[...e];u.splice(l+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const f=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Y({},t,Object.assign(Object.assign({transform:u,scale:f},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function SL(t,e){for(const n of t)kL(n,Object.assign(Object.assign({},e),{facet:!0}))}function AL(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>OL(t).scales.map((t=>t.name)),s=[...ML(r),...EL(r)],c=s.flatMap(a),l=Z(o?SL:kL,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=OL(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===pL?function(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:ur(h,"marker")},p={unselected:ur(h,"label")},{setState:g,removeState:m}=CN(d,void 0),{setState:y,removeState:v}=CN(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(m(o,"unselected"),v(a,"unselected")):(g(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{DN(t,"pointer")},r=()=>{FN(t)},c=t=>pe(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),0===x.length&&x.push(...b.map(i)),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const M=t=>pe(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),E=t=>pe(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",M),a.on("legend:reset",E),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),a.off("legend:filter",M),a.off("legend:reset",E)}}(r,{legends:wL,marker:bL,label:xL,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function TL(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=ML(r),s=MN(r),c=t=>OL(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=LN(o,["active","inactive"]),f=jN(s,PN(i)),h=[];for(const t of a){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=wL(t),o=l(r),a=Pn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:m}=CN(u,f),y={inactive:ur(p,"marker")},v={inactive:ur(p,"label")},{setState:b,removeState:x}=CN(y),{setState:w,removeState:M}=CN(v),E=t=>{for(const e of i){const n=bL(e),r=xL(e);e===t||null===t?(x(n,"inactive"),M(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},O=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");E(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},k=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),k.set(t,e)}const S=t=>{for(const t of s)m(t,"inactive","active");E(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find((t=>e(t)===s));c&&O({nativeEvent:!1},c)},T=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",T);const _=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",T);for(const[t,e]of k)t.removeEventListener(e)};h.push(_)}return()=>h.forEach((t=>t()))}}function _L(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function PL(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function CL(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const NL=nm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=he(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=ur(hr(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=he(d,["render"]),m=ur(u,"handleE"),{render:y=h}=m,v=he(m,["render"]),b=ur(hr(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=he(b,["render"]),M=ur(u,"handleW"),{render:E=h}=M,O=he(M,["render"]),k=ur(u,"handleNW"),{render:S=h}=k,A=he(k,["render"]),T=ur(u,"handleNE"),{render:_=h}=T,P=he(T,["render"]),C=ur(u,"handleSE"),{render:N=h}=C,L=he(C,["render"]),j=ur(u,"handleSW"),{render:R=h}=j,I=he(j,["render"]),B=t=>()=>{const e=nm((e=>((t,e)=>{const{id:n}=t,r=he(t.attributes,["x","y"]),i=e(t,Object.assign({x:0,y:0},r),l);i.id=n,i.style.draggable=!0})(e,t)));return new e({})},D=Dg(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(CL,Object.assign({width:i,height:o},hr(u,"handle"))),D.maybeAppend("handle-n",B(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(CL,g),D.maybeAppend("handle-e",B(y)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(CL,v),D.maybeAppend("handle-s",B(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(CL,w),D.maybeAppend("handle-w",B(E)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(CL,O),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(CL,A),D.maybeAppend("handle-ne",B(_)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(CL,P),D.maybeAppend("handle-se",B(N)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(CL,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(CL,I)}));function LL(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=PL(t),brushRegion:c=((t,e,n,r,i)=>[t,e,n,r]),reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=he(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,m=null,y=null,v=null,b=null,x=!1;const[w,M,E,O]=s;DN(t,"crosshair"),t.style.draggable=!0;const k=(t,e,n)=>{if(o(n),v&&v.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new pp({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),v=new NL({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},A=()=>{v=new NL({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(v)},T=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,m=null,y=null,x=!1,v=null,b=null,r(t)},_=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${M}L${E},${M}L${E},${O}L${w},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===v.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=AN(t,e);if(!v||!L(n))return k(r,i,e),void(x=!0);L(n)&&(y=[r,i])},B=e=>{const{target:n}=e,r=AN(t,e);if(!g)return;if(!y)return _(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,g[0],m[0],w,E),o=e(r,g[1],m[1],M,O),a=[g[0]+i,g[1]+o],s=[m[0]+i,m[1]+o];_(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(N[a]){const[t,e,n,r]=N[a].vector;return _([g[0]+i*t,g[1]+o*e],[m[0]+i*n,m[1]+o*r])}},D=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=v.style;return g=[t,n],m=[t+r,n+i],void a(t,n,t+r,n+i,e)}m=AN(t,e);const[n,r,o,s]=_(g,m);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;v&&!L(e)&&T()},z=e=>{const{target:n}=e;v&&L(n)&&!x?R(n)?DN(t,"move"):j(n)&&DN(t,N[n.id].cursor):DN(t,"crosshair")},G=()=>{DN(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",B),t.addEventListener("dragend",D),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:v,move(t,e,n,r,i=!0){v||k(t,e,{}),g=[t,e],m=[n,r],_([t,e],[n,r],i)},remove(t=!0){v&&T(t)},destroy(){v&&T(!1),DN(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",B),t.removeEventListener("dragend",D),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function jL(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function RL(t,e,n){return jL(t,e,n).map((t=>t.options))}function IL(t,e){var{elements:n,selectedHandles:r,siblings:i=(t=>[]),datum:o,brushRegion:a,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=(t=>t),bboxOf:d=(t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}}),state:p={},emitter:g}=e,m=he(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),v=i(t),b=v.flatMap(n),x=jN(y,o),w=ur(m,"mask"),{setState:M,removeState:E}=CN(p,x),O=new Map,{width:k,height:S,x:A=0,y:T=0}=d(t),_=s||[0,0,k,S],P=()=>{for(const t of[...y,...b])E(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of v)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;_L([c,l,u,f],[t,e,n,r])?(M(i,"active"),o.add(h(i))):M(i,"inactive")}for(const t of b)o.has(h(t))?M(t,"active"):M(t,"inactive")},N=()=>{for(const t of y)E(t,"inactive");for(const t of O.values())t.remove();O.clear()},L=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e};for(const o of y){const a=O.get(o)||i(o);a.style.clipPath=new yp({style:{x:t+A,y:e+T,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},j=LL(t,Object.assign(Object.assign({},w),{extent:_,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=SO(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=SO(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushupdated:(t,e,n,r,i)=>{const o=SO(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const{x:r,y:i}=e,[o,a]=t,s=AO(o,r),c=AO(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const B=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),B()},j}function BL(t){var{facet:e,brushKey:n}=t,r=he(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=kN(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return IL(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>EN(t,i),datum:PN(ON(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:LN(ON(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=IL(l,Object.assign(Object.assign({elements:MN,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return jL(t,e,n).map((t=>kN(t.container)))}(t,i,n),datum:PN([s,...jL(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:LN([c,...RL(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function DL(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function FL(t){return BL(Object.assign(Object.assign({},t),{brushRegion:DL,selectedHandles:["handle-e","handle-w"]}))}function zL(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function GL(t){return BL(Object.assign(Object.assign({},t),{brushRegion:zL,selectedHandles:["handle-n","handle-s"]}))}const WL="axis",$L="axis-line",HL="axis-main-group",VL="axis-hot-area";function YL(t){return t.getElementsByClassName(WL)}function qL(t){return t.getElementsByClassName($L)[0]}function UL(t){return function(t){return t.getElementsByClassName(HL)[0]}(t).getLocalBounds()}function XL(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=he(e,["cross","offsetX","offsetY"]);const a=UL(t),s=qL(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:zL,hotZone:new yp({className:VL,style:Object.assign({x:n?l:c-d/2,width:n?d/2:d,y:u,height:h-u},o)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function KL(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=he(e,["offsetY","offsetX","cross"]);const a=UL(t),s=qL(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:DL,hotZone:new yp({className:VL,style:Object.assign({x:l,width:f-l,y:i?u:c-d,height:i?d:2*d},o)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function ZL(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=kN(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=o;return function(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=he(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),m=jN(p,a),{setState:y,removeState:v}=CN(u,m),b=new Map,x=ur(d,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),M=g.map((t=>t.attributes.scale)),E=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,k=()=>{O.clear();for(let t=0;t<g.length;t++){const e=M[t],{domain:n}=e.getOptions();O.set(t,E(n))}};k();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}O.set(t,T(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!_)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=M[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},T=(t,e)=>{const n=M[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return E(kO(n,i))},_=g.some(o)&&g.some((t=>!o(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?KL:XL,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:_,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=LL(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},N=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=M[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:MN,axes:YL,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:PN(o),state:LN(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function QL(t){var{hideX:e=!0,hideY:n=!0}=t,r=he(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=kN(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:m}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=ur(he(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],m=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=LL(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(u(t,e,r,i),o),y.remove()}}));function v(t){m(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",v);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{y.destroy(),s.off("brush:filter",b),t.removeEventListener("click",v)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return SO(t,e,n,r,i,o)},filter:(t,r)=>pe(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,a]=t;u("brushFilter",(t=>{const{marks:r}=t,o=r.map((t=>Y({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:a,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:o,clip:!0})})),o.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,a]}}));const s=yield l();p=s.view,d=!1,h=!0})),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,a=r.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,a]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:o,scale:g,coordinate:m},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function JL(t){return QL(Object.assign(Object.assign({hideX:!0},t),{brushRegion:DL}))}function tj(t){return QL(Object.assign(Object.assign({hideY:!0},t),{brushRegion:zL}))}const ej="slider";function nj(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return Y({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(a=t[n])||void 0===a?void 0:a[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[o])&&{[o]:{preserve:!0}}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function rj(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return kO(e,[OO(e,o(r),!0),OO(e,o(i),!1)])}function ij(t){return[t[0],t[t.length-1]]}function oj({initDomain:t={},className:e=ej,prefix:n="slider",setValue:r=((t,e)=>t.setValues(e)),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1}){return(c,l,u)=>{const{container:f,view:h,update:d,setState:p}=c,g=f.getElementsByClassName(e);if(!g.length)return()=>{};let m=!1;const{scale:y,coordinate:v,layout:b}=h,{paddingLeft:x,paddingTop:w,paddingBottom:M,paddingRight:E}=b,{x:O,y:k}=y,S=wc(v),A=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},T=new Map,_=new Set,P={x:t.x||O.getOptions().domain,y:t.y||k.getOptions().domain};for(const t of g){const{orientation:e}=t.attributes,[c,l]=A(e),f=`${n}${B(c)}:filter`,h="x"===c,{ratio:g}=O.getOptions(),{ratio:v}=k.getOptions(),b=t=>{if(t.data){const{selection:e}=t.data,[n=ij(P.x),r=ij(P.y)]=e;return h?[kO(O,n,g),kO(k,r,v)]:[kO(k,r,v),kO(O,n,g)]}const{value:n}=t.detail;return[rj(n,y[c],S&&"horizontal"===e),P[l]]},C=Z((e=>pe(this,void 0,void 0,(function*(){if(m)return;m=!0;const{nativeEvent:r=!0}=e,[o,a]=b(e);if(P[c]=o,P[l]=a,r){const t=h?o:a,n=h?a:o;u.emit(f,Object.assign(Object.assign({},e),{nativeEvent:r,data:{selection:[ij(t),ij(n)]}}))}p(t,(t=>Object.assign(Object.assign({},nj(t,{[c]:{domain:o,nice:!1}},n,i,c,l)),{paddingLeft:x,paddingTop:w,paddingBottom:M,paddingRight:E}))),yield d(),m=!1}))),o,{leading:a,trailing:s}),N=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new Md("valuechange",{data:i,nativeEvent:!1}));const c=h?AO(a,O):AO(s,k);r(t,c)};u.on(f,N),t.addEventListener("valuechange",C),T.set(t,C),_.add([f,N])}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of _)u.off(t,e)}}}const aj="g2-scrollbar";function sj(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(aj).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return oj(Object.assign(Object.assign({},t),{initDomain:l,className:aj,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(e,n,r)}}function cj(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const lj={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function uj(t){return"text"===t.nodeName&&!!t.isOverflowing()}function fj(t){var{offsetX:e=8,offsetY:n=8}=t,r=he(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=ur(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!uj(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,h=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new fp({className:"poptip",style:{innerHTML:cj("div",d,Object.assign(Object.assign({},lj),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;uj(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}function hj(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function dj(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}const pj=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{wN(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}(hj(e),hj(t.getLocalBounds()))));r?xN(t):n.push(t)})),t}};function gj([t,e],[n,r]){return r>t&&e>n}function mj(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function yj(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const vj=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=mj(),[s,c]=mj(),[l,u]=mj(),[f,h]=mj();for(const e of t){const{min:t,max:n}=yj(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),h(e,[r,o])}for(let o=0;o<e;o++){t.sort(((t,e)=>dn(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let o,a=n+1;for(;(o=t[a])&&!gj(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function bj(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function xj(t,e,n){return.2126*bj(t)+.7152*bj(e)+.0722*bj(n)}function wj(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=xj(n,r,i),l=xj(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function Mj(t,e){const n=Un(e,(e=>wj(t,function(t){return"object"==typeof t?t:uf(t)}(e))));return e[n]}const Ej=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;wj(t.parsedStyle.fill,r)<e&&t.attr("fill",Mj(r,n))})),t)},Oj=()=>t=>(t.forEach((t=>{wN(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(dj(n,e)&&dj(r,e))}(hj(t.getLocalBounds()),e);n&&xN(t)})),t);function kj(){return{"data.fetch":CM,"data.inline":FM,"data.sortBy":DM,"data.sort":RM,"data.filter":jM,"data.pick":IM,"data.rename":BM,"data.fold":NM,"data.slice":HM,"data.custom":zM,"data.map":GM,"data.join":$M,"data.kde":UM,"data.log":XM,"transform.stackY":Nr,"transform.binX":ys,"transform.bin":ms,"transform.dodgeX":Xr,"transform.jitter":Aa,"transform.jitterX":Ta,"transform.symmetryY":_a,"transform.diffY":Pa,"transform.stackEnter":Kr,"transform.normalizeY":Zr,"transform.select":Ra,"transform.selectX":Ia,"transform.selectY":Ba,"transform.groupX":Xa,"transform.groupY":Ka,"transform.groupColor":Za,"transform.group":Ua,"transform.sortX":ts,"transform.sortY":ns,"transform.sortColor":es,"transform.flexX":rs,"transform.pack":ds,"transform.sample":bs,"transform.filter":xs,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":i,"coordinate.theta":o,"coordinate.parallel":c,"coordinate.fisheye":l,"coordinate.radial":s,"coordinate.radar":u,"encode.constant":f,"encode.field":d,"encode.transform":h,"encode.column":p,"mark.interval":jw,"mark.rect":Iw,"mark.line":zw,"mark.point":Ww,"mark.text":Hw,"mark.cell":Yw,"mark.area":Uw,"mark.link":Kw,"mark.image":Qw,"mark.polygon":tM,"mark.box":nM,"mark.vector":iM,"mark.lineX":cM,"mark.lineY":aM,"mark.connector":uM,"mark.range":pM,"mark.rangeX":mM,"mark.rangeY":vM,"mark.path":xM,"mark.shape":wM,"mark.density":ZM,"mark.heatmap":JM,"palette.category10":tE,"palette.category20":eE,"scale.linear":rE,"scale.ordinal":iE,"scale.band":nE,"scale.identity":oE,"scale.point":aE,"scale.time":sE,"scale.log":cE,"scale.pow":lE,"scale.sqrt":dE,"scale.threshold":uE,"scale.quantile":fE,"scale.quantize":hE,"scale.sequential":pE,"scale.constant":gE,"theme.classic":bE,"theme.classicDark":ME,"theme.academy":OE,"theme.light":vE,"theme.dark":wE,"component.axisX":rO,"component.axisY":iO,"component.legendCategory":uO,"component.legendContinuous":gO,"component.legends":jO,"component.title":MO,"component.sliderX":_O,"component.sliderY":PO,"component.scrollbarX":NO,"component.scrollbarY":LO,"animation.scaleInX":RO,"animation.scaleOutX":IO,"animation.scaleInY":BO,"animation.scaleOutY":DO,"animation.waveIn":ZO,"animation.fadeIn":FO,"animation.fadeOut":zO,"animation.zoomIn":QO,"animation.zoomOut":JO,"animation.pathIn":tk,"animation.morphing":KO,"animation.growInX":ek,"animation.growInY":nk,"interaction.elementHighlight":WN,"interaction.elementHighlightByX":$N,"interaction.elementHighlightByColor":HN,"interaction.elementSelect":YN,"interaction.elementSelectByX":qN,"interaction.elementSelectByColor":UN,"interaction.fisheye":KN,"interaction.chartIndex":XN,"interaction.tooltip":dL,"interaction.legendFilter":AL,"interaction.legendHighlight":TL,"interaction.brushHighlight":BL,"interaction.brushXHighlight":FL,"interaction.brushYHighlight":GL,"interaction.brushAxisHighlight":ZL,"interaction.brushFilter":QL,"interaction.brushXFilter":JL,"interaction.brushYFilter":tj,"interaction.sliderFilter":oj,"interaction.scrollbarFilter":sj,"interaction.poptip":fj,"composition.spaceLayer":mA,"composition.spaceFlex":yA,"composition.facetRect":LA,"composition.repeatMatrix":FA,"composition.facetCircle":VA,"composition.timingKeyframe":qA,"labelTransform.overlapHide":pj,"labelTransform.overlapDodgeY":vj,"labelTransform.overflowHide":Oj,"labelTransform.contrastReverse":Ej}}function Sj(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const Aj={};const Tj=t=>t?parseInt(t):0;function _j(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class Pj{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=(t=>t)){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return _j(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return _j(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return _j(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const Cj=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],Nj="__remove__",Lj="__callback__";function jj(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function Rj(t,e){const{autoFit:n}=t,{width:r=640,height:i=480}=n?function(t){const e=getComputedStyle(t),n=t.clientWidth||Tj(e.width),r=t.clientHeight||Tj(e.height);return{width:n-(Tj(e.paddingLeft)+Tj(e.paddingRight)),height:r-(Tj(e.paddingTop)+Tj(e.paddingBottom))}}(e):t,{depth:o=0}=t;return{width:r,height:i,depth:o}}function Ij(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of Cj)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,jj(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===Lj)e.children=t.value;else{const i=jj(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function Bj(t,e,n,r){const{type:i}=t,{type:o=n||i}=e;if("view"===o)return e;if(!function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r))return e;const a={type:"view"},s=Object.assign({},e);for(const t of Cj)void 0!==s[t]&&(a[t]=s[t],delete s[t]);return Object.assign(Object.assign({},a),{children:[s]})}function Dj(t,e,n){if("function"==typeof t){const e=new Pj;return e.value=t,e.type=Lj,e}const{type:r,children:i}=t,o=he(t,["type","children"]),a=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new a;return s.value=o,s.type=r,s}function Fj(t,e){const{type:n,children:r}=e,i=he(e,["type","children"]);t.type===n||void 0===n?mr(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function zj(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=Dj(e,n,r);Array.isArray(t.children)&&t.push(o);const{children:a}=e;if(Array.isArray(a))for(const t of a)i.push([o,t]);else"function"==typeof a&&i.push([o,a])}}function Gj(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function Wj(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function $j(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function Hj(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(pr(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function Vj(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function Yj(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function qj(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?Gj(e,n,r):"array"===t?Wj(e,n,r):"object"===t?$j(e,n,r):"node"===t?Vj(e,n,r):"container"===t?Yj(e,n,r):"mix"===t&&Hj(e,n)}return e}}function Uj(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const Xj={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},Kj=Object.assign(Object.assign({},Xj),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),Zj=Object.assign(Object.assign({},Xj),{labelTransform:{type:"array"}});let Qj=class extends Pj{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&wN(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&xN(t)}};Qj=de([qj(Zj)],Qj);let Jj=class extends Pj{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};Jj=de([qj(Kj)],Jj);const tR="G2_CHART_KEY";class eR extends Qj{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o}=t;super(he(t,["container","canvas","renderer","plugins","lib"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=W((()=>{this.forceFit()}),300),this._renderer=r||new iS,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[Nj]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new cS,this._context={library:Object.assign(Object.assign({},o),Aj),emitter:this._emitter,canvas:n},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>gN(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return Ij(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,Bj(t,e,n,r)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){Fj(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],a=r[i];o.push([e,a,n])}}else"function"==typeof t&&o.push([e,null,t])}else e.remove();else zj(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit(lS.BEFORE_CLEAR),this._reset(),mN(0,this._context,!1),this.emit(lS.AFTER_CLEAR)}destroy(){this.options();this.emit(lS.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),mN(0,this._context,!0),this._container[Nj]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(lS.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=Rj(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(lS.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(lS.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(lS.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(lS.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends Jj{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends Qj{constructor(){super({},e)}};return n=de([qj(Uj(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))qj(Uj(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=tR}=t,{width:n,height:r,depth:i}=Rj(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=Rj(this.options(),this._container);this._plugins.push(new aS),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new Cp({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}$d.enableCSSParsing=!1;const nR=Sj(eR,Object.assign({},kj()));t.AREA_CLASS_NAME=uk,t.COMPONENT_CLASS_NAME=ck,t.Chart=nR,t.ChartEvent=lS,t.ELEMENT_CLASS_NAME=ok,t.LABEL_CLASS_NAME=lk,t.LABEL_LAYER_CLASS_NAME=ik,t.MAIN_LAYER_CLASS_NAME=rk,t.MASK_CLASS_NAME="mask",t.PLOT_CLASS_NAME=sk,t.Runtime=eR,t.VIEW_CLASS_NAME=ak,t.corelib=kj,t.extend=Sj,t.register=function(t,e){Object.assign(Aj,{[t]:e})},t.render=gN,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480}=t,a=dN(t),{group:s=new up,emitter:c=new cS,library:l}=e;(null==s?void 0:s.parentElement)||ar("renderToMountedElement can't render chart to unmounted group.");const u=Dg(s);return e.group=s,e.emitter=c,c.emit(lS.BEFORE_RENDER),GC(Object.assign(Object.assign({},a),{width:i,height:o}),u,l,e).then((()=>{s.ownerDocument.defaultView.requestAnimationFrame((()=>{c.emit(lS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),s},Object.defineProperty(t,"__esModule",{value:!0})}));