@antv/g2 5.1.8 → 5.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +484 -0
- package/README.md +7 -0
- package/README.zh-CN.md +7 -0
- package/dist/g2.lite.min.js +1 -1
- package/dist/g2.min.js +1 -1
- package/esm/component/slider.js +1 -1
- package/esm/component/slider.js.map +1 -1
- package/esm/composition/facetCircle.js +1 -1
- package/esm/data/utils/arc/arc.js +4 -4
- package/esm/data/utils/arc/arc.js.map +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/interaction/chartIndex.d.ts +5 -0
- package/esm/interaction/chartIndex.js +4 -1
- package/esm/interaction/chartIndex.js.map +1 -1
- package/esm/interaction/elementHighlight.d.ts +5 -0
- package/esm/interaction/elementHighlight.js +3 -0
- package/esm/interaction/elementHighlight.js.map +1 -1
- package/esm/interaction/elementHighlightByColor.d.ts +5 -0
- package/esm/interaction/elementHighlightByColor.js +3 -0
- package/esm/interaction/elementHighlightByColor.js.map +1 -1
- package/esm/interaction/elementHighlightByX.d.ts +5 -0
- package/esm/interaction/elementHighlightByX.js +3 -0
- package/esm/interaction/elementHighlightByX.js.map +1 -1
- package/esm/interaction/elementSelect.d.ts +5 -0
- package/esm/interaction/elementSelect.js +3 -0
- package/esm/interaction/elementSelect.js.map +1 -1
- package/esm/interaction/elementSelectByColor.d.ts +5 -0
- package/esm/interaction/elementSelectByColor.js +3 -0
- package/esm/interaction/elementSelectByColor.js.map +1 -1
- package/esm/interaction/elementSelectByX.d.ts +5 -0
- package/esm/interaction/elementSelectByX.js +3 -0
- package/esm/interaction/elementSelectByX.js.map +1 -1
- package/esm/interaction/event.d.ts +5 -0
- package/esm/interaction/event.js +3 -0
- package/esm/interaction/event.js.map +1 -1
- package/esm/interaction/poptip.d.ts +5 -0
- package/esm/interaction/poptip.js +3 -0
- package/esm/interaction/poptip.js.map +1 -1
- package/esm/interaction/sliderFilter.js +2 -0
- package/esm/interaction/sliderFilter.js.map +1 -1
- package/esm/interaction/tooltip.d.ts +5 -0
- package/esm/interaction/tooltip.js +7 -3
- package/esm/interaction/tooltip.js.map +1 -1
- package/esm/interaction/utils.d.ts +1 -0
- package/esm/interaction/utils.js +7 -1
- package/esm/interaction/utils.js.map +1 -1
- package/esm/lib/graph.d.ts +1 -0
- package/esm/lib/graph.js +2 -1
- package/esm/lib/graph.js.map +1 -1
- package/esm/lib/std.d.ts +1 -0
- package/esm/mark/chord.d.ts +4 -0
- package/esm/mark/chord.js +121 -0
- package/esm/mark/chord.js.map +1 -0
- package/esm/mark/index.d.ts +2 -0
- package/esm/mark/index.js +1 -0
- package/esm/mark/index.js.map +1 -1
- package/esm/runtime/plot.js +29 -19
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/scale.js +11 -18
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/types/common.d.ts +1 -1
- package/esm/shape/area/curve.js +5 -2
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/line/curve.js +4 -3
- package/esm/shape/line/curve.js.map +1 -1
- package/esm/shape/utils.d.ts +1 -1
- package/esm/shape/utils.js +21 -2
- package/esm/shape/utils.js.map +1 -1
- package/esm/spec/mark.d.ts +17 -2
- package/lib/component/slider.js +1 -1
- package/lib/component/slider.js.map +1 -1
- package/lib/composition/facetCircle.js +1 -1
- package/lib/data/utils/arc/arc.js +4 -4
- package/lib/data/utils/arc/arc.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/interaction/chartIndex.d.ts +5 -0
- package/lib/interaction/chartIndex.js +4 -1
- package/lib/interaction/chartIndex.js.map +1 -1
- package/lib/interaction/elementHighlight.d.ts +5 -0
- package/lib/interaction/elementHighlight.js +3 -0
- package/lib/interaction/elementHighlight.js.map +1 -1
- package/lib/interaction/elementHighlightByColor.d.ts +5 -0
- package/lib/interaction/elementHighlightByColor.js +3 -0
- package/lib/interaction/elementHighlightByColor.js.map +1 -1
- package/lib/interaction/elementHighlightByX.d.ts +5 -0
- package/lib/interaction/elementHighlightByX.js +3 -0
- package/lib/interaction/elementHighlightByX.js.map +1 -1
- package/lib/interaction/elementSelect.d.ts +5 -0
- package/lib/interaction/elementSelect.js +3 -0
- package/lib/interaction/elementSelect.js.map +1 -1
- package/lib/interaction/elementSelectByColor.d.ts +5 -0
- package/lib/interaction/elementSelectByColor.js +3 -0
- package/lib/interaction/elementSelectByColor.js.map +1 -1
- package/lib/interaction/elementSelectByX.d.ts +5 -0
- package/lib/interaction/elementSelectByX.js +3 -0
- package/lib/interaction/elementSelectByX.js.map +1 -1
- package/lib/interaction/event.d.ts +5 -0
- package/lib/interaction/event.js +3 -0
- package/lib/interaction/event.js.map +1 -1
- package/lib/interaction/poptip.d.ts +5 -0
- package/lib/interaction/poptip.js +3 -0
- package/lib/interaction/poptip.js.map +1 -1
- package/lib/interaction/sliderFilter.js +2 -0
- package/lib/interaction/sliderFilter.js.map +1 -1
- package/lib/interaction/tooltip.d.ts +5 -0
- package/lib/interaction/tooltip.js +6 -2
- package/lib/interaction/tooltip.js.map +1 -1
- package/lib/interaction/utils.d.ts +1 -0
- package/lib/interaction/utils.js +9 -2
- package/lib/interaction/utils.js.map +1 -1
- package/lib/lib/graph.d.ts +1 -0
- package/lib/lib/graph.js +1 -0
- package/lib/lib/graph.js.map +1 -1
- package/lib/lib/std.d.ts +1 -0
- package/lib/mark/chord.d.ts +4 -0
- package/lib/mark/chord.js +125 -0
- package/lib/mark/chord.js.map +1 -0
- package/lib/mark/index.d.ts +2 -0
- package/lib/mark/index.js +3 -1
- package/lib/mark/index.js.map +1 -1
- package/lib/runtime/plot.js +29 -19
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/scale.js +11 -18
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/types/common.d.ts +1 -1
- package/lib/shape/area/curve.js +5 -2
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/line/curve.js +3 -2
- package/lib/shape/line/curve.js.map +1 -1
- package/lib/shape/utils.d.ts +1 -1
- package/lib/shape/utils.js +21 -2
- package/lib/shape/utils.js.map +1 -1
- package/lib/spec/mark.d.ts +17 -2
- package/package.json +4 -7
- package/src/component/slider.ts +1 -1
- package/src/composition/facetCircle.ts +1 -1
- package/src/data/utils/arc/arc.ts +4 -4
- package/src/interaction/chartIndex.ts +5 -1
- package/src/interaction/elementHighlight.ts +4 -0
- package/src/interaction/elementHighlightByColor.ts +4 -0
- package/src/interaction/elementHighlightByX.ts +4 -0
- package/src/interaction/elementSelect.ts +4 -0
- package/src/interaction/elementSelectByColor.ts +4 -0
- package/src/interaction/elementSelectByX.ts +4 -0
- package/src/interaction/event.ts +4 -0
- package/src/interaction/poptip.ts +4 -0
- package/src/interaction/sliderFilter.ts +3 -0
- package/src/interaction/tooltip.ts +8 -2
- package/src/interaction/utils.ts +7 -1
- package/src/lib/graph.ts +2 -1
- package/src/mark/chord.ts +161 -0
- package/src/mark/index.ts +2 -0
- package/src/runtime/plot.ts +47 -21
- package/src/runtime/scale.ts +11 -16
- package/src/runtime/types/common.ts +1 -1
- package/src/shape/area/curve.ts +6 -2
- package/src/shape/line/curve.ts +6 -3
- package/src/shape/utils.ts +20 -1
- package/src/spec/mark.ts +31 -0
- package/dist/g2.full.min.js +0 -1
package/dist/g2.lite.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).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},O=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},E=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)&&!O(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},_=function(t){return b(t,"String")};var A=function(t,e,n){return t<e?e:t>n?n:t},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 H(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 $(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($(e,i)){var o=e[i];null!==o&&O(o)?(O(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(_(t)||_(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=_(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,O=i*l-o*c,E=u*g-f*p,k=u*m-h*p,S=u*y-d*p,_=f*m-h*g,A=f*y-d*g,T=h*y-d*m,P=v*T-b*A+x*_+w*S-M*k+O*E;return P?(P=1/P,t[0]=(s*T-c*A+l*_)*P,t[1]=(i*A-r*T-o*_)*P,t[2]=(g*O-m*M+y*w)*P,t[3]=(h*M-f*O-d*w)*P,t[4]=(c*S-a*T-l*k)*P,t[5]=(n*T-i*S+o*k)*P,t[6]=(m*x-p*O-y*b)*P,t[7]=(u*O-h*x+d*b)*P,t[8]=(a*A-s*S+l*E)*P,t[9]=(r*S-n*A-o*E)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-d*v)*P,t[12]=(s*k-a*_-c*E)*P,t[13]=(n*_-r*k+i*E)*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],O=r[2],E=i[0],k=i[1],S=i[2],_=(1-(g+y))*w,A=(d+x)*w,T=(p-b)*w,P=(d-x)*M,C=(1-(h+y))*M,N=(m+v)*M,L=(p+b)*O,j=(m-v)*O,R=(1-(h+g))*O;return t[0]=_,t[1]=A,t[2]=T,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]+E-(_*E+P*k+L*S),t[13]=n[1]+k-(A*E+C*k+j*S),t[14]=n[2]+S-(T*E+N*k+R*S),t[15]=1,t}function Ot(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 Et(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=Et;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 _t=St;function At(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 Tt(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,O,E,k,S,_,A=r[0],T=r[1],P=r[2],C=Math.hypot(A,T,P);return C<J?null:(A*=C=1/C,T*=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=A*A*a+o,x=T*A*a+P*i,w=P*A*a-T*i,M=A*T*a-P*i,O=T*T*a+o,E=P*T*a+A*i,k=A*P*a+T*i,S=T*P*a-A*i,_=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*O+g*E,t[5]=c*M+h*O+m*E,t[6]=l*M+d*O+y*E,t[7]=u*M+p*O+v*E,t[8]=s*k+f*S+g*_,t[9]=c*k+h*S+m*_,t[10]=l*k+d*S+y*_,t[11]=u*k+p*S+v*_,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:Ot,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:Et,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:_t,orthoZO:At,lookAt:Tt,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],O=e[5],E=e[6],k=e[7],S=e[8],_=e[9],A=e[10],T=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-O)<=J*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(c-E)<=J*Math.max(1,Math.abs(c),Math.abs(E))&&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-_)<=J*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(h-A)<=J*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-T)<=J*Math.max(1,Math.abs(d),Math.abs(T))&&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 Ht(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function $t(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 Oe(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Me[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Ee(t){return Oe(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ke(t){return Ee(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 _e(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 Ae(t){return t>=48&&t<=57||43===t||45===t||46===t}function Te(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)),Te(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Te(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&Te(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Te(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&&Te(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&Te(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):_e(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(!Ae(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(Ee(t))return[].concat(t);var e=function(t){if(Oe(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),O=[];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 E=(g-(b=(u=Be(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=E*E/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var _=y*y,A=v*v,T=(o===a?-1:1)*Math.sqrt(Math.abs((_*A-_*k*k-A*E*E)/(_*k*k+A*E*E)));d=T*y*k/v+(g+b)/2,p=T*-v*E/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),O=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],H=[b+F*B,x-z*I],$=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat(H,$,O);for(var V=[],Y=0,q=(O=W.concat(H,$,O)).length;Y<q;Y+=1)V[Y]=Y%2?Be(O[Y-1],O[Y],M).y:Be(O[Y],O[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 He(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function $e(t,e,n,r,i){var o=He([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 $e(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)),O=(o!==a?1:-1)*d(M=M<0?0:M),E=O*(g*x.y/m),k=O*(-m*x.x/g),S=h(y)*E-f(y)*k+(t+s)/2,_=f(y)*E+h(y)*k+(e+c)/2,A={x:(x.x-E)/g,y:(x.y-k)/m},T=Ve({x:1,y:0},A),P=Ve(A,{x:(-x.x-E)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(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+_}}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],O=[b,x],E={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(E={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+=He(O,[b,x])),O=[b,x],v&&w>=l&&l>M[2]){var _=(w-l)/(w-M[2]);E={x:O[0]*(1-_)+M[0]*_,y:O[1]*(1-_)+M[1]*_}}M=[b,x,w]}return v&&l>=w&&(E={x:s,y:c}),{length:w,point:E,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],O={x:0,y:0},E=[{x:v,y:b}];y&&c<=0&&(O={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&&E.push({x:v,y:b}),p&&(x+=He(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);O={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&c>=x&&(O={x:a,y:s}),{length:x,point:O,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function 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 O=0;O<=p;O+=1){if(m=(c=Ke(t,e,n,r,i,o,O/p)).x,y=c.y,u&&M.push({x:m,y:y}),h&&(v+=He(x,[m,y])),x=[m,y],g&&v>=a&&a>b[2]){var E=(v-a)/(v-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}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},O=M,E=M,k=M,S=0,_=0,A=h.length;_<A;_+=1)p=(l="M"===(u=(f=h[_])[0]))?p:[g,m].concat(f.slice(1)),l?(O=M={x:y=f[1],y:v=f[2]},w=0,d&&e<.001&&(k=M)):"L"===u?(w=(r=$e(p[0],p[1],p[2],p[3],(e||0)-S)).length,M=r.min,O=r.max,E=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,O=i.max,E=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,O=o.max,E=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,O=a.max,E=a.point):"Z"===u&&(w=(s=$e((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,O=s.max,E=s.point),d&&S<e&&S+w>=e&&(k=E),x.push(O),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 On(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 En(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=An){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(_n(this,t))}has(t){return super.has(_n(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 _n({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function An(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Tn(t){return t}function Pn(t,...e){return jn(t,Tn,Tn,e)}function Cn(t,...e){return jn(t,Array.from,Tn,e)}function Nn(t,e,...n){return jn(t,Tn,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 Hn(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?Hn(t,e,2*n):[s,c,l]}function $n(t,e,n){return Hn(t=+t,e=+e,n=+n)[2]}function Vn(t){return Math.max(1,Math.ceil(Math.log(On(t))/Math.LN2)+1)}function Yn(){var t=Tn,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=$n(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?Hn(e,t,n):Hn(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=$n(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===kn){const t=$n(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];O(o)&&O(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 Or(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 Er(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?_r:"value"===t?Ar:"sum"===t?Tr:"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 _r(t,e,n){return Cr((t=>n[t]))}function Ar(t,e,n){return Cr((t=>e[t]))}function Tr(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=Or(e,t,s),y=Er(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 O=new Set(w),E=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)=>O.has(e),last:(t,e)=>E.has(e)},u)})]}};function Lr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Nr.props={};const jr=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(Lr))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Nr({groupBy:c?["x","series"]:"x"})(e,n,r)};function Rr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Ir(t){const e=`${t.getFullYear()}-${Rr(t.getMonth()+1)}-${Rr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Rr(n)}:${Rr(r)}:${Rr(i)}`:e}jr.props={};const Br=(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]instanceof Date?Ir(t[e]):t[e])).join(", ")};return[t,Y({},n,{tooltip:{title:s}})]}};Br.props={};const Dr=()=>(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}}})]};Dr.props={};const Fr=()=>(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}}})]};Fr.props={};const zr=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{z:on(cn(t,0))},scale:{z:{guide:null}}})]};zr.props={};const Gr=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{size:an(cn(t,3))}})]};Gr.props={};const Wr=()=>(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)}})]};Wr.props={};const Hr=()=>(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)}})]};Hr.props={};const $r=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{y:rn(n)}})]};$r.props={};const Vr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{x:rn(n)}})]};Vr.props={};const Yr=()=>(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])}})]};Yr.props={};const qr=()=>(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])}})]};qr.props={};const Ur=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}})]}};Ur.props={};const Xr=()=>(t,e)=>[t,Y({scale:{x:{padding:0},y:{padding:0}}},e)];Xr.props={};const Kr=()=>(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})]};Kr.props={};const Zr=()=>(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]))))})]};Zr.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 Jr=()=>(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))}})]};Jr.props={};const ti=(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=Or(e,t,o),p=Er(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)}})]}};ti.props={};const ei=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)}})]}};ei.props={};const ni=(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=Or(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)=>En(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 ri(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function ii(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function oi(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}ni.props={};const ai=Math.sqrt(50),si=Math.sqrt(10),ci=Math.sqrt(2);function li(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>=ai?10:o>=si?5:o>=ci?2:1)*10**i:-(10**-i)/(o>=ai?10:o>=si?5:o>=ci?2:1)}function ui(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>=ai?i*=10:o>=si?i*=5:o>=ci&&(i*=2),e<t?-i:i}const fi=(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=li(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=li(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=li(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},hi=1e3,di=6e4,pi=36e5,gi=864e5,mi=6048e5,yi=2592e6,vi=31536e6;function bi(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 xi=bi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),wi=bi(hi,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+hi*e)}),(t=>t.getSeconds())),Mi=bi(di,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+di*e)}),(t=>t.getMinutes())),Oi=bi(pi,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+pi*e)}),(t=>t.getHours())),Ei=bi(gi,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+gi*e)}),(t=>t.getDate()-1)),ki=bi(yi,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),Si=bi(mi,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+mi*e)}),(t=>{const e=ki.floor(t),n=new Date(+t);return Math.floor((+n-+e)/mi)})),_i=bi(vi,(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())),Ai={millisecond:xi,second:wi,minute:Mi,hour:Oi,day:Ei,week:Si,month:ki,year:_i},Ti=bi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Pi=bi(hi,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+hi*e)}),(t=>t.getUTCSeconds())),Ci=bi(di,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+di*e)}),(t=>t.getUTCMinutes())),Ni=bi(pi,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+pi*e)}),(t=>t.getUTCHours())),Li=bi(gi,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+gi*e)}),(t=>t.getUTCDate()-1)),ji=bi(yi,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Ri=bi(mi,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+mi*e)}),(t=>{const e=ji.floor(t),n=new Date(+t);return Math.floor((+n-+e)/mi)})),Ii=bi(vi,(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())),Bi={millisecond:Ti,second:Pi,minute:Ci,hour:Ni,day:Li,week:Ri,month:ji,year:Ii};function Di(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Bi:Ai,{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=oi(s,h,0,d,u);let g;if(p===d){g=[c,ui(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(ui(o,a,f),1)]}return g}const Fi=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Di(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var zi=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Gi={}.toString,Wi=function(t,e){return Gi.call(t)==="[object "+e+"]"},Hi=function(t){return null==t},$i=function(t){return Array.isArray?Array.isArray(t):Wi(t,"Array")},Vi=function(t){return"object"==typeof t&&null!==t},Yi=function(t){if(!Vi(t)||!Wi(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},qi=function(t){return Wi(t,"Number")},Ui=function(t){return null===t},Xi=function(t){return void 0===t};function Ki(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&&Yi(o)?(Yi(t[i])||(t[i]={}),n<r?Ki(t[i],o,n+1,r):t[i]=e[i]):$i(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Zi=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)Ki(t,e[r]);return t},Qi=function(t,e){if(!zi(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},Ji=function(t){return t};function to(t){return Hi(t)?0:zi(t)?t.length:Object.keys(t).length}function eo(t){return!Xi(t)&&!Ui(t)&&!Number.isNaN(t)}const no=t=>e=>-t(-e),ro=(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?no(r):r},io=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?no(n):n},oo=(t,e,n,r)=>{const i=t<0,o=ro(r,i),a=io(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 ao={exports:{}},so={exports:{}},co=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))},lo=Array.prototype.concat,uo=Array.prototype.slice,fo=so.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];co(i)?e=lo.call(e,uo.call(i)):e.push(i)}return e};fo.wrap=function(t){return function(){return t(fo(arguments))}};var ho={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]},po=so.exports,go=Object.hasOwnProperty,mo=Object.create(null);for(var yo in ho)go.call(ho,yo)&&(mo[ho[yo]]=yo);var vo=ao.exports={to:{},get:{}};function bo(t,e,n){return Math.min(Math.max(e,t),n)}function xo(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}vo.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=vo.get.hsl(t),n="hsl";break;case"hwb":e=vo.get.hwb(t),n="hwb";break;default:e=vo.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},vo.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]:go.call(ho,e[1])?((i=ho[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]=bo(i[n],0,255);return i[3]=bo(i[3],0,1),i},vo.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,bo(parseFloat(e[2]),0,100),bo(parseFloat(e[3]),0,100),bo(isNaN(n)?1:n,0,1)]}return null},vo.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,bo(parseFloat(e[2]),0,100),bo(parseFloat(e[3]),0,100),bo(isNaN(n)?1:n,0,1)]}return null},vo.to.hex=function(){var t=po(arguments);return"#"+xo(t[0])+xo(t[1])+xo(t[2])+(t[3]<1?xo(Math.round(255*t[3])):"")},vo.to.rgb=function(){var t=po(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]+")"},vo.to.rgb.percent=function(){var t=po(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]+")"},vo.to.hsl=function(){var t=po(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},vo.to.hwb=function(){var t=po(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},vo.to.keyword=function(t){return mo[t.slice(0,3)]};var wo=ao.exports;function Mo(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 Oo(t){const e=wo.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*Mo(a,o,e+1/3),255*Mo(a,o,e),255*Mo(a,o,e-1/3),i]}(r):null}const Eo=(t,e)=>n=>t*(1-n)+e*n,ko=(t,e)=>"number"==typeof t&&"number"==typeof e?Eo(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Oo(t),r=Oo(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,So=(t,e)=>{const n=Eo(t,e);return t=>Math.round(n(t))};function _o({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ao(t){return"object"==typeof t?t.valueOf():t}class To extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Ao,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(_o({map:this.map,initKey:this.initKey},t))}has(t){return super.has(_o({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 Po{constructor(t){this.options=Zi({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Zi({},this.options,t),this.rescale(t)}rescale(t){}}const Co=Symbol("defaultUnknown");function No(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Lo(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Co)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function jo(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Ro extends Po{getDefaultOptions(){return{domain:[],range:[],unknown:Co}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&No(this.domainIndexMap,this.getDomain(),this.domainKey),Lo({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&No(this.rangeIndexMap,this.getRange(),this.rangeKey),Lo({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=jo(e),this.rangeKey=jo(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 Ro(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 Io(t){return Math.round(1e12*t)/1e12}function Bo(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 To(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new To(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 O=a?Math.round(M):M;const E=new Array(c);for(let t=0;t<c;t+=1){E[t]=Io(O);const n=e[t];O+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:E}}class Do extends Ro{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Co,flex:[]}}constructor(t){super(t)}clone(){return new Do(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 Bo(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 Fo=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=li(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 zo extends Po{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Fo}}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 qi(r)&&qi(i)?t(r,i,n):[]}clone(){return new zo(this.options)}}function Go(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Wo=[1,5,2,2.5,4,3],Ho=100*Number.EPSILON;function $o(t,e,n,r,i,o){const a=to(e),s=Qi(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<Ho||o-l<Ho)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function Vo(t,e,n){const r=to(e);return 1-Qi(e,t)/(r-1)-n+1}function Yo(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 qo(t,e){return t>=e?2-(t-1)/(e-1):1}function Uo(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Xo(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const Ko=(t,e,n=5,r=!0,i=Wo,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=Vo(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=qo(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=Xo(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=$o(l,i,c,n,d,p),y=Uo(t,e,n,d),v=Yo(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=Go(s.lmax),u=Go(s.lmin),f=Go(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Go(u);for(let t=1;t<h;t+=1)d[t]=Go(d[t-1]+f);return d};class Zo extends Po{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Ko}}map(t){return eo(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Zo(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return qi(r)&&qi(i)?n(r,i,e):[]}}const Qo=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=ii(r,i),c=n(o,a)):(s=ii(i,r),c=n(a,o)),ri(c,s)},Jo=(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]=ii(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=oi(t,e,1,r)-1,a=i[n];return ri(o[n],a)(e)}},ta=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Jo:Qo)(t,e,r?So:n);class ea extends Po{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Eo,tickCount:5}}map(t){return eo(t)?this.output(t):this.options.unknown}invert(t){return eo(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 fi}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]):Ji}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=ta(n.map(t),r,o,i);this.output=ri(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=ta(i,r.map(t),Eo);this.input=ri(e,n,o)}}class na extends ea{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:ko,tickMethod:Fo,tickCount:5}}chooseTransforms(){return[Ji,Ji]}clone(){return new na(this.options)}}class ra extends Do{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Co,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new ra(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const ia=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class oa extends ea{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:ko,tickMethod:Fo,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[Ji,Ji];const e=.5===t?ia:(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 oa(this.options)}}class aa extends oa{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:ko,tickMethod:Fo,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new aa(this.options)}}class sa extends Po{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!eo(t))return this.options.unknown;const e=oi(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 sa(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ca=(t,e,n,r=10)=>{const i=t<0,o=io(r,i),a=ro(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=Fo(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=Fo(u,f,t).map(o)}return s?h.reverse():h};class la extends ea{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:ko,tickMethod:ca,tickCount:5}}chooseNice(){return oo}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[ro(t,n),io(t,n)]}clone(){return new la(this.options)}}class ua extends sa{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Ko}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=fi(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 ua(this.options)}}function fa(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 ha extends sa{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Ko}}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(fa(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 ha(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var da=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,pa=/\[([^]*?)\]/gm;function ga(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function ma(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 ya=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],va=["January","February","March","April","May","June","July","August","September","October","November","December"],ba=ga(va,3),xa=ma({},{dayNamesShort:ga(ya,3),dayNames:ya,monthNamesShort:ba,monthNames:va,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),wa=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ma={D:function(t){return String(t.getDate())},DD:function(t){return wa(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return wa(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 wa(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 wa(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return wa(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return wa(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return wa(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return wa(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return wa(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return wa(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return wa(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?"-":"+")+wa(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+wa(Math.floor(Math.abs(e)/60),2)+":"+wa(Math.abs(e)%60,2)}},Oa={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 Ea=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Di(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function ka(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Sa extends ea{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:Ea,interpolate:Eo,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Fi}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?Bi:Ai,r=e?ka:Ji;return e=>function(t,e,n){if(void 0===e&&(e=Oa.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=Oa[e]||e).replace(pa,(function(t,e){return r.push(e),"@@@"}));var i=ma(ma({},xa),n);return(e=e.replace(da,(function(e){return Ma[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 Sa(this.options)}}var _a,Aa=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 Ta=_a=class extends na{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Ji,tickMethod:Fo,tickCount:5}}constructor(t){super(t)}clone(){return new _a(this.options)}};function Pa(t,e,n){if(null===t)return[-.5,.5];const r=Sr(t,e),i=new Do({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Ca(t,e,n){return e*(1-t)+n*t}Ta=_a=Aa([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 qi(n)?Math.round(n):n})(i):i;this.output=ri(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return ri(Eo(0,1),ii(e,n))}))],Ta);const Na=(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=Pa(l,s,n),h=Pa(u,c,r),d=t.map((()=>Ca(i(),...h))),p=t.map((()=>Ca(i(),...f)));return[t,Y({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:rn(d),dx:rn(p)}})]}};Na.props={};const La=(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=Pa(s,a,e),l=t.map((()=>Ca(n(),...c)));return[t,Y({scale:{x:{padding:.5}}},r,{encode:{dx:rn(l)}})]}};La.props={};const ja=(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=Or(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])])))})]}};ja.props={};const Ra=(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=Or(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 Ia(t,e){return[t[0]]}function Ba(t,e){return[t[t.length-1]]}function Da(t,e){return[t[Un(t,(t=>e[t]))]]}function Fa(t,e){return[t[Kn(t,(t=>e[t]))]]}Ra.props={};const za=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=Or(e,t,i),[s]=ln(o,n),c=function(t){return"function"==typeof t?t:{first:Ia,last:Ba,max:Da,min:Fa}[t]||Ia}(r);return[a.flatMap((t=>c(t,s))),i]}};za.props={};const Ga=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return za(Object.assign({channel:"x",selector:e},n))};Ga.props={};const Wa=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return za(Object.assign({channel:"y",selector:e},n))};function Ha(t){return e=>null===e?t:`${t} of ${e}`}function $a(){return[(t,e)=>tr(t,(t=>+e[t])),Ha("mean")]}function Va(){return[(t,e)=>er(t,(t=>+e[t])),Ha("median")]}function Ya(){return[(t,e)=>qn(t,(t=>+e[t])),Ha("max")]}function qa(){return[(t,e)=>Xn(t,(t=>+e[t])),Ha("min")]}function Ua(){return[(t,e)=>t.length,Ha("count")]}function Xa(){return[(t,e)=>nr(t,(t=>+e[t])),Ha("sum")]}function Ka(){return[(t,e)=>e[t[0]],Ha("first")]}function Za(){return[(t,e)=>e[t[t.length-1]],Ha("last")]}Wa.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:$a,max:Ya,count:Ua,first:Ka,last:Za,sum:Xa,min:qa,median:Va}[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 Ja=(t={})=>{const{channels:e=["x","y"]}=t,n=he(t,["channels"]);return Qa(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Or(e,t,n)}))};Ja.props={};const ts=(t={})=>Ja(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));ts.props={};const es=(t={})=>Ja(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));es.props={};const ns=(t={})=>Ja(Object.assign(Object.assign({},t),{channels:["color"]}));function rs(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}}})]}ns.props={};const is=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=he(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?rs(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))};is.props={};const os=(t={})=>is(Object.assign(Object.assign({},t),{channel:"x"}));os.props={};const as=(t={})=>is(Object.assign(Object.assign({},t),{channel:"color"}));as.props={};const ss=(t={})=>is(Object.assign(Object.assign({},t),{channel:"y"}));ss.props={};const cs=(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 ls([t,e],[n,r]){return[t-n,e-r]}function us([t,e],[n,r]){return[t+n,e+r]}function fs([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function hs([t,e]){return Math.atan2(e,t)}function ds([t,e]){return hs([t,e])+Math.PI/2}function ps(t,e){const n=hs(t),r=hs(e);return n<r?r-n:2*Math.PI-(n-r)}function gs(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 ms([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function ys(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]=gs(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})`}))}cs.props={};const vs=()=>(t,e)=>[t,Y({},e,{modifier:ys,axis:!1})];vs.props={};const bs="thresholds";function xs(t){const[e,n]=kn(t);return Math.min(200,function(t,e,n){const r=On(t),i=En(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const ws=(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(bs))))),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,bs),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]||xs(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())}}))};ws.props={};const Ms=(t={})=>{const{thresholds:e}=t;return ws(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Os(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]))}Ms.props={};const Es=(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 Os;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=Or(r,t,e),[s]=ln(o,"x"),[c]=ln(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};Es.props={};const ks=(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]])).filter((t=>void 0!==t))})]));return[s,Y({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function Ss(t){return function(){return t}}ks.props={};const _s=Math.abs,As=Math.atan2,Ts=Math.cos,Ps=Math.max,Cs=Math.min,Ns=Math.sin,Ls=Math.sqrt,js=1e-12,Rs=Math.PI,Is=Rs/2,Bs=2*Rs;function Ds(t){return t>=1?Is:t<=-1?-Is:Math.asin(t)}const Fs=Math.PI,zs=2*Fs,Gs=1e-6,Ws=zs-Gs;function Hs(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class $s{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Hs:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Hs;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>Gs)if(Math.abs(u*s-c*l)>Gs&&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((Fs-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Gs&&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)>Gs||Math.abs(this._y1-l)>Gs)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%zs+zs),f>Ws?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>Gs&&this._append`A${n},${n},0,${+(f>=Fs)},${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 Vs(){return new $s}function Ys(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 $s(e)}function qs(t){return t.innerRadius}function Us(t){return t.outerRadius}function Xs(t){return t.startAngle}function Ks(t){return t.endAngle}function Zs(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)/Ls(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,O=(b<0?-1:1)*Ls(Ps(0,w*w*x-M*M)),E=(M*b-v*O)/x,k=(-M*v-b*O)/x,S=(M*b+v*O)/x,_=(-M*v+b*O)/x,A=E-m,T=k-y,P=S-m,C=_-y;return A*A+T*T>P*P+C*C&&(E=S,k=_),{cx:E,cy:k,x01:-u,y01:-f,x11:E*(i/w-1),y11:k*(i/w-1)}}function Js(){var t=qs,e=Us,n=Ss(0),r=null,i=Xs,o=Ks,a=Zs,s=null,c=Ys(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Is,p=o.apply(this,arguments)-Is,g=_s(p-d),m=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>js)if(g>Bs-js)s.moveTo(h*Ts(d),h*Ns(d)),s.arc(0,0,h,d,p,!m),f>js&&(s.moveTo(f*Ts(p),f*Ns(p)),s.arc(0,0,f,p,d,m));else{var y,v,b=d,x=p,w=d,M=p,O=g,E=g,k=a.apply(this,arguments)/2,S=k>js&&(r?+r.apply(this,arguments):Ls(f*f+h*h)),_=Cs(_s(h-f)/2,+n.apply(this,arguments)),A=_,T=_;if(S>js){var P=Ds(S/f*Ns(k)),C=Ds(S/h*Ns(k));(O-=2*P)>js?(w+=P*=m?1:-1,M-=P):(O=0,w=M=(d+p)/2),(E-=2*C)>js?(b+=C*=m?1:-1,x-=C):(E=0,b=x=(d+p)/2)}var N=h*Ts(b),L=h*Ns(b),j=f*Ts(M),R=f*Ns(M);if(_>js){var I,B=h*Ts(x),D=h*Ns(x),F=f*Ts(w),z=f*Ns(w);if(g<Rs)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<js))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],H=B-I[0],$=D-I[1],V=1/Ns(function(t){return t>1?0:t<-1?Rs:Math.acos(t)}((G*H+W*$)/(Ls(G*G+W*W)*Ls(H*H+$*$)))/2),Y=Ls(I[0]*I[0]+I[1]*I[1]);A=Cs(_,(f-Y)/(V-1)),T=Cs(_,(h-Y)/(V+1))}else A=T=0}E>js?T>js?(y=Qs(F,z,N,L,h,T,m),v=Qs(B,D,j,R,h,T,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),T<_?s.arc(y.cx,y.cy,T,As(y.y01,y.x01),As(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,As(y.y01,y.x01),As(y.y11,y.x11),!m),s.arc(0,0,h,As(y.cy+y.y11,y.cx+y.x11),As(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,T,As(v.y11,v.x11),As(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!m)):s.moveTo(N,L),f>js&&O>js?A>js?(y=Qs(j,R,B,D,f,-A,m),v=Qs(N,L,F,z,f,-A,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),A<_?s.arc(y.cx,y.cy,A,As(y.y01,y.x01),As(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,A,As(y.y01,y.x01),As(y.y11,y.x11),!m),s.arc(0,0,f,As(y.cy+y.y11,y.cx+y.x11),As(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,A,As(v.y11,v.x11),As(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-Rs/2;return[Ts(r)*n,Ns(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ss(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ss(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ss(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ss(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ss(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function tc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ec(t){this._context=t}function nc(t){return new ec(t)}function rc(t){return t[0]}function ic(t){return t[1]}function oc(t,e){var n=Ss(!0),r=null,i=nc,o=null,a=Ys(s);function s(s){var c,l,u,f=(s=tc(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?rc:Ss(t),e="function"==typeof e?e:void 0===e?ic:Ss(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ss(!!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 ac(t,e,n){var r=null,i=Ss(!0),o=null,a=nc,s=null,c=Ys(l);function l(l){var u,f,h,d,p,g=(l=tc(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 oc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?rc:Ss(+t),e="function"==typeof e?e:Ss(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?ic:Ss(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ss(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ss(+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:Ss(!!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}Vs.prototype=$s.prototype,ec.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 sc=lc(nc);function cc(t){this._curve=t}function lc(t){function e(e){return new cc(t(e))}return e._curve=t,e}function uc(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(lc(t)):e()._curve},t}function fc(){}function hc(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 dc(t,e){this._context=t,this._k=(1-e)/6}function pc(t,e){this._context=t,this._k=(1-e)/6}function gc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>js){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>js){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 mc(t,e){this._context=t,this._alpha=e}cc.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))}},dc.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:hc(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:hc(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 dc(t,e)}return n.tension=function(e){return t(+e)},n}(0),pc.prototype={areaStart:fc,areaEnd:fc,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:hc(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 pc(t,e)}return n.tension=function(e){return t(+e)},n}(0),mc.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:gc(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 yc=function t(e){function n(t){return e?new mc(t,e):new dc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function vc(t,e){this._context=t,this._alpha=e}vc.prototype={areaStart:fc,areaEnd:fc,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:gc(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 bc=function t(e){function n(t){return e?new vc(t,e):new pc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function xc(t){this._context=t}function wc(t){return new xc(t)}function Mc(t){return t<0?-1:1}function Oc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Mc(o)+Mc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Ec(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function kc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Sc(t){this._context=t}function _c(t){this._context=new Ac(t)}function Ac(t){this._context=t}function Tc(t){return new Sc(t)}function Pc(t){return new _c(t)}function Cc(t,e){this._context=t,this._t=e}function Nc(t){return new Cc(t,.5)}function Lc(t){return new Cc(t,0)}function jc(t){return new Cc(t,1)}function Rc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Ic(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Bc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Dc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Fc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function zc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function Gc(t){return Dc(t)||Ic(t)}function Wc(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function Hc(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]}xc.prototype={areaStart:fc,areaEnd:fc,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))}},Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:kc(this,this._t0,Ec(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){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,kc(this,Ec(this,n=Oc(this,t,e)),n);break;default:kc(this,this._t0,n=Oc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(_c.prototype=Object.create(Sc.prototype)).point=function(t,e){Sc.prototype.point.call(this,e,t)},Ac.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},Cc.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 $c="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Vc={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}(Vc);var Yc=Vc.exports;function qc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Uc(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Xc(){}var Kc=.7,Zc=1/Kc,Qc="\\s*([+-]?\\d+)\\s*",Jc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",el=/^#([0-9a-f]{3,8})$/,nl=new RegExp("^rgb\\("+[Qc,Qc,Qc]+"\\)$"),rl=new RegExp("^rgb\\("+[tl,tl,tl]+"\\)$"),il=new RegExp("^rgba\\("+[Qc,Qc,Qc,Jc]+"\\)$"),ol=new RegExp("^rgba\\("+[tl,tl,tl,Jc]+"\\)$"),al=new RegExp("^hsl\\("+[Jc,tl,tl]+"\\)$"),sl=new RegExp("^hsla\\("+[Jc,tl,tl,Jc]+"\\)$"),cl={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 ll(){return this.rgb().formatHex()}function ul(){return this.rgb().formatRgb()}function fl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=el.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?hl(e):3===n?new ml(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?dl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?dl(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=nl.exec(t))?new ml(e[1],e[2],e[3],1):(e=rl.exec(t))?new ml(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=il.exec(t))?dl(e[1],e[2],e[3],e[4]):(e=ol.exec(t))?dl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=al.exec(t))?xl(e[1],e[2]/100,e[3]/100,1):(e=sl.exec(t))?xl(e[1],e[2]/100,e[3]/100,e[4]):cl.hasOwnProperty(t)?hl(cl[t]):"transparent"===t?new ml(NaN,NaN,NaN,0):null}function hl(t){return new ml(t>>16&255,t>>8&255,255&t,1)}function dl(t,e,n,r){return r<=0&&(t=e=n=NaN),new ml(t,e,n,r)}function pl(t){return t instanceof Xc||(t=fl(t)),t?new ml((t=t.rgb()).r,t.g,t.b,t.opacity):new ml}function gl(t,e,n,r){return 1===arguments.length?pl(t):new ml(t,e,n,null==r?1:r)}function ml(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function yl(){return"#"+bl(this.r)+bl(this.g)+bl(this.b)}function vl(){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 bl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xl(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ml(t,e,n,r)}function wl(t){if(t instanceof Ml)return new Ml(t.h,t.s,t.l,t.opacity);if(t instanceof Xc||(t=fl(t)),!t)return new Ml;if(t instanceof Ml)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 Ml(a,s,c,t.opacity)}function Ml(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ol(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}qc(Xc,fl,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ll,formatHex:ll,formatHsl:function(){return wl(this).formatHsl()},formatRgb:ul,toString:ul}),qc(ml,gl,Uc(Xc,{brighter:function(t){return t=null==t?Zc:Math.pow(Zc,t),new ml(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Kc:Math.pow(Kc,t),new ml(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:yl,formatHex:yl,formatRgb:vl,toString:vl})),qc(Ml,(function(t,e,n,r){return 1===arguments.length?wl(t):new Ml(t,e,n,null==r?1:r)}),Uc(Xc,{brighter:function(t){return t=null==t?Zc:Math.pow(Zc,t),new Ml(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Kc:Math.pow(Kc,t),new Ml(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 ml(Ol(t>=240?t-240:t+120,i,r),Ol(t,i,r),Ol(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 El=Math.PI/180,kl=180/Math.PI,Sl=-.14861,_l=1.78277,Al=-.29227,Tl=-.90649,Pl=1.97294,Cl=Pl*Tl,Nl=Pl*_l,Ll=_l*Al-Tl*Sl;function jl(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Rl)return new Rl(t.h,t.s,t.l,t.opacity);t instanceof ml||(t=pl(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Ll*r+Cl*e-Nl*n)/(Ll+Cl-Nl),o=r-i,a=(Pl*(n-i)-Al*o)/Tl,s=Math.sqrt(a*a+o*o)/(Pl*i*(1-i)),c=s?Math.atan2(a,o)*kl-120:NaN;return new Rl(c<0?c+360:c,s,i,t.opacity)}(t):new Rl(t,e,n,null==r?1:r)}function Rl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Il(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Bl(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 Dl(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 zl(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=Dl(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}}qc(Rl,jl,Uc(Xc,{brighter:function(t){return t=null==t?Zc:Math.pow(Zc,t),new Rl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Kc:Math.pow(Kc,t),new Rl(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*El,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new ml(255*(e+n*(Sl*r+_l*i)),255*(e+n*(Al*r+Tl*i)),255*(e+n*(Pl*r)),this.opacity)}}));var Gl=1e-4;function Wl(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=Il(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<Gl);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))],Il(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=Il(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 Hl(t,e,n,r){return Il(t,e,n,r)}function $l(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Vl(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 Yl(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 ql(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 Ul(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=ql(t,n,i,a),f=ql(e,r,o,s),h=0;h<u.length;h++)c.push(Yl(t,n,i,a,u[h]));for(h=0;h<f.length;h++)l.push(Yl(e,r,o,s,f[h]));return Bl(c,l)}function Xl(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 Wl([t,n,i,a],[e,r,o,s],c,l,Yl,u)}(t,e,n,r,i,o,a,s,c,l,u);return Il(f.x,f.y,c,l)}function Kl(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+=Il(r[0],r[1],i[0],i[1])}return e}(t)}function Zl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ql(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 Jl(t,e,n,r,i,o){var a=Ql(t,n,i)[0],s=Ql(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Zl(t,n,i,a)),void 0!==s&&l.push(Zl(e,r,o,s)),Bl(c,l)}function tu(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return Wl([t,n,i],[e,r,o],a,s,Zl)}(t,e,n,r,i,o,a,s);return Il(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==$c||"undefined"!=typeof self&&self;var eu={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}()}(eu);var nu,ru,iu=eu.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"}(nu||(nu={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(ru||(ru={}));var ou=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}(),au=function(){function t(t){this.clipSpaceNearZ=ru.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 su(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function cu(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function lu(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function uu(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function fu(t){return void 0===t?0:t>360||t<-360?t%360:t}function hu(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Rt(t):T(t)?Bt(t,e,n):Bt(t[0],t[1]||e,t[2]||n)}function du(t){return t*(Math.PI/180)}function pu(t){return t*(180/Math.PI)}function gu(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 mu(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 yu(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=pu(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var vu=rt(),bu=rt(),xu=Qt(),wu=[jt(),jt(),jt()],Mu=jt();function Ou(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 Eu,ku=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){su(this.center,t),su(this.halfExtents,e),cu(this.min,this.center,this.halfExtents),lu(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){lu(this.center,e,t),uu(this.center,this.center,.5),cu(this.halfExtents,e,t),uu(this.halfExtents,this.halfExtents,.5),su(this.min,t),su(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],O=x[2],E=y-w,k=y+w,S=v-M,_=v+M,A=b-O,T=b+O;E<u&&(u=E),k>f&&(f=k),S<h&&(h=S),_>d&&(d=_),A<p&&(p=A),T>g&&(g=T),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),O=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]+O*o[2],cu(this.min,n,r),lu(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?su([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?su([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}(),Su=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 $t(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"}(Eu||(Eu={}));var _u,Au,Tu,Pu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Su)}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}(),Cu=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}(),Nu=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}(),Lu="Method not implemented.",ju="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(_u||(_u={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(Au||(Au={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(Tu||(Tu={}));var Ru,Iu,Bu,Du,Fu,zu="updated",Gu=2e-4,Wu=function(){function t(){this.clipSpaceNearZ=ru.NEGATIVE_ONE,this.eventEmitter=new Yc,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=_u.EXPLORING,this.trackingMode=Au.DEFAULT,this.projectionMode=Tu.PERSPECTIVE,this.frustum=new Pu,this.orthoMatrix=rt()}return t.prototype.isOrtho=function(){return this.projectionMode===Tu.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===_u.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===_u.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!==_u.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===Tu.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===Tu.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===Tu.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===Tu.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===Tu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Tu.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=$t(s,this.right)/It(this.right),l=$t(s,this.up)/It(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=Tu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(du(.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===ru.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=Tu.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===ru.NEGATIVE_ONE?_t(this.projectionMatrix,f,h,p,d,i,o):At(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=hu(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=hu(t,e,n),this.trackingMode===Au.CINEMATIC){var i=Gt(jt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=It(i),a=pu(Math.asin(e/o)),s=90+pu(Math.atan2(n,t)),c=rt();gt(c,c,du(s)),pt(c,c,du(a)),r=qt(jt(),[0,1,0],c)}return lt(this.matrix,Tt(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<Gu&&(this.distance=Gu),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=fu(t),this.computeMatrix(),this._getAxes(),this.type===_u.ORBITING||this.type===_u.EXPLORING?this._getPosition():this.type===_u.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=fu(t),this.computeMatrix(),this._getAxes(),this.type===_u.ORBITING||this.type===_u.EXPLORING?this._getPosition():this.type===_u.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=fu(t),this.computeMatrix(),this._getAxes(),this.type===_u.ORBITING||this.type===_u.EXPLORING?this._getPosition():this.type===_u.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],du(this.roll));st(this.matrix);var e=ee(te(),[1,0,0],du((this.rotateWorld&&this.type!==_u.TRACKING||this.type===_u.TRACKING?1:-1)*this.elevation)),n=ee(te(),[0,1,0],du((this.rotateWorld&&this.type!==_u.TRACKING||this.type===_u.TRACKING?1:-1)*this.azimuth)),r=ne(te(),n,e);r=ne(te(),r,t);var i=Ot(rt(),r);this.type===_u.ORBITING||this.type===_u.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===_u.TRACKING&&(ht(this.matrix,this.matrix,this.position),ft(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=hu(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,hu(Jt(Qt(),[1,0,0,0],this.matrix))),Dt(this.up,hu(Jt(Qt(),[0,1,0,0],this.matrix))),Dt(this.forward,hu(Jt(Qt(),[0,0,1,0],this.matrix))),Ht(this.right,this.right),Ht(this.up,this.up),Ht(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===_u.TRACKING||this.rotateWorld?(this.elevation=pu(Math.asin(e/r)),this.azimuth=pu(Math.atan2(-t,-n))):(this.elevation=-pu(Math.asin(e/r)),this.azimuth=-pu(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Dt(this.position,hu(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===Tu.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(zu)}},t.prototype.rotate=function(t,e,n){throw new Error(Lu)},t.prototype.pan=function(t,e){throw new Error(Lu)},t.prototype.dolly=function(t){throw new Error(Lu)},t.prototype.createLandmark=function(t,e){throw new Error(Lu)},t.prototype.gotoLandmark=function(t,e){throw new Error(Lu)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Lu)},t}();function Hu(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(Hu.Cache||Map),n}Hu.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"}(Ru||(Ru={})),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"}(Iu||(Iu={})),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"}(Bu||(Bu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Du||(Du={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Fu||(Fu={}));var $u,Vu=[{name:"em",unit_type:Ru.kEms},{name:"px",unit_type:Ru.kPixels},{name:"deg",unit_type:Ru.kDegrees},{name:"rad",unit_type:Ru.kRadians},{name:"grad",unit_type:Ru.kGradians},{name:"ms",unit_type:Ru.kMilliseconds},{name:"s",unit_type:Ru.kSeconds},{name:"rem",unit_type:Ru.kRems},{name:"turn",unit_type:Ru.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"}($u||($u={}));var Yu,qu=function(t){return t?"number"===t?Ru.kNumber:"percent"===t||"%"===t?Ru.kPercentage:function(t){return Vu.find((function(e){return e.name===t})).unit_type}(t):Ru.kUnknown},Uu=function(t){var e=1;switch(t){case Ru.kPixels:case Ru.kDegrees:case Ru.kSeconds:break;case Ru.kMilliseconds:e=.001;break;case Ru.kRadians:e=180/Math.PI;break;case Ru.kGradians:e=.9;break;case Ru.kTurns:e=360}return e},Xu=function(t){switch(t){case Ru.kNumber:case Ru.kInteger:return"";case Ru.kPercentage:return"%";case Ru.kEms:return"em";case Ru.kRems:return"rem";case Ru.kPixels:return"px";case Ru.kDegrees:return"deg";case Ru.kRadians:return"rad";case Ru.kGradians:return"grad";case Ru.kMilliseconds:return"ms";case Ru.kSeconds:return"s";case Ru.kTurns:return"turn"}return""},Ku=function(){function t(){}return t.isAngle=function(t){return t===Ru.kDegrees||t===Ru.kRadians||t===Ru.kGradians||t===Ru.kTurns},t.isLength=function(t){return t>=Ru.kEms&&t<Ru.kDegrees},t.isRelativeUnit=function(t){return t===Ru.kPercentage||t===Ru.kEms||t===Ru.kRems},t.isTime=function(t){return t===Ru.kSeconds||t===Ru.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Du.kNo,Fu.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=$u.kUnitType&&this.getType()<=$u.kClampType},t}(),Zu=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 $u.kColorType},e.prototype.to=function(t){return this},e}(Ku);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Yu||(Yu={}));var Qu=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 $u.kColorType},e}(Ku),Ju=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 $u.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Ku),tf=Hu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),ef=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function nf(t){return"function"==typeof t}var rf={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},of=Hu((function(t){var e=tf(t),n=rf[e];return e=(null==n?void 0:n.alias)||e})),af=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},sf=function(t){return function(t){switch(t){case Iu.kUNumber:return Ru.kNumber;case Iu.kULength:return Ru.kPixels;case Iu.kUPercent:return Ru.kPercentage;case Iu.kUTime:return Ru.kSeconds;case Iu.kUAngle:return Ru.kDegrees;default:return Ru.kUnknown}}(function(t){switch(t){case Ru.kNumber:case Ru.kInteger:return Iu.kUNumber;case Ru.kPercentage:return Iu.kUPercent;case Ru.kPixels:return Iu.kULength;case Ru.kMilliseconds:case Ru.kSeconds:return Iu.kUTime;case Ru.kDegrees:case Ru.kRadians:case Ru.kGradians:case Ru.kTurns:return Iu.kUAngle;default:return Iu.kUOther}}(t))},cf=function(t){function e(e,n){void 0===n&&(n=Ru.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?qu(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 $u.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=sf(this.unit);if(n!==sf(t)||n===Ru.kUnknown)return null;var r=Uu(this.unit)/Uu(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Ru.kUnknown:break;case Ru.kInteger:r=Number(this.value).toFixed(0);break;case Ru.kNumber:case Ru.kPercentage:case Ru.kEms:case Ru.kRems:case Ru.kPixels:case Ru.kDegrees:case Ru.kRadians:case Ru.kGradians:case Ru.kMilliseconds:case Ru.kSeconds:case Ru.kTurns:var i=this.value,o=Xu(this.unit);if(i<-999999||i>999999){var a=Xu(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?af(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Ku),lf=new cf(0,"px");new cf(1,"px");var uf,ff,hf=new cf(0,"deg"),df=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}(Zu),pf=new Ju("unset"),gf=new Ju("initial"),mf=new Ju("inherit"),yf={"":pf,unset:pf,initial:gf,inherit:mf},vf=function(t){return yf[t]||(yf[t]=new Ju(t)),yf[t]},bf=new df(0,0,0,0,!0),xf=new df(0,0,0,0),wf=Hu((function(t,e,n,r){return new df(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Mf=function(t,e){return void 0===e&&(e=Ru.kNumber),new cf(t,e)},Of=new cf(50,"%");!function(t){t[t.Standard=0]="Standard"}(uf||(uf={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(ff||(ff={}));var Ef,kf={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Nu(0,0,0,0)};function Sf(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>"}(Ef||(Ef={}));var _f=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 Af=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Tf=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Pf=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Cf=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Nf={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},Lf=Hu((function(t){var e;return e="angular"===t.type?Number(t.value):Nf[t.value]||0,Mf(e,"deg")})),jf=Hu((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:Mf(e,r),cy:Mf(n,i)}})),Rf=Hu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return _f(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:Mf(Number(t.length.value),"%"),color:Sf(t)}}));if("linear-gradient"===e)return new Qu(Yu.LinearGradient,{angle:n?Lf(n):hf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=jf(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?vf(f):Mf(f,u)}return new Qu(Yu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Af.exec(t);if(r){var i=(null===(e=r[2].match(Cf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Qu(Yu.LinearGradient,{angle:Mf(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:Mf(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(Cf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Mf(50,"%"),cy:Mf(50,"%"),steps:r.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:Mf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!_(o))return[new Qu(Yu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=Pf.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 If(t){return t&&!!t.image}function Bf(t){return t&&!y(t.r)&&!y(t.g)&&!y(t.b)}var Df=Hu((function(t){if(If(t))return fe({repetition:"repeat"},t);if(y(t)&&(t=""),"transparent"===t)return xf;"currentColor"===t&&(t="black");var e=Rf(t);if(e)return e;var n=fl(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),wf.apply(void 0,ve([],ye(r),!1))}));function Ff(t,e){if(Bf(t)&&Bf(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(A(e[n],0,255));return e[3]=A(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function zf(t,e){if(y(e))return Mf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Mf(Number(e),"px");if("deg".search(t)>=0)return Mf(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 Mf(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Gf=Hu((function(t){return zf(new RegExp("px","g"),t)}));Hu((function(t){return zf(new RegExp("%","g"),t)}));var Wf=function(t){return T(t)||isFinite(Number(t))?Mf(Number(t)||0,"px"):zf(new RegExp("px|%|em|rem","g"),t)},Hf=Hu((function(t){return zf(new RegExp("deg|rad|grad|turn","g"),t)}));function $f(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=sf(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=Xu(t.unit)):(cf.isLength(t.unit)||cf.isLength(e.unit))&&(a=Uf(t,i,n),s=Uf(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Vf(t){var e=0;return t.unit===Ru.kDegrees?e=t.value:t.unit===Ru.kRadians?e=pu(Number(t.value)):t.unit===Ru.kTurns&&(e=360*Number(t.value)),e}function Yf(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):_(t)?n=t.split(" ").map((function(t){return Number(t)})):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 qf(t){return _(t)?t.split(" ").map((function(t){return Wf(t)})):t.map((function(t){return Wf(t.toString())}))}function Uf(t,e,n){if(0===t.value)return 0;if(t.unit===Ru.kPixels)return Number(t.value);if(t.unit===Ru.kPercentage&&n){var r=n.nodeName===nu.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var Xf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Kf(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,Xf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return zf(/deg|rad|grad|turn|px|%/g,t)||Df(t)}))}),n.lastIndex===t.length)return r}return[]}function Zf(t){return t.toString()}var Qf=Hu((function(t){return"number"==typeof t?Mf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Mf(Number(t)):Mf(0)}));function Jf(t,e){return[t,e,Zf]}function th(t,e){return function(n,r){return[n,r,function(n){return Zf(A(n,t,e))}]}}function eh(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function nh(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 rh(t,e){return t[0]===e[0]&&t[1]===e[1]}function ih(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 oh(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Hu((function(t){return _(t)?t.split(" ").map(Qf):t.map(Qf)}));var ah=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)},sh=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=du(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=ah({x:1,y:0},v),x=ah(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),O=n*Math.sin(w);return{x:Math.cos(c)*M-Math.sin(c)*O+y.x,y:Math.sin(c)*M+Math.cos(c)*O+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function ch(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=sh({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=sh({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 lh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function uh(t,e){return lh(t)*lh(e)?(t[0]*e[0]+t[1]*e[1])/(lh(t)*lh(e)):1}function fh(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(uh(t,e))}function hh(t,e){var n=e[1],r=e[2],i=j(du(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=fh([1,0],x),O=fh(x,w);return uh(x,w)<=-1&&(O=Math.PI),uh(x,w)>=1&&(O=0),0===a&&O>0&&(O-=2*Math.PI),1===a&&O<0&&(O+=2*Math.PI),{cx:v,cy:b,rx:rh(t,[l,u])?0:n,ry:rh(t,[l,u])?0:r,startAngle:M,endAngle:M+O,xRotation:i,arcFlag:o,sweepFlag:a}}function dh(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 ph(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case nu.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 nu.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=dh(d,d,g,void 0===m?0:m);break;case nu.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,O=(g=void 0===M?0:M,y.cy);n=dh(b,w,g,void 0===O?0:O);break;case nu.POLYLINE:case nu.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===nu.POLYGON);break;case nu.RECT:var E=t.parsedStyle,k=E.width,S=void 0===k?0:k,_=E.height,T=void 0===_?0:_,P=E.x,C=void 0===P?0:P,N=E.y,L=void 0===N?0:N,j=E.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,T,C,L,R&&j.map((function(t){return A(t,0,Math.min(Math.abs(S)/2,Math.abs(T)/2))})));break;case nu.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 gh=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&&rh(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=hh(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]&&rh(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=oh((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=oh((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=ch(u,0),x=b.x,w=b.y,M=ch(u,1,!1),O=M.x,E=M.y;u.startTangent=[x,w],u.endTangent=[O,E]}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=Jl(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=Ul(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=zl(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=E(n),p=E(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-=ih(g,e).xExtra:a[0]===d&&(d+=ih(g,e).xExtra),a[1]===h?h-=ih(g,e).yExtra:a[1]===p&&(p+=ih(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}}},mh=Hu(gh);function yh(t){return _(t)?mh(t):gh(t)}function vh(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+=He(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 bh(t,e){var n;n=_(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=Kl(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Hl(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 xh(t,e){return[t.points,e.points,function(t){return t}]}var wh=null;function Mh(t){return function(e){var n=0;return t.map((function(t){return t===wh?e[n++]:t}))}}function Oh(t){return t}var Eh={matrix:["NNNNNN",[wh,wh,0,0,wh,wh,0,0,0,0,1,0,wh,wh,0,1],Oh],matrix3d:["NNNNNNNNNNNNNNNN",Oh],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Mh([wh,wh,new cf(1)]),Oh],scalex:["N",Mh([wh,new cf(1),new cf(1)]),Mh([wh,new cf(1)])],scaley:["N",Mh([new cf(1),wh,new cf(1)]),Mh([new cf(1),wh])],scalez:["N",Mh([new cf(1),new cf(1),wh])],scale3d:["NNN",Oh],skew:["Aa",null,Oh],skewx:["A",null,Mh([wh,hf])],skewy:["A",null,Mh([hf,wh])],translate:["Tt",Mh([wh,wh,lf]),Oh],translatex:["T",Mh([wh,lf,lf]),Mh([wh,lf])],translatey:["T",Mh([lf,wh,lf]),Mh([lf,wh])],translatez:["L",Mh([lf,lf,wh])],translate3d:["TTL",Oh]};function kh(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=Eh[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()?hf:Hf(t)},N:Qf,T:Wf,L:Gf}[h.toUpperCase()](f):{a:hf,n:l[0],t:lf}[h]))return[];l.push(d)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Sh(t){var e,n,r,i;switch(t.t){case"rotatex":return i=du(Vf(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=du(Vf(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=du(Vf(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=du(Vf(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=du(Vf(t.d[0])),f=du(Vf(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=du(Vf(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=du(Vf(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=Uf(t.d[0],0,null)||0,n=Uf(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Uf(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=Uf(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=Uf(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Uf(t.d[0],0,null)||0,n=Uf(t.d[1],0,null)||0,r=Uf(t.d[2],0,null)||0,1];case"perspective":var h=Uf(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 _h(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 Ah(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}(vu,t))return!1;if(ot(bu,vu),bu[3]=0,bu[7]=0,bu[11]=0,bu[15]=1,Math.abs(ut(bu))<1e-8)return!1;var a,s,c=vu[3],l=vu[7],u=vu[11],f=vu[12],h=vu[13],d=vu[14],p=vu[15];if(0!==c||0!==l||0!==u){if(xu[0]=c,xu[1]=l,xu[2]=u,xu[3]=p,!lt(bu,bu))return!1;ct(bu,bu),Jt(i,xu,bu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=vu,(a=wu)[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(wu[0]),Ht(wu[0],wu[0]),r[0]=$t(wu[0],wu[1]),Ou(wu[1],wu[1],wu[0],1,-r[0]),n[1]=It(wu[1]),Ht(wu[1],wu[1]),r[0]/=n[1],r[1]=$t(wu[0],wu[2]),Ou(wu[2],wu[2],wu[0],1,-r[1]),r[2]=$t(wu[1],wu[2]),Ou(wu[2],wu[2],wu[1],1,-r[2]),n[2]=It(wu[2]),Ht(wu[2],wu[2]),r[1]/=n[2],r[2]/=n[2],Vt(Mu,wu[1],wu[2]),$t(wu[0],Mu)<0)for(var g=0;g<3;g++)n[g]*=-1,wu[g][0]*=-1,wu[g][1]*=-1,wu[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+wu[0][0]-wu[1][1]-wu[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-wu[0][0]+wu[1][1]-wu[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-wu[0][0]-wu[1][1]+wu[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+wu[0][0]+wu[1][1]+wu[2][2],0)),wu[2][1]>wu[1][2]&&(o[0]=-o[0]),wu[0][2]>wu[2][0]&&(o[1]=-o[1]),wu[1][0]>wu[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(Sh).reduce(_h)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Th=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 Ph(t){return t.toFixed(6).replace(".000000","")}function Ch(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Ah(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Ah(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=A(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 Th(t[0],t[1],t[2],e,t[4]).map(Ph).join(",")}])}function Nh(t){return t.replace(/[xy]/,"")}function Lh(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function jh(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?Mf(a):Mf(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=Ch(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=Eh[f],m=Eh[h],y=void 0;if(s=h,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=Ch([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]&&Nh(f)===Nh(h))y=Nh(f),d=g[2](d),p=m[2](p);else{if(!g[1]||!m[1]||Lh(f)!==Lh(h)){c=[(v=Ch(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=Lh(f),d=g[1](d),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<d.length;M++){v=$f(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 O=c;c=l,l=O}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 Rh=Hu((function(t){if(_(t)){if("text-anchor"===t)return[Mf(0,"px"),Mf(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:[Wf(Ih(e[0])),Wf(Ih(e[1]))]}return[Mf(t[0]||0,"px"),Mf(t[1]||0,"px")]}));function Ih(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Bh=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Ef.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Ef.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Ef.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Ef.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Ef.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Ef.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Ef.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Ef.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Ef.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:Ef.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Ef.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Ef.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Ef.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Ef.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:Ef.FILTER},{n:"clipPath",syntax:Ef.DEFINED_PATH},{n:"textPath",syntax:Ef.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Ef.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===nu.CIRCLE||t===nu.ELLIPSE?"center":t===nu.TEXT?"text-anchor":"left top"},l:!0,syntax:Ef.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===nu.CIRCLE||t===nu.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:Ef.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:Ef.COORDINATE},{n:"cy",int:!0,d:"0",syntax:Ef.COORDINATE},{n:"cz",int:!0,d:"0",syntax:Ef.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:Ef.COORDINATE},{n:"y",int:!0,d:"0",syntax:Ef.COORDINATE},{n:"z",int:!0,d:"0",syntax:Ef.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ef.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Ef.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Ef.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Ef.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Ef.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Ef.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Ef.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Ef.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:Ef.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Ef.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Ef.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Ef.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Ef.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:Ef.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Ef.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Ef.NUMBER,d:function(t){return t===nu.PATH||t===nu.POLYGON||t===nu.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:Ef.MARKER},{n:"markerEnd",syntax:Ef.MARKER},{n:"markerMid",syntax:Ef.MARKER},{n:"markerStartOffset",syntax:Ef.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Ef.LENGTH,l:!0,int:!0,d:"0"}],Dh=Bh.filter((function(t){return!!t.l})).map((function(t){return t.n})),Fh={},zh=new WeakMap,Gh=function(){function t(t){var e=this;this.runtime=t,Bh.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<Dh.length;c++)if(Dh[c]in e){s=!0;break}return e.fill&&(t.parsedStyle.fill=Df(e.fill)),e.stroke&&(t.parsedStyle.stroke=Df(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Df(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Kf(e.filter)),y(e.radius)||(t.parsedStyle.radius=Yf(e.radius,4)),y(e.lineDash)||(t.parsedStyle.lineDash=Yf(e.lineDash,2)),e.points&&(t.parsedStyle.points=bh(e.points,t)),""===e.path&&(t.parsedStyle.path=fe({},kf)),e.path&&(t.parsedStyle.path=yh(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=Yf(e.anchor,2)),e.transform&&(t.parsedStyle.transform=kh(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Rh(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!==nu.CIRCLE&&t.nodeName!==nu.ELLIPSE||y(e.cx)&&y(e.cy))&&(t.nodeName!==nu.RECT&&t.nodeName!==nu.IMAGE&&t.nodeName!==nu.GROUP&&t.nodeName!==nu.HTML&&t.nodeName!==nu.TEXT&&t.nodeName!==nu.MESH||y(e.x)&&y(e.y)&&y(e.z))&&(t.nodeName!==nu.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=vf(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=vf(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 Ju){var l=e.value;if("unset"===l&&(l=s&&!i?"inherit":"initial"),"initial"===l)y(c)||(e=this.parseProperty(t,nf(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 Ju?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=zh.get(t);n||(zh.set(t,[]),n=zh.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=zh.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=zh.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),zh.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 ku),r.renderBounds||(r.renderBounds=new ku);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,O=y.filter,E=void 0===O?[]:O,k=y.transformOrigin,S=i.anchor;e===nu.TEXT?delete i.anchor:e===nu.MESH&&(i.anchor[2]=.5);var _=[(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(_,m);var A=e===nu.POLYLINE||e===nu.POLYGON||e===nu.PATH?Math.SQRT2:.5;if(v&&!v.isNone){var T=((b||0)+(x||0))*A;m[0]+=T,m[1]+=T}if(r.renderBounds.update(_,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)}E.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,lu(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,H=(G?-1:1)*(k?Uf(k[0],0,t):0),$=(W?-1:1)*(k?Uf(k[1],1,t):0);H-=(G?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,$-=(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}(),Wh=function(){function t(){this.parser=Hf,this.parserWithCSSDisabled=null,this.mixer=Jf}return t.prototype.calculator=function(t,e,n,r){return Vf(n)},t}(),Hh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Ju&&(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}(),$h=function(){function t(){this.parser=Df,this.parserWithCSSDisabled=Df,this.mixer=Ff}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ju?"none"===n.value?bf:xf:n},t}(),Vh=function(){function t(){this.parser=Kf}return t.prototype.calculator=function(t,e,n){return n instanceof Ju?[]:n},t}();function Yh(t){var e=t.parsedStyle.fontSize;return y(e)?null:e}var qh=function(){function t(){this.parser=Wf,this.parserWithCSSDisabled=null,this.mixer=Jf}return t.prototype.calculator=function(t,e,n,r,i){var o;if(T(n))return n;if(!cf.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Ru.kPercentage)return 0;if(n.unit===Ru.kEms){if(r.parentNode){if(s=Yh(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Ru.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=Yh(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),Uh=function(){function t(){this.mixer=eh}return t.prototype.parser=function(t){var e=qf(T(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}(),Xh=function(){function t(){this.mixer=eh}return t.prototype.parser=function(t){var e=qf(T(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}(),Kh=rt();function Zh(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||[lf,lf];e.translateLocal(s[0].value,s[1].value,0)}else if("translatex"===i){s=o||[lf];e.translateLocal(s[0].value,0,0)}else if("translatey"===i){s=o||[lf];e.translateLocal(0,s[0].value,0)}else if("translatez"===i){s=o||[lf];e.translateLocal(0,0,s[0].value)}else if("translate3d"===i){s=o||[lf,lf,lf];e.translateLocal(s[0].value,s[1].value,s[2].value)}else if("rotate"===i){var c=o||[hf];e.rotateLocal(0,0,Vf(c[0]))}else if("rotatex"===i){c=o||[hf];e.rotateLocal(Vf(c[0]),0,0)}else if("rotatey"===i){c=o||[hf];e.rotateLocal(0,Vf(c[0]),0)}else if("rotatez"===i){c=o||[hf];e.rotateLocal(0,0,Vf(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(du(l[0]),du(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(du(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],du(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(Kh,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([Kh],ye(o.map((function(t){return t.value}))),!1)),Kh[12]+=n,Kh[13]+=r,e.setLocalTransform(Kh))})),e.getLocalTransform()}var Qh=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 nu.CIRCLE:case nu.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 nu.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 nu.RECT:case nu.IMAGE:case nu.GROUP:case nu.HTML:case nu.TEXT:case nu.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!==nu.PATH&&t.nodeName!==nu.POLYLINE&&t.nodeName!==nu.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)Zh(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}(qh),Jh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Ju&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),td=function(){function t(){this.mixer=Jf,this.parser=Qf,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ed=function(){function t(){this.parser=Qf,this.parserWithCSSDisabled=null,this.mixer=th(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===nu.LINE||i===nu.PATH||i===nu.POLYLINE){var o=n.getPoint(r);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},t}(),nd=function(){function t(){this.parser=Qf,this.parserWithCSSDisabled=null,this.mixer=th(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),rd=function(){function t(){this.parser=yh,this.parserWithCSSDisabled=yh,this.mixer=vh}return t.prototype.calculator=function(t,e,n){return n instanceof Ju&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Nu(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===nu.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}(),id=function(){function t(){this.parser=bh,this.mixer=xh}return t.prototype.postProcessor=function(t,e){if((t.nodeName===nu.POLYGON||t.nodeName===nu.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(r,i)}},t}(),od=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=th(0,1/0),e}return ue(e,t),e}(qh),ad=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ju?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),sd=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}(),cd={},ld=0;var ud="undefined"!=typeof window&&void 0!==window.document;function fd(t){return!!t.getAttribute}function hd(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 dd(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 pd(t,e){if(ud)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var gd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},md="object"==typeof performance&&performance.now?performance:Date;function yd(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 vd=1,bd="object"==typeof self&&self.self==self?self:"object"==typeof $c&&$c.global==$c?$c:{},xd=Date.now(),wd={},Md=Date.now(),Od=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Md,r=n>16?0:16-n,i=vd++;return wd[i]=t,Object.keys(wd).length>1||setTimeout((function(){Md=e;var t=wd;wd={},Object.keys(t).forEach((function(e){return t[e](bd.performance&&"function"==typeof bd.performance.now?bd.performance.now():Date.now()-xd)}))}),r),i},Ed=function(t){delete wd[t]},kd=function(t){return"string"!=typeof t?Od:""===t?bd.requestAnimationFrame:bd[t+"RequestAnimationFrame"]},Sd=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!!kd(t)})),_d=kd(Sd),Ad=function(t){return"string"!=typeof t?Ed:""===t?bd.cancelAnimationFrame:bd[t+"CancelAnimationFrame"]||bd[t+"CancelRequestAnimationFrame"]}(Sd);bd.requestAnimationFrame=_d,bd.cancelAnimationFrame=Ad;var Td=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}(),Pd=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}(),Cd=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}(),Nd=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}(),Ld=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],jd=/([\"\'])[^\'\"]+\1/;var Rd=function(){function t(){this.parser=kh,this.parserWithCSSDisabled=kh,this.mixer=jh}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ju?[]:n},t.prototype.postProcessor=function(t){Zh(t.parsedStyle.transform,t)},t}(),Id=function(){this.parser=Rh},Bd=function(){function t(){this.parser=Qf}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=ff.Z_INDEX_CHANGED)}},t}(),Dd=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}(),zd=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}(),Gd=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Wd=function(){function t(){}return t.prototype.update=function(t){if(t.points&&x(t.points.points)){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}}return{width:0,height:0}},t}(),Hd=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&&!_(n)&&(a||(a=n.width,t.width=a),s||(s=n.height,t.height=s)),{width:a,height:s}},t}(),$d=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 Vd,Yd=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 Cu,this.page=new Cu,this.canvas=new Cu,this.viewport=new Cu,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(Lu)},t}(),qd=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new Cu,e.movement=new Cu,e.offset=new Cu,e.global=new Cu,e.screen=new Cu,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(Lu)},e}(Yd),Ud=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}(qd),Xd=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}(qd),Kd=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}(Yd),Zd=function(){function t(){this.emitter=new Yc}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=nf(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=nf(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=nf(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=nf(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Kd(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}(),Qd=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===nu.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===nu.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===nu.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(Lu)},e.prototype.lookupNamespaceURI=function(t){throw new Error(Lu)},e.prototype.lookupPrefix=function(t){throw new Error(Lu)},e.prototype.normalize=function(){throw new Error(Lu)},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}(Zd),Jd=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new Yc,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=md.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")}Qd.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"),Qd.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&&Qd.isNode(o)&&o.parentNode;f&&f!==(Qd.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Qd.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!==(Qd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)h.currentTarget=h.target,n.notifyTarget(h),r&&n.notifyTarget(h,"mouseenter"),Qd.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!==(Qd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),Qd.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!==(Qd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),Qd.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"),Qd.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 Cu(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 Cu(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 Cu(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 Cu((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++)Qd.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(Ud);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(Xd);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(Xd);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(Ud);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=md.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||Qd.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=fd(e)&&e.getAttribute("cursor");if(n)return n;e=Qd.isNode(e)&&e.parentNode}},t}(),tp=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||yp.offscreenCanvas)this.canvas=t||yp.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"}(Vd||(Vd={}));var ep,np=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 Cd,initAsync:new Td,dirtycheck:new Nd,cull:new Nd,beginFrame:new Cd,beforeRender:new Cd,render:new Cd,afterRender:new Cd,endFrame:new Cd,destroy:new Cd,pick:new Pd,pickSync:new Nd,pointerDown:new Cd,pointerUp:new Cd,pointerMove:new Cd,pointerOut:new Cd,pointerOver:new Cd,pointerWheel:new Cd,pointerCancel:new Cd,click:new Cd}}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(Vd.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(Vd.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!==ff.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;hd(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(hd)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Vd.DISPLAY_OBJECT_CHANGED)},t}(),rp=/\[\s*(.*)=(.*)\s*\]/,ip=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(rp),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}(),op=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}(Yd);function ap(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"}(ep||(ep={}));var sp,cp,lp,up=new op(ep.REPARENT,null,"","","",0,"",""),fp=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new Kd(ep.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=ff.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(up)},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=ff.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;)ap(n),n=n.parentNode;e&&t.forEach((function(t){ap(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 op(ep.ATTR_MODIFIED,n,e,e,t,op.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(ku.isEmpty(r))return null;var i=n||new ku;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 ku},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 ku).update(r.center,r.halfExtents))})),e){var a=dd(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new ku),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(!ku.isEmpty(n)){var r=new ku;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);ku.isEmpty(i)||(r=new ku).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 Nu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new Nu((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}(),hp={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]},dp=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,pp=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),gp=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),mp=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!gp.exec(n)&&!pp.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=hp.MetricsString+hp.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(hp.BaselineSymbol).width),c=hp.HeightMultiplier*s;s=s*hp.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=T(e)&&"".concat(e,"px")||"16px",s=n.split(","),c=s.length-1;c>=0;c--){var l=s[c].trim();!jd.test(l)&&Ld.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(O=0;O<m.length;O++){var b=g.measureText(m[O]).width+(m[O].length-1)*l;y[O]=b,v=Math.max(v,b)}E=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:E,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 Nu(n-a/2,M+e*x,t+a,x)}))}}u.getTotalLength();for(var O=0;O<m.length;O++)var E=g.measureText(m[O]).width+(m[O].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],O=t[x+1],E=y(w);if(this.isNewline(w)){if(++p>=c){e.isOverflowing=!0;break}g=0,d[p]=""}else{if(g>0&&g+E>f){if(p+1>=c){if(e.isOverflowing=!0,v>0&&v<=f){for(var k=d[p].length,S=0,_=k,A=0;A<k;A++){var T=y(d[p][A]);if(S+T+v>f){_=A;break}S+=T}d[p]=(d[p]||"").slice(0,_)+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,O)&&(d=this.trimByKinsokuShorui(d),g+=y(M||""))}g+=E,d[p]=(d[p]||"")+w}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&hp.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&hp.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||!dp.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(!dp.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}(),yp={},vp=(cp=new Hd,lp=new Wd,(sp={})[nu.CIRCLE]=new Dd,sp[nu.ELLIPSE]=new Fd,sp[nu.RECT]=cp,sp[nu.IMAGE]=cp,sp[nu.GROUP]=cp,sp[nu.LINE]=new zd,sp[nu.TEXT]=new $d(yp),sp[nu.POLYLINE]=lp,sp[nu.POLYGON]=lp,sp[nu.PATH]=new Gd,sp[nu.HTML]=null,sp[nu.MESH]=null,sp),bp=function(){var t,e=new $h,n=new qh;return(t={})[Ef.PERCENTAGE]=null,t[Ef.NUMBER]=new td,t[Ef.ANGLE]=new Wh,t[Ef.DEFINED_PATH]=new Hh,t[Ef.PAINT]=e,t[Ef.COLOR]=e,t[Ef.FILTER]=new Vh,t[Ef.LENGTH]=n,t[Ef.LENGTH_PERCENTAGE]=n,t[Ef.LENGTH_PERCENTAGE_12]=new Uh,t[Ef.LENGTH_PERCENTAGE_14]=new Xh,t[Ef.COORDINATE]=new Qh,t[Ef.OFFSET_DISTANCE]=new ed,t[Ef.OPACITY_VALUE]=new nd,t[Ef.PATH]=new rd,t[Ef.LIST_OF_POINTS]=new id,t[Ef.SHADOW_BLUR]=new od,t[Ef.TEXT]=new ad,t[Ef.TEXT_TRANSFORM]=new sd,t[Ef.TRANSFORM]=new Rd,t[Ef.TRANSFORM_ORIGIN]=new Id,t[Ef.Z_INDEX]=new Bd,t[Ef.MARKER]=new Jh,t}();yp.CameraContribution=Wu,yp.AnimationTimeline=null,yp.EasingFunction=null,yp.offscreenCanvasCreator=new tp,yp.nativeHTMLMap=new WeakMap,yp.sceneGraphSelector=new ip,yp.sceneGraphService=new fp(yp),yp.textService=new mp(yp),yp.geometryUpdaterFactory=vp,yp.CSSPropertySyntaxFactory=bp,yp.styleValueRegistry=new Gh(yp),yp.layoutRegistry=null,yp.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==$c?$c:{},yp.enableCSSParsing=!0,yp.enableDataset=!1,yp.enableStyleSyntax=!0;var xp=0,wp=new op(ep.INSERTED,null,"","","",0,"",""),Mp=new op(ep.REMOVED,null,"","","",0,"",""),Op=new Kd(ep.DESTROY),Ep=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entity=xp++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:uf.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=yp.enableCSSParsing?{anchor:pf,opacity:pf,fillOpacity:pf,strokeOpacity:pf,fill:pf,stroke:pf,transform:pf,transformOrigin:pf,visibility:pf,pointerEvents:pf,lineWidth:pf,lineCap:pf,lineJoin:pf,increasedLineWidthForHitTesting:pf,fontSize:pf,fontFamily:pf,fontStyle:pf,fontWeight:pf,fontVariant:pf,textAlign:pf,textBaseline:pf,textTransform:pf,zIndex:pf,filter:pf,shadowType:pf}: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(Lu)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return yp.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),wp.relatedNode=this,t.dispatchEvent(wp),t},e.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},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 Mp.relatedNode=this,t.dispatchEvent(Mp),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),yp.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 yp.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return yp.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return yp.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return yp.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return yp.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return yp.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return yp.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(yp.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(Op),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return yp.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return yp.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return yp.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return yp.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return yp.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 yp.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=of(t);return e=this.attributes[n],yp.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(Lu)},e.prototype.getAttributeNode=function(t){throw new Error(Lu)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(Lu)},e.prototype.hasAttributeNS=function(t,e){throw new Error(Lu)},e.prototype.removeAttributeNS=function(t,e){throw new Error(Lu)},e.prototype.removeAttributeNode=function(t){throw new Error(Lu)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(Lu)},e.prototype.setAttributeNode=function(t){throw new Error(Lu)},e.prototype.setAttributeNodeNS=function(t){throw new Error(Lu)},e.prototype.toggleAttribute=function(t,e){throw new Error(Lu)},e}(Qd);function kp(t){return!!(null==t?void 0:t.nodeName)}var Sp,_p=new op(ep.ATTR_MODIFIED,null,null,null,null,op.MODIFICATION,null,null),Ap={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:""},Tp={anchor:[0,0],fill:bf,stroke:bf,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Pp=fe(fe({},Tp),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Cp=ve(ve([],ye(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Np="data-",Lp=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||nu.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,yp.enableCSSParsing?Tp:Pp,r.config.initialParsedStyle),yp.enableCSSParsing&&Object.assign(r.attributes,Ap),r.initAttributes(r.config.style);var i=yp.globalThis.Proxy?yp.globalThis.Proxy:function(){};return yp.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(Np).concat(ef(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(Np).concat(ef(e)),n),!0}})),yp.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];kp(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};yp.enableCSSParsing&&(n.usedAttributes=Cp);var r={};for(var i in t){r[of(i)]=t[i]}yp.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=of(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];yp.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(_p.relatedNode=this,_p.prevValue=o,_p.newValue=e,_p.attrName=t,_p.prevParsedValue=a,_p.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(_p):(_p.target=this,this.ownerDocument.defaultView.dispatchEvent(_p,!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 Nu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),yp.sceneGraphService.setOrigin(this,hu(t,e,n)),this},e.prototype.getOrigin=function(){return yp.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),yp.sceneGraphService.setPosition(this,hu(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),yp.sceneGraphService.setLocalPosition(this,hu(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),yp.sceneGraphService.translate(this,hu(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),yp.sceneGraphService.translateLocal(this,hu(t,e,n)),this},e.prototype.getPosition=function(){return yp.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return yp.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=hu(t,e=e||t,n=n||t)),yp.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=hu(t,e=e||t,n=n||t)),yp.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return yp.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return yp.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return pu(ye(gu(jt(),yp.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return pu(ye(gu(jt(),yp.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return yp.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return yp.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return y(e)&&y(n)?yp.sceneGraphService.rotateLocal(this,0,0,t):yp.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return y(e)&&y(n)?yp.sceneGraphService.rotate(this,0,0,t):yp.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return yp.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return yp.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return yp.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return yp.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return yp.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return yp.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return yp.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return yp.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return yp.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){yp.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(gu(jt(),c),3),u=l[0],f=l[2];return mu(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=ye(yu(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(yu(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(){yp.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){yp.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}(Ep),jp=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;yp.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},Rp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:nu.CIRCLE,style:yp.enableCSSParsing?fe({cx:"",cy:"",r:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:yp.enableCSSParsing?null:[Of,Of]}},r))||this}return ue(e,t),e}(Lp),Ip=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:yp.enableCSSParsing?fe({x:"",y:""},r):fe({},r)},i))||this).isCustomElement=!0,n}return ue(e,t),e}(Lp),Bp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:nu.ELLIPSE,style:yp.enableCSSParsing?fe({cx:"",cy:"",rx:"",ry:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:yp.enableCSSParsing?null:[Of,Of]}},r))||this}return ue(e,t),e}(Lp),Dp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:nu.GROUP,style:yp.enableCSSParsing?fe({x:"",y:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(Lp),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:nu.HTML,style:yp.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 Nu(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 ku,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(!ku.isEmpty(e)){var n=new ku;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Lp),zp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:nu.IMAGE,style:yp.enableCSSParsing?fe({x:"",y:"",img:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(Lp),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:nu.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&&kp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&kp(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&&kp(r)&&(this.markerStartAngle=0,r.remove()),i&&kp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&kp(r)&&(this.markerEndAngle=0,r.remove()),i&&kp(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&&kp(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=$l(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 Cu(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 Hl(t.x1,t.y1,t.x2,t.y2)},e}(Lp),Wp=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:nu.PATH,style:yp.enableCSSParsing?fe({path:"",miterLimit:""},r):fe({},r),initialParsedStyle:yp.enableCSSParsing?null:{miterLimit:4,path:fe({},kf)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&kp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&kp(c)&&n.placeMarkerMid(c),s&&kp(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&&kp(r)&&(this.markerStartAngle=0,r.remove()),i&&kp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&kp(r)&&(this.markerEndAngle=0,r.remove()),i&&kp(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&&kp(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&&kp(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 nh(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 Cu(c[0],c[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*nh(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}(Lp),Hp=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:nu.POLYGON,style:yp.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!0},r):fe({},r),initialParsedStyle:yp.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&&kp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&kp(c)&&n.placeMarkerMid(c),s&&kp(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&&kp(r)&&(this.markerStartAngle=0,r.remove()),i&&kp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&kp(r)&&(this.markerEndAngle=0,r.remove()),i&&kp(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,s=e.defX,c=e.defY,l=(a||{}).points,u=t?n:r;if(u&&kp(u)&&l){var f,h,d,p,g,m,y;if(p=l[0][0]-s,g=l[0][1]-c,t)h=l[1][0]-l[0][0],d=l[1][1]-l[0][1],m=i||0,y=this.markerStartAngle;else{var v=l.length;this.parsedStyle.isClosed?(h=l[v-1][0]-l[0][0],d=l[v-1][1]-l[0][1]):(p=l[v-1][0]-s,g=l[v-1][1]-c,h=l[v-2][0]-l[v-1][0],d=l[v-2][1]-l[v-1][1]),m=o||0,y=this.markerEndAngle}f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*m,g+Math.sin(f)*m)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points,r=e.defX,i=e.defY,o=(n||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&kp(t)&&o)for(var a=1;a<(this.parsedStyle.isClosed?o.length:o.length-1);a++){var s=o[a][0]-r,c=o[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s,c)}},e}(Lp),$p=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:nu.POLYLINE,style:yp.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!1},n):fe({},n),initialParsedStyle:yp.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=$l(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 Cu(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}(Hp),Vp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:nu.RECT,style:yp.enableCSSParsing?fe({x:"",y:"",width:"",height:"",radius:""},n):fe({},n)},r))||this}return ue(e,t),e}(Lp),Yp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:nu.TEXT,style:yp.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:yp.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}(Lp),qp=function(){function t(){this.registry={},this.define(nu.CIRCLE,Rp),this.define(nu.ELLIPSE,Bp),this.define(nu.RECT,Vp),this.define(nu.IMAGE,zp),this.define(nu.LINE,Gp),this.define(nu.GROUP,Dp),this.define(nu.PATH,Wp),this.define(nu.POLYGON,Hp),this.define(nu.POLYLINE,$p),this.define(nu.TEXT,Yp),this.define(nu.HTML,Fp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),Up=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new yp.AnimationTimeline(e)}catch(t){}var n={};return Bh.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=nf(i)?i(nu.GROUP):i)})),e.documentElement=new Dp({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?Yp:Dp);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(Lu)},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(ju)},e.prototype.insertBefore=function(t,e){throw new Error(ju)},e.prototype.removeChild=function(t,e){throw new Error(ju)},e.prototype.replaceChild=function(t,e,n){throw new Error(ju)},e.prototype.append=function(){throw new Error(ju)},e.prototype.prepend=function(){throw new Error(ju)},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}(Qd),Xp=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 Kd(ep.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),Kp=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Ud(null),this.rootWheelEvent=new Xd(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 Cu(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=gd[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=md.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}(),Zp=[nu.CIRCLE,nu.ELLIPSE,nu.IMAGE,nu.RECT,nu.LINE,nu.POLYLINE,nu.POLYGON,nu.TEXT,nu.PATH,nu.HTML],Qp=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(ku.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||Eu.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Eu.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Eu.OUTSIDE||n===Eu.INSIDE)return n;for(var i=Eu.INSIDE,o=Zp.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($t(u,e.getPositiveFarPoint(r[a]))+f<0)return Eu.OUTSIDE;$t(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),Jp=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;yp.enableCSSParsing&&yp.styleValueRegistry.recalc(e),yp.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),yp.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){a.addEventListener(ep.MOUNTED,l),a.addEventListener(ep.UNMOUNTED,u),a.addEventListener(ep.ATTR_MODIFIED,s),a.addEventListener(ep.BOUNDS_CHANGED,c)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(ep.MOUNTED,l),a.removeEventListener(ep.UNMOUNTED,u),a.removeEventListener(ep.ATTR_MODIFIED,s),a.removeEventListener(ep.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"}(Sp||(Sp={}));var tg=new Kd(ep.MOUNTED),eg=new Kd(ep.UNMOUNTED),ng=new Kd(Sp.BEFORE_RENDER),rg=new Kd(Sp.RERENDER),ig=new Kd(Sp.AFTER_RENDER),og=function(t){function e(e){var n=t.call(this)||this;n.Element=Lp,n.inited=!1,n.context={},n.document=new Up,n.document.defaultView=n,n.customElements=new qp;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,O=e.isMouseEvent;b||function(t,e){if(t){var n="string"==typeof t?t:t.id||ld++;cd[n]&&cd[n].destroy(),cd[n]=e}}(r,n);var E=a,k=s,S=c;return i&&(S=(S=c||ud&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,E=a||function(t){var e=pd(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=pd(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(yp.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=d?d:_d.bind(yp.globalThis),n.cancelAnimationFrame=null!=p?p:Ad.bind(yp.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in yp.globalThis,n.supportsPointerEvents=null!=m?m:!!yp.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof yp.globalThis.TouchEvent},n.isMouseEvent=null!=O?O:function(t){return!yp.globalThis.MouseEvent||t instanceof yp.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof yp.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:E,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(E,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 yp.CameraContribution;i.clipSpaceNearZ=n,i.setType(_u.EXPLORING,Au.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(zu,(function(){r.context.renderingContext.renderReasons.add(Vd.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 Kd(Sp.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 Kd(Sp.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===Tu.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Kd(Sp.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(ng),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(rg)})),this.dispatchEvent(ig)},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 iu,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Kp,new Jp,new Xp([new Qp])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(fe(fe({},yp),this.context)),this.context.renderingService=new np(yp,this.context),this.context.eventService=new Jd(yp,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 Kd(Sp.READY))})):r.dispatchEvent(new Kd(Sp.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new Kd(Sp.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(yp)}))},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(yp)})),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(eg):(eg.target=t,this.dispatchEvent(eg,!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(tg):(tg.target=t,this.dispatchEvent(tg,!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}(Zd),ag=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=fu(e),this.relAzimuth=fu(t),this.relRoll=fu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===_u.EXPLORING){var r=ee(te(),[1,0,0],du((this.rotateWorld?1:-1)*this.relElevation)),i=ee(te(),[0,1,0],du((this.rotateWorld?1:-1)*this.relAzimuth)),o=ee(te(),[0,0,1],du(this.relRoll)),a=ne(te(),i,r);a=ne(te(),a,o);var s=Ot(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===_u.ORBITING||this.type===_u.EXPLORING?this._getPosition():this.type===_u.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=hu(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===_u.ORBITING||this.type===_u.EXPLORING?this._getDistance():this.type===_u.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 yp.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=_(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=T(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,d=i.onframe,p=void 0===d?void 0:d;if(0===c)return this.syncFromLandmark(r),void(h&&h());this.cancelLandmarkAnimation();var g,m=r.position,y=r.focalPoint,v=r.zoom,b=r.roll,x=u||yp.EasingFunction(a),w=function(){n.setFocalPoint(y),n.setPosition(m),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),h&&h()},M=function(t){void 0===g&&(g=t);var e=t-g;if(e>c)w();else{var r,i,o=x(e/c),a=jt(),s=jt();Yt(a,n.focalPoint,y,o),Yt(s,n.position,m,o),i=n.roll*(1-o)+b*o,r=n.zoom*(1-o)+v*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),Kt(a,y)+Kt(s,m)<=.01&&null==v&&null==b?w():(n.computeMatrix(),n.triggerUpdate(),e<c&&(p&&p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(M)))}};this.canvas.requestAnimationFrame(M)}},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}(Wu);yp.CameraContribution=ag;var sg=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}(Yd),cg=0,lg=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(cg++),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 sg(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(Lu)},t.prototype.addEventListener=function(t,e,n){throw new Error(Lu)},t.prototype.removeEventListener=function(t,e,n){throw new Error(Lu)},t.prototype.dispatchEvent=function(t){throw new Error(Lu)},t.prototype.commitStyles=function(){throw new Error(Lu)},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 sg(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 sg(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),ug=.1,fg="function"==typeof Float32Array,hg=function(t,e){return 1-3*e+3*t},dg=function(t,e){return 3*e-6*t},pg=function(t){return 3*t},gg=function(t,e,n){return((hg(e,n)*t+dg(e,n))*t+pg(e))*t},mg=function(t,e,n){return 3*hg(e,n)*t*t+2*dg(e,n)*t+pg(e)},yg=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=fg?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=gg(o*ug,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=ug;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*ug,s=mg(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=mg(e,n,r);if(0===o)return e;e-=(gg(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=gg(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+ug,t,n)};return function(t){return 0===t||1===t?t:gg(a(t),e,r)}},vg=function(t){return Math.pow(t,2)},bg=function(t){return Math.pow(t,3)},xg=function(t){return Math.pow(t,4)},wg=function(t){return Math.pow(t,5)},Mg=function(t){return Math.pow(t,6)},Og=function(t){return 1-Math.cos(t*Math.PI/2)},Eg=function(t){return 1-Math.sqrt(1-t*t)},kg=function(t){return t*t*(3*t-2)},Sg=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)},_g=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=A(Number(i),1,10),c=A(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)},Ag=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=A(o,.1,1e3),s=A(s,.1,1e3),l=A(l,.1,1e3),f=A(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},Tg=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)(A(t,0,1)*i)/i},Pg=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 yg(r,i,o,a)(t)},Cg=yg(.42,0,1,1),Ng=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Lg=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}},jg=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}},Rg={steps:Tg,"step-start":function(t){return Tg(t,[1,"start"])},"step-end":function(t){return Tg(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Pg,ease:function(t){return Pg(t,[.25,.1,.25,1])},in:Cg,out:Ng(Cg),"in-out":Lg(Cg),"out-in":jg(Cg),"in-quad":vg,"out-quad":Ng(vg),"in-out-quad":Lg(vg),"out-in-quad":jg(vg),"in-cubic":bg,"out-cubic":Ng(bg),"in-out-cubic":Lg(bg),"out-in-cubic":jg(bg),"in-quart":xg,"out-quart":Ng(xg),"in-out-quart":Lg(xg),"out-in-quart":jg(xg),"in-quint":wg,"out-quint":Ng(wg),"in-out-quint":Lg(wg),"out-in-quint":jg(wg),"in-expo":Mg,"out-expo":Ng(Mg),"in-out-expo":Lg(Mg),"out-in-expo":jg(Mg),"in-sine":Og,"out-sine":Ng(Og),"in-out-sine":Lg(Og),"out-in-sine":jg(Og),"in-circ":Eg,"out-circ":Ng(Eg),"in-out-circ":Lg(Eg),"out-in-circ":jg(Eg),"in-back":kg,"out-back":Ng(kg),"in-out-back":Lg(kg),"out-in-back":jg(kg),"in-bounce":Sg,"out-bounce":Ng(Sg),"in-out-bounce":Lg(Sg),"out-in-bounce":jg(Sg),"in-elastic":_g,"out-elastic":Ng(_g),"in-out-elastic":Lg(_g),"out-in-elastic":jg(_g),spring:Ag,"spring-in":Ag,"spring-out":Ng(Ag),"spring-in-out":Lg(Ag),"spring-out-in":jg(Ag)},Ig=function(t){return Rg[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)]||Rg.linear},Bg=function(t){return t},Dg=1,Fg=.5,zg=0;function Gg(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Wg="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Hg=new RegExp("cubic-bezier\\("+Wg+","+Wg+","+Wg+","+Wg+"\\)"),$g=/steps\(\s*(\d+)\s*\)/,Vg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Yg(t){var e=Hg.exec(t);if(e)return yg.apply(void 0,ve([],ye(e.slice(1).map(Number)),!1));var n=$g.exec(t);if(n)return Gg(Number(n[1]),zg);var r=Vg.exec(t);return r?Gg(Number(r[1]),{start:Dg,middle:Fg,end:zg}[r[2]]):Ig(t)}function qg(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 Ug=0,Xg=1,Kg=2,Zg=3;function Qg(t,e,n){var r=function(t,e,n){if(null===e)return Ug;var r=n.endTime;return e<Math.min(n.delay,r)?Xg:e>=Math.min(n.delay+t+n.endDelay,r)?Kg:Zg}(t,e,n),i=function(t,e,n,r,i){switch(r){case Xg:return"backwards"===e||"both"===e?0:null;case Zg:return n-i;case Kg:return"forwards"===e||"both"===e?t:null;case Ug: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!==Xg&&(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!==Kg||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===Kg&&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 Jg(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(tm(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Yg(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:nm(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)tm(n)&&t.setAttribute(n,null)}}function tm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var em=function(t,e,n){return function(r){var i=rm(t,e,r);return!yp.enableCSSParsing&&T(i)?i:n(i)}};function nm(t,e,n,r){var i=Fh[t];if(i&&i.syntax&&i.int){var o=yp.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(yp.enableCSSParsing){var c=yp.styleValueRegistry.parseProperty(t,e,r),l=yp.styleValueRegistry.parseProperty(t,n,r);a=yp.styleValueRegistry.computeProperty(t,c,r),s=yp.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=em.apply(void 0,ve([],ye(f),!1));return function(t){return 0===t?e:1===t?n:h(t)}}}}return em(!1,!0,(function(t){return t?n:e}))}function rm(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(rm(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var im=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Bg,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=Yg(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function om(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 am="backwards|forwards|both|none".split("|"),sm="reverse|alternate|alternate-reverse".split("|");function cm(t,e){return function(t,e){var n=new im;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===am.indexOf(t[e]))return;if("direction"===e&&-1===sm.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 lm=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=cm(n,!1),this.timing.effect=this,this.timing.activeDuration=qg(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=om(e,this.timing),this.interpolations=Jg(this.normalizedKeyframes,this.timing,this.target);var i=yp.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=Qg(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=om(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 um(t,e){return Number(t.id)-Number(e.id)}var fm=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(um),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 lm(t,e,n),i=new lg(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(um),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 hm(t){return new dm([t],null,t,t.ownerDocument)}yp.EasingFunction=Yg,yp.AnimationTimeline=fm;class dm{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 dm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new dm(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 dm([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 dm(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 dm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new dm([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 dm([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 dm([],r,this._parent,this._document),new dm(i,null,this._parent,this._document),new dm(o,null,this._parent,this._document),new dm([],a,this._parent,this._document),new dm(s,null,this._parent,this._document)];return new dm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new dm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=dm.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 dm([],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 pm(t,e,n){return Math.max(e,Math.min(t,n))}function gm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function mm(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function ym(t,e,n,r,i){const o=hs(ls(r,e))+Math.PI,a=hs(ls(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function vm(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 na({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 bm(t){const[e,n,r,i]=t;return[i,e,n,r]}function xm(t,e,n){const[r,i,,o]=Rc(t)?bm(e):e,[a,s]=n,c=t.getCenter(),l=ds(ls(r,c)),u=ds(ls(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:fs(o,c),outerRadius:fs(r,c)}}function wm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Mm(t,e){if(!Ic(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Om(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,minHeight:y=-1/0}=i,v=he(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Ic(r)&&!Dc(r)){const n=!!Rc(r),[i,,o]=n?bm(e):e,[a,b]=i,[x,w]=ls(o,i),M=(x>0?a:a+x)+s,O=(w>0?b:b+w)+c,E=Math.abs(x)-(s+l),k=Math.abs(w)-(c+u),S=n?pm(E,y,1/0):pm(E,g,m),_=n?pm(k,g,m):pm(k,y,1/0),A=n?M:M-(S-E)/2,T=n?O-(_-k)/2:O-(_-k);return hm(t.createElement("rect",{})).style("x",A).style("y",T).style("width",S).style("height",_).style("radius",[d,p,h,f]).call(mm,v).node()}const{y:b,y1:x}=n,w=r.getCenter(),M=xm(r,e,[b,x]),O=Js().cornerRadius(a).padAngle(o*Math.PI/180);return hm(t.createElement("path",{})).style("path",O(M)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(mm,v).node()}dm.registry={g:Dp,rect:Vp,circle:Rp,path:Wp,text:Yp,ellipse:Bp,image:zp,line:Gp,polygon:Hp,polyline:$p,html:Fp};const Em=(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:O=x,innerRadiusBottomLeft:E=x,lineWidth:k=("stroke"===n||p?d:0),inset:S=0,insetLeft:_=S,insetRight:A=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:N,minHeight:L}=a,j=he(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,B=[i?m:w,i?y:M,o?v:O,o?b:E],D=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Rc(s)&&D.push(D.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(D.map(((t,e)=>[t,B[e]])))),{inset:S,insetLeft:_,insetRight:A,insetBottom:T,insetTop:P,minWidth:C,maxWidth:N,minHeight:L});return hm(Om(c,e,r,s,F)).call(mm,h).style("fill","transparent").style(n,R).style(wm(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(mm,j).node()}};Em.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const km=(t,e)=>Em(Object.assign({colorAttribute:"fill"},t),e);km.props=Object.assign(Object.assign({},Em.props),{defaultMarker:"square"});const Sm=(t,e)=>Em(Object.assign({colorAttribute:"stroke"},t),e);function _m(t,e,n){const[r,i,o,a]=t;if(Rc(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]}Sm.props=Object.assign(Object.assign({},Em.props),{defaultMarker:"hollowSquare"});const Am=(t,e)=>{const{adjustPoints:n=_m}=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=!!Rc(i),[p,g,m,y]=d?bm(h):h,{color:v=l,opacity:b}=e,x=oc().curve(wc)([p,g,m,y]);return hm(o.createElement("path",{})).call(mm,u).style("path",x).style("fill",v).style("fillOpacity",b).call(mm,r).node()}};function Tm(t,e,n){const[r,i,o,a]=t;if(Rc(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]}Am.props={defaultMarker:"square"};const Pm=(t,e)=>Am(Object.assign({adjustPoints:Tm},t),e);function Cm(t){const e="function"==typeof t?t:t.render;return class extends Ip{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Pm.props={defaultMarker:"square"};const Nm=Cm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;hm(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(mm,r),hm(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(mm,i)}));const Lm=(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?vm(m,y,v,r,i):p,x=Mm(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(Ic(c)){const t=c.getCenter();M=e=>uc(oc().curve(sc)).angle(((n,r)=>ds(ls(e[r],t)))).radius(((n,r)=>fs(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else M=oc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[O,E]=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=!!E.length;if(!S||a&&!Object.keys(k).length)return hm(l.createElement("path",{})).style("d",M(O)||[]).call(mm,w).node();if(S&&!a)return hm(l.createElement("path",{})).style("d",M(t)).call(mm,w).node();return hm(new Nm).style("style1",Object.assign(Object.assign({},w),k)).style("style2",w).style("d1",(_=E,_.map(M).join(","))).style("d2",M(t)).node();var _}};Lm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Ic(n)?wc:nc;return Lm(Object.assign({curve:i},t),e)(...r)}};jm.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"line"});const Rm=(t,e)=>{const n=he(t,["alpha"]),{coordinate:r}=e;return(...t)=>{const i=Ic(r)?bc:Rc(r)?Pc:Tc;return Lm(Object.assign({curve:i},n),e)(...t)}};Rm.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"smooth"});const Im=(t,e)=>Lm(Object.assign({curve:jc},t),e);Im.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"hv"});const Bm=(t,e)=>Lm(Object.assign({curve:Lc},t),e);Bm.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"vh"});const Dm=(t,e)=>Lm(Object.assign({curve:Nc},t),e);function Fm(t,e,n,r,i){const o=hs(ls(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=us(e,s),h=us(n,c),d=us(h,l),p=us(n,l),g=ls(p,c),m=ls(n,c),y=ls(e,s),v=ls(y,u),b=ls(e,u),x=ls(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()}Dm.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"hvh"});const zm=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=he(i,["color"]),l=Vs();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)&&Fm(l,n,r,i,a)}return hm(n.createElement("path",{})).call(mm,c).style("fill",a||s).style("d",l.toString()).call(mm,t).node()}};zm.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"line"});const Gm=(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"]];Gm.style=["fill"];const Wm=Gm.bind(void 0);Wm.style=["stroke","lineWidth"];const Hm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Hm.style=["fill"];const $m=Hm.bind(void 0);$m.style=["fill"];const Vm=Hm.bind(void 0);Vm.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 qm=Ym.bind(void 0);qm.style=["stroke","lineWidth"];const Um=(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"]]};Um.style=["fill"];const Xm=Um.bind(void 0);Xm.style=["stroke","lineWidth"];const Km=(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"]]};Km.style=["fill"];const Zm=Km.bind(void 0);Zm.style=["stroke","lineWidth"];const Qm=(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"]]};Qm.style=["fill"];const Jm=Qm.bind(void 0);Jm.style=["stroke","lineWidth"];const ty=(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"]]};ty.style=["fill"];const ey=ty.bind(void 0);ey.style=["stroke","lineWidth"];const ny=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];ny.style=["stroke","lineWidth"];const ry=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];ry.style=["stroke","lineWidth"];const iy=(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]];iy.style=["stroke","lineWidth"];const oy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];oy.style=["stroke","lineWidth"];const ay=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];ay.style=["stroke","lineWidth"];const sy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];sy.style=["stroke","lineWidth"];const cy=sy.bind(void 0);cy.style=["stroke","lineWidth"];const ly=(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]];ly.style=["stroke","lineWidth"];const uy=(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]];uy.style=["stroke","lineWidth"];const fy=(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]];fy.style=["stroke","lineWidth"];const hy=(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]];hy.style=["stroke","lineWidth"];const dy=(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]];dy.style=["stroke","lineWidth"];const py=new Map([["bowtie",ty],["cross",ry],["dash",cy],["diamond",Ym],["dot",sy],["hexagon",Qm],["hollowBowtie",ey],["hollowDiamond",qm],["hollowHexagon",Jm],["hollowPoint",Wm],["hollowSquare",Vm],["hollowTriangle",Xm],["hollowTriangleDown",Zm],["hv",uy],["hvh",hy],["hyphen",ay],["line",ny],["plus",oy],["point",Gm],["rect",$m],["smooth",ly],["square",Hm],["tick",iy],["triangleDown",Km],["triangle",Um],["vh",fy],["vhv",dy]]);const gy=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=he(t,["colorAttribute","symbol","mode"]),a=py.get(r)||py.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||zc(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 hm(c.createElement("path",{})).call(mm,l).style("fill","transparent").style("d",a(m,y,b)).style("lineWidth",h).style("transform",p).style("stroke",d).style(wm(t),g).style(n,d).call(mm,o).node()}};gy.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const my=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);my.props=Object.assign({defaultMarker:"hollowBowtie"},gy.props);const yy=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);yy.props=Object.assign({defaultMarker:"hollowDiamond"},gy.props);const vy=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);vy.props=Object.assign({defaultMarker:"hollowHexagon"},gy.props);const by=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);by.props=Object.assign({defaultMarker:"hollowPoint"},gy.props);const xy=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);xy.props=Object.assign({defaultMarker:"hollowSquare"},gy.props);const wy=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);wy.props=Object.assign({defaultMarker:"hollowTriangle"},gy.props);const My=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);My.props=Object.assign({defaultMarker:"hollowTriangleDown"},gy.props);const Oy=(t,e)=>gy(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Oy.props=Object.assign({defaultMarker:"bowtie"},gy.props);const Ey=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Ey.props=Object.assign({defaultMarker:"cross"},gy.props);const ky=(t,e)=>gy(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);ky.props=Object.assign({defaultMarker:"diamond"},gy.props);const Sy=(t,e)=>gy(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Sy.props=Object.assign({defaultMarker:"hexagon"},gy.props);const _y=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);_y.props=Object.assign({defaultMarker:"hyphen"},gy.props);const Ay=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Ay.props=Object.assign({defaultMarker:"line"},gy.props);const Ty=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Ty.props=Object.assign({defaultMarker:"plus"},gy.props);const Py=(t,e)=>gy(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Py.props=Object.assign({defaultMarker:"point"},gy.props);const Cy=(t,e)=>gy(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Cy.props=Object.assign({defaultMarker:"square"},gy.props);const Ny=(t,e)=>gy(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Ny.props=Object.assign({defaultMarker:"tick"},gy.props);const Ly=(t,e)=>gy(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Ly.props=Object.assign({defaultMarker:"triangle"},gy.props);const jy=(t,e)=>gy(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);jy.props=Object.assign({defaultMarker:"triangleDown"},gy.props);const Ry=(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=Vs();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*fs(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 hm(o.createElement("path",{})).call(mm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(mm,i).node()}};function Iy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Iy(t,e)}))}function By(t){Fy(t,!0)}function Dy(t){Fy(t,!1)}function Fy(t,e){var n=e?"visible":"hidden";Iy(t,(function(t){t.attr("visibility",n)}))}Ry.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var zy=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(ep.INSERTED,(function(){Dy(r)})),r}return ue(e,t),e}(Dp);function Gy(t){var e=t.appendChild(new zy({class:"offscreen"}));return Dy(e),e}var Wy=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=Gy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Yp);function Hy(t){return t*Math.PI/180}function $y(t){return Number((180*t/Math.PI).toPrecision(5))}var Vy=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 qy,Uy=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?O(s)?(O(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)}))},Ky=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},Zy=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},Qy=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=H(n),r}((function(t,e){var n=_(t)?t:t.style.text.toString(),r=e||Jy(t),i=r.fontSize,o=r.fontFamily,a=r.fontWeight,s=r.fontStyle,c=r.fontVariant;return qy||(qy=document.createElement("canvas").getContext("2d")),qy.font=[s,c,a,"".concat(i,"px"),o].join(" "),qy.measureText(n).width}),(function(t,e){return[_(t)?t:t.style.text.toString(),Object.values(e||Jy(t)).join()].join("")}),4096),Jy=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 tv(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function ev(t,e){var n=tv(t);n&&n.attr(e)}function nv(t,e,n){void 0===n&&(n="..."),ev(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function rv(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 iv(t){return"function"==typeof t?t():_(t)||T(t)?new Wy({style:{text:String(t)}}):t}function ov(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 av(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 sv=function(t,e){return function(n){return t*(1-n)+e*n}};function cv(t,e){return"number"==typeof t&&"number"==typeof e?sv(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]=cv(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]=cv(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 lv(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 Vy(e,n,r-e,i-n)}var uv=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 Vy(o,a,n,r)})),v=lv(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=Vy.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));lv(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=Vy.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),O=M.map((function(e){var n,r,i=Vy.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 O},fv=function(t,e,n){return[]};function hv(t,e){return[t[0]*e,t[1]*e]}function dv(t,e){return[t[0]+e[0],t[1]+e[1]]}function pv(t,e){return[t[0]-e[0],t[1]-e[1]]}function gv(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function mv(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function yv(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function vv(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 bv(t,e){return+t.toPrecision(e)}function xv(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 wv(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=gv(h,y=t[p]),d=mv(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=hv(v=pv(a=t[n?(p+1)%m:p+1],o),e);var b=yv(y,o),x=yv(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=hv(v,-b),O=hv(v,x);c=dv(y,M),s=gv(s=dv(y,O),mv(a,y)),s=mv(s,gv(a,y)),c=gv(c=dv(y,M=hv(M=pv(s,y),-b/x)),mv(o,y)),s=dv(y,O=hv(O=pv(y,c=mv(c,gv(o,y))),x/b)),f&&(c=gv(c=mv(c,h),d),s=gv(s=mv(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 Mv=["$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 Ov(t){return Mv.includes(t)}function Ev(t){var e={};for(var n in t)Ov(n)&&(e[n]=t[n]);return e}function kv(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 Sv=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:Dp,rect:Vp,circle:Rp,path:Wp,text:Wy,ellipse:Bp,image:zp,line:Gp,polygon:Hp,polyline:$p,html:Fp},t}();function _v(t){return new Sv([t],null,t,t.ownerDocument)}function Av(t){if(T(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 Pv(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 Cv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Nv(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 Lv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function jv(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(Lv(o,"show")&&Lv(Nv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(Cv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(Cv(e)),"")]=a;else if(!Lv(o,"show")&&Lv(o,e)!==n){var s=Nv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function Rv(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(Cv(i))]=o,t}),{})}function Iv(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 Bv(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 Dv(){Fy(this,"hidden"!==this.attributes.visibility)}var Fv=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,Ky({},{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=Gy(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&&Dv.call(this)},e.prototype.update=function(t,e){var n;return this.attr(Ky({},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}(Ip),zv=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"]]},Gv=zv,Wv=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Hv=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},$v=Hv;var Vv=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(_(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 qv=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);ov(!!s,_v(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.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(Fv);qv.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]]})),qv.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),qv.registerSymbol("line",Wv),qv.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),qv.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]]})),qv.registerSymbol("circle",zv),qv.registerSymbol("point",Gv),qv.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"]]})),qv.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"]]})),qv.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"]]})),qv.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),qv.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"]]})),qv.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"]]})),qv.registerSymbol("line",Wv),qv.registerSymbol("dot",Hv),qv.registerSymbol("dash",$v),qv.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]]})),qv.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]]})),qv.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]]})),qv.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]]})),qv.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 Uv=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 Dp({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes.columns;_v(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(Ky({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Lp),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 Dp),n.areasGroup=n.appendChild(new Dp),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(Ky({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){_v(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){_v(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}(Lp);function Kv(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 Zv(t,e){if(void 0===e&&(e=!1),t.length<=2)return Kv(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=wv(n,!1);return e?a.unshift(ve(["M"],ye(t[r-1]),!1)):a.unshift(ve(["M"],ye(t[0]),!1)),a}function Qv(t,e,n){var r=G(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function Jv(t){return 0===t.length?[0,0]:[k(L(t,(function(t){return k(t)||0}))),E(N(t,(function(t){return E(t)||0})))]}function tb(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 eb=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 T(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?tb(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=jv(this.attributes,"area"),a=jv(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),A(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=Zv(o),s=void 0;if(0===i)s=Qv(a,e,n);else{var c=Zv(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=Kv(t[i]),a=void 0;if(0===i)a=Qv(o,e,n);else{var s=Kv(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 Qv(e?Zv(t):Kv(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return fe({stroke:t.getColor(n),path:i?Zv(e):Kv(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=jv(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=tb(s));var c=this.createScales(s),l=c.x,u=c.y,f=ye(Jv(s),2),h=f[0],d=f[1],p=new na({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)?_v(n).select(r):_v(n).append(i)).attr("className","container").node();var o=t.type,a="spark".concat(o),s="line"===o?this.linesStyle:this.columnsStyle;_v(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new Xv({className:a,style:s}):new Uv({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(Jv(t),2),d=h[0],p=h[1],g=new na({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 na({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Do({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}(Fv);function nb(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 rb(t,e){t?t.finished.then(e):e()}function ib(t,e){"update"in t?t.update(e):t.attr(e)}function ob(t,e,n){return 0===e.length?null:n?t.animate(e,n):(ib(t,{style:e.slice(-1)[0]}),null)}function ab(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?ob(t,[r,i],fe({fill:"both"},n)):(ib(t,i),null)}function sb(t,e){return t.style.opacity||(t.style.opacity=1),ab(t,{opacity:0},e)}var cb={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},lb={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},ub={orientation:"horizontal",showLabel:!0,type:"start"},fb=Uy({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),hb=Uy({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),db=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=_v(e).maybeAppendByClassName(hb.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(hb.iconLine,"-1"),"line").styles(fe({x1:f,x2:f,y1:d,y2:p},s)),u.maybeAppendByClassName("".concat(hb.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}(Fv),pb=function(t){function e(e){return t.call(this,e,ub)||this}return ue(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=jv(this.attributes,"label"),i=r.transform,o=ye(Iv(he(r,["transform"]),[]),2),a=o[0],s=o[1],c=_v(t).maybeAppendByClassName(hb.labelGroup,"g").styles(s),l=fe(fe({},lb),a),u=l.text,f=he(l,["text"]);ov(!!n,c,(function(t){e.label=t.maybeAppendByClassName(hb.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},cb),jv(this.attributes,"icon")),o=this.attributes.iconShape,a=void 0===o?function(){return new db({style:i})}:o;_v(t).maybeAppendByClassName(hb.iconGroup,"g").selectAll(hb.icon.class).data([a]).join((function(t){return t.append("string"==typeof a?a:function(){return a(r)}).attr("className",hb.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}(Fv),gb=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},Rv(ub,"handle")),Rv(cb,"handleIcon")),Rv(lb,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(rv(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(rv(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 Kd("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=jv(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(Av(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(fb.selection.class).each((function(n,r){ab(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&ab(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&ab(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=jv(this.attributes,"track");this.trackShape=_v(t).maybeAppendByClassName(fb.track,"rect").styles(fe(fe({},this.shape),e))},e.prototype.renderBrushArea=function(t){var e=this.attributes.brushable;this.brushArea=_v(t).maybeAppendByClassName(fb.brushArea,"rect").styles(fe({fill:"transparent",cursor:e?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this;ov("horizontal"===this.attributes.orientation,_v(t).maybeAppendByClassName(fb.sparklineGroup,"g"),(function(t){var n=e.sparklineStyle;t.maybeAppendByClassName(fb.sparkline,(function(){return new eb({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(fb.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 pb({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(fb.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=_v(t).maybeAppendByClassName(fb.foreground,"g");var i=jv(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(fb.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",fb.selection.name).call(o).each((function(t,e){var n=this;1===e?(a.selectionShape=_v(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 bv(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 bv(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,A(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=jv(this.attributes,"handle"),c=jv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new Wy({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,O=this.calcSelectionArea()[1],E=O.x,k=O.y,S=O.width,_=O.height,A=l+u;if("horizontal"===i){var T=A+g/2;if("start"===t)v=E-A-g>0?-T:T;else v=w-E-S-A>g?T:-T}else{var P=m+A;b="start"===t?k-u>m?-P:A:M-(k+_)-u>m?P:-A}return{x:v,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=jv(this.attributes,"handleLabel");return fe(fe(fe({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=jv(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({},Rv(this.getHandleIconStyle(),"icon")),Rv(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 Kd(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}(Fv),mb=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 Kd("scroll",r)),n.dispatchEvent(new Kd("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(rv(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Kd("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Kd("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Kd("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Kd("trackMouseleave",{detail:t.detail}))},n}return ue(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Av(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 A(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=jv(this.attributes,"track"),s=jv(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()},Rv(a,"track")),Rv(s,"selection"));this.slider=_v(t).maybeAppendByClassName("scrollbar",(function(){return new gb({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(A(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}(Fv),yb={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 Wp({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({},yb,{style:{type:"arc"}}),Y({},yb,{style:{}});var vb=Uy({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"),bb=Uy({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function xb(t){return t.reduce((function(t,e,n){return t.push(ve([0===n?"M":"L"],ye(e),!1)),t}),[])}function wb(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 xb(t);if(!o)return[];var a=yv(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):xb(t)}function Mb(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=ye([wb(t,n),wb(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([yv(h,o),yv(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 Ob=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=_v(e).maybeAppendByClassName(bb.lineGroup,"g"),o=_v(e).maybeAppendByClassName(bb.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:wb(t.points,n)}}));return t.selectAll(bb.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Yy(Ev(fe({path:t.path},r)),[t,e,a]);this.attr(fe({class:bb.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return ab(this,Yy(Ev(fe({path:t.path},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=sb(this,i.exit);return rb(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=Mb(u[0],u[1],n);c.push({path:f,fill:s(l)})}return t.selectAll(bb.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",bb.region.name)}),(function(t){return t.transition((function(t,e){return ab(this,Yy(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=sb(this,r.exit);return rb(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return ve(ve([],ye(a),!1),ye(s),!1)},e}(Fv);function Eb(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=ye(t,2);return[n[0],Yy(n[1],e)]})))}function kb(t,e){return e&&m(e)?t.filter(e):t}function Sb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function _b(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 vv([a[0],a[1]])}var s=Hy(Sb(t,e));return[-Math.sin(s),Math.cos(s)]}function Ab(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(_b(t,n),"positive"!==e)}function Tb(t,e){return Ab(t,e.labelDirection,e)}function Pb(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=Hy(Sb(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Cb(t){return 0===_b(0,t)[1]}function Nb(t){return 0===_b(0,t)[0]}function Lb(t,e){return e-t==360}function jb(t,e,n,r,i){var o=e-t,a=ye([i,i],2),s=a[0],c=a[1],l=ye([Hy(t),Hy(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(Lb(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 Rb(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(vb.line.class).data([{path:jb.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",vb.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=cv(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=jb.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 Ib(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 Bb(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(vb.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(vb.line.name," ").concat(t.className)})).styles(n).transition((function(t){return ab(this,Ib(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return ab(this,Ib(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:vb.line.name}]);var M=ye(s,2),O=M[0],E=M[1],k=p-f,S=g-h,_=ye([f+k*O,h+S*O],2),A=_[0],T=_[1],P=ye([f+k*E,h+S*E],2),C=P[0],N=P[1];return w([{line:[[f+y,h+v],[A,T]],className:vb.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:vb.lineSecond.name}])}function Db(t,e,n){var r,i=e.type,o=jv(e,"line");return r="linear"===i?Bb(t,e,xv(o,"arrow"),n):Rb(t,e,xv(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(vb.line.class):a?t.select(vb.lineSecond.class):t.select(vb.line.class),!o||!s||"arc"===n.type&&Lb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=iv(s);f.attr(r),kv(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Fb(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function zb(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=ye(Pb(i,e),2),a=o[0],s=o[1],c=ye(hv(function(t,e){return Ab(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Gb(t,e,n,r){var i=jv(n,"grid"),o=i.type,a=i.areaFill,s=Fb(n),c=kb(e,n.gridFilter),l="segment"===o?zb(c,n):function(t,e){var n=e.gridControlAngles,r=Fb(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(Pb(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=Hy(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(vb.grid.class).data([1]).join((function(t){return t.append((function(){return new Ob({style:u})})).attr("className",vb.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var Wb=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 Hb(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=$b(t),f=u.width,h=u.height,d=0,p=0,g=o,m=a,y=tv(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(Av(e),4),w=x[0],M=void 0===w?0:w,O=x[1],E=void 0===O?0:O,k=x[2],S=void 0===k?M:k,_=x[3],A=new Wb((d+=o)-(void 0===_?E:_),(p+=a)-M,d+f+E,p+h+S);return t.setEulerAngles(n),A.rotatedPoints(Hy(n),g,m)}function $b(t){return t.__bbox__?t.__bbox__:t.getBBox()}function Vb(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 qb(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&&Vb(r,i[0])||0===a&&Vb(r,i[1])||0===s&&Vb(i,r[0])||0===c&&Vb(i,r[1])){if(0===Yb(h[0],e,h[1]))return Vb(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function Ub(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(Av(e),4),p=d[0],g=d[1],m=d[2],y=d[3];return new Wb(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],O=w[1],E=ye(Nb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=E[0],S=E[1],_=E[2],A=E[3],T=hv(Tb(0,t),i),P=new Wb(b,x,M,O);return P.x1+=A,P.y1+=k,P.x2+=S+T[0],P.y2+=_+T[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 qb([[r,o],[i,o],[i,a],[r,a]],Hb(e,n))}(c,t)},u=function(t,e){return!t||!function(t,e,n){var r,i,o=Hb(t,n).flat(1),a=Hb(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(Ub(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,Av(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 Kb(t,e){return void 0===e&&(e={}),y(t)?0:"number"==typeof t?t:Math.floor(Qy(t,e))}var Zb=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Dy(t),!1)}))};var Qb=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=Zb,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 $b(t).width}))),!1));if("linear"===n.type&&(Cb(n)||Nb(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(Zy)),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=Jy(r.getTextShape(t[0])),p=Kb(u,d),g=a?Kb(a,d):p,m=Kb(c,d);(y(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return $b(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&&Cb(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 Jb(){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 tx(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function ex(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 nx(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=_b(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return av(e,-90,90)||(e+=180),e}($y("perpendicular"===i?ex([1,0],o):ex([a[0]<0?-1:1,0],a)))}function rx(t,e,n){var r=n.type,i=n.labelAlign,o=Tb(t,n),a=tx(e),s=tx($y(ex([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?(av(a,0,90,!1,!0)||av(a,0,90)||av(a,270,360))&&(c="start"):90===s?av(a,0,90,!1,!0)?c="start":(av(a,90,180)||av(a,270,360))&&(c="end"):270===s?av(a,0,90,!1,!0)?c="end":(av(a,90,180)||av(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(av(a,0,90)||av(a,270,360))&&(c="end")):c="center":"parallel"===i?l=av(s,0,180,!0)?"top":"bottom":"horizontal"===i?av(s,90,270,!1)?c="end":(av(s,270,360,!1)||av(s,0,90))&&(c="start"):"perpendicular"===i&&(c=av(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function ix(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),Jb(a,o)],2),f=ye(dv(hv(u[0],l+(1===u[1]?Yy(r?i:0,[t,c,e]):0)),Pb(t.value,n)),2);return{x:f[0],y:f[1]}}function ox(t,e){"text"===t.nodeName&&t.attr(e)}function ax(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=Qb.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:Dy,show:By,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=rx(e.__data__.value,t,n),i=e.querySelector(vb.labelItem.class);i&&ox(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&nv(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"),ev(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function sx(t,e,n,r,i){var o=n.indexOf(e),a=_v(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return iv(Yy(i,[t,e,n,Tb(t.value,r)]))}:function(){return iv(t.label||"")}}(e,o,n,i)).attr("className",vb.labelItem.name).node(),s=ye(Iv(Eb(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=he(l,["transform"]);Bv(t,u);var h=nx(e,t,i);return t.setLocalEulerAngles(+h),ox(a,fe(fe({},rx(e.value,h,i)),c)),Bv(t,u),t.attr(f),a}function cx(t,e,n,r){var i=kb(e,n.labelFilter),o=jv(n,"label");return t.selectAll(vb.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",vb.label.name).transition((function(t){return sx(this,t,e,o,n),this.attr(ix(t,e,n)),this.__bbox__=t.bbox,null})).call((function(){return ax.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&&Dy(t),e.isVisible()&&By(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,O=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})),E=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 rb(E,i),[O,E]}(this.querySelector(vb.labelItem.class),sx(this,t,e,o,n),r.update),a=ab(this,ix(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(Zy);i=function(){return ax.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=sb(this.childNodes[0],r.exit);return rb(e,(function(){return _v(t).remove()})),e}))})).transitions()}function lx(t,e){return Ab(t,e.tickDirection,e)}function ux(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 fx(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=lx(e.value,i),s="line";return m(o)&&(s=function(){return Yy(o,[e,n,r,a])}),t.append(s).attr("className",vb.tickItem.name)}(_v(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=lx(t.value,o),c=ux(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=ye(Iv(Eb(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(Pb(t.value,r),2);return ab(this,{x:s[0],y:s[1]},o)}var hx=Uy({text:"text"},"title");function dx(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function px(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 gx=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(hx.text.class);if(!a)return new Vy(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=ye(Av(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=dx(r);if(x.includes("i"))return new Vy(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(Av(o),4),M=w[0],O=w[1],E=w[2],k=w[3],S=ye([k+O,M+E],2),_=S[0],A=S[1];return new Vy(m+k,y+M,v-_,b-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Vy(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=he(t,["width","height","position","spacing"]),i=ye(Iv(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=dx(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;ov(!!r.text,_v(e),(function(t){n.title=t.maybeAppendByClassName(hx.text,"text").styles(i).call(px,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Fv);function mx(t,e,n,r,i){var o=ye(Iv(jv(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);Bv(t.node(),u);var f=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=dx(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(Av(o),4),w=x[0],M=x[1],O=x[2],E=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var k=n.startPos,S=n.endPos,_=ye("start"===i?[k,S]:[S,k],2),A=_[0],T=_[1],P=ye(hv(vv([-T[0]+A[0],-T[1]+A[1]]),w),2),C=P[0],N=P[1];return{x:A[0]+C,y:A[1]+N}}return a.includes("t")&&(b-=d+m+w),a.includes("r")&&(v+=h+g+M),a.includes("l")&&(v-=h+2*g+E),a.includes("b")&&(b+=d+2*m+O),{x:v,y:b}}(_v(n._offscreen||n.querySelector(vb.mainGroup.class)),e,r),h=f.x,d=f.y,p=ab(e.node(),{x:h,y:d},i);return Bv(t.node(),u),p}function yx(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=ov(i,e.maybeAppendByClassName(vb.lineGroup,"g"),(function(e){return Db(e,t,r)}))||[],c=ov(o,e.maybeAppendByClassName(vb.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=kb(e,n.tickFilter),o=jv(n,"tick");return t.selectAll(vb.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",vb.tick.name).transition((function(t,e){return fx.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),fx.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=sb(this.childNodes[0],r.exit);return rb(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=ov(a,e.maybeAppendByClassName(vb.labelGroup,"g"),(function(e){return cx(e,n,t,r)}))||[];return ve(ve(ve([],ye(s),!1),ye(c),!1),ye(l),!1).filter((function(t){return!!t}))}var vx=function(t){function e(e){return t.call(this,e,yb)||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=nb(void 0===n?a:n),d=ov(c,_v(e).maybeAppendByClassName(vb.gridGroup,"g"),(function(e){return Gb(e,f,t,h)}))||[],p=_v(e).maybeAppendByClassName(vb.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&yx(t,_v(this.offscreenGroup),f,nb(!1));var g=yx(t,_v(p.node()),f,h),m=ov(s,_v(e).maybeAppendByClassName(vb.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(vb.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 iv(i)})).attr("className",vb.title.name).transition((function(){return mx(_v(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return mx(_v(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}(Fv),bx=Uy({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"),xx=function(t){function e(e){var n=t.call(this,e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:Vv(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 Dp({class:bx.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Dp({class:bx.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return ue(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return A(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 Vy(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=ob(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return rb(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:A(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:A(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(bx.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)?By(e):Dy(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],O=ye(b[1],2),E=O[0],k=O[1],S=ye(b[2],2),_=S[0],A=S[1],T=v.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,M),r.setLocalPosition(E,k),n.setLocalPosition(_,A)},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(bx.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(bx.controller,"g");if(Fy(s.node(),a),a){var c=jv(this.attributes,"button"),l=jv(this.attributes,"pageNum"),u=ye(Iv(c),2),f=u[0],h=u[1],d=f.size,p=he(f,["size"]),g=!s.select(bx.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(bx.prevBtnGroup,"g").styles(h);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(bx.prevBtn,"path"),v=s.maybeAppendByClassName(bx.nextBtnGroup,"g").styles(h);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(bx.nextBtn,"path")].forEach((function(t){t.styles(fe(fe({},p),{transformOrigin:"center"})),kv(t.node(),d,!0)}));var b=s.maybeAppendByClassName(bx.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(bx.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=_v(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(ep.INSERTED,e),this.playWindow.addEventListener(ep.REMOVED,e)},e}(Fv);function wx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}qv.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"]]})),qv.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]]})),qv.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 Mx=Uy({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 Ox=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Rp({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(Av(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(Av(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(Mx.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=jv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Mx.markerGroup,"g").style("zIndex",0),ov(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(Mx.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),_v(i).styles(r)):(i.remove(),_v(o).attr("className",Mx.marker.name).styles(r),t.appendChild(o)):(_v(o).attr("className",Mx.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),kv(e.markerGroup.node(),e.scaleSize,!0)}))},e.prototype.renderLabel=function(t){var e=jv(this.attributes,"label"),n=e.text,r=he(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Mx.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Mx.label,(function(){return iv(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=jv(this.attributes,"value"),r=n.text,i=he(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Mx.valueGroup,"g").style("zIndex",0),ov(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Mx.value,(function(){return iv(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=jv(this.attributes,"background");this.background=t.maybeAppendByClassName(Mx.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Mx.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}),nv(this.labelGroup.select(Mx.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:s,y:c}),nv(this.valueGroup.select(Mx.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=_v(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(Fv),Ex=Uy({page:"item-page",navigator:"navigator",item:"item"},"items"),kx=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Sx=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=jv(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,O=ye([0,0],2),E=O[0],k=O[1];return"horizontal"===n?(E=(h=ye([f,b*(M+i)],2))[0],k=h[1],f=x===l-1?0:f+w+o):(E=(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:E,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,O=0===b?0:i,E=b+O+w;return E<=u&&kx(y,(function(t){return t<c}))?(n=ye([b+O,x,E],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&&kx(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 wx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Ex.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Ex.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);_v(t).selectAll(Ex.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Ox({style:e})})).attr("className",Ex.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 Dp({className:Ex.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=_(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=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=jv(this.attributes,"nav"),r=Ky({orientation:e},n),i=this;return t.selectAll(Ex.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new xx({style:r})})).attr("className",Ex.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(_v(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Kd(t,{detail:e});this.dispatchEvent(n)},e}(Fv),_x=Uy({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Ax={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,Ax)||this}return ue(e,t),e.prototype.render=function(t,e){var n=_v(e).maybeAppendByClassName(_x.markerGroup,"g");this.renderMarker(n);var r=_v(e).maybeAppendByClassName(_x.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?wx(r,"horizontalHandle","verticalHandle"):i;ov(!!o,t,(function(t){var n=jv(e.attributes,"marker"),r=fe({symbol:o},n);e.marker=t.maybeAppendByClassName(_x.marker,(function(){return new qv({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;ov(r,t,(function(t){var n,r=jv(e.attributes,"label"),o=r.text,c=he(r,["text"]),l=(null===(n=t.select(_x.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=ye(wx(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(_x.label,"text").styles(fe(fe({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(Fv),Px={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Cx=Ky({},Px,{}),Nx=Ky({},Px,Rv(Ax,"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"}),Lx=Uy({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"),jx=function(t){function e(e){return t.call(this,e,Cx)||this}return ue(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=ye(Iv(jv(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Lx.titleGroup,"g").styles(c);var l=fe(fe({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Lx.title,(function(){return new gx({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(Iv(jv(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(Lx.itemsGroup,"g").styles(fe({x:n,y:r},c));var u=this;this.itemsGroup.selectAll(Lx.items.class).data(["items"]).join((function(t){return t.append((function(){return new Sx({style:l})})).attr("className",Lx.items.name).each((function(){u.items=_v(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 Vy(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=dx(r),u=ye(Av(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye(Av(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],O=ye([b+y,m+v],2),E=O[0],k=O[1];if("l"===l[0])return new Vy(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+k,s.height));if("t"===l[0])return new Vy(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+M+k);var S=ye([e.attributes.width||c.width,e.attributes.height||c.height],2),_=S[0],A=S[1];return new Vy(c.x,c.y,_+s.width+w+E,A+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=_v(e);this.renderTitle(i,n,r),this.renderItems(i,this.availableSpace),this.adjustLayout()},e}(Fv),Rx={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},Ix=Uy({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Bx=function(t){function e(e){var n=t.call(this,e,Rx)||this;return n.point=[0,0],n.group=n.appendChild(new Dp({})),n.isMutationObserved=!0,n}return ue(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=ye(Av(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 Vy(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=jv(this.attributes,"background");this.background=_v(this.group).maybeAppendByClassName(Ix.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(Iv(jv(this.attributes,"label")),2),i=r[0],o=r[1],a=he(i,["text"]);(this.label=_v(this.group).maybeAppendByClassName(Ix.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Ix.label,(function(){return iv(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=Pv.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],O=b[3],E=b[4];return n?(this.point=[M,a-v],[["L",x,a],["L",w,a],["L",M,a-v],["L",O,a],["L",E,a]]):(this.point=[o+v,M],[["L",o,x],["L",o,w],["L",o+v,M],["L",o,O],["L",o,E]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Dy(this):By(this)},e.prototype.bindEvents=function(){this.label.on(ep.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Fv);function Dx(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 Fx=Uy({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function zx(t){var e=t.orientation,n=t.size,r=t.length;return wx(e,[r,n],[n,r])}function Gx(t){var e=t.type,n=ye(zx(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 Wx(t){return Gx(t)}function Hx(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 Df(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(wx(n,"0","270"),")")):""}function $x(t){var e=t.orientation,n=t.range;if(!n)return[];var r=ye(zx(t),2),i=r[0],o=r[1],a=ye(n,2),s=a[0],c=a[1],l=wx(e,s*i,0),u=wx(e,0,s*o),f=wx(e,c*i,i),h=wx(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var Vx=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=jv(e,"track");t.maybeAppendByClassName(Fx.track,"path").styles(fe({path:Gx(e)},n))}(_v(e).maybeAppendByClassName(Fx.trackGroup,"g"),t),function(t,e){var n=jv(e,"selection"),r=Hx(e),i=t.maybeAppendByClassName(Fx.selection,"path").styles(fe({path:Wx(e),fill:r},n)),o=i.maybeAppendByClassName(Fx.clipPath,"path").styles({path:$x(e)}).node();i.style("clip-path",o)}(_v(e).maybeAppendByClassName(Fx.selectionGroup,"g"),t)},e}(Fv);var Yx=function(t){function e(e){var n=t.call(this,e,Nx)||this;return n.eventToOffsetScale=new na({}),n.innerRibbonScale=new na({}),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=Dx(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 Vy(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(_v(e));var i=this.availableSpace,o=i.x,a=i.y,s=_v(e).maybeAppendByClassName(Lx.contentGroup,"g").styles({x:o,y:a});ov(!!r,s.maybeAppendByClassName(Lx.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Lx.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Lx.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 wx(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=jv(this.attributes,"title"),s=fe(fe({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Lx.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new gx({style:s})})).attr("className",Lx.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 Vy(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 Vy(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(vb.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Vy(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],O=["top","left"].includes(y)?s:0,E=ye(this.ifHorizontal([v/2,O],[O,v/2]),2),k=E[0],S=E[1];return new Vy(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=jv(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=Ky({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(Lx.ribbon,(function(){return new Vx({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(Lx.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=jv(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:pb,u=this;this.handlesGroup.selectAll(Lx.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(Lx.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(Lx.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 Vy(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 Vy(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=jv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Lx.indicator,(function(){return new Bx({})})).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=jv(this.attributes,"tick"),s=jv(this.attributes,"label"),c=s.align,l=Ky(fe({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Rv(a,"tick"),Rv(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(Lx.label,(function(){return new vx({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=A(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}),By(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Dy(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)?bv(.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?Dx(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(rv(t)),!1))-c;return A(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 Kd("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new Kd("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(Fv);function qx(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 Ux={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Xx(t){var e;void 0===t&&(t="");var n=qx(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},Ux),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)"},Ux),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 Kx=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=qx(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=qx(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}(Fv),Zx=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[ep.BOUNDS_CHANGED,ep.INSERTED,ep.REMOVED],n.$margin=Av(0),n.$padding=Av(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=Av(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Av(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 Vy(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 Vy(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:uv,grid:fv},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}(Dp);function Qx(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 oc()([[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=fs(t,e),i=fs(e,n),o=fs(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 oc()(u)}const Jx=Cm((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(t))))return void t.children.forEach((t=>t.remove()));const x=ur(b,"background"),{padding:w}=x,M=he(x,["padding"]),O=ur(b,"connector"),{points:E=[]}=O,k=he(O,["points"]),S=[[+u,+f],[+c,+l]];let _;_=v?hm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(mm,Object.assign({transform:a,transformOrigin:s},b)).node():hm(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(mm,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const A=hm(t).maybeAppend("background","rect").style("zIndex",-1).call(mm,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}}(_,w)).call(mm,d?M:{}).node(),P=Qx(A,S,E,y),C=g&&new qv({id:"startMarker",style:Object.assign({x:0,y:0},ur(b,"startMarker"))}),N=m&&new qv({id:"endMarker",style:Object.assign({x:0,y:0},ur(b,"endMarker"))});hm(t).maybeAppend("connector","path").style("zIndex",0).style("path",P).style("markerStart",C).style("markerEnd",N).call(mm,p?k:{})})),tw=(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 hm(new Jx).style("x",f).style("y",h).call(mm,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(mm,u).call(mm,t).node()}};tw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ew=Cm((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=hm(t).maybeAppend("marker",(()=>new qv({}))).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);hm(t).maybeAppend("text","text").style("x",a).style("y",s).call(mm,e)})),nw=(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 hm(new ew).call(mm,o).style("x",l).style("y",u).call(mm,c).call(mm,n).node()}};nw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const rw=Cm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;hm(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(mm,i),hm(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(mm,r)})),iw=(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=Mm(s,e),m=r&&h?vm(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=>hm(c.createElement("path",{})).style("d",t||"").call(mm,y).node();if(Ic(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=ac().curve(sc),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 uc(n())},delete t.lineX0,t.lineEndAngle=function(){return uc(r())},delete t.lineX1,t.lineInnerRadius=function(){return uc(i())},delete t.lineY0,t.lineOuterRadius=function(){return uc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(lc(t)):e()._curve},t}().angle(((t,n)=>ds(ls(r[n],e)))).outerRadius(((t,n)=>fs(r[n],e))).innerRadius(((t,n)=>fs(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)):hm(new rw).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 Rc(s)?ac().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):ac().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)):hm(new rw).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},x),a)).style("areaPath",e(t)).style("connectPath",b.map(e).join("")).node()}}};iw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ow=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Ic(n)?wc:nc;return iw(Object.assign({curve:i},t),e)(...r)}};ow.props=Object.assign(Object.assign({},iw.props),{defaultMarker:"square"});const aw=(t,e)=>{const{alpha:n=.5}=t,r=he(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=Ic(i)?bc:yc;return iw(Object.assign({curve:o.alpha(n)},r),e)(...t)}};aw.props=Object.assign(Object.assign({},iw.props),{defaultMarker:"smooth"});const sw=(t,e)=>(...n)=>iw(Object.assign({curve:Nc},t),e)(...n);sw.props=Object.assign(Object.assign({},iw.props),{defaultMarker:"hvh"});const cw=(t,e)=>(...n)=>iw(Object.assign({curve:Lc},t),e)(...n);cw.props=Object.assign(Object.assign({},iw.props),{defaultMarker:"vh"});const lw=(t,e)=>(...n)=>iw(Object.assign({curve:jc},t),e)(...n);lw.props=Object.assign(Object.assign({},iw.props),{defaultMarker:"hv"});const uw=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Ry(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};uw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fw=(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=Vs();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]),hm(r.createElement("path",{})).call(mm,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(mm,n).node()}};function hw(t,e,n,r){const i=Vs();if(Ic(n)){const o=n.getCenter(),a=fs(t,o),s=(fs(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),ym(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Rc(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)}fw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dw=(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=hw(f,h,i,n);return hm(o.createElement("path",{})).call(mm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(mm,r).node()}};dw.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pw=(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=Vs();if(h.moveTo(u[0],u[1]),Ic(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{ym(h,u,f,ms(u,f),fs(u,f)/2)}return hm(i.createElement("path",{})).call(mm,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(mm,n).node()}};function gw(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 mw(t={}){return[...gw(t),{name:"title",scale:"identity"}]}function yw(){return[{type:Br,channel:"color"},{type:Ur,channel:["x","y"]}]}function vw(){return[{type:Br,channel:"x"},{type:Ur,channel:["y"]}]}function bw(t={}){return gw(t)}function xw(){return[{type:Wr}]}function ww(t,e){return t.getBandWidth(t.invert(e))}function Mw(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?ww(a,r[e]):0,l=d?ww(s,i[e]):0,g=p&&o?(ww(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function Ow(t){return parseFloat(t)/100}function Ew(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?Ow(e)*a:+e,"string"==typeof n?Ow(n)*s:+n]]}))]}pw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kw=(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?Ow(h)*m:h,d="string"==typeof d?Ow(d)*y:d;const v=p-Number(h)/2,b=g-Number(d)/2;return hm(r.createElement("image",{})).call(mm,s).style("x",v).style("y",b).style("img",l).style("stroke",c).style("transform",f).call(mm,t).style("width",h).style("height",d).node()}};function Sw(t,e){const n=Vs();if(Ic(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>fs(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?ym(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)}kw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _w=(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=Sw(e,n);return hm(r.createElement("path",{})).call(mm,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(mm,t).node()}};function Aw(t,e){const[n,r,i,o]=t,a=Vs();if(Ic(e)){const t=e.getCenter(),s=fs(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),ym(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),ym(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}_w.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=Aw(t,r);return hm(i.createElement("path",{})).call(mm,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(mm,n).node()}};function Pw(t,e){const n=Vs();if(Ic(e)){const r=e.getCenter(),[i,o]=r,a=hs(ls(t[0],r)),s=hs(ls(t[1],r)),c=fs(r,t[2]),l=fs(r,t[3]),u=fs(r,t[8]),f=fs(r,t[10]),h=fs(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 Cw=(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=Pw(e,n);return hm(r.createElement("path",{})).call(mm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(mm,t).node()}};function Nw(t,e,n=4){const r=Vs();if(!Ic(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=fs(i,t[3]),c=fs(i,t[8]),l=fs(i,t[10]),u=hs(ls(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}Cw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Lw=(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=Nw(e,n,4);return hm(r.createElement("path",{})).call(mm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(mm,t).node()}};Lw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jw=(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(!Ic(e))return oc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return Js()({startAngle:0,endAngle:2*Math.PI,outerRadius:fs(t[0],n),innerRadius:fs(t[1],n)})}(t,o),g=function(t,e){if(!Ic(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return hm(a.createElement("path",{})).call(mm,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(mm,i).node()}};function Rw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}jw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Iw=(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(Rc(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 hm(new Wp).call(mm,f).style("path",function(t){return oc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new qv({className:"marker",style:Object.assign(Object.assign({},g),{symbol:Rw})}):null).call(mm,s).node()}};function Bw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Dw(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 Fw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=xm(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=Gw(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?zw(c,p,i):ms(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function zw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Gw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Ww(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=xm(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:Gw(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=zw(d,p,v);return Object.assign({x:b,y:x},g)}function Hw(t){return void 0===t?null:t}function $w(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:Hw(o[0]),y:Hw(o[1])}}function Vw(t,e,n,r){const{bounds:i}=n;if(1===i.length)return $w(0,0,n);return(Bc(r)?Fw:Gc(r)?Ww:Dw)(t,e,n,r)}function Yw(t,e,n){const r=xm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function qw(t,e,n){const r=xm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function Uw(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=qw(e,n,r),d=Math.sin(h)>0?1:-1,p=Gw(h,i,o),g={textAlign:d>0||Bc(r)?"start":"end",textBaseline:"middle",rotate:p},m=Yw(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,O]]=function(t,e,n,r,i){const[o,a]=zw(t,e,n),[s,c]=zw(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,m,y,s?l:0),E=s?+u*d:0,k=M+E,S={connector:s,connectorPoints:[[x-k,w-O],[M-k,O-O]]};return Object.assign(Object.assign({x0:v,y0:b,x:M+E,y:O},g),S)}Iw.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=hs(ls(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:Vw,bottomLeft:Vw,bottomRight:Vw,inside:Vw,left:Vw,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?$w(0,0,n):(Bc(r)?Fw:Gc(r)?Uw:Dw)(t,e,n,r)},right:Vw,spider:function(t,e,n,r){if(!Gc(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(Uw(0,e,n,r),[]),c=r.getCenter(),l=Yw(e,n,r),u=qw(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(!Gc(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(Uw(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(Gc(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=ds([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,m]=zw(u,d,h);return s.x=g+(o+a)*p,s.y=m,s},top:Vw,topLeft:Vw,topRight:Vw});function Kw(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:Gc(e)?"inside":Rc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=Xw[Bw(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const Zw=(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=Kw(e,o,n,r,t),{rotate:p=0,transform:g=""}=d,m=he(d,["rotate","transform"]);return hm(new Jx).call(mm,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(mm,h).node()}};Zw.props={defaultMarker:"point"};const Qw=(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 hm(a.createElement("path",{})).call(mm,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(mm,i).node()}};Qw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jw=(t,e)=>Qw(Object.assign({colorAttribute:"fill"},t),e);Jw.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tM=(t,e)=>Qw(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);tM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eM=(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=Vs();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),hm(n.createElement("path",{})).call(mm,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(mm,t).node()}};function nM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}eM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},H(3);const rM=function(t,e=((...t)=>`${t[0]}`),n=16){const r=H(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=nM(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 iM(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=nM(a,t,e).getContext("2d"),l=function(t,e){const n=nM(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=rM(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=nM(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const oM=(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?iM(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 hm(f.createElement("image",{})).call(mm,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(mm,c).node()}};oM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aM=(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 sM(t,e){return t.getBandWidth(t.invert(e))}aM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const cM={rect:km,hollow:Sm,funnel:Am,pyramid:Pm},lM=()=>(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=sM(l,i[t]),n=e*(u?sM(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]};lM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:cM,channels:[...mw({shapes:Object.keys(cM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...xw(),{type:hn},{type:Dr}],postInference:[...vw()],interaction:{shareTooltip:!0}};const uM={rect:km,hollow:Sm},fM=()=>(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]};fM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:uM,channels:[...mw({shapes:Object.keys(uM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...xw(),{type:hn}],postInference:[...vw()],interaction:{shareTooltip:!0}};const hM={line:jm,smooth:Rm,hv:Im,vh:Bm,hvh:Dm,trail:zm},dM=(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]},pM=(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}))]},gM=()=>(t,e,n,r)=>(Fc(r)?pM:dM)(t,e,n,r);gM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:hM,channels:[...mw({shapes:Object.keys(hM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...xw(),{type:Jr},{type:Hr}],postInference:[...vw(),{type:Br,channel:"color"},{type:Ur,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const mM={hollow:by,hollowDiamond:yy,hollowHexagon:vy,hollowSquare:xy,hollowTriangleDown:My,hollowTriangle:wy,hollowBowtie:my,point:Py,plus:Ty,diamond:ky,square:Cy,triangle:Ly,hexagon:Sy,cross:Ey,bowtie:Oy,hyphen:_y,line:Ay,tick:Ny,triangleDown:jy},yM=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=Mw(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))]))]};yM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:mM,channels:[...mw({shapes:Object.keys(mM)}),{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:[...xw(),{type:Dr},{type:Fr}],postInference:[{type:Gr},...yw()]};const vM={text:tw,badge:nw},bM=t=>{const{cartesian:e=!1}=t;return e?Ew:(e,n,r,i)=>{const{x:o,y:a}=r,s=Mw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};bM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:vM,channels:[...mw({shapes:Object.keys(vM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...xw(),{type:Qr},{type:Kr}],postInference:[...yw()]};const xM={cell:km,hollow:Sm},wM=()=>(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]};wM.props={defaultShape:"cell",defaultLabelShape:"label",shape:xM,composite:!1,channels:[...mw({shapes:Object.keys(xM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...xw(),{type:Dr},{type:Fr},{type:Xr}],postInference:[...yw()]};const MM={area:ow,smooth:aw,hvh:sw,vh:cw,hv:lw},OM=()=>(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]};OM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:MM,channels:[...mw({shapes:Object.keys(MM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...xw(),{type:Hr},{type:hn},{type:Xr}],postInference:[...vw()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const EM={link:uw,arc:pw,smooth:fw,vhv:dw},kM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Mw(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]};kM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:EM,channels:[...mw({shapes:Object.keys(EM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...xw(),{type:Yr},{type:qr}],postInference:[...yw()]};const SM={image:kw},_M=t=>{const{cartesian:e}=t;return e?Ew:(e,n,r,i)=>{const{x:o,y:a}=r,s=Mw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};_M.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:SM,channels:[...mw({shapes:Object.keys(SM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...xw(),{type:Qr},{type:Kr}],postInference:[...yw()]};const AM={polygon:_w,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:AM,channels:[...mw({shapes:Object.keys(AM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...xw()],postInference:[...yw()]};const PM={box:Cw,violin:Lw},CM=()=>(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]};CM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...mw({shapes:Object.keys(PM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...xw(),{type:Dr}],postInference:[...vw()],interaction:{shareTooltip:!0}};const NM={vector:Ry},LM=()=>(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]};LM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...mw({shapes:Object.keys(NM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...xw()],postInference:[...yw()]};const jM={line:jw},RM=t=>(e,n,r,i)=>{const{y:o}=r,a=Mw(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]};RM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:jM,channels:[...bw({shapes:Object.keys(jM)}),{name:"y",required:!0}],preInference:[...xw(),{type:$r}],postInference:[]};const IM={line:jw},BM=t=>(e,n,r,i)=>{const{x:o}=r,a=Mw(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]};BM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:IM,channels:[...bw({shapes:Object.keys(IM)}),{name:"x",required:!0}],preInference:[...xw(),{type:Vr}],postInference:[]};const DM={connector:Iw},FM=(...t)=>kM(...t);function zM(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 GM(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=zM("x",e,i,r.x),s=zM("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]}}FM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:DM,channels:[...bw({shapes:Object.keys(DM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...xw()],postInference:[]};const WM={range:km},HM=()=>GM();HM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:WM,channels:[...bw({shapes:Object.keys(WM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...xw()],postInference:[]};const $M={range:km},VM=()=>GM({extendY:!0});VM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:$M,channels:[...bw({shapes:Object.keys($M)}),{name:"x",required:!0}],preInference:[...xw()],postInference:[]};const YM={range:km},qM=()=>GM({extendX:!0});qM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...bw({shapes:Object.keys(YM)}),{name:"y",required:!0}],preInference:[...xw()],postInference:[]};const UM={path:Jw,hollow:tM},XM=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];XM.props={defaultShape:"path",defaultLabelShape:"label",shape:UM,composite:!1,channels:[...mw({shapes:Object.keys(UM)}),{name:"d",scale:"identity"}],preInference:[...xw()],postInference:[]};const KM=t=>{const{cartesian:e}=t;return e?Ew:(e,n,r,i)=>{const{x:o,y:a}=r,s=Mw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};KM.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:aM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...xw(),{type:Qr},{type:Kr},{type:Zr}]};var ZM={},QM={};function JM(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function tO(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 eO(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function nO(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+eO(-t,6):t>9999?"+"+eO(t,6):eO(t,4)}(t.getUTCFullYear())+"-"+eO(t.getUTCMonth()+1,2)+"-"+eO(t.getUTCDate(),2)+(i?"T"+eO(e,2)+":"+eO(n,2)+":"+eO(r,2)+"."+eO(i,3)+"Z":r?"T"+eO(e,2)+":"+eO(n,2)+":"+eO(r,2)+"Z":n||e?"T"+eO(e,2)+":"+eO(n,2)+"Z":"")}function rO(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 QM;if(l)return l=!1,ZM;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())!==QM;){for(var f=[];r!==ZM&&r!==QM;)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?nO(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=JM(t);return function(r,i){return e(n(r),i,t)}}(t,e):JM(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=tO(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=tO(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function iO(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;oO&&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 oO=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),aO=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 rO(r).parse(e,i?iO:rr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};aO.props={};const sO=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 cO(t){return null!=t&&!Number.isNaN(t)}sO.props={};const lO=t=>{const{callback:e=cO}=t;return t=>t.filter(e)};lO.props={};const uO=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};uO.props={};const fO=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)))};fO.props={};const hO=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)),{})))};hO.props={};const dO=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)))};dO.props={};const pO=t=>{const{value:e}=t;return()=>e};pO.props={};const gO=t=>{const{callback:e=rr}=t;return t=>e(t)};gO.props={};const mO=t=>{const{callback:e=rr}=t;return t=>Array.isArray(t)?t.map(e):t};function yO(t){return"string"==typeof t?e=>e[t]:t}mO.props={};const vO=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=yO(s),l=yO(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)),{}))}))};vO.props={};const bO=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};bO.props={};var xO={exports:{}},wO={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}}(wO),function(t){var e=Math.log(2),n=t.exports,r=wO.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)}}}(xO);var MO=xO.exports;const OO=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=MO.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})}))}};OO.props={};const EO=()=>t=>(console.log("G2 data section:",t),t);EO.props={};const kO={density:eM},SO=()=>(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]};SO.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:kO,channels:[...mw({shapes:Object.keys(kO)}),{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:[...xw(),{type:hn},{type:Dr}],postInference:[...vw()],interaction:{shareTooltip:!0}};const _O={heatmap:oM},AO=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]}))]]};AO.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:_O,channels:[...mw({shapes:Object.keys(_O)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...xw(),{type:Dr},{type:Fr}],postInference:[...yw()]};const TO=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];TO.props={};const PO=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];PO.props={};const CO=t=>new Do(t);CO.props={};const NO=t=>new na(t);NO.props={};const LO=t=>new Ro(t);LO.props={};const jO=t=>new Zo(t);jO.props={};const RO=t=>new ra(t);RO.props={};const IO=t=>new Sa(t);IO.props={};const BO=t=>new la(t);BO.props={};const DO=t=>new oa(t);DO.props={};const FO=t=>new sa(t);FO.props={};const zO=t=>new ha(t);zO.props={};const GO=t=>new ua(t);GO.props={};const WO=t=>new aa(t);WO.props={};const HO=t=>new Ta(t);HO.props={};const $O=t=>new zo(t);function VO({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,lineCap:"round"}},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",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",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",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"}}}$O.props={};const YO=VO({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}),qO=t=>Y({},YO,t);qO.props={};const UO=t=>Y({},qO(),{category10:"category10",category20:"category20"},t);UO.props={};const XO=VO({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}),KO=t=>Y({},XO,{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),ZO=t=>Object.assign({},KO(),{category10:"category10",category20:"category20"},t);ZO.props={};const QO=VO({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}),JO=t=>Y({},QO,{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 tE(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)]}JO.props={};var eE,nE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rE(t){if(!(e=nE.exec(t)))throw new Error("invalid format: "+t);var e;return new iE({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 iE(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 oE(t,e){var n=tE(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")}rE.prototype=iE.prototype,iE.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 aE={"%":(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)=>oE(100*t,e),r:oE,s:function(t,e){var n=tE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(eE=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")+tE(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sE(t){return t}var cE,lE,uE=Array.prototype.map,fE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?sE:(e=uE.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?sE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(uE.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=rE(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"):aE[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=aE[v],M=/[defgprs%]/.test(v);function O(t){var i,o,c,h=b,O=x;if("c"===v)O=w(t)+O,t="";else{var E=(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)),E&&0==+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:l:"-"===f||"("===f?"":f)+h,O=("s"===v?fE[8+eE/3]:"")+O+(E&&"("===f?")":""),M)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){O=(46===c?a+t.slice(i+1):t.slice(i))+O,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var k=h.length+t.length+O.length,S=k<p?new Array(p-k+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-O.length:1/0),S=""),n){case"<":t=h+t+O+S;break;case"=":t=h+S+t+O;break;case"^":t=S.slice(0,k=S.length>>1)+h+t+O+S.slice(k);break;default:t=S+h+t+O}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)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var n=f(((t=rE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=tE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=fE[8+r/3];return function(t){return n(i*t)+o}}}}function dE(t,e,n){return t.querySelector(e)?hm(t).select(e):hm(t).append(n)}function pE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function gE(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)}cE=hE({thousands:",",grouping:[3],currency:["$",""]}),lE=cE.format;class mE extends Zx{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 yE extends mE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function vE(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function bE(t){return"vertical"===t||t===-Math.PI/2}function xE(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 wE(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 ME(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function OE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function EE(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(Ic(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 na({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(!zc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new na({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new na({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Ic(s)||Rc(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:Bc(s)&&"center"===a||Rc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Rc(s)&&g(a)?1-l:l,label:f(h(gm(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(gm(e),n,r)),id:String(n)}}))}function kE(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 SE(t,e,n){return!function(t){return Ic(t)&&Rc(t)}(e)&&!Fc(e)&&(void 0===t?!!n.getTicks:t)}function _E(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:bE(o)?10:0,tick:"center"!==r&&void 0}):a}const AE=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?lE(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)}},TE=AE((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=_E(i,0,b,e,s,o),O=Object.assign(Object.assign(Object.assign({},M),l),m),E=function(t,e,n="xy"){const[r,i,o]=OE(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]=Wc(r),[u,f]=Hc(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),_=EE(i,w,f,r,h,d,s,v),A=g?_.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):_,T=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},O),{type:"linear",data:A,crossSize:c,titleText:pE(u),labelOverlap:kE(p,O),grid:SE(O.grid,v,i),gridLength:E,line:!0,indexBBox:g}),O.line?null:{lineOpacity:0}),k),S),n),P=T.labelOverlap.find((t=>"hide"===t.type));return P&&(T.crossSize=!1),new vx({className:"axis",style:wE(T)})}})),PE=AE((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=EE(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]=Wc(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]=Hc(i),[d,p]=OE(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,O=wE(Y({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:pE(h),grid:d},p),l)));return new vx({style:K(O,["transform"])})}}));TE.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},PE.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const CE=t=>(...e)=>{const n=TE(Object.assign({},{crossPadding:50},t))(...e);return ME(n,t),n};CE.props=Object.assign(Object.assign({},TE.props),{defaultPosition:"bottom"});const NE=t=>(...e)=>{const n=TE(Object.assign({},{crossPadding:10},t))(...e);return ME(n,t),n};function LE(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=Hc(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))})}NE.props=Object.assign(Object.assign({},TE.props),{defaultPosition:"left"});const jE=t=>{const{important:e={}}=t,n=he(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return TE(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({},LE(t,i,o,a)),e)}))(r)}};function RE(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=vE(t,"shape"),r=vE(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=py.get(t)||py.get("point");return(...t)=>new Wp({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 vE(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 IE(t){const e=vE(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function BE(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=vE(t,"size");return n instanceof Zo?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:RE(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:IE(r)},s="string"==typeof n?lE(n):n,c=vE(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)})))})}jE.props=Object.assign(Object.assign({},TE.props),{defaultPosition:"center"});const DE=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}=xE(t,e,n);return{width:i,height:o}}(r,t,DE),d=gE(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:pE(s)}),BE(t,e)),{legendCategory:g={}}=i,m=wE(Object.assign({},g,p,u)),y=new yE({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:m})});return y.appendChild(new jx({className:"legend-category",style:m})),y}};function FE(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 zE(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],xr(e)];return[n,r]}function GE(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:[Df(e).toString()]})),r}(s,c),[u,f]=zE(l),[h,d]=zE([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof zo))));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)||c,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 WE(t,e,n,r,i,o){const a=vE(t,"color"),s=function(t,e,n){const{size:r}=e,i=xE(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 sa){const{range:t}=a.getOptions(),[e,n]=zE(a);return a instanceof ua||a instanceof ha?FE(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 GE(s,a,vE(t,"size"),vE(t,"opacity"),e,o)}DE.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const HE=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=gE(o,n),{legendContinuous:y={}}=a,v=wE(Object.assign({},y,Object.assign(Object.assign({titleText:pE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>lE(e)(t.label):e},WE(r,l,i,t,HE,a)),c),f)),b=new mE({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}};HE.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const $E=t=>(...e)=>HE(Object.assign({},{block:!0},t))(...e);$E.props=Object.assign(Object.assign({},HE.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const VE=t=>e=>{const{scales:n}=e,r=vE(n,"size");return HE(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};VE.props=Object.assign(Object.assign({},HE.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const YE=t=>VE(Object.assign({},{block:!0},t));function qE(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"}}}YE.props=Object.assign(Object.assign({},HE.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const UE=(XE={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(mm,Object.assign(Object.assign(Object.assign({},qE(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({},qE(0,u.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),l))}))}},class extends Ip{constructor(t){super(t),this.descriptor=XE}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 XE;const KE=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new UE({style:Y({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function ZE(t){return!!t.getBandWidth}function QE(t,e,n){if(!ZE(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 JE(t,e,n){if(!e)return t.getOptions().domain;if(!ZE(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 tk(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[QE(a,n,e),QE(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[JE(a,[l[0],u[0]]),JE(s,[l[1],u[1]])]}function ek(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}KE.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const nk=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?lE(n):n,m="horizontal"===e,y=Rc(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 gb({className:"slider",style:Object.assign({},d,Object.assign(Object.assign({x:b,y:x,trackLength:m?f:h,orientation:e,formatter:e=>(g||p)(QE(t,y?1-e:e,!0))},i),a))})}};nk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const rk=t=>nk(Object.assign(Object.assign({},t),{orientation:"horizontal"}));rk.props=Object.assign(Object.assign({},nk.props),{defaultPosition:"bottom"});const ik=t=>nk(Object.assign(Object.assign({},t),{orientation:"vertical"}));ik.props=Object.assign(Object.assign({},nk.props),{defaultPosition:"left"});const ok=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 mb({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}))})}};ok.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const ak=t=>ok(Object.assign(Object.assign({},t),{orientation:"horizontal"}));ak.props=Object.assign(Object.assign({},ok.props),{defaultPosition:"bottom"});const sk=t=>ok(Object.assign(Object.assign({},t),{orientation:"vertical"}));sk.props=Object.assign(Object.assign({},ok.props),{defaultPosition:"left"});const ck=t=>()=>new Dp;ck.props={};const lk=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(h,Object.assign(Object.assign({},i),t))}},uk=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},fk=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(h,Object.assign(Object.assign({},i),t))}},hk=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},dk=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))};dk.props={};const pk=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 gk(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}pk.props={};const mk=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function yk(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function vk(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 bk(t,e){const[n,r,i,o]=yk(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(vk([t,o,e,l]))}f-=t,u+=1}return c}function xk(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function wk(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function Mk(t){const e=ph(t);if(e&&!function(t){return!wk(t,"m")||!wk(t,"M")}(e))return e}function Ok(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=Mk(e),s=Mk(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){const[r,i,o,a]=yk(t),{transform:s}=t.style,{transform:c}=e.style;xk(e,t);const[l,u,f,h]=yk(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})`},gk(t,mk)),Object.assign({transform:(c?c+" ":"")+"translate(0, 0) scale(1, 1)"},gk(e,mk))];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 Wp({style:Object.assign(Object.assign({},gk(t,mk)),{d:e})});return xk(r,t),r}(t,a),l=[Object.assign({path:a},gk(e,mk)),Object.assign({path:s},gk(n,mk))],u=c.animate(l,r);return u.onfinish=()=>{c.style.transform="none",sr(c,n)},c.style.transform="none",u}const Ek=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:bk}(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 Ok(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)=>Ok(e,new Wp({style:Object.assign({path:i[r]},gk(t,mk))}),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)=>Ok(t,t,new Wp({style:{path:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};Ek.props={};const kk=(t,e)=>{const n=1e-4;jp({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Ef.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Ic(r))return lk(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=Js().cornerRadius(f).padAngle(h*Math.PI/180),x=xm(r,m,[y,v]),{startAngle:w,endAngle:M}=x,O=new Wp({}),E=t=>{O.attr({d:b(t),transform:`translate(${c[0]}, ${c[1]})`});const e=ph(O);return O.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=E(Object.assign(Object.assign({},x),{endAngle:Number(s.style.waveInArcAngle)}))},S.onfinish=function(){s.style.path=E(Object.assign(Object.assign({},x),{endAngle:M}))},S}};kk.props={};const Sk=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},_k=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(1)`.trimStart(),transformOrigin:l},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},Ak=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))};Ak.props={};const Tk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Wp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return lk(t,e)([c],r,i)};Tk.props={};const Pk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Wp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return fk(t,e)([c],r,i)};Pk.props={};const Ck="main-layer",Nk="label-layer",Lk="element",jk="view",Rk="plot",Ik="component",Bk="label",Dk="area";function Fk(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function zk(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 Gk(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&&kp(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&&kp(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 Wk(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&&kp(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&&kp(l)&&f){var O=ye(l.parentNode.getEndTangent(),2);w=O[0],M=O[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 E=0;E<d.length;E++){var k=d[E],S=k[0],_=d[E+1],A=0===E&&(0!==g||0!==m),T=(E===d.length-1||_&&("M"===_[0]||"Z"===_[0]))&&0!==y&&0!==v;switch(S){case"M":A?(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?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&&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&&t.lineTo(k[5]-o+y,k[6]-s+v);break;case"A":var P=p[E].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&&t.lineTo(k[6]-o+y,k[7]-s+v);break;case"Z":t.closePath()}}}function Hk(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&&kp(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&&kp(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 O=1;O<d-1;O++){var E=h[O];t.lineTo(E[0]-o,E[1]-s)}t.lineTo(m,y)}function $k(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&&kp(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&&kp(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 O=1;O<d-1;O++){var E=h[O];t.lineTo(E[0]-o,E[1]-s)}t.lineTo(m+x,y+w)}function Vk(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 A(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 Yk=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={})[nu.CIRCLE]=Fk,t[nu.ELLIPSE]=zk,t[nu.RECT]=Vk,t[nu.LINE]=Gk,t[nu.POLYLINE]=$k,t[nu.POLYGON]=Hk,t[nu.PATH]=Wk,t[nu.TEXT]=void 0,t[nu.GROUP]=void 0,t[nu.IMAGE]=void 0,t[nu.HTML]=void 0,t[nu.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(ou),qk=jt(),Uk=jt(),Xk=jt(),Kk=rt(),Zk=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(Kk,r),s=qt(Uk,Ft(Xk,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 Cu(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(qk,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=dd(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 Qk(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=Il(i,i,e.x,e.y),h=ye(yd(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 Jk(t,e,n,r){return t/(n*n)+e/(r*r)}function tS(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(yd(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?Jk(y,v,i+m,o+m)<=1:p?Jk(y,v,i,o)<=1:!!g&&(Jk(y,v,i-m,o-m)>=1&&Jk(y,v,i+m,o+m)<=1)}function eS(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function nS(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 Il(l.x,l.y,a,s)<=o/2}function rS(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&&Vl(t,e,n,r,o,a)<=i/2}function iS(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(rS(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(rS(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var oS=1e-6;function aS(t){return Math.abs(t)<oS?0:t<0?-1:1}function sS(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 cS(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(sS(a,s,[e,n]))return!0;aS(a[1]-n)>0!=aS(s[1]-n)>0&&aS(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function lS(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=cS(t[i],e,n))break}return r}function uS(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(yd(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!c)&&rS(i,o,a,s,(c||0)+(l||0),e.x+f,e.y+d)}function fS(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(yd(m,(null==x?void 0:x.length)&&u,l),2),M=w[0],O=w[1],E=nh(t),k=!1;return M||n?k=v?r(t,e):lS(x,e.x+h,e.y+p)||lS(b,e.x+h,e.y+p):((O||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||eS(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=rS(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=tu(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Xl(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=Xl(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,E)),k)}function hS(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(yd(r.pointerEvents,o,i),2),p=d[0],g=!1;return(d[1]||n)&&(g=iS(c.points,(a||0)+(s||0),e.x+u,e.y+h,!0)),g||!p&&!n||(g=cS(c.points,e.x+u,e.y+h)),g}function dS(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(yd(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&iS(a.points,(i||0)+(o||0),e.x+c,e.y+u,!1)}function pS(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(yd(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 rS(t+l,e,t+n-u,e,o,a,s)||rS(t+n,e+u,t+n,e+r-f,o,a,s)||rS(t+n-f,e+r,t+h,e+r,o,a,s)||rS(t,e+r-h,t,e+l,o,a,s)||nS(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||nS(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||nS(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||nS(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(0,0,f,h,a.map((function(t){return A(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?eS(0-v,0-v,f+v,h+v,e.x,e.y):p?eS(0,0,f,h,e.x,e.y):!!g&&function(t,e,n,r,i,o,a){var s=i/2;return eS(t-s,e-s,n,i,o,a)||eS(t+n-s,e-s,i,r,o,a)||eS(t+s,e+r-s,n,i,o,a)||eS(t-s,e+s,i,r,o,a)}(0,0,f,h,m,e.x,e.y)}function gS(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[nu.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 mS=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={})[nu.CIRCLE]=Qk,t[nu.ELLIPSE]=tS,t[nu.RECT]=pS,t[nu.LINE]=uS,t[nu.POLYLINE]=dS,t[nu.POLYGON]=hS,t[nu.PATH]=fS,t[nu.TEXT]=function(){return!0},t[nu.GROUP]=null,t[nu.IMAGE]=gS,t[nu.HTML]=null,t[nu.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new Zk)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(ou),yS=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(ep.UNMOUNTED,h),f.addEventListener(ep.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(ep.UNMOUNTED,h),f.removeEventListener(ep.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 ku;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],ku.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]),O=Math.max(m[1],y[1],b[1],v[1]),E=Math.floor(x),k=Math.floor(w),S=Math.ceil(M-x),_=Math.ceil(O-w);t.save(),r.clearRect(t,E,k,S,_,i.background),t.beginPath(),t.rect(E,k,S,_),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 Kd(Sp.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:k,width:S,height:_}})),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)&Qd.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!==nu.LINE&&t.nodeName!==nu.PATH&&t.nodeName!==nu.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 ku;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 ku);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 ku;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),vS=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,O=0===a.alpha,E=!(!b||!b.length),k=!y(m)&&v>0,S=n.nodeName,_="inner"===g,A=M&&k&&(S===nu.PATH||S===nu.LINE||S===nu.POLYLINE||O||_);w&&(t.globalAlpha=c*l,A||bS(n,t,k),this.fill(t,n,a,s,r,i,o),A||this.clearShadowAndFilter(t,E,k)),M&&(t.globalAlpha=c*f,t.lineWidth=h,y(x)||(t.miterLimit=x),y(d)||(t.lineCap=d),y(p)||(t.lineJoin=p),A&&(_&&(t.globalCompositeOperation="source-atop"),bS(n,t,!0),_&&(this.stroke(t,n,u,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,E,!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()})):(If(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()})):(If(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===Yu.LinearGradient||t.type===Yu.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 bS(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 xS=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)?r=this.imagePool.getImageSync(a):(l||(l=a.width),u||(u=a.height),r=a),r){bS(n,t,!y(s)&&c>0);try{t.drawImage(r,0,0,l,u)}catch(t){}}},t}(),wS=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,O=a.shadowBlur,E=b.font,k=b.lines,S=b.height,_=b.lineHeight,A=b.lineMetrics;t.font=E,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var T=l;o.enableCSSParsing||"alphabetic"!==T||(T="bottom"),t.lineJoin=u,y(f)||(t.miterLimit=f);var P=0;"middle"===l?P=-S/2-_/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?P=-S:"top"!==l&&"hanging"!==l||(P=-_);var C=x||0;P+=w||0,1===k.length&&("bottom"===T?(T="middle",P-=.5*S):"top"===T&&(T="middle",P+=.5*S)),t.textBaseline=T,bS(n,t,!y(M)&&O>0);for(var N=0;N<k.length;N++){var L=s/2+C;P+=_,y(d)||d.isNone||!s||this.drawLetterSpacing(t,k[N],A[N],c,L,P,h,g,m,v,!0),y(p)||this.drawLetterSpacing(t,k[N],A[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)}(vS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(vS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(vS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(vS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(vS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(vS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(vS);var MS=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 vS(n),i=((t={})[nu.CIRCLE]=r,t[nu.ELLIPSE]=r,t[nu.RECT]=r,t[nu.IMAGE]=new xS(n),t[nu.TEXT]=new wS,t[nu.LINE]=r,t[nu.POLYLINE]=r,t[nu.POLYGON]=r,t[nu.PATH]=r,t[nu.GROUP]=void 0,t[nu.HTML]=void 0,t[nu.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new yS(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(ou),OS=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}(),ES=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 OS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ou),kS=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===nu.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===nu.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===nu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;if(e.nodeName===nu.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(Sp.RESIZE,d),s.addEventListener(ep.MOUNTED,l),s.addEventListener(ep.UNMOUNTED,u),s.addEventListener(ep.ATTR_MODIFIED,f),s.addEventListener(ep.BOUNDS_CHANGED,h)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Vd.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Sp.RESIZE,d),s.removeEventListener(ep.MOUNTED,l),s.removeEventListener(ep.UNMOUNTED,u),s.removeEventListener(ep.ATTR_MODIFIED,f),s.removeEventListener(ep.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;_(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=T(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=T(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="";Bf(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="";Bf(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}(),SS=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 kS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ou),_S=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):ud&&(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;_(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?Zh(kh(l),new Lp({})):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===Yu.LinearGradient){var h=function(t,e,n){var r=du(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===Yu.RadialGradient){var y=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===Ru.kPercentage&&(o=n.value/100*t),r.unit===Ru.kPercentage&&(a=r.value/100*e);var s=Math.max(He([0,0],[o,a]),He([0,e],[o,a]),He([t,e],[o,a]),He([t,0],[o,a]));return i&&(i instanceof cf?s=i.value:i instanceof Ju&&("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(He([0,0],[o,a]),He([0,e],[o,a]),He([t,e],[o,a]),He([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===Ru.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 _(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),AS=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===nu.IMAGE){var a=o.img;_(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===nu.IMAGE&&"img"===r&&_(o)&&i.getOrCreateImage(o).then((function(){e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(ep.MOUNTED,a),o.addEventListener(ep.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(ep.MOUNTED,a),o.removeEventListener(ep.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),TS=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 _S(this.context.config),this.addRenderingPlugin(new AS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ou),PS=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=_(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||ud&&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){ud&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Vd.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}(),CS=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=PS},e.prototype.destroy=function(){delete this.context.ContextService},e}(ou),NS=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new CS),n.registerPlugin(new TS),n.registerPlugin(new Yk),n.registerPlugin(new MS),n.registerPlugin(new ES),n.registerPlugin(new mS),n.registerPlugin(new SS),n}return ue(e,t),e}(au),LS=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=He([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}(),jS=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 LS(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}(ou),RS=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}(),IS=RS;const BS={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"},DS=[["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"]]]]];var FS={}.toString,zS=function(t,e){return FS.call(t)==="[object "+e+"]"},GS=function(t){return Array.isArray?Array.isArray(t):zS(t,"Array")},WS=function(t){return"object"==typeof t&&null!==t},HS=function(t){if(!WS(t)||!zS(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};function $S(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&&HS(o)?(HS(t[i])||(t[i]={}),n<r?$S(t[i],o,n+1,r):t[i]=e[i]):GS(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var VS=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)$S(t,e[r]);return t},YS=function(t){return t};function qS(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):YS}function US(t){return t instanceof Float32Array||t instanceof Array}var 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},KS=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 ZS(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var QS=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},JS=function(t,e,n,r,i){var o,a,s=QS(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},t_=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},e_=function(t,e,n,r,i){var o=new na({range:[e,e+r]}),a=new na({range:[n,n+i]});return{transform:function(t){var e=t_(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=t_(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},n_=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},r_=function(t,e,n,r,i){return(0,n_(t,1)[0])(e,n,r,i)},i_=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},o_=function(t,e,n,r,i){return i_(t,1)[0]},a_=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_(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new na({range:[c,l]}),f=new na({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=a_(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=a_(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=ZS(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},c_=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},l_=function(t,e,n,r,i){return{transform:function(t){var e=c_(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=c_(t,2),n=e[0];return[e[1],n]}}},u_=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},f_=function(t,e,n,r,i){var o,a,s=u_(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},h_=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},d_=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))},p_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return f_.apply(void 0,d_([[-1,-1]],h_(e),!1))},g_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return f_.apply(void 0,d_([[-1,1]],h_(e),!1))},m_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return f_.apply(void 0,d_([[1,-1]],h_(e),!1))},y_=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},v_=function(t,e,n,r,i){var o=y_(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)},b_=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},x_=function(t,e,n,r,i){var o=b_(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 na({range:[c,c+.99*l]}),h=new na({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=b_(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=b_(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=ZS(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*d;return[h.invert(d),f.invert(m)]}}},w_=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},M_=function(t,e,n,r,i){var o=w_(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new na({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new ra({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}}},O_=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 E_(t){return 1/Math.tan(t)}var k_=function(t,e,n,r,i){var o=E_(O_(t,1)[0]);return{transform:function(t){var e=O_(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=O_(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},S_=function(t,e,n,r,i){var o=E_(O_(t,1)[0]);return{transform:function(t){var e=O_(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=O_(t,2),n=e[0];return[n,e[1]-n*o]}}},__=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 A_(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 T_(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 P_(t,e,n){return n?new na({range:[0,1],domain:[0,e]}).map(t):t}var C_=function(t,e,n,r,i){var o=__(t,3),a=o[0],s=o[1],c=o[2],l=P_(a,r,void 0!==c&&c);return{transform:function(t){var e=__(t,2),n=e[0],r=e[1];return[A_(n,l,s,0,1),r]},untransform:function(t){var e=__(t,2),n=e[0],r=e[1];return[T_(n,l,s,0,1),r]}}},N_=function(t,e,n,r,i){var o=__(t,3),a=o[0],s=o[1],c=o[2],l=P_(a,i,void 0!==c&&c);return{transform:function(t){var e=__(t,2);return[e[0],A_(e[1],l,s,0,1)]},untransform:function(t){var e=__(t,2);return[e[0],T_(e[1],l,s,0,1)]}}},L_=function(t,e,n,r,i){var o=__(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=P_(a,r,f),d=P_(s,i,f);return{transform:function(t){var e=__(t,2),n=e[0],r=e[1];return[A_(n,h,c,0,1),A_(r,d,l,0,1)]},untransform:function(t){var e=__(t,2),n=e[0],r=e[1];return[T_(n,h,c,0,1),T_(r,d,l,0,1)]}}},j_=function(t,e,n,r,i){var o=__(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new na({range:[0,r]}),d=new na({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=__(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=A_(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=__(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=T_(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)]}}},R_=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},I_=function(t,e,n,r,i,o,a){var s=new na({range:[e,e+i]}),c=new na({range:[n,n+o]}),l=new na({range:[r,r+a]});return{transform:function(t){var e=R_(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=R_(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},B_=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},D_=function(t,e,n,r,i,o,a){var s=B_(t,3),c=s[0],l=s[1],u=s[2];return mt(rt(),[c,l,u])},F_=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},z_=function(t,e,n,r,i,o,a){var s=F_(t,3),c=s[0],l=s[1],u=s[2];return yt(rt(),[c,l,u])},G_=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},W_=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))},H_=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.")},$_=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:e_,translate:JS,custom:r_,matrix:o_,polar:s_,transpose:l_,scale:f_,"shear.x":k_,"shear.y":S_,reflect:p_,"reflect.x":g_,"reflect.y":m_,rotate:v_,helix:x_,parallel:M_,fisheye:L_,"fisheye.x":C_,"fisheye.y":N_,"fisheye.circular":j_},this.update(t)}return t.prototype.update=function(t){this.options=VS({},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:W_(W_([],G_(n),!1),[W_([],G_(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?W_([],G_(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,KS([],XS(o),!1))}return n}}(t):t)};try{for(var c=H_(r),l=c.next();!l.done;l=c.next()){var u=G_(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(W_([],G_(h),!1),g,m,y,v);if(US(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||YS,"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 qS.apply(void 0,W_([],G_(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}(),V_=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},Y_=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))},q_=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.")},U_=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:I_,translate3D:D_,scale3D:z_},this.update(t)}return t.prototype.update=function(t){this.options=VS({},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:Y_(Y_([],V_(n),!1),[Y_([],V_(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?Y_([],V_(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,KS([],XS(o),!1))}return n}}(t):t)};try{for(var c=q_(r),l=c.next();!l.done;l=c.next()){var u=V_(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(Y_([],V_(h),!1),g,m,y,v,b,x);if(US(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||YS,!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 qS.apply(void 0,Y_([],V_(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&<(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 X_(t){return(e,...n)=>Y({},t(e,...n),e)}function K_(t){return(e,...n)=>Y({},e,t(e,...n))}function Z_(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 Q_=()=>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:Z_(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};Q_.props={};const J_=()=>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=Z_(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};J_.props={};const tA=()=>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:Z_(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"})]};tA.props={};const eA=({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:O,interaction:E,x:k,y:S,z:_,key:A,frame:T,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:_,key:A,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:O,interaction:E,frame:T,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:`${A}-0`,data:x}),t&&{title:j})]})]};eA.props={};class nA{constructor(t){this.$value=t}static of(t){return new nA(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const rA=X_((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"))}}})),iA=X_((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)}}})),oA=X_((()=>({animate:{enterType:"fadeIn"}}))),aA=K_((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),sA=K_((()=>({type:"cell"}))),cA=K_((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]}}})),lA=K_(((t,e=uA,n=hA,r=dA,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:O}=m.getOptions(),E=vr(t),k=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),m.invert(e)])),_=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),A=_.map((t=>d.filter(t))),T=f?qn(A,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:M.indexOf(t),columnValue:t,columnValuesLength:M.length,rowField:g,rowIndex:O.indexOf(e),rowValue:e,rowValuesLength:O.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return E.flatMap((t=>{const[e,o,a,s]=k[t],c=P[t],f=A[t];return C[t].map((m=>{var M,O,{scale:E,key:k,facet:S=!0,axis:_={},legend:A={}}=m,P=he(m,["scale","key","facet","axis","legend"]);const C=(null===(M=null==E?void 0:E.y)||void 0===M?void 0:M.guide)||_.y,N=(null===(O=null==E?void 0:E.x)||void 0===O?void 0:O.guide)||_.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:pA(N,n)(c,j),y:pA(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:T,scale:Y(L,E,R),axis:Y({},_,I),legend:!1},P),i)}))}))}}}));function uA(t){const{points:e}=t;return gs(e)}function fA(t,e){return e.length?Y({title:!1,tick:null,label:null},t):Y({title:!1,tick:null,label:null,grid:null},t)}function hA(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return fA(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Y({title:s,grid:c},t)}}function dA(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return fA(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Y({title:o,grid:a},t)}}function pA(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const gA=()=>t=>[nA.of(t).call(sA).call(iA).call(oA).call(rA).call(aA).call(cA).call(lA).value()];gA.props={};const mA=X_((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),yA=K_((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})=>gs(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:O}=m,E=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:xA(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({},O,{legendFilter:!1})},E)}))}))}}})),vA=K_((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 fA(t,n)}}function xA(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return fA(t,n)}}const wA=()=>t=>[nA.of(t).call(sA).call(iA).call(yA).call(vA).call(oA).call(aA).call(mA).value()],MA=X_((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),OA=X_((t=>({coordinate:{type:"polar"}}))),EA=t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function kA(t){return t=>null}function SA(t){const{points:e}=t,[n,r,i,o]=e,a=fs(n,o),s=ls(n,o),c=ps(s,ls(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=ds(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d+g*Math.cos(p)-f/2,f,f]}const _A=()=>t=>[nA.of(t).call(sA).call(EA).call(iA).call(OA).call(cA).call(lA,SA,kA,kA,{frame:!1}).call(oA).call(aA).call(MA).value()];function AA(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 TA=()=>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]=AA(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 PA(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 CA(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function NA(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=CA(o,(t=>"element"===t.className));const c=function(t){return CA(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:PA(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 LA(){return(t,e,n)=>{const{container:r,view:i}=t,o=NA(BS.CLICK,i,n,(t=>1===t.detail)),a=NA(BS.DBLCLICK,i,n,(t=>2===t.detail)),s=NA(BS.POINTER_TAP,i,n),c=NA(BS.POINTER_DOWN,i,n),l=NA(BS.POINTER_UP,i,n),u=NA(BS.POINTER_OVER,i,n),f=NA(BS.POINTER_OUT,i,n),h=NA(BS.POINTER_MOVE,i,n),d=NA(BS.POINTER_ENTER,i,n),p=NA(BS.POINTER_LEAVE,i,n),g=NA(BS.POINTER_UPOUTSIDE,i,n),m=NA(BS.DRAG_START,i,n),y=NA(BS.DRAG,i,n),v=NA(BS.DRAG_END,i,n),b=NA(BS.DRAG_ENTER,i,n),x=NA(BS.DRAG_LEAVE,i,n),w=NA(BS.DRAG_OVER,i,n),M=NA(BS.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 jA(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":jE,"component.axisLinear":TE,"component.axisArc":PE,"component.legendContinuousBlock":$E,"component.legendContinuousBlockSize":YE,"component.legendContinuousSize":VE,"interaction.event":LA,"composition.mark":eA,"composition.view":tA,"shape.label.label":Zw}),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 RA(t){const{canvas:e,group:n}=t;return n?n.ownerDocument:e.document}function IA(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]=jA("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 BA(t,e){return t.filter((t=>t.type===e))}function DA(t){return BA(t,"polar").length>0}function FA(t){return BA(t,"transpose").length%2==1}function zA(t){return BA(t,"theta").length>0}function GA(t){return BA(t,"radial").length>0}function WA(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}TA.props={};var HA=WA("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),$A=WA("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),VA=WA("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),YA=WA("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),qA=WA("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),UA=WA("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),XA=WA("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),KA=WA("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),ZA=WA("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),QA=WA("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var JA=t=>()=>t;function tT(t,e){return function(n){return t+n*e}}function eT(t){return 1==(t=+t)?nT: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):JA(isNaN(e)?n:e)}}function nT(t,e){var n=e-t;return n?tT(t,n):JA(isNaN(t)?e:t)}!function t(e){var n=eT(e);function r(t,e){var r=n((t=gl(t)).r,(e=gl(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=nT(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 rT,iT=(rT=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=gl(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=rT(i),o=rT(o),a=rT(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function oT(t){return function e(n){function r(e,r){var i=t((e=jl(e)).h,(r=jl(r)).h),o=nT(e.s,r.s),a=nT(e.l,r.l),s=nT(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)}oT((function(t,e){var n=e-t;return n?tT(t,n>180||n<-180?n-360*Math.round(n/360):n):JA(isNaN(t)?e:t)}));var aT=oT(nT),sT=t=>iT(t[t.length-1]),cT=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(WA),lT=sT(cT),uT=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(WA),fT=sT(uT),hT=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(WA),dT=sT(hT),pT=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(WA),gT=sT(pT),mT=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(WA),yT=sT(mT),vT=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(WA),bT=sT(vT),xT=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(WA),wT=sT(xT),MT=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(WA),OT=sT(MT),ET=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(WA),kT=sT(ET),ST=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(WA),_T=sT(ST),AT=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(WA),TT=sT(AT),PT=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(WA),CT=sT(PT),NT=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(WA),LT=sT(NT),jT=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(WA),RT=sT(jT),IT=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(WA),BT=sT(IT),DT=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(WA),FT=sT(DT),zT=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(WA),GT=sT(zT),WT=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(WA),HT=sT(WT),$T=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(WA),VT=sT($T),YT=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(WA),qT=sT(YT),UT=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(WA),XT=sT(UT),KT=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(WA),ZT=sT(KT),QT=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(WA),JT=sT(QT),tP=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(WA),eP=sT(tP),nP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(WA),rP=sT(nP),iP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(WA),oP=sT(iP),aP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(WA),sP=sT(aP);var cP=aT(jl(300,.5,0),jl(-240,.5,1)),lP=aT(jl(-100,.75,.35),jl(80,1.5,.8)),uP=aT(jl(260,.75,.35),jl(80,1.5,.8)),fP=jl();var hP=gl(),dP=Math.PI/3,pP=2*Math.PI/3;function gP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var mP=gP(WA("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),yP=gP(WA("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),vP=gP(WA("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),bP=gP(WA("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),xP=Object.freeze({__proto__:null,schemeCategory10:HA,schemeAccent:$A,schemeDark2:VA,schemePaired:YA,schemePastel1:qA,schemePastel2:UA,schemeSet1:XA,schemeSet2:KA,schemeSet3:ZA,schemeTableau10:QA,interpolateBrBG:lT,schemeBrBG:cT,interpolatePRGn:fT,schemePRGn:uT,interpolatePiYG:dT,schemePiYG:hT,interpolatePuOr:gT,schemePuOr:pT,interpolateRdBu:yT,schemeRdBu:mT,interpolateRdGy:bT,schemeRdGy:vT,interpolateRdYlBu:wT,schemeRdYlBu:xT,interpolateRdYlGn:OT,schemeRdYlGn:MT,interpolateSpectral:kT,schemeSpectral:ET,interpolateBuGn:_T,schemeBuGn:ST,interpolateBuPu:TT,schemeBuPu:AT,interpolateGnBu:CT,schemeGnBu:PT,interpolateOrRd:LT,schemeOrRd:NT,interpolatePuBuGn:RT,schemePuBuGn:jT,interpolatePuBu:BT,schemePuBu:IT,interpolatePuRd:FT,schemePuRd:DT,interpolateRdPu:GT,schemeRdPu:zT,interpolateYlGnBu:HT,schemeYlGnBu:WT,interpolateYlGn:VT,schemeYlGn:$T,interpolateYlOrBr:qT,schemeYlOrBr:YT,interpolateYlOrRd:XT,schemeYlOrRd:UT,interpolateBlues:ZT,schemeBlues:KT,interpolateGreens:JT,schemeGreens:QT,interpolateGreys:eP,schemeGreys:tP,interpolatePurples:rP,schemePurples:nP,interpolateReds:oP,schemeReds:iP,interpolateOranges:sP,schemeOranges:aP,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:cP,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return fP.h=360*t-100,fP.s=1.5-1.5*e,fP.l=.8-.9*e,fP+""},interpolateWarm:lP,interpolateCool:uP,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,hP.r=255*(e=Math.sin(t))*e,hP.g=255*(e=Math.sin(t+dP))*e,hP.b=255*(e=Math.sin(t+pP))*e,hP+""},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:mP,interpolateMagma:yP,interpolateInferno:vP,interpolatePlasma:bP});function wP(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 DP(t,pr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return NP(t,s);if(void 0!==i)return IP([i])?NP(t,s):BP(e)?"time":LP(t,o,a);return IP(e)?NP(t,s):BP(e)?"time":LP(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 jP(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 RP(n);case"quantile":return function(t){return RP(t).sort()}(n);case"sequential":return jP(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(AP({type:t}))return function(t,e,n){const r=t.map(Number),i=new na({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 TP({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=ko,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?zA(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=xP[`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:PP(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function MP(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 OP(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 EP(t,e){const[n]=jA("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 kP(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));_P(e,"x"),_P(e,"y")}function SP(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 _P(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(AP)?kn(r):n.every(TP)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function AP(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function TP(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function PP(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=CP(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 CP(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function CP(t,e,n,r,i){const[o]=jA("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=xP[`scheme${r}`],o=xP[`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 NP(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function LP(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function jP(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 RP(t){return Array.from(new Set(t.flat()))}function IP(t){return DP(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function BP(t){return DP(t,(t=>t instanceof Date))}function DP(t,e){for(const n of t)if(n.some(e))return!0;return!1}const FP={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},zP={threshold:"threshold",quantize:"quantize",quantile:"quantile"},GP={ordinal:"ordinal",band:"band",point:"point"},WP={constant:"constant"};function HP(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=jA("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=jA("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?FA(n)?`${e}Y`:`${e}X`:"y"===t?FA(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[...YP(n),...UP(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]=ZP(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:O=v,crossPadding:E=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:M,position:o,plane:c,orientation:g,padding:O,order:w,crossPadding:E,size:x,type:t,scales:e}))}})),s}function $P(t,e,n,r,i){const[o]=jA("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 VP(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 YP(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,qP(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 DS)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 qP(t){const{type:e}=t;return"string"!=typeof e?null:e in FP?"continuous":e in GP?"discrete":e in zP?"distribution":e in WP?"constant":null}function UP(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return BA(t,"helix").length>0}(e)||zA(e))return null;if(FA(e)&&(DA(e)||GA(e)))return null;if(n.startsWith("x"))return DA(e)?["axisArc",[t]]:GA(e)?["axisLinear",[t]]:[FA(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return DA(e)?["axisLinear",[t]]:GA(e)?["axisArc",[t]]:[FA(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return BA(t,"radar").length>0}(e))return["axisRadar",[t]];if(!DA(e))return["axisY",[t]]}return null})).filter(cr)}function XP(t){const e=BA(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=BA(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 KP(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]=XP(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return BA(t,"parallel").length>0}(i))return FA(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=XP(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:DA(i)||GA(i)?["center",null]:"axisX"===t&&function(t){return BA(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return BA(t,"reflectY").length>0}(i)?["top",null]:e}function ZP(t,e,n,r,i,o,a){const[s]=XP(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?KP(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&DA(a)&&"center"===r.position?["center","vertical"]:c}function QP(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")?rC:s.startsWith("group")?JP:s.startsWith("legendContinuous")?iC:"legendCategory"===s?oC:s.startsWith("slider")?nC:"title"===s?eC:s.startsWith("scrollbar")?tC:()=>{})(t,e,n,r,i,o)}function JP(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=>QP(t,e,n,r,i,o)));const c=qn(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function tC(t,e,n,r,i,o){const{trackSize:a=6}=Y({},i.scrollbar,t);t.size=a}function eC(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=fC(s,ur(u,"title"));t.size=e.height}if(c){const e=fC(c,ur(u,"subtitle"));t.size+=l+e.height}}function nC(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 rC(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=lC(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,h=he(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),d=aC(t,o),p=sC(h,d),g=c+l;if(p&&p.length){const r=qn(p,(t=>t.width)),i=qn(p,(t=>t.height));if(a)t.size=r+g;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=uC(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}(d,p,e,n,o)||a||!1===f||null===f?t.size=i+g:(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=c;const m=cC(h);m&&(t.size+=a?u+m.width:u+m.height)}function iC(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=sC(l,aC(t,o));if(m){const e=u?"width":"height",n=qn(m,(t=>t[e]));t.size+=n+s}const y=cC(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function oC(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=cC(p),M=sC(p,aC(t,o),"itemLabel"),O=Math.max(M[0].height,c)+u,E=(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=E(t);e=Math.max(e,s),n+O>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=O):(n+=O,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=>E(t.width)))*g;t.size=O*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=E(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=O*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function aC(t,e){const[n]=jA("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 sC(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=uC(t,n),i=r.map((t=>"number"==typeof t?gm(t):t)),o=e?"string"==typeof e?lE(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)=>fC(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 cC(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 fC(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function lC(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 uC(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function fC(t,e){const n=function(t){return t instanceof Lp?t:new Yp({style:{text:`${t}`}})}(t),r=he(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function hC(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:O=M,paddingLeft:E=M,paddingRight:k=M,paddingTop:S=M}=function(t,e,n,r){const{coordinates:i}=e;if(!DA(i)&&!GA(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=>lC(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)=>sC(a[e],aC(t,r)))).filter(cr),l=qn(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>cC(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),_=(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]},A=t=>"auto"===t?20:null!=t?t:20,T=A(S),P=A(O),C=dC(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-v-w,[R,I]=_(j,E,k,N,L),B=j-R-I,D=dC(t,B,[R+v,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=D,G=s-b-x,[W,H]=_(G,O,S,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:m,innerWidth:B,innerHeight:G-W-H,paddingLeft:R,paddingRight:I,paddingTop:H,paddingBottom:W,marginLeft:v,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function dC(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(Bw(t))}`,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):(QP(r,e,n,t,o,a),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=Xn(i,(t=>t.order)),m=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(m.length&&(m[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=VP(i,p?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 pC({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 gC(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 Fc(t)&&Ic(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):Ic(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):Fc(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]=Wc(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]=Wc(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 mC(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 O=t.filter((t=>"group"===t.type));for(const t of O){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 yC(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 vC(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=jA("data",t),o=function(t){if(T(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 bC(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 xC(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 wC(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 MC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=jA("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:TC(n)})}(o),s=yr(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function OC(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 EC(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?lE(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 kC(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 SC(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 _C(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 AC(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]=jA("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[yC,vC,bC,xC,wC,MC,kC,_C,SC,OC,...o.map(i),...s.map(i),...a.map(i),EC];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 TC(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function PC(t,e,n,r){var i,o;return pe(this,void 0,void 0,(function*(){const[a]=jA("composition",n),[s]=jA("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?RC(e,t,n):yield NC(t,n);m.set(r,t),g.push(r);const o=i.flatMap(p).map((t=>IA(t,n)));if(v.push(...o),o.every(h)){const t=yield Promise.all(o.map((t=>LC(t,n))));kP(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 KC(t,n));Array.isArray(e)?v.push(...e):"function"==typeof e&&b.push(e())}}r.emitter.emit(BS.BEFORE_PAINT);const x=new Map,w=new Map,M=[];e.selectAll(tN(jk)).data(g,(t=>t.key)).join((t=>t.append("g").attr("className",jk).attr("id",(t=>t.key)).call(CC).each((function(t,e,i){IC(t,hm(i),M,n,r),x.set(t,i)}))),(t=>t.call(CC).each((function(t,e,i){IC(t,hm(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 O=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 NC(r,e);IC(o,t,i,e,n),function(t,e,n,r,i){var o;const[a]=jA("interaction",r),s=t.node(),c=s.nameInteraction,l=XC(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=jC(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)PC(r,t,e,n);return{options:r,view:o}}))}(hm(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)}))}})),E=O(x);for(const t of E){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of XC(e)){const[e,o]=i;if(o){const i=jC(t.view,e,o,s)(t,E,r.emitter);n.set(e,{destroy:i})}}}const k=O(w);for(const t of k){const{options:e,container:n}=t,o=n.nameInteraction;for(const n of XC(e)){const[e,a]=n,c=o.get(e);if(c&&(null===(i=c.destroy)||void 0===i||i.call(c)),a){const n=jC(t.view,e,a,s)(t,k,r.emitter);o.set(e,{destroy:n})}}}const{width:S,height:_}=t,A=[];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:_},i);yield PC(t,e,n,r)}i()}))));A.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(BS.AFTER_PAINT);const T=M.filter(cr).map(VC).map((t=>t.finished));return Promise.all([...T,...A])}))}function CC(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function NC(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]=jA("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 KC(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=IA(r,e);return RC(yield LC(i,e),i,e)}))}function LC(t,e){return pe(this,void 0,void 0,(function*(){const[n]=jA("theme",e),[,r]=jA("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(UC(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield AC(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({},wP(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function jC(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Y(o,Object.assign({type:e},n)))}function RC(t,e,n){const[r]=jA("mark",n),[i]=jA("theme",n),[o]=jA("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,h=i(UC(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=SP(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}))}(HP(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=hC(g,e,h,n),y=function(t,e,n){const[r]=jA("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 U_(p):new $_(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:pC({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:pC({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:pC({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&&gC(a,e,o,i),s.length&&mC(n,0,o)}}(VP(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=EP(t,n);r.push(i),OP(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=>EP(t,n)));OP(b,d);const p=MP(u,d),g=r(e),[v,w,M]=BC(g(l,d,p,y)),O=o||v.length,E=s?s(w,O,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])),_=v.map(((t,e)=>{const n=Object.assign({points:w[e],transform:E[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=_,i.index=v;const A=null==t?void 0:t(_,d,m);x.push(...A||[])}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 IC(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))),O=t=>t.style("x",(t=>A[t].x)).style("y",(t=>A[t].y)).style("width",(t=>A[t].width)).style("height",(t=>A[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(hm(n),w[t])}));let E=0,k=0,S=m,_=y;const A=x.map((t=>{const e=M[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return E+=n,k+=r,S-=n+o,_-=r+i,{x:E,y:k,width:S,height:_}}));e.selectAll(tN(Dk)).data(x.filter((t=>cr(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",Dk).style("zIndex",-2).call(O)),(t=>t.call(O)),(t=>t.remove()));const T=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=!!T&&{duration:T[1]};for(const[,t]of Cn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(tN(Ik)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",Ik).append((t=>$P(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=$P(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(tN(Rk)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",Rk).call(ZC).call(JC,Array.from(c.keys())).call(eN,h)),(t=>t.call(JC,Array.from(c.keys())).call((t=>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,T):ZC(t))).call(eN,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=GC(o,a,t,r,i),d=$C(o,a,t,r),p=YC(o,a,t,r),g=qC(o,a,t,r),m=FC(e,f,l,"element"),y=f.selectAll(tN(Lk)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",Lk).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=Lk,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",Lk)}))),(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",Lk).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new dm(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new dm([],n.__toData__,n.parentNode).append(h).attr("className",Lk).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=jA("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(tN(Nk)).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]=jA("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:RA(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=>DC(t,r,e,a))),{shape:m=c,text:y}=g,v=he(g,["shape","text"]),b="string"==typeof i?lE(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,WC(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(tN(Lk)).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=hm(c).selectAll(tN(Bk)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",Bk)),(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 BC([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 DC(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function FC(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 GC(t,e,n,r,i){const[o]=jA("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:RA(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=>DC(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:QC(t,r)}),g))(i,y,WC(f,d,r,s),u)}}function WC(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 HC(t,e,n,r,i){var o,a;const[,s]=jA("shape",i),[c]=jA("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(QC(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 $C(t,e,n,r){return HC("enter",t,e,n,r)}function VC(t){return t.finished.then((()=>{t.cancel()})),t}function YC(t,e,n,r){return HC("update",t,e,n,r)}function qC(t,e,n,r){return HC("exit",t,e,n,r)}function UC(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 XC(t){const{interaction:e={}}=t;return Object.entries(Y({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e))}function KC(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 vC(0,{data:r},n);return Object.assign({data:o},i)}))}function ZC(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 QC(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function JC(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(tN(Ck)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",Ck).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(tN(Nk)).node()||t.append("g").attr("className",Nk).style("zIndex",0)}function tN(...t){return t.map((t=>`.${t}`)).join("")}function eN(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 Vp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function nN(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 rN(t,e){const n=new NS;return n.registerPlugin(new jS),new og({width:t,height:e,container:document.createElement("div"),renderer:n})}function iN(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=nN(t),{canvas:c=rN(i,o),emitter:l=new IS,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(BS.BEFORE_RENDER);const d=hm(c.document.documentElement);return c.ready.then((()=>PC(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(BS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function oN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${jk}`);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 aN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function sN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:aN[e]}function cN(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>cN(t,e,n,r)))}function lN(t){cN(t,"visibility","hidden",!0)}function uN(t){cN(t,"visibility","visible",!0)}function fN(t){return hm(t).selectAll(`.${Lk}`).nodes().filter((t=>!t.__removed__))}function hN(t,e){return dN(t,e).flatMap((({container:t})=>fN(t)))}function dN(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function pN(t){return hm(t).select(`.${Rk}`).node()}function gN(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 mN(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 yN(t){return t=>t.__data__.color}function vN(t){return t=>t.__data__.x}function bN(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[wN(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(wN(i,r))[e]}}function xN(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=sN(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 wN(t,e){return`${t},${e}`}function MN(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[wN(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=wN(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 ON(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 EN(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=Vs(),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 Wp({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 kN(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Ic(n)){const{points:i}=t.__data__,[o,a]=Rc(n)?bm(i):i,s=n.getCenter(),c=ls(o,s),l=ls(a,s),u=hs(c)+ps(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Rc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function SN(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(!ZE(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(!ZE(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 Om(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(ZE)})()?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 _N(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 AN(t){_N(t,t.cursor)}function TN(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function PN(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=ON(h,n),[m,y]=EN(Object.assign({elements:h,valueof:g,link:i,coordinate:c},ur(u.active,"link"))),[v,b,x]=SN(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 kN(h[n],e,c)}})}),{setState:M,removeState:O,hasState:E}=xN(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)?E(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)}})},_=(t=!0)=>{for(const t of h)O(t,"active","inactive"),b(t),y(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},A=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{_(),k=null}),a)):_())},T=()=>{_()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",A),t.addEventListener("pointerleave",T);const P=t=>{const{nativeEvent:e}=t;e||_(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=TN(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",A),t.removeEventListener("pointerleave",T),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),y(t)}}function CN(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 PN(pN(c),Object.assign({elements:fN,datum:bN(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:MN(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function NN(t){return CN(Object.assign(Object.assign({},t),{createGroup:vN}))}function LN(t){return CN(Object.assign(Object.assign({},t),{createGroup:yN}))}function jN(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=ON(h,n),[m,y]=EN(Object.assign({link:i,elements:h,valueof:g,coordinate:a},ur(u.selected,"link"))),[v,b]=SN(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 kN(h[n],e,a)}})}),{setState:w,removeState:M,hasState:O}=xN(x,g),E=(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(O(e,"selected"))E();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(O(e,"selected")){if(!h.some((t=>!c.has(t)&&O(t,"selected"))))return E();for(const t of s)w(t,"unselected"),y(t),b(t)}else{const t=s.some((t=>O(t,"selected")));for(const t of h)c.has(t)?w(t,"selected"):O(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=>O(t,"selected"))).map(n)}}))})(t,e,a):E()};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=TN(h,t,n);k({target:e,nativeEvent:!1})}},_=()=>{E(!1)};return l.on("element:select",S),l.on("element:unselect",_),()=>{for(const t of h)y(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",_)}}function RN(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 jN(pN(s),Object.assign({elements:fN,datum:bN(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:MN(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function IN(t){return RN(Object.assign(Object.assign({},t),{createGroup:vN}))}function BN(t){return RN(Object.assign(Object.assign({},t),{createGroup:yN}))}function DN(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=pN(s),x=s.getElementsByClassName(Lk),w=Pn(s.getElementsByClassName(Bk),(t=>t.__data__.key.split("-")[0])),M=new Gp({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ur(o,"rule"))}),O=new Yp({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ur(o,"label"))});M.append(O),b.appendChild(M);const E=(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]),O.setAttribute("text",i(e))};let S;const _=Z((t=>{const e=gN(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=E(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=E(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",_),b.addEventListener("pointermove",_),b.addEventListener("pointerleave",_),()=>{M.remove(),b.removeEventListener("pointerenter",_),b.removeEventListener("pointermove",_),b.removeEventListener("pointerleave",_)}}}function FN({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=pN(s),l=Z((t=>{const e=gN(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 Kx({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 GN({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 WN({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 HN({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 $N(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function VN(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function YN(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function qN(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=YN(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=VN(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 Do)&&!(t instanceof zo);if(s(r))return r.clone().invert(a);if(a&&r instanceof Do&&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($N);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:YN(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function UN(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=hs(ls([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 Gp({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 XN(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function KN(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function ZN(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function QN(t,e){return void 0===t?e:t}function JN(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function tL(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:O=!1,marker:E=!0,preserve:k=!1,style:S={},css:_={}}=e,A=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 T=n(t),P=Rc(a),C=Ic(a),N=Y(S,A),{innerWidth:L,innerHeight:j,width:R,height:B,insetLeft:D,insetTop:F}=a.getOptions(),z=[],G=[];for(const t of T){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 H=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]=H(t),[i,o]=H(e),a=(n+r)/2,s=(i+o)/2;return P?s-a:a-s}));const $=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=gN(t,e);if(!n)return;const f=t.getRenderBounds(),h=f.min[0],d=f.min[1],O=[n[0]-p,n[1]-g];if(!O)return;const k=((t,e)=>{const n=t[P?1:0],r=e.filter((t=>{const[e,r]=H(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=gn((t=>{const[e,n]=H(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(cr)})(O,G),S=[],A=[];for(const t of z){const[e,n]=$.get(t),r=X(O,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]);A.push([Object.assign(Object.assign({},e),{element:t}),o])}}const T=Array.from(new Set(A.map((t=>t[0].x)))),I=T[Kn(T,(t=>Math.abs(t-U(O))))],V=A.filter((t=>t[0].x===I)),Y=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],Z=[...S,...k],Q=qN(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||JN(Q))J();else{if(m&&GN({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:_}),s){const e=V.map((t=>t[1])),n=ur(N,"crosshairs");UN(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(E){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 Rp({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:QE(o.x,U(O),!0)}}}))}}),f,{leading:h,trailing:d}),J=()=>{WN({root:t,single:y,emitter:u}),s&&XN(t),E&&KN(t)},tt=()=>{HN({root:t,single:y}),s&&XN(t),E&&KN(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=()=>{WN({root:t,single:y,emitter:u,nativeEvent:!1})},rt=()=>{at(),tt()},it=()=>{ot()},ot=()=>{O||(t.addEventListener("pointerenter",Q),t.addEventListener("pointermove",Q),t.addEventListener("pointerleave",J))},at=()=>{O||(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?WN({root:t,single:y,emitter:u,nativeEvent:!1}):tt()}}function eL(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:O=!1,css:E={}}){const k=e(t),S=new Set(k),_=Pn(k,f),A=Z((e=>{const{target:c}=e;if(!S.has(c))return void WN({root:t,single:h,emitter:s});const l=f(c),u=_.get(l),g=1!==u.length||x?qN(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=VN(t)}=e,r=he(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map($N);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)),JN(g))return void WN({root:t,single:h,emitter:s});const{offsetX:M,offsetY:O}=e;w&&GN({root:t,data:g,x:M,y:O,render:r,event:e,single:h,position:d,enterable:p,mount:y,bounding:v,css:E}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:PA(c,m)}}))}),c,{leading:l,trailing:u}),T=e=>{const{target:n}=e;S.has(n)&&WN({root:t,single:h,emitter:s})},P=()=>{M||(t.addEventListener("pointerover",A),t.addEventListener("pointermove",A),t.addEventListener("pointerout",T))},C=()=>{M||(t.removeEventListener("pointerover",A),t.removeEventListener("pointermove",A),t.removeEventListener("pointerout",T))},N=({nativeEvent:t,data:e})=>{if(t)return;const n=TN(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;A({target:n,offsetX:i+a/2,offsetY:o+s/2})},L=({nativeEvent:e}={})=>{e||WN({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(),HN({root:t,single:h})})),P(),()=>{C(),s.off("tooltip:show",N),s.off("tooltip:hide",L),O?WN({root:t,single:h,emitter:s,nativeEvent:!1}):HN({root:t,single:h})}}function nL(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=ZN(h,"seriesTooltip"),m=ZN(h,"crosshairs"),y=pN(l),v=QN(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 tL(y,Object.assign(Object.assign({},s),{theme:p,elements:fN,scale:f,coordinate:d,crosshairs:QN(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=hN(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),tL(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:d,crosshairs:QN(n,m),item:o,startX:u,startY:f,emitter:c}))}return eL(y,Object.assign(Object.assign({},s),{datum:bN(u),elements:fN,scale:f,coordinate:d,groupKey:e?t=>t.__data__.x:void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}const rL="legend-category",iL="legend-continuous",oL="items-item",aL="legend-category-item-marker",sL="legend-category-item-label";function cL(t){return t.getElementsByClassName(aL)[0]}function lL(t){return t.getElementsByClassName(sL)[0]}function uL(t){return t.getElementsByClassName(oL)}function fL(t){return t.getElementsByClassName(rL)}function hL(t){return t.getElementsByClassName(iL)}function dL(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function pL(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 gL(t,e){for(const n of t)pL(n,Object.assign(Object.assign({},e),{facet:!0}))}function mL(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>dL(t).scales.map((t=>t.name)),s=[...fL(r),...hL(r)],c=s.flatMap(a),l=Z(o?gL:pL,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=dL(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===rL?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}=xN(d,void 0),{setState:y,removeState:v}=xN(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=()=>{_N(t,"pointer")},r=()=>{AN(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())})),O=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",O),()=>{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",O)}}(r,{legends:uL,marker:cL,label:lL,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 yL(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=fL(r),s=fN(r),c=t=>dL(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=MN(o,["active","inactive"]),f=ON(s,bN(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=uL(t),o=l(r),a=Pn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:m}=xN(u,f),y={inactive:ur(p,"marker")},v={inactive:ur(p,"label")},{setState:b,removeState:x}=xN(y),{setState:w,removeState:M}=xN(v),O=t=>{for(const e of i){const n=cL(e),r=lL(e);e===t||null===t?(x(n,"inactive"),M(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},E=(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");O(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=>{E(e,t)};t.addEventListener("pointerover",e),k.set(t,e)}const S=t=>{for(const t of s)m(t,"inactive","active");O(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},_=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&&E({nativeEvent:!1},c)},A=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",_),n.on("legend:unhighlight",A);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",_),n.off("legend:unhighlight",A);for(const[t,e]of k)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function vL(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function bL(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function xL(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const wL=Cm((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:O=h}=M,E=he(M,["render"]),k=ur(u,"handleNW"),{render:S=h}=k,_=he(k,["render"]),A=ur(u,"handleNE"),{render:T=h}=A,P=he(A,["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=Cm((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=hm(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(xL,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(xL,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(xL,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(xL,w),D.maybeAppend("handle-w",B(O)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(xL,E),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(xL,_),D.maybeAppend("handle-ne",B(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(xL,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(xL,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(xL,I)}));function ML(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=bL(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,O,E]=s;_N(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();_()},S=()=>{b=new Wp({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),v=new wL({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},_=()=>{v=new wL({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)},A=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,m=null,y=null,x=!1,v=null,b=null,r(t)},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${O},${M}L${O},${E}L${w},${E}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]=mN(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=mN(t,e);if(!g)return;if(!y)return T(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,O),o=e(r,g[1],m[1],M,E),a=[g[0]+i,g[1]+o],s=[m[0]+i,m[1]+o];T(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 T([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=mN(t,e);const[n,r,o,s]=T(g,m);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;v&&!L(e)&&A()},z=e=>{const{target:n}=e;v&&L(n)&&!x?R(n)?_N(t,"move"):j(n)&&_N(t,N[n.id].cursor):_N(t,"crosshair")},G=()=>{_N(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([t,e],[n,r],i)},remove(t=!0){v&&A(t)},destroy(){v&&A(!1),_N(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 OL(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 EL(t,e,n){return OL(t,e,n).map((t=>t.options))}function kL(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=ON(y,o),w=ur(m,"mask"),{setState:M,removeState:O}=xN(p,x),E=new Map,{width:k,height:S,x:_=0,y:A=0}=d(t),T=s||[0,0,k,S],P=()=>{for(const t of[...y,...b])O(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;vL([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)O(t,"inactive");for(const t of E.values())t.remove();E.clear()},L=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e};for(const o of y){const a=E.get(o)||i(o);a.style.clipPath=new Vp({style:{x:t+_,y:e+A,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},j=ML(t,Object.assign(Object.assign({},w),{extent:T,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=tk(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=tk(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=tk(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=ek(o,r),c=ek(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 SL(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=pN(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 kL(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>hN(t,i),datum:bN(dN(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:MN(dN(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=kL(l,Object.assign(Object.assign({elements:fN,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return OL(t,e,n).map((t=>pN(t.container)))}(t,i,n),datum:bN([s,...OL(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:MN([c,...EL(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function _L(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function AL(t){return SL(Object.assign(Object.assign({},t),{brushRegion:_L,selectedHandles:["handle-e","handle-w"]}))}function TL(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function PL(t){return SL(Object.assign(Object.assign({},t),{brushRegion:TL,selectedHandles:["handle-n","handle-s"]}))}const CL="axis",NL="axis-line",LL="axis-main-group",jL="axis-hot-area";function RL(t){return t.getElementsByClassName(CL)}function IL(t){return t.getElementsByClassName(NL)[0]}function BL(t){return function(t){return t.getElementsByClassName(LL)[0]}(t).getLocalBounds()}function DL(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=he(e,["cross","offsetX","offsetY"]);const a=BL(t),s=IL(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:TL,hotZone:new Vp({className:jL,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 FL(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=he(e,["offsetY","offsetX","cross"]);const a=BL(t),s=IL(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:_L,hotZone:new Vp({className:jL,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=pN(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=ON(p,a),{setState:y,removeState:v}=xN(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)),O=t=>t.length>2?[t[0],t[t.length-1]]:t,E=new Map,k=()=>{E.clear();for(let t=0;t<g.length;t++){const e=M[t],{domain:n}=e.getOptions();E.set(t,O(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")}E.set(t,A(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(E.values());const t=[];for(const[e,n]of E){const r=M[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},_=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},A=(t,e)=>{const n=M[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return O(JE(n,i))},T=g.some(o)&&g.some((t=>!o(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?FL:DL,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=ML(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?_(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:fN,axes:RL,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:bN(o),state:MN(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function GL(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=pN(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=ML(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 tk(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 WL(t){return GL(Object.assign(Object.assign({hideX:!0},t),{brushRegion:_L}))}function HL(t){return GL(Object.assign(Object.assign({hideY:!0},t),{brushRegion:TL}))}const $L="slider";function VL(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 YL(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return JE(e,[QE(e,o(r),!0),QE(e,o(i),!1)])}function qL(t){return[t[0],t[t.length-1]]}function UL({initDomain:t={},className:e=$L,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:O}=b,{x:E,y:k}=y,S=Rc(v),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},A=new Map,T=new Set,P={x:t.x||E.getOptions().domain,y:t.y||k.getOptions().domain};for(const t of g){const{orientation:e}=t.attributes,[c,l]=_(e),f=`${n}${B(c)}:filter`,h="x"===c,{ratio:g}=E.getOptions(),{ratio:v}=k.getOptions(),b=t=>{if(t.data){const{selection:e}=t.data,[n=qL(P.x),r=qL(P.y)]=e;return h?[JE(E,n,g),JE(k,r,v)]:[JE(k,r,v),JE(E,n,g)]}const{value:n}=t.detail;return[YL(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:[qL(t),qL(n)]}}))}p(t,(t=>Object.assign(Object.assign({},VL(t,{[c]:{domain:o,nice:!1}},n,i,c,l)),{paddingLeft:x,paddingTop:w,paddingBottom:M,paddingRight:O}))),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 Kd("valuechange",{data:i,nativeEvent:!1}));const c=h?ek(a,E):ek(s,k);r(t,c)};u.on(f,N),t.addEventListener("valuechange",C),A.set(t,C),T.add([f,N])}return()=>{for(const[t,e]of A)t.removeEventListener("valuechange",e);for(const[t,e]of T)u.off(t,e)}}}const XL="g2-scrollbar";function KL(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(XL).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 UL(Object.assign(Object.assign({},t),{initDomain:l,className:XL,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(e,n,r)}}function ZL(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 QL={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 JL(t){return"text"===t.nodeName&&!!t.isOverflowing()}function tj(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(!JL(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:ZL("div",d,Object.assign(Object.assign({},QL),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;JL(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 ej(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function nj(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}const rj=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{uN(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]}(ej(e),ej(t.getLocalBounds()))));r?lN(t):n.push(t)})),t}};function ij([t,e],[n,r]){return r>t&&e>n}function oj(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function aj(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 sj=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]=oj(),[s,c]=oj(),[l,u]=oj(),[f,h]=oj();for(const e of t){const{min:t,max:n}=aj(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])&&!ij(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 cj(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function lj(t,e,n){return.2126*cj(t)+.7152*cj(e)+.0722*cj(n)}function uj(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=lj(n,r,i),l=lj(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function fj(t,e){const n=Un(e,(e=>uj(t,function(t){return"object"==typeof t?t:Df(t)}(e))));return e[n]}const hj=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;uj(t.parsedStyle.fill,r)<e&&t.attr("fill",fj(r,n))})),t)},dj=()=>t=>(t.forEach((t=>{uN(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(nj(n,e)&&nj(r,e))}(ej(t.getLocalBounds()),e);n&&lN(t)})),t);function pj(){return{"data.fetch":aO,"data.inline":pO,"data.sortBy":dO,"data.sort":uO,"data.filter":lO,"data.pick":fO,"data.rename":hO,"data.fold":sO,"data.slice":bO,"data.custom":gO,"data.map":mO,"data.join":vO,"data.kde":OO,"data.log":EO,"transform.stackY":Nr,"transform.binX":Ms,"transform.bin":ws,"transform.dodgeX":ti,"transform.jitter":Na,"transform.jitterX":La,"transform.symmetryY":ja,"transform.diffY":Ra,"transform.stackEnter":ei,"transform.normalizeY":ni,"transform.select":za,"transform.selectX":Ga,"transform.selectY":Wa,"transform.groupX":ts,"transform.groupY":es,"transform.groupColor":ns,"transform.group":Ja,"transform.sortX":os,"transform.sortY":ss,"transform.sortColor":as,"transform.flexX":cs,"transform.pack":vs,"transform.sample":Es,"transform.filter":ks,"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":lM,"mark.rect":fM,"mark.line":gM,"mark.point":yM,"mark.text":bM,"mark.cell":wM,"mark.area":OM,"mark.link":kM,"mark.image":_M,"mark.polygon":TM,"mark.box":CM,"mark.vector":LM,"mark.lineX":BM,"mark.lineY":RM,"mark.connector":FM,"mark.range":HM,"mark.rangeX":VM,"mark.rangeY":qM,"mark.path":XM,"mark.shape":KM,"mark.density":SO,"mark.heatmap":AO,"palette.category10":TO,"palette.category20":PO,"scale.linear":NO,"scale.ordinal":LO,"scale.band":CO,"scale.identity":jO,"scale.point":RO,"scale.time":IO,"scale.log":BO,"scale.pow":DO,"scale.sqrt":WO,"scale.threshold":FO,"scale.quantile":zO,"scale.quantize":GO,"scale.sequential":HO,"scale.constant":$O,"theme.classic":UO,"theme.classicDark":ZO,"theme.academy":JO,"theme.light":qO,"theme.dark":KO,"component.axisX":CE,"component.axisY":NE,"component.legendCategory":DE,"component.legendContinuous":HE,"component.legends":ck,"component.title":KE,"component.sliderX":rk,"component.sliderY":ik,"component.scrollbarX":ak,"component.scrollbarY":sk,"animation.scaleInX":lk,"animation.scaleOutX":uk,"animation.scaleInY":fk,"animation.scaleOutY":hk,"animation.waveIn":kk,"animation.fadeIn":dk,"animation.fadeOut":pk,"animation.zoomIn":Sk,"animation.zoomOut":_k,"animation.pathIn":Ak,"animation.morphing":Ek,"animation.growInX":Tk,"animation.growInY":Pk,"interaction.elementHighlight":CN,"interaction.elementHighlightByX":NN,"interaction.elementHighlightByColor":LN,"interaction.elementSelect":RN,"interaction.elementSelectByX":IN,"interaction.elementSelectByColor":BN,"interaction.fisheye":FN,"interaction.chartIndex":DN,"interaction.tooltip":nL,"interaction.legendFilter":mL,"interaction.legendHighlight":yL,"interaction.brushHighlight":SL,"interaction.brushXHighlight":AL,"interaction.brushYHighlight":PL,"interaction.brushAxisHighlight":zL,"interaction.brushFilter":GL,"interaction.brushXFilter":WL,"interaction.brushYFilter":HL,"interaction.sliderFilter":UL,"interaction.scrollbarFilter":KL,"interaction.poptip":tj,"composition.spaceLayer":Q_,"composition.spaceFlex":J_,"composition.facetRect":gA,"composition.repeatMatrix":wA,"composition.facetCircle":_A,"composition.timingKeyframe":TA,"labelTransform.overlapHide":rj,"labelTransform.overlapDodgeY":sj,"labelTransform.overflowHide":dj,"labelTransform.contrastReverse":hj}}function gj(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const mj={};const yj=t=>t?parseInt(t):0;function vj(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 bj{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 vj(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return vj(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return vj(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 xj=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],wj="__remove__",Mj="__callback__";function Oj(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function Ej(t,e){const{width:n=640,height:r=480,autoFit:i,depth:o=0}=t;let a=n,s=r;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||yj(e.width),r=t.clientHeight||yj(e.height);return{width:n-(yj(e.paddingLeft)+yj(e.paddingRight)),height:r-(yj(e.paddingTop)+yj(e.paddingBottom))}}(e);a=t||a,s=n||s}return{width:Math.max(T(a)?a:1,1),height:Math.max(T(s)?s:1,1),depth:o}}function kj(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of xj)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,Oj(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===Mj)e.children=t.value;else{const i=Oj(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function Sj(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 xj)void 0!==s[t]&&(a[t]=s[t],delete s[t]);return Object.assign(Object.assign({},a),{children:[s]})}function _j(t,e,n){if("function"==typeof t){const e=new bj;return e.value=t,e.type=Mj,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 Aj(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 Tj(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=_j(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 Pj(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function Cj(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 Nj(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 Lj(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 jj(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function Rj(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function Ij(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?Pj(e,n,r):"array"===t?Cj(e,n,r):"object"===t?Nj(e,n,r):"node"===t?jj(e,n,r):"container"===t?Rj(e,n,r):"mix"===t&&Lj(e,n)}return e}}function Bj(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const Dj={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"}},Fj=Object.assign(Object.assign({},Dj),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),zj=Object.assign(Object.assign({},Dj),{labelTransform:{type:"array"}});let Gj=class extends bj{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()&&uN(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&lN(t)}};Gj=de([Ij(zj)],Gj);let Wj=class extends bj{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)}};Wj=de([Ij(Fj)],Wj);const Hj="G2_CHART_KEY";class $j extends Gj{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 NS,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[wj]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new IS,this._context={library:Object.assign(Object.assign({},o),mj),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)=>iN(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 kj(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,Sj(t,e,n,r)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){Aj(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 Tj(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(BS.BEFORE_CLEAR),this._reset(),oN(0,this._context,!1),this.emit(BS.AFTER_CLEAR)}destroy(){this.options();this.emit(BS.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),oN(0,this._context,!0),this._container[wj]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(BS.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=Ej(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(BS.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(BS.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(BS.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(BS.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 Wj{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 Gj{constructor(){super({},e)}};return n=de([Ij(Bj(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))Ij(Bj(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=Hj}=t,{width:n,height:r,depth:i}=Ej(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}=Ej(this.options(),this._container);this._plugins.push(new jS),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new og({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))}}yp.enableCSSParsing=!1;const Vj=gj($j,Object.assign({},pj()));t.AREA_CLASS_NAME=Dk,t.Academy=JO,t.Bin=ws,t.BinX=Ms,t.COMPONENT_CLASS_NAME=Ik,t.Chart=Vj,t.ChartEvent=BS,t.Classic=UO,t.ClassicDark=ZO,t.Dark=KO,t.DiffY=Ra,t.DodgeX=ti,t.ELEMENT_CLASS_NAME=Lk,t.Filter=ks,t.FlexX=cs,t.Group=Ja,t.GroupColor=ns,t.GroupX=ts,t.GroupY=es,t.Jitter=Na,t.JitterX=La,t.LABEL_CLASS_NAME=Bk,t.LABEL_LAYER_CLASS_NAME=Nk,t.Light=qO,t.LinearAxis=TE,t.MAIN_LAYER_CLASS_NAME=Ck,t.MASK_CLASS_NAME="mask",t.MaybeFunctionAttribute=Zr,t.MaybeGradient=Jr,t.MaybeIdentityX=qr,t.MaybeIdentityY=Yr,t.MaybeKey=Wr,t.MaybeSeries=Hr,t.MaybeSize=Gr,t.MaybeStackY=jr,t.MaybeTitle=Br,t.MaybeTooltip=Ur,t.MaybeTuple=Qr,t.MaybeTupleX=Vr,t.MaybeTupleY=$r,t.MaybeVisualPosition=Kr,t.MaybeZeroPadding=Xr,t.MaybeZeroX=Dr,t.MaybeZeroY=Fr,t.MaybeZeroY1=hn,t.MaybeZeroZ=zr,t.NormalizeY=ni,t.PLOT_CLASS_NAME=Rk,t.Pack=vs,t.Runtime=$j,t.Sample=Es,t.Select=za,t.SelectX=Ga,t.SelectY=Wa,t.Selection=dm,t.SortColor=as,t.SortX=os,t.SortY=ss,t.StackEnter=ei,t.StackY=Nr,t.SymmetryY=ja,t.VIEW_CLASS_NAME=jk,t.corelib=pj,t.extend=gj,t.register=function(t,e){Object.assign(mj,{[t]:e})},t.render=iN,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480}=t,a=nN(t),{group:s=new Dp,emitter:c=new IS,library:l}=e;(null==s?void 0:s.parentElement)||ar("renderToMountedElement can't render chart to unmounted group.");const u=hm(s);return e.group=s,e.emitter=c,c.emit(BS.BEFORE_RENDER),PC(Object.assign(Object.assign({},a),{width:i,height:o}),u,l,e).then((()=>{s.ownerDocument.defaultView.requestAnimationFrame((()=>{c.emit(BS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),s},t.select=hm,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},_=function(t){return b(t,"String")};var A=function(t,e,n){return t<e?e:t>n?n:t},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(_(t)||_(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=_(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,_=f*m-h*g,A=f*y-d*g,T=h*y-d*m,P=v*T-b*A+x*_+w*S-M*k+E*O;return P?(P=1/P,t[0]=(s*T-c*A+l*_)*P,t[1]=(i*A-r*T-o*_)*P,t[2]=(g*E-m*M+y*w)*P,t[3]=(h*M-f*E-d*w)*P,t[4]=(c*S-a*T-l*k)*P,t[5]=(n*T-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*A-s*S+l*O)*P,t[9]=(r*S-n*A-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*_-c*O)*P,t[13]=(n*_-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],_=(1-(g+y))*w,A=(d+x)*w,T=(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]=_,t[1]=A,t[2]=T,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-(_*O+P*k+L*S),t[13]=n[1]+k-(A*O+C*k+j*S),t[14]=n[2]+S-(T*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 _t=St;function At(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 Tt(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=r[0],T=r[1],P=r[2],C=Math.hypot(A,T,P);return C<J?null:(A*=C=1/C,T*=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=A*A*a+o,x=T*A*a+P*i,w=P*A*a-T*i,M=A*T*a-P*i,E=T*T*a+o,O=P*T*a+A*i,k=A*P*a+T*i,S=T*P*a-A*i,_=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*_,t[9]=c*k+h*S+m*_,t[10]=l*k+d*S+y*_,t[11]=u*k+p*S+v*_,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:_t,orthoZO:At,lookAt:Tt,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],_=e[9],A=e[10],T=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-_)<=J*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(h-A)<=J*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-T)<=J*Math.max(1,Math.abs(d),Math.abs(T))&&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 _e(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 Ae(t){return t>=48&&t<=57||43===t||45===t||46===t}function Te(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)),Te(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Te(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&Te(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Te(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&&Te(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&Te(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):_e(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(!Ae(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 _=y*y,A=v*v,T=(o===a?-1:1)*Math.sqrt(Math.abs((_*A-_*k*k-A*O*O)/(_*k*k+A*O*O)));d=T*y*k/v+(g+b)/2,p=T*-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,_=f(y)*O+h(y)*k+(e+c)/2,A={x:(x.x-O)/g,y:(x.y-k)/m},T=Ve({x:1,y:0},A),P=Ve(A,{x:(-x.x-O)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(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+_}}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 _=(w-l)/(w-M[2]);O={x:E[0]*(1-_)+M[0]*_,y:E[1]*(1-_)+M[1]*_}}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,_=0,A=h.length;_<A;_+=1)p=(l="M"===(u=(f=h[_])[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=An){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(_n(this,t))}has(t){return super.has(_n(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 _n({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function An(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Tn(t){return t}function Pn(t,...e){return jn(t,Tn,Tn,e)}function Cn(t,...e){return jn(t,Array.from,Tn,e)}function Nn(t,e,...n){return jn(t,Tn,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=Tn,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?_r:"value"===t?Ar:"sum"===t?Tr:"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 _r(t,e,n){return Cr((t=>n[t]))}function Ar(t,e,n){return Cr((t=>e[t]))}function Tr(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)})]}};function Lr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Nr.props={};const jr=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(Lr))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Nr({groupBy:c?["x","series"]:"x"})(e,n,r)};function Rr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Ir(t){const e=`${t.getFullYear()}-${Rr(t.getMonth()+1)}-${Rr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Rr(n)}:${Rr(r)}:${Rr(i)}`:e}jr.props={};const Br=(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]instanceof Date?Ir(t[e]):t[e])).join(", ")};return[t,Y({},n,{tooltip:{title:s}})]}};Br.props={};const Dr=()=>(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}}})]};Dr.props={};const Fr=()=>(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}}})]};Fr.props={};const zr=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{z:on(cn(t,0))},scale:{z:{guide:null}}})]};zr.props={};const Gr=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{size:an(cn(t,3))}})]};Gr.props={};const Wr=()=>(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)}})]};Wr.props={};const $r=()=>(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)}})]};$r.props={};const Hr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{y:rn(n)}})]};Hr.props={};const Vr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,Y({},e,{encode:{x:rn(n)}})]};Vr.props={};const Yr=()=>(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])}})]};Yr.props={};const qr=()=>(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])}})]};qr.props={};const Ur=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}})]}};Ur.props={};const Xr=()=>(t,e)=>[t,Y({scale:{x:{padding:0},y:{padding:0}}},e)];Xr.props={};const Kr=()=>(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})]};Kr.props={};const Zr=()=>(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]))))})]};Zr.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 Jr=()=>(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))}})]};Jr.props={};const ti=(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)}})]}};ti.props={};const ei=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)}})]}};ei.props={};const ni=(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 ri(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function ii(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function oi(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}ni.props={};const ai=Math.sqrt(50),si=Math.sqrt(10),ci=Math.sqrt(2);function li(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>=ai?10:o>=si?5:o>=ci?2:1)*10**i:-(10**-i)/(o>=ai?10:o>=si?5:o>=ci?2:1)}function ui(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>=ai?i*=10:o>=si?i*=5:o>=ci&&(i*=2),e<t?-i:i}const fi=(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=li(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=li(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=li(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},hi=1e3,di=6e4,pi=36e5,gi=864e5,mi=6048e5,yi=2592e6,vi=31536e6;function bi(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 xi=bi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),wi=bi(hi,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+hi*e)}),(t=>t.getSeconds())),Mi=bi(di,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+di*e)}),(t=>t.getMinutes())),Ei=bi(pi,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+pi*e)}),(t=>t.getHours())),Oi=bi(gi,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+gi*e)}),(t=>t.getDate()-1)),ki=bi(yi,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),Si=bi(mi,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+mi*e)}),(t=>{const e=ki.floor(t),n=new Date(+t);return Math.floor((+n-+e)/mi)})),_i=bi(vi,(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())),Ai={millisecond:xi,second:wi,minute:Mi,hour:Ei,day:Oi,week:Si,month:ki,year:_i},Ti=bi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Pi=bi(hi,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+hi*e)}),(t=>t.getUTCSeconds())),Ci=bi(di,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+di*e)}),(t=>t.getUTCMinutes())),Ni=bi(pi,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+pi*e)}),(t=>t.getUTCHours())),Li=bi(gi,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+gi*e)}),(t=>t.getUTCDate()-1)),ji=bi(yi,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Ri=bi(mi,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+mi*e)}),(t=>{const e=ji.floor(t),n=new Date(+t);return Math.floor((+n-+e)/mi)})),Ii=bi(vi,(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())),Bi={millisecond:Ti,second:Pi,minute:Ci,hour:Ni,day:Li,week:Ri,month:ji,year:Ii};function Di(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Bi:Ai,{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=oi(s,h,0,d,u);let g;if(p===d){g=[c,ui(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(ui(o,a,f),1)]}return g}const Fi=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Di(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var zi=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Gi={}.toString,Wi=function(t,e){return Gi.call(t)==="[object "+e+"]"},$i=function(t){return null==t},Hi=function(t){return Array.isArray?Array.isArray(t):Wi(t,"Array")},Vi=function(t){return"object"==typeof t&&null!==t},Yi=function(t){if(!Vi(t)||!Wi(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},qi=function(t){return Wi(t,"Number")},Ui=function(t){return null===t},Xi=function(t){return void 0===t};function Ki(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&&Yi(o)?(Yi(t[i])||(t[i]={}),n<r?Ki(t[i],o,n+1,r):t[i]=e[i]):Hi(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Zi=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)Ki(t,e[r]);return t},Qi=function(t,e){if(!zi(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},Ji=function(t){return t};function to(t){return $i(t)?0:zi(t)?t.length:Object.keys(t).length}function eo(t){return!Xi(t)&&!Ui(t)&&!Number.isNaN(t)}const no=t=>e=>-t(-e),ro=(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?no(r):r},io=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?no(n):n},oo=(t,e,n,r)=>{const i=t<0,o=ro(r,i),a=io(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 ao={exports:{}},so={exports:{}},co=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))},lo=Array.prototype.concat,uo=Array.prototype.slice,fo=so.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];co(i)?e=lo.call(e,uo.call(i)):e.push(i)}return e};fo.wrap=function(t){return function(){return t(fo(arguments))}};var ho={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]},po=so.exports,go=Object.hasOwnProperty,mo=Object.create(null);for(var yo in ho)go.call(ho,yo)&&(mo[ho[yo]]=yo);var vo=ao.exports={to:{},get:{}};function bo(t,e,n){return Math.min(Math.max(e,t),n)}function xo(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}vo.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=vo.get.hsl(t),n="hsl";break;case"hwb":e=vo.get.hwb(t),n="hwb";break;default:e=vo.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},vo.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]:go.call(ho,e[1])?((i=ho[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]=bo(i[n],0,255);return i[3]=bo(i[3],0,1),i},vo.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,bo(parseFloat(e[2]),0,100),bo(parseFloat(e[3]),0,100),bo(isNaN(n)?1:n,0,1)]}return null},vo.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,bo(parseFloat(e[2]),0,100),bo(parseFloat(e[3]),0,100),bo(isNaN(n)?1:n,0,1)]}return null},vo.to.hex=function(){var t=po(arguments);return"#"+xo(t[0])+xo(t[1])+xo(t[2])+(t[3]<1?xo(Math.round(255*t[3])):"")},vo.to.rgb=function(){var t=po(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]+")"},vo.to.rgb.percent=function(){var t=po(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]+")"},vo.to.hsl=function(){var t=po(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},vo.to.hwb=function(){var t=po(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},vo.to.keyword=function(t){return mo[t.slice(0,3)]};var wo=ao.exports;function Mo(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 Eo(t){const e=wo.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*Mo(a,o,e+1/3),255*Mo(a,o,e),255*Mo(a,o,e-1/3),i]}(r):null}const Oo=(t,e)=>n=>t*(1-n)+e*n,ko=(t,e)=>"number"==typeof t&&"number"==typeof e?Oo(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Eo(t),r=Eo(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,So=(t,e)=>{const n=Oo(t,e);return t=>Math.round(n(t))};function _o({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ao(t){return"object"==typeof t?t.valueOf():t}class To extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Ao,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(_o({map:this.map,initKey:this.initKey},t))}has(t){return super.has(_o({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 Po{constructor(t){this.options=Zi({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Zi({},this.options,t),this.rescale(t)}rescale(t){}}const Co=Symbol("defaultUnknown");function No(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Lo(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Co)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function jo(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Ro extends Po{getDefaultOptions(){return{domain:[],range:[],unknown:Co}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&No(this.domainIndexMap,this.getDomain(),this.domainKey),Lo({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&No(this.rangeIndexMap,this.getRange(),this.rangeKey),Lo({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=jo(e),this.rangeKey=jo(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 Ro(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 Io(t){return Math.round(1e12*t)/1e12}function Bo(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 To(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new To(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]=Io(E);const n=e[t];E+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Do extends Ro{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Co,flex:[]}}constructor(t){super(t)}clone(){return new Do(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 Bo(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 Fo=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=li(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 zo extends Po{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Fo}}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 qi(r)&&qi(i)?t(r,i,n):[]}clone(){return new zo(this.options)}}function Go(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const Wo=[1,5,2,2.5,4,3],$o=100*Number.EPSILON;function Ho(t,e,n,r,i,o){const a=to(e),s=Qi(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<$o||o-l<$o)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function Vo(t,e,n){const r=to(e);return 1-Qi(e,t)/(r-1)-n+1}function Yo(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 qo(t,e){return t>=e?2-(t-1)/(e-1):1}function Uo(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Xo(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const Ko=(t,e,n=5,r=!0,i=Wo,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=Vo(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=qo(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=Xo(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=Ho(l,i,c,n,d,p),y=Uo(t,e,n,d),v=Yo(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=Go(s.lmax),u=Go(s.lmin),f=Go(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Go(u);for(let t=1;t<h;t+=1)d[t]=Go(d[t-1]+f);return d};class Zo extends Po{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Ko}}map(t){return eo(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Zo(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return qi(r)&&qi(i)?n(r,i,e):[]}}const Qo=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=ii(r,i),c=n(o,a)):(s=ii(i,r),c=n(a,o)),ri(c,s)},Jo=(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]=ii(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=oi(t,e,1,r)-1,a=i[n];return ri(o[n],a)(e)}},ta=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Jo:Qo)(t,e,r?So:n);class ea extends Po{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Oo,tickCount:5}}map(t){return eo(t)?this.output(t):this.options.unknown}invert(t){return eo(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 fi}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]):Ji}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=ta(n.map(t),r,o,i);this.output=ri(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=ta(i,r.map(t),Oo);this.input=ri(e,n,o)}}class na extends ea{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:ko,tickMethod:Fo,tickCount:5}}chooseTransforms(){return[Ji,Ji]}clone(){return new na(this.options)}}class ra extends Do{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Co,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new ra(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const ia=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class oa extends ea{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:ko,tickMethod:Fo,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[Ji,Ji];const e=.5===t?ia:(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 oa(this.options)}}class aa extends oa{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:ko,tickMethod:Fo,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new aa(this.options)}}class sa extends Po{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!eo(t))return this.options.unknown;const e=oi(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 sa(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ca=(t,e,n,r=10)=>{const i=t<0,o=io(r,i),a=ro(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=Fo(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=Fo(u,f,t).map(o)}return s?h.reverse():h};class la extends ea{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:ko,tickMethod:ca,tickCount:5}}chooseNice(){return oo}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[ro(t,n),io(t,n)]}clone(){return new la(this.options)}}class ua extends sa{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Ko}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=fi(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 ua(this.options)}}function fa(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 ha extends sa{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Ko}}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(fa(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 ha(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var da=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,pa=/\[([^]*?)\]/gm;function ga(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function ma(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 ya=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],va=["January","February","March","April","May","June","July","August","September","October","November","December"],ba=ga(va,3),xa=ma({},{dayNamesShort:ga(ya,3),dayNames:ya,monthNamesShort:ba,monthNames:va,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),wa=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ma={D:function(t){return String(t.getDate())},DD:function(t){return wa(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return wa(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 wa(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 wa(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return wa(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return wa(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return wa(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return wa(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return wa(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return wa(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return wa(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?"-":"+")+wa(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+wa(Math.floor(Math.abs(e)/60),2)+":"+wa(Math.abs(e)%60,2)}},Ea={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 Oa=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Di(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function ka(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Sa extends ea{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:Oa,interpolate:Oo,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Fi}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?Bi:Ai,r=e?ka:Ji;return e=>function(t,e,n){if(void 0===e&&(e=Ea.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=Ea[e]||e).replace(pa,(function(t,e){return r.push(e),"@@@"}));var i=ma(ma({},xa),n);return(e=e.replace(da,(function(e){return Ma[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 Sa(this.options)}}var _a,Aa=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 Ta=_a=class extends na{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Ji,tickMethod:Fo,tickCount:5}}constructor(t){super(t)}clone(){return new _a(this.options)}};function Pa(t,e,n){if(null===t)return[-.5,.5];const r=Sr(t,e),i=new Do({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Ca(t,e,n){return e*(1-t)+n*t}Ta=_a=Aa([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 qi(n)?Math.round(n):n})(i):i;this.output=ri(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return ri(Oo(0,1),ii(e,n))}))],Ta);const Na=(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=Pa(l,s,n),h=Pa(u,c,r),d=t.map((()=>Ca(i(),...h))),p=t.map((()=>Ca(i(),...f)));return[t,Y({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:rn(d),dx:rn(p)}})]}};Na.props={};const La=(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=Pa(s,a,e),l=t.map((()=>Ca(n(),...c)));return[t,Y({scale:{x:{padding:.5}}},r,{encode:{dx:rn(l)}})]}};La.props={};const ja=(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])])))})]}};ja.props={};const Ra=(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 Ia(t,e){return[t[0]]}function Ba(t,e){return[t[t.length-1]]}function Da(t,e){return[t[Un(t,(t=>e[t]))]]}function Fa(t,e){return[t[Kn(t,(t=>e[t]))]]}Ra.props={};const za=(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:Ia,last:Ba,max:Da,min:Fa}[t]||Ia}(r);return[a.flatMap((t=>c(t,s))),i]}};za.props={};const Ga=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return za(Object.assign({channel:"x",selector:e},n))};Ga.props={};const Wa=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return za(Object.assign({channel:"y",selector:e},n))};function $a(t){return e=>null===e?t:`${t} of ${e}`}function Ha(){return[(t,e)=>tr(t,(t=>+e[t])),$a("mean")]}function Va(){return[(t,e)=>er(t,(t=>+e[t])),$a("median")]}function Ya(){return[(t,e)=>qn(t,(t=>+e[t])),$a("max")]}function qa(){return[(t,e)=>Xn(t,(t=>+e[t])),$a("min")]}function Ua(){return[(t,e)=>t.length,$a("count")]}function Xa(){return[(t,e)=>nr(t,(t=>+e[t])),$a("sum")]}function Ka(){return[(t,e)=>e[t[0]],$a("first")]}function Za(){return[(t,e)=>e[t[t.length-1]],$a("last")]}Wa.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:Ha,max:Ya,count:Ua,first:Ka,last:Za,sum:Xa,min:qa,median:Va}[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 Ja=(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)}))};Ja.props={};const ts=(t={})=>Ja(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));ts.props={};const es=(t={})=>Ja(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));es.props={};const ns=(t={})=>Ja(Object.assign(Object.assign({},t),{channels:["color"]}));function rs(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}}})]}ns.props={};const is=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=he(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?rs(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))};is.props={};const os=(t={})=>is(Object.assign(Object.assign({},t),{channel:"x"}));os.props={};const as=(t={})=>is(Object.assign(Object.assign({},t),{channel:"color"}));as.props={};const ss=(t={})=>is(Object.assign(Object.assign({},t),{channel:"y"}));ss.props={};const cs=(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 ls([t,e],[n,r]){return[t-n,e-r]}function us([t,e],[n,r]){return[t+n,e+r]}function fs([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function hs([t,e]){return Math.atan2(e,t)}function ds([t,e]){return hs([t,e])+Math.PI/2}function ps(t,e){const n=hs(t),r=hs(e);return n<r?r-n:2*Math.PI-(n-r)}function gs(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 ms([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function ys(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]=gs(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})`}))}cs.props={};const vs=()=>(t,e)=>[t,Y({},e,{modifier:ys,axis:!1})];vs.props={};const bs="thresholds";function xs(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 ws=(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(bs))))),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,bs),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]||xs(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())}}))};ws.props={};const Ms=(t={})=>{const{thresholds:e}=t;return ws(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Es(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]))}Ms.props={};const Os=(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 Es;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]}};Os.props={};const ks=(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]])).filter((t=>void 0!==t))})]));return[s,Y({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function Ss(t){return function(){return t}}ks.props={};const _s=Math.abs,As=Math.atan2,Ts=Math.cos,Ps=Math.max,Cs=Math.min,Ns=Math.sin,Ls=Math.sqrt,js=1e-12,Rs=Math.PI,Is=Rs/2,Bs=2*Rs;function Ds(t){return t>=1?Is:t<=-1?-Is:Math.asin(t)}const Fs=Math.PI,zs=2*Fs,Gs=1e-6,Ws=zs-Gs;function $s(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Hs{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?$s:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return $s;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>Gs)if(Math.abs(u*s-c*l)>Gs&&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((Fs-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Gs&&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)>Gs||Math.abs(this._y1-l)>Gs)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%zs+zs),f>Ws?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>Gs&&this._append`A${n},${n},0,${+(f>=Fs)},${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 Vs(){return new Hs}function Ys(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 Hs(e)}function qs(t){return t.innerRadius}function Us(t){return t.outerRadius}function Xs(t){return t.startAngle}function Ks(t){return t.endAngle}function Zs(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)/Ls(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)*Ls(Ps(0,w*w*x-M*M)),O=(M*b-v*E)/x,k=(-M*v-b*E)/x,S=(M*b+v*E)/x,_=(-M*v+b*E)/x,A=O-m,T=k-y,P=S-m,C=_-y;return A*A+T*T>P*P+C*C&&(O=S,k=_),{cx:O,cy:k,x01:-u,y01:-f,x11:O*(i/w-1),y11:k*(i/w-1)}}function Js(){var t=qs,e=Us,n=Ss(0),r=null,i=Xs,o=Ks,a=Zs,s=null,c=Ys(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Is,p=o.apply(this,arguments)-Is,g=_s(p-d),m=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>js)if(g>Bs-js)s.moveTo(h*Ts(d),h*Ns(d)),s.arc(0,0,h,d,p,!m),f>js&&(s.moveTo(f*Ts(p),f*Ns(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>js&&(r?+r.apply(this,arguments):Ls(f*f+h*h)),_=Cs(_s(h-f)/2,+n.apply(this,arguments)),A=_,T=_;if(S>js){var P=Ds(S/f*Ns(k)),C=Ds(S/h*Ns(k));(E-=2*P)>js?(w+=P*=m?1:-1,M-=P):(E=0,w=M=(d+p)/2),(O-=2*C)>js?(b+=C*=m?1:-1,x-=C):(O=0,b=x=(d+p)/2)}var N=h*Ts(b),L=h*Ns(b),j=f*Ts(M),R=f*Ns(M);if(_>js){var I,B=h*Ts(x),D=h*Ns(x),F=f*Ts(w),z=f*Ns(w);if(g<Rs)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<js))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/Ns(function(t){return t>1?0:t<-1?Rs:Math.acos(t)}((G*$+W*H)/(Ls(G*G+W*W)*Ls($*$+H*H)))/2),Y=Ls(I[0]*I[0]+I[1]*I[1]);A=Cs(_,(f-Y)/(V-1)),T=Cs(_,(h-Y)/(V+1))}else A=T=0}O>js?T>js?(y=Qs(F,z,N,L,h,T,m),v=Qs(B,D,j,R,h,T,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),T<_?s.arc(y.cx,y.cy,T,As(y.y01,y.x01),As(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,As(y.y01,y.x01),As(y.y11,y.x11),!m),s.arc(0,0,h,As(y.cy+y.y11,y.cx+y.x11),As(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,T,As(v.y11,v.x11),As(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!m)):s.moveTo(N,L),f>js&&E>js?A>js?(y=Qs(j,R,B,D,f,-A,m),v=Qs(N,L,F,z,f,-A,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),A<_?s.arc(y.cx,y.cy,A,As(y.y01,y.x01),As(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,A,As(y.y01,y.x01),As(y.y11,y.x11),!m),s.arc(0,0,f,As(y.cy+y.y11,y.cx+y.x11),As(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,A,As(v.y11,v.x11),As(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-Rs/2;return[Ts(r)*n,Ns(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ss(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ss(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ss(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ss(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ss(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function tc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ec(t){this._context=t}function nc(t){return new ec(t)}function rc(t){return t[0]}function ic(t){return t[1]}function oc(t,e){var n=Ss(!0),r=null,i=nc,o=null,a=Ys(s);function s(s){var c,l,u,f=(s=tc(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?rc:Ss(t),e="function"==typeof e?e:void 0===e?ic:Ss(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ss(!!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 ac(t,e,n){var r=null,i=Ss(!0),o=null,a=nc,s=null,c=Ys(l);function l(l){var u,f,h,d,p,g=(l=tc(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 oc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?rc:Ss(+t),e="function"==typeof e?e:Ss(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?ic:Ss(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ss(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ss(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ss(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ss(+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:Ss(!!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}Vs.prototype=Hs.prototype,ec.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 sc=lc(nc);function cc(t){this._curve=t}function lc(t){function e(e){return new cc(t(e))}return e._curve=t,e}function uc(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(lc(t)):e()._curve},t}function fc(){}function hc(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 dc(t,e){this._context=t,this._k=(1-e)/6}function pc(t,e){this._context=t,this._k=(1-e)/6}function gc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>js){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>js){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 mc(t,e){this._context=t,this._alpha=e}cc.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))}},dc.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:hc(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:hc(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 dc(t,e)}return n.tension=function(e){return t(+e)},n}(0),pc.prototype={areaStart:fc,areaEnd:fc,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:hc(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 pc(t,e)}return n.tension=function(e){return t(+e)},n}(0),mc.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:gc(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 yc=function t(e){function n(t){return e?new mc(t,e):new dc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function vc(t,e){this._context=t,this._alpha=e}vc.prototype={areaStart:fc,areaEnd:fc,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:gc(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 bc=function t(e){function n(t){return e?new vc(t,e):new pc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function xc(t){this._context=t}function wc(t){return new xc(t)}function Mc(t){return t<0?-1:1}function Ec(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Mc(o)+Mc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Oc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function kc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Sc(t){this._context=t}function _c(t){this._context=new Ac(t)}function Ac(t){this._context=t}function Tc(t){return new Sc(t)}function Pc(t){return new _c(t)}function Cc(t,e){this._context=t,this._t=e}function Nc(t){return new Cc(t,.5)}function Lc(t){return new Cc(t,0)}function jc(t){return new Cc(t,1)}function Rc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Ic(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Bc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Dc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Fc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function zc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function Gc(t){return Dc(t)||Ic(t)}function Wc(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]}xc.prototype={areaStart:fc,areaEnd:fc,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))}},Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:kc(this,this._t0,Oc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){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,kc(this,Oc(this,n=Ec(this,t,e)),n);break;default:kc(this,this._t0,n=Ec(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(_c.prototype=Object.create(Sc.prototype)).point=function(t,e){Sc.prototype.point.call(this,e,t)},Ac.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},Cc.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 Hc="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Vc={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}(Vc);var Yc=Vc.exports;function qc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Uc(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Xc(){}var Kc=.7,Zc=1/Kc,Qc="\\s*([+-]?\\d+)\\s*",Jc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",el=/^#([0-9a-f]{3,8})$/,nl=new RegExp("^rgb\\("+[Qc,Qc,Qc]+"\\)$"),rl=new RegExp("^rgb\\("+[tl,tl,tl]+"\\)$"),il=new RegExp("^rgba\\("+[Qc,Qc,Qc,Jc]+"\\)$"),ol=new RegExp("^rgba\\("+[tl,tl,tl,Jc]+"\\)$"),al=new RegExp("^hsl\\("+[Jc,tl,tl]+"\\)$"),sl=new RegExp("^hsla\\("+[Jc,tl,tl,Jc]+"\\)$"),cl={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 ll(){return this.rgb().formatHex()}function ul(){return this.rgb().formatRgb()}function fl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=el.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?hl(e):3===n?new pl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?dl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?dl(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=nl.exec(t))?new pl(e[1],e[2],e[3],1):(e=rl.exec(t))?new pl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=il.exec(t))?dl(e[1],e[2],e[3],e[4]):(e=ol.exec(t))?dl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=al.exec(t))?vl(e[1],e[2]/100,e[3]/100,1):(e=sl.exec(t))?vl(e[1],e[2]/100,e[3]/100,e[4]):cl.hasOwnProperty(t)?hl(cl[t]):"transparent"===t?new pl(NaN,NaN,NaN,0):null}function hl(t){return new pl(t>>16&255,t>>8&255,255&t,1)}function dl(t,e,n,r){return r<=0&&(t=e=n=NaN),new pl(t,e,n,r)}function pl(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function gl(){return"#"+yl(this.r)+yl(this.g)+yl(this.b)}function ml(){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 yl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function vl(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new xl(t,e,n,r)}function bl(t){if(t instanceof xl)return new xl(t.h,t.s,t.l,t.opacity);if(t instanceof Xc||(t=fl(t)),!t)return new xl;if(t instanceof xl)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 xl(a,s,c,t.opacity)}function xl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function wl(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 Ml(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function El(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 Ol(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function kl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Sl(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=Ol(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=kl(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}}qc(Xc,fl,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ll,formatHex:ll,formatHsl:function(){return bl(this).formatHsl()},formatRgb:ul,toString:ul}),qc(pl,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Xc||(i=fl(i)),i?new pl((i=i.rgb()).r,i.g,i.b,i.opacity):new pl):new pl(t,e,n,null==r?1:r);var i}),Uc(Xc,{brighter:function(t){return t=null==t?Zc:Math.pow(Zc,t),new pl(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Kc:Math.pow(Kc,t),new pl(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:gl,formatHex:gl,formatRgb:ml,toString:ml})),qc(xl,(function(t,e,n,r){return 1===arguments.length?bl(t):new xl(t,e,n,null==r?1:r)}),Uc(Xc,{brighter:function(t){return t=null==t?Zc:Math.pow(Zc,t),new xl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Kc:Math.pow(Kc,t),new xl(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 pl(wl(t>=240?t-240:t+120,i,r),wl(t,i,r),wl(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 _l=1e-4;function Al(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=Ml(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<_l);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))],Ml(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=Ml(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 Tl(t,e,n,r){return Ml(t,e,n,r)}function Pl(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Cl(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 Nl(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 Ll(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 jl(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Ll(t,n,i,a),f=Ll(e,r,o,s),h=0;h<u.length;h++)c.push(Nl(t,n,i,a,u[h]));for(h=0;h<f.length;h++)l.push(Nl(e,r,o,s,f[h]));return El(c,l)}function Rl(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 Al([t,n,i,a],[e,r,o,s],c,l,Nl,u)}(t,e,n,r,i,o,a,s,c,l,u);return Ml(f.x,f.y,c,l)}function Il(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+=Ml(r[0],r[1],i[0],i[1])}return e}(t)}function Bl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Dl(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 Fl(t,e,n,r,i,o){var a=Dl(t,n,i)[0],s=Dl(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Bl(t,n,i,a)),void 0!==s&&l.push(Bl(e,r,o,s)),El(c,l)}function zl(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return Al([t,n,i],[e,r,o],a,s,Bl)}(t,e,n,r,i,o,a,s);return Ml(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Hc||"undefined"!=typeof self&&self;var Gl={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}()}(Gl);var Wl,$l,Hl=Gl.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"}(Wl||(Wl={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}($l||($l={}));var Vl=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}(),Yl=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 ql(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ul(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Xl(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Kl(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Zl(t){return void 0===t?0:t>360||t<-360?t%360:t}function Ql(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Rt(t):T(t)?Bt(t,e,n):Bt(t[0],t[1]||e,t[2]||n)}function Jl(t){return t*(Math.PI/180)}function tu(t){return t*(180/Math.PI)}function eu(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 nu(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 ru(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=tu(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var iu=rt(),ou=rt(),au=Qt(),su=[jt(),jt(),jt()],cu=jt();function lu(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 uu,fu=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){ql(this.center,t),ql(this.halfExtents,e),Ul(this.min,this.center,this.halfExtents),Xl(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Xl(this.center,e,t),Kl(this.center,this.center,.5),Ul(this.halfExtents,e,t),Kl(this.halfExtents,this.halfExtents,.5),ql(this.min,t),ql(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,_=v+M,A=b-E,T=b+E;O<u&&(u=O),k>f&&(f=k),S<h&&(h=S),_>d&&(d=_),A<p&&(p=A),T>g&&(g=T),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],Ul(this.min,n,r),Xl(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?ql([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?ql([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}(),hu=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"}(uu||(uu={}));var du,pu,gu,mu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new hu)}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}(),yu=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}(),vu=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}(),bu="Method not implemented.",xu="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(du||(du={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(pu||(pu={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(gu||(gu={}));var wu,Mu,Eu,Ou,ku,Su="updated",_u=2e-4,Au=function(){function t(){this.clipSpaceNearZ=$l.NEGATIVE_ONE,this.eventEmitter=new Yc,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=du.EXPLORING,this.trackingMode=pu.DEFAULT,this.projectionMode=gu.PERSPECTIVE,this.frustum=new mu,this.orthoMatrix=rt()}return t.prototype.isOrtho=function(){return this.projectionMode===gu.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===du.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===du.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!==du.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===gu.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===gu.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===gu.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===gu.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===gu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===gu.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=gu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(Jl(.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=gu.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?_t(this.projectionMatrix,f,h,p,d,i,o):At(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=Ql(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=Ql(t,e,n),this.trackingMode===pu.CINEMATIC){var i=Gt(jt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=It(i),a=tu(Math.asin(e/o)),s=90+tu(Math.atan2(n,t)),c=rt();gt(c,c,Jl(s)),pt(c,c,Jl(a)),r=qt(jt(),[0,1,0],c)}return lt(this.matrix,Tt(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<_u&&(this.distance=_u),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=Zl(t),this.computeMatrix(),this._getAxes(),this.type===du.ORBITING||this.type===du.EXPLORING?this._getPosition():this.type===du.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=Zl(t),this.computeMatrix(),this._getAxes(),this.type===du.ORBITING||this.type===du.EXPLORING?this._getPosition():this.type===du.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=Zl(t),this.computeMatrix(),this._getAxes(),this.type===du.ORBITING||this.type===du.EXPLORING?this._getPosition():this.type===du.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],Jl(this.roll));st(this.matrix);var e=ee(te(),[1,0,0],Jl((this.rotateWorld&&this.type!==du.TRACKING||this.type===du.TRACKING?1:-1)*this.elevation)),n=ee(te(),[0,1,0],Jl((this.rotateWorld&&this.type!==du.TRACKING||this.type===du.TRACKING?1:-1)*this.azimuth)),r=ne(te(),n,e);r=ne(te(),r,t);var i=Et(rt(),r);this.type===du.ORBITING||this.type===du.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===du.TRACKING&&(ht(this.matrix,this.matrix,this.position),ft(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=Ql(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,Ql(Jt(Qt(),[1,0,0,0],this.matrix))),Dt(this.up,Ql(Jt(Qt(),[0,1,0,0],this.matrix))),Dt(this.forward,Ql(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===du.TRACKING||this.rotateWorld?(this.elevation=tu(Math.asin(e/r)),this.azimuth=tu(Math.atan2(-t,-n))):(this.elevation=-tu(Math.asin(e/r)),this.azimuth=-tu(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Dt(this.position,Ql(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===gu.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(Su)}},t.prototype.rotate=function(t,e,n){throw new Error(bu)},t.prototype.pan=function(t,e){throw new Error(bu)},t.prototype.dolly=function(t){throw new Error(bu)},t.prototype.createLandmark=function(t,e){throw new Error(bu)},t.prototype.gotoLandmark=function(t,e){throw new Error(bu)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(bu)},t}();function Tu(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(Tu.Cache||Map),n}Tu.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"}(wu||(wu={})),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"}(Mu||(Mu={})),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"}(Eu||(Eu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Ou||(Ou={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(ku||(ku={}));var Pu,Cu=[{name:"em",unit_type:wu.kEms},{name:"px",unit_type:wu.kPixels},{name:"deg",unit_type:wu.kDegrees},{name:"rad",unit_type:wu.kRadians},{name:"grad",unit_type:wu.kGradians},{name:"ms",unit_type:wu.kMilliseconds},{name:"s",unit_type:wu.kSeconds},{name:"rem",unit_type:wu.kRems},{name:"turn",unit_type:wu.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"}(Pu||(Pu={}));var Nu,Lu=function(t){return t?"number"===t?wu.kNumber:"percent"===t||"%"===t?wu.kPercentage:function(t){return Cu.find((function(e){return e.name===t})).unit_type}(t):wu.kUnknown},ju=function(t){var e=1;switch(t){case wu.kPixels:case wu.kDegrees:case wu.kSeconds:break;case wu.kMilliseconds:e=.001;break;case wu.kRadians:e=180/Math.PI;break;case wu.kGradians:e=.9;break;case wu.kTurns:e=360}return e},Ru=function(t){switch(t){case wu.kNumber:case wu.kInteger:return"";case wu.kPercentage:return"%";case wu.kEms:return"em";case wu.kRems:return"rem";case wu.kPixels:return"px";case wu.kDegrees:return"deg";case wu.kRadians:return"rad";case wu.kGradians:return"grad";case wu.kMilliseconds:return"ms";case wu.kSeconds:return"s";case wu.kTurns:return"turn"}return""},Iu=function(){function t(){}return t.isAngle=function(t){return t===wu.kDegrees||t===wu.kRadians||t===wu.kGradians||t===wu.kTurns},t.isLength=function(t){return t>=wu.kEms&&t<wu.kDegrees},t.isRelativeUnit=function(t){return t===wu.kPercentage||t===wu.kEms||t===wu.kRems},t.isTime=function(t){return t===wu.kSeconds||t===wu.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Ou.kNo,ku.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Pu.kUnitType&&this.getType()<=Pu.kClampType},t}(),Bu=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 Pu.kColorType},e.prototype.to=function(t){return this},e}(Iu);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Nu||(Nu={}));var Du=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 Pu.kColorType},e}(Iu),Fu=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 Pu.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Iu),zu=Tu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Gu=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Wu(t){return"function"==typeof t}var $u={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Hu=Tu((function(t){var e=zu(t),n=$u[e];return e=(null==n?void 0:n.alias)||e})),Vu=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},Yu=function(t){return function(t){switch(t){case Mu.kUNumber:return wu.kNumber;case Mu.kULength:return wu.kPixels;case Mu.kUPercent:return wu.kPercentage;case Mu.kUTime:return wu.kSeconds;case Mu.kUAngle:return wu.kDegrees;default:return wu.kUnknown}}(function(t){switch(t){case wu.kNumber:case wu.kInteger:return Mu.kUNumber;case wu.kPercentage:return Mu.kUPercent;case wu.kPixels:return Mu.kULength;case wu.kMilliseconds:case wu.kSeconds:return Mu.kUTime;case wu.kDegrees:case wu.kRadians:case wu.kGradians:case wu.kTurns:return Mu.kUAngle;default:return Mu.kUOther}}(t))},qu=function(t){function e(e,n){void 0===n&&(n=wu.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Lu(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 Pu.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Yu(this.unit);if(n!==Yu(t)||n===wu.kUnknown)return null;var r=ju(this.unit)/ju(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case wu.kUnknown:break;case wu.kInteger:r=Number(this.value).toFixed(0);break;case wu.kNumber:case wu.kPercentage:case wu.kEms:case wu.kRems:case wu.kPixels:case wu.kDegrees:case wu.kRadians:case wu.kGradians:case wu.kMilliseconds:case wu.kSeconds:case wu.kTurns:var i=this.value,o=Ru(this.unit);if(i<-999999||i>999999){var a=Ru(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?Vu(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Iu),Uu=new qu(0,"px");new qu(1,"px");var Xu,Ku,Zu=new qu(0,"deg"),Qu=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}(Bu),Ju=new Fu("unset"),tf=new Fu("initial"),ef=new Fu("inherit"),nf={"":Ju,unset:Ju,initial:tf,inherit:ef},rf=function(t){return nf[t]||(nf[t]=new Fu(t)),nf[t]},of=new Qu(0,0,0,0,!0),af=new Qu(0,0,0,0),sf=Tu((function(t,e,n,r){return new Qu(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),cf=function(t,e){return void 0===e&&(e=wu.kNumber),new qu(t,e)},lf=new qu(50,"%");!function(t){t[t.Standard=0]="Standard"}(Xu||(Xu={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(Ku||(Ku={}));var uf,ff={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new vu(0,0,0,0)};function hf(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>"}(uf||(uf={}));var df=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 pf=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,gf=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,mf=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,yf=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var vf={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},bf=Tu((function(t){var e;return e="angular"===t.type?Number(t.value):vf[t.value]||0,cf(e,"deg")})),xf=Tu((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:cf(e,r),cy:cf(n,i)}})),wf=Tu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return df(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:cf(Number(t.length.value),"%"),color:hf(t)}}));if("linear-gradient"===e)return new Du(Nu.LinearGradient,{angle:n?bf(n):Zu,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=xf(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?rf(f):cf(f,u)}return new Du(Nu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=pf.exec(t);if(r){var i=(null===(e=r[2].match(yf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Du(Nu.LinearGradient,{angle:cf(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:cf(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=gf.exec(t);if(n){var r=(null===(e=n[4].match(yf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:cf(50,"%"),cy:cf(50,"%"),steps:r.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:cf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!_(o))return[new Du(Nu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=mf.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 Mf(t){return t&&!!t.image}function Ef(t){return t&&!y(t.r)&&!y(t.g)&&!y(t.b)}var Of=Tu((function(t){if(Mf(t))return fe({repetition:"repeat"},t);if(y(t)&&(t=""),"transparent"===t)return af;"currentColor"===t&&(t="black");var e=wf(t);if(e)return e;var n=fl(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),sf.apply(void 0,ve([],ye(r),!1))}));function kf(t,e){if(Ef(t)&&Ef(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(A(e[n],0,255));return e[3]=A(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Sf(t,e){if(y(e))return cf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return cf(Number(e),"px");if("deg".search(t)>=0)return cf(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 cf(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var _f=Tu((function(t){return Sf(new RegExp("px","g"),t)}));Tu((function(t){return Sf(new RegExp("%","g"),t)}));var Af=function(t){return T(t)||isFinite(Number(t))?cf(Number(t)||0,"px"):Sf(new RegExp("px|%|em|rem","g"),t)},Tf=Tu((function(t){return Sf(new RegExp("deg|rad|grad|turn","g"),t)}));function Pf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=Yu(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=Ru(t.unit)):(qu.isLength(t.unit)||qu.isLength(e.unit))&&(a=jf(t,i,n),s=jf(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Cf(t){var e=0;return t.unit===wu.kDegrees?e=t.value:t.unit===wu.kRadians?e=tu(Number(t.value)):t.unit===wu.kTurns&&(e=360*Number(t.value)),e}function Nf(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):_(t)?n=t.split(" ").map((function(t){return Number(t)})):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 Lf(t){return _(t)?t.split(" ").map((function(t){return Af(t)})):t.map((function(t){return Af(t.toString())}))}function jf(t,e,n){if(0===t.value)return 0;if(t.unit===wu.kPixels)return Number(t.value);if(t.unit===wu.kPercentage&&n){var r=n.nodeName===Wl.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var Rf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function If(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,Rf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Sf(/deg|rad|grad|turn|px|%/g,t)||Of(t)}))}),n.lastIndex===t.length)return r}return[]}function Bf(t){return t.toString()}var Df=Tu((function(t){return"number"==typeof t?cf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?cf(Number(t)):cf(0)}));function Ff(t,e){return[t,e,Bf]}function zf(t,e){return function(n,r){return[n,r,function(n){return Bf(A(n,t,e))}]}}function Gf(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Wf(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 Hf(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 Vf(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Tu((function(t){return _(t)?t.split(" ").map(Df):t.map(Df)}));var Yf=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)},qf=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=Jl(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=Yf({x:1,y:0},v),x=Yf(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 Uf(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=qf({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=qf({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 Xf(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Kf(t,e){return Xf(t)*Xf(e)?(t[0]*e[0]+t[1]*e[1])/(Xf(t)*Xf(e)):1}function Zf(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Kf(t,e))}function Qf(t,e){var n=e[1],r=e[2],i=j(Jl(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=Zf([1,0],x),E=Zf(x,w);return Kf(x,w)<=-1&&(E=Math.PI),Kf(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 Jf(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 th(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case Wl.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 Wl.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=Jf(d,d,g,void 0===m?0:m);break;case Wl.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=Jf(b,w,g,void 0===E?0:E);break;case Wl.POLYLINE:case Wl.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===Wl.POLYGON);break;case Wl.RECT:var O=t.parsedStyle,k=O.width,S=void 0===k?0:k,_=O.height,T=void 0===_?0:_,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,T,C,L,R&&j.map((function(t){return A(t,0,Math.min(Math.abs(S)/2,Math.abs(T)/2))})));break;case Wl.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 eh=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=Qf(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=Vf((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=Vf((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=Uf(u,0),x=b.x,w=b.y,M=Uf(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=Fl(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=jl(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=Sl(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-=Hf(g,e).xExtra:a[0]===d&&(d+=Hf(g,e).xExtra),a[1]===h?h-=Hf(g,e).yExtra:a[1]===p&&(p+=Hf(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}}},nh=Tu(eh);function rh(t){return _(t)?nh(t):eh(t)}function ih(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 oh(t,e){var n;n=_(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=Il(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Tl(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 ah(t,e){return[t.points,e.points,function(t){return t}]}var sh=null;function ch(t){return function(e){var n=0;return t.map((function(t){return t===sh?e[n++]:t}))}}function lh(t){return t}var uh={matrix:["NNNNNN",[sh,sh,0,0,sh,sh,0,0,0,0,1,0,sh,sh,0,1],lh],matrix3d:["NNNNNNNNNNNNNNNN",lh],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ch([sh,sh,new qu(1)]),lh],scalex:["N",ch([sh,new qu(1),new qu(1)]),ch([sh,new qu(1)])],scaley:["N",ch([new qu(1),sh,new qu(1)]),ch([new qu(1),sh])],scalez:["N",ch([new qu(1),new qu(1),sh])],scale3d:["NNN",lh],skew:["Aa",null,lh],skewx:["A",null,ch([sh,Zu])],skewy:["A",null,ch([Zu,sh])],translate:["Tt",ch([sh,sh,Uu]),lh],translatex:["T",ch([sh,Uu,Uu]),ch([sh,Uu])],translatey:["T",ch([Uu,sh,Uu]),ch([Uu,sh])],translatez:["L",ch([Uu,Uu,sh])],translate3d:["TTL",lh]};function fh(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=uh[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()?Zu:Tf(t)},N:Df,T:Af,L:_f}[h.toUpperCase()](f):{a:Zu,n:l[0],t:Uu}[h]))return[];l.push(d)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function hh(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Jl(Cf(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=Jl(Cf(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=Jl(Cf(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=Jl(Cf(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=Jl(Cf(t.d[0])),f=Jl(Cf(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=Jl(Cf(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=Jl(Cf(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=jf(t.d[0],0,null)||0,n=jf(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=jf(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=jf(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=jf(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=jf(t.d[0],0,null)||0,n=jf(t.d[1],0,null)||0,r=jf(t.d[2],0,null)||0,1];case"perspective":var h=jf(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 dh(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 ph(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}(iu,t))return!1;if(ot(ou,iu),ou[3]=0,ou[7]=0,ou[11]=0,ou[15]=1,Math.abs(ut(ou))<1e-8)return!1;var a,s,c=iu[3],l=iu[7],u=iu[11],f=iu[12],h=iu[13],d=iu[14],p=iu[15];if(0!==c||0!==l||0!==u){if(au[0]=c,au[1]=l,au[2]=u,au[3]=p,!lt(ou,ou))return!1;ct(ou,ou),Jt(i,au,ou)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=iu,(a=su)[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(su[0]),$t(su[0],su[0]),r[0]=Ht(su[0],su[1]),lu(su[1],su[1],su[0],1,-r[0]),n[1]=It(su[1]),$t(su[1],su[1]),r[0]/=n[1],r[1]=Ht(su[0],su[2]),lu(su[2],su[2],su[0],1,-r[1]),r[2]=Ht(su[1],su[2]),lu(su[2],su[2],su[1],1,-r[2]),n[2]=It(su[2]),$t(su[2],su[2]),r[1]/=n[2],r[2]/=n[2],Vt(cu,su[1],su[2]),Ht(su[0],cu)<0)for(var g=0;g<3;g++)n[g]*=-1,su[g][0]*=-1,su[g][1]*=-1,su[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+su[0][0]-su[1][1]-su[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-su[0][0]+su[1][1]-su[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-su[0][0]-su[1][1]+su[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+su[0][0]+su[1][1]+su[2][2],0)),su[2][1]>su[1][2]&&(o[0]=-o[0]),su[0][2]>su[2][0]&&(o[1]=-o[1]),su[1][0]>su[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(hh).reduce(dh)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var gh=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 mh(t){return t.toFixed(6).replace(".000000","")}function yh(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ph(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=ph(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=A(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 gh(t[0],t[1],t[2],e,t[4]).map(mh).join(",")}])}function vh(t){return t.replace(/[xy]/,"")}function bh(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function xh(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?cf(a):cf(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=yh(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=uh[f],m=uh[h],y=void 0;if(s=h,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=yh([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]&&vh(f)===vh(h))y=vh(f),d=g[2](d),p=m[2](p);else{if(!g[1]||!m[1]||bh(f)!==bh(h)){c=[(v=yh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=bh(f),d=g[1](d),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<d.length;M++){v=Pf(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 wh=Tu((function(t){if(_(t)){if("text-anchor"===t)return[cf(0,"px"),cf(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:[Af(Mh(e[0])),Af(Mh(e[1]))]}return[cf(t[0]||0,"px"),cf(t[1]||0,"px")]}));function Mh(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Eh=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:uf.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:uf.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:uf.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:uf.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:uf.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:uf.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:uf.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:uf.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:uf.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:uf.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:uf.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:uf.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:uf.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:uf.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:uf.FILTER},{n:"clipPath",syntax:uf.DEFINED_PATH},{n:"textPath",syntax:uf.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:uf.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===Wl.CIRCLE||t===Wl.ELLIPSE?"center":t===Wl.TEXT?"text-anchor":"left top"},l:!0,syntax:uf.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===Wl.CIRCLE||t===Wl.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:uf.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:uf.COORDINATE},{n:"cy",int:!0,d:"0",syntax:uf.COORDINATE},{n:"cz",int:!0,d:"0",syntax:uf.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:uf.COORDINATE},{n:"y",int:!0,d:"0",syntax:uf.COORDINATE},{n:"z",int:!0,d:"0",syntax:uf.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:uf.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:uf.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:uf.COORDINATE},{n:"y1",int:!0,l:!0,syntax:uf.COORDINATE},{n:"z1",int:!0,l:!0,syntax:uf.COORDINATE},{n:"x2",int:!0,l:!0,syntax:uf.COORDINATE},{n:"y2",int:!0,l:!0,syntax:uf.COORDINATE},{n:"z2",int:!0,l:!0,syntax:uf.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:uf.PATH,p:50},{n:"points",int:!0,l:!0,syntax:uf.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:uf.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:uf.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:uf.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:uf.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:uf.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:uf.NUMBER,d:function(t){return t===Wl.PATH||t===Wl.POLYGON||t===Wl.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:uf.MARKER},{n:"markerEnd",syntax:uf.MARKER},{n:"markerMid",syntax:uf.MARKER},{n:"markerStartOffset",syntax:uf.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:uf.LENGTH,l:!0,int:!0,d:"0"}],Oh=Eh.filter((function(t){return!!t.l})).map((function(t){return t.n})),kh={},Sh=new WeakMap,_h=function(){function t(t){var e=this;this.runtime=t,Eh.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){ve([t.n],ye(t.a||[]),!1).forEach((function(e){kh[e]=t}))},t.prototype.unregisterMetadata=function(t){delete kh[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<Oh.length;c++)if(Oh[c]in e){s=!0;break}return e.fill&&(t.parsedStyle.fill=Of(e.fill)),e.stroke&&(t.parsedStyle.stroke=Of(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Of(e.shadowColor)),e.filter&&(t.parsedStyle.filter=If(e.filter)),y(e.radius)||(t.parsedStyle.radius=Nf(e.radius,4)),y(e.lineDash)||(t.parsedStyle.lineDash=Nf(e.lineDash,2)),e.points&&(t.parsedStyle.points=oh(e.points,t)),""===e.path&&(t.parsedStyle.path=fe({},ff)),e.path&&(t.parsedStyle.path=rh(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=Nf(e.anchor,2)),e.transform&&(t.parsedStyle.transform=fh(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=wh(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!==Wl.CIRCLE&&t.nodeName!==Wl.ELLIPSE||y(e.cx)&&y(e.cy))&&(t.nodeName!==Wl.RECT&&t.nodeName!==Wl.IMAGE&&t.nodeName!==Wl.GROUP&&t.nodeName!==Wl.HTML&&t.nodeName!==Wl.TEXT&&t.nodeName!==Wl.MESH||y(e.x)&&y(e.y)&&y(e.z))&&(t.nodeName!==Wl.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=kh[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=kh[t],i=e;if((""===e||y(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=rf(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=rf(e):s&&s.parser&&(i=s.parser(e,n))}return i},t.prototype.computeProperty=function(t,e,n){var r=kh[t],i="g-root"===n.id,o=e;if(r){var a=r.syntax,s=r.inh,c=r.d;if(e instanceof Fu){var l=e.value;if("unset"===l&&(l=s&&!i?"inherit":"initial"),"initial"===l)y(c)||(e=this.parseProperty(t,Wu(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 Fu?e.value:e}return o},t.prototype.postProcessProperty=function(t,e,n){var r=kh[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=Sh.get(t);n||(Sh.set(t,[]),n=Sh.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=Sh.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=Sh.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Sh.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 fu),r.renderBounds||(r.renderBounds=new fu);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===Wl.TEXT?delete i.anchor:e===Wl.MESH&&(i.anchor[2]=.5);var _=[(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(_,m);var A=e===Wl.POLYLINE||e===Wl.POLYGON||e===Wl.PATH?Math.SQRT2:.5;if(v&&!v.isNone){var T=((b||0)+(x||0))*A;m[0]+=T,m[1]+=T}if(r.renderBounds.update(_,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,Xl(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?jf(k[0],0,t):0),H=(W?-1:1)*(k?jf(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=kh[t];return!!e&&e.inh},t}(),Ah=function(){function t(){this.parser=Tf,this.parserWithCSSDisabled=null,this.mixer=Ff}return t.prototype.calculator=function(t,e,n,r){return Cf(n)},t}(),Th=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Fu&&(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}(),Ph=function(){function t(){this.parser=Of,this.parserWithCSSDisabled=Of,this.mixer=kf}return t.prototype.calculator=function(t,e,n,r){return n instanceof Fu?"none"===n.value?of:af:n},t}(),Ch=function(){function t(){this.parser=If}return t.prototype.calculator=function(t,e,n){return n instanceof Fu?[]:n},t}();function Nh(t){var e=t.parsedStyle.fontSize;return y(e)?null:e}var Lh=function(){function t(){this.parser=Af,this.parserWithCSSDisabled=null,this.mixer=Ff}return t.prototype.calculator=function(t,e,n,r,i){var o;if(T(n))return n;if(!qu.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===wu.kPercentage)return 0;if(n.unit===wu.kEms){if(r.parentNode){if(s=Nh(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===wu.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=Nh(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),jh=function(){function t(){this.mixer=Gf}return t.prototype.parser=function(t){var e=Lf(T(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}(),Rh=function(){function t(){this.mixer=Gf}return t.prototype.parser=function(t){var e=Lf(T(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}(),Ih=rt();function Bh(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||[Uu,Uu];e.translateLocal(s[0].value,s[1].value,0)}else if("translatex"===i){s=o||[Uu];e.translateLocal(s[0].value,0,0)}else if("translatey"===i){s=o||[Uu];e.translateLocal(0,s[0].value,0)}else if("translatez"===i){s=o||[Uu];e.translateLocal(0,0,s[0].value)}else if("translate3d"===i){s=o||[Uu,Uu,Uu];e.translateLocal(s[0].value,s[1].value,s[2].value)}else if("rotate"===i){var c=o||[Zu];e.rotateLocal(0,0,Cf(c[0]))}else if("rotatex"===i){c=o||[Zu];e.rotateLocal(Cf(c[0]),0,0)}else if("rotatey"===i){c=o||[Zu];e.rotateLocal(0,Cf(c[0]),0)}else if("rotatez"===i){c=o||[Zu];e.rotateLocal(0,0,Cf(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(Jl(l[0]),Jl(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(Jl(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],Jl(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(Ih,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([Ih],ye(o.map((function(t){return t.value}))),!1)),Ih[12]+=n,Ih[13]+=r,e.setLocalTransform(Ih))})),e.getLocalTransform()}var Dh=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 Wl.CIRCLE:case Wl.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 Wl.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 Wl.RECT:case Wl.IMAGE:case Wl.GROUP:case Wl.HTML:case Wl.TEXT:case Wl.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!==Wl.PATH&&t.nodeName!==Wl.POLYLINE&&t.nodeName!==Wl.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)Bh(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}(Lh),Fh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Fu&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),zh=function(){function t(){this.mixer=Ff,this.parser=Df,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Gh=function(){function t(){this.parser=Df,this.parserWithCSSDisabled=null,this.mixer=zf(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===Wl.LINE||i===Wl.PATH||i===Wl.POLYLINE){var o=n.getPoint(r);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},t}(),Wh=function(){function t(){this.parser=Df,this.parserWithCSSDisabled=null,this.mixer=zf(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),$h=function(){function t(){this.parser=rh,this.parserWithCSSDisabled=rh,this.mixer=ih}return t.prototype.calculator=function(t,e,n){return n instanceof Fu&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new vu(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===Wl.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}(),Hh=function(){function t(){this.parser=oh,this.mixer=ah}return t.prototype.postProcessor=function(t,e){if((t.nodeName===Wl.POLYGON||t.nodeName===Wl.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(r,i)}},t}(),Vh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=zf(0,1/0),e}return ue(e,t),e}(Lh),Yh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Fu?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),qh=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}(),Uh={},Xh=0;var Kh="undefined"!=typeof window&&void 0!==window.document;function Zh(t){return!!t.getAttribute}function Qh(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 Jh(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 td(t,e){if(Kh)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ed={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},nd="object"==typeof performance&&performance.now?performance:Date;function rd(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 id=1,od="object"==typeof self&&self.self==self?self:"object"==typeof Hc&&Hc.global==Hc?Hc:{},ad=Date.now(),sd={},cd=Date.now(),ld=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-cd,r=n>16?0:16-n,i=id++;return sd[i]=t,Object.keys(sd).length>1||setTimeout((function(){cd=e;var t=sd;sd={},Object.keys(t).forEach((function(e){return t[e](od.performance&&"function"==typeof od.performance.now?od.performance.now():Date.now()-ad)}))}),r),i},ud=function(t){delete sd[t]},fd=function(t){return"string"!=typeof t?ld:""===t?od.requestAnimationFrame:od[t+"RequestAnimationFrame"]},hd=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!!fd(t)})),dd=fd(hd),pd=function(t){return"string"!=typeof t?ud:""===t?od.cancelAnimationFrame:od[t+"CancelAnimationFrame"]||od[t+"CancelRequestAnimationFrame"]}(hd);od.requestAnimationFrame=dd,od.cancelAnimationFrame=pd;var gd=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}(),md=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}(),yd=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}(),vd=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}(),bd=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],xd=/([\"\'])[^\'\"]+\1/;var wd=function(){function t(){this.parser=fh,this.parserWithCSSDisabled=fh,this.mixer=xh}return t.prototype.calculator=function(t,e,n,r){return n instanceof Fu?[]:n},t.prototype.postProcessor=function(t){Bh(t.parsedStyle.transform,t)},t}(),Md=function(){this.parser=wh},Ed=function(){function t(){this.parser=Df}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=Ku.Z_INDEX_CHANGED)}},t}(),Od=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),kd=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Sd=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}(),_d=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Ad=function(){function t(){}return t.prototype.update=function(t){if(t.points&&x(t.points.points)){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}}return{width:0,height:0}},t}(),Td=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&&!_(n)&&(a||(a=n.width,t.width=a),s||(s=n.height,t.height=s)),{width:a,height:s}},t}(),Pd=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 Cd,Nd=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 yu,this.page=new yu,this.canvas=new yu,this.viewport=new yu,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(bu)},t}(),Ld=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new yu,e.movement=new yu,e.offset=new yu,e.global=new yu,e.screen=new yu,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(bu)},e}(Nd),jd=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}(Ld),Rd=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}(Ld),Id=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}(Nd),Bd=function(){function t(){this.emitter=new Yc}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=Wu(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=Wu(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=Wu(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=Wu(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Id(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}(),Dd=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===Wl.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===Wl.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===Wl.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(bu)},e.prototype.lookupNamespaceURI=function(t){throw new Error(bu)},e.prototype.lookupPrefix=function(t){throw new Error(bu)},e.prototype.normalize=function(){throw new Error(bu)},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}(Bd),Fd=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new Yc,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=nd.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")}Dd.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"),Dd.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&&Dd.isNode(o)&&o.parentNode;f&&f!==(Dd.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Dd.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!==(Dd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)h.currentTarget=h.target,n.notifyTarget(h),r&&n.notifyTarget(h,"mouseenter"),Dd.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!==(Dd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),Dd.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!==(Dd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),Dd.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"),Dd.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 yu(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 yu(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 yu(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 yu((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++)Dd.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(jd);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(Rd);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(Rd);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(jd);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=nd.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||Dd.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Zh(e)&&e.getAttribute("cursor");if(n)return n;e=Dd.isNode(e)&&e.parentNode}},t}(),zd=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||rp.offscreenCanvas)this.canvas=t||rp.offscreenCanvas,this.context=this.canvas.getContext("2d",fe({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",fe({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",fe({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(Cd||(Cd={}));var Gd,Wd=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 yd,initAsync:new gd,dirtycheck:new vd,cull:new vd,beginFrame:new yd,beforeRender:new yd,render:new yd,afterRender:new yd,endFrame:new yd,destroy:new yd,pick:new md,pickSync:new vd,pointerDown:new yd,pointerUp:new yd,pointerMove:new yd,pointerOut:new yd,pointerOver:new yd,pointerWheel:new yd,pointerCancel:new yd,click:new yd}}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(Cd.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(Cd.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!==Ku.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;Qh(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(Qh)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Cd.DISPLAY_OBJECT_CHANGED)},t}(),$d=/\[\s*(.*)=(.*)\s*\]/,Hd=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}(),Vd=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}(Nd);function Yd(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"}(Gd||(Gd={}));var qd,Ud,Xd,Kd=new Vd(Gd.REPARENT,null,"","","",0,"",""),Zd=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new Id(Gd.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=Ku.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(Kd)},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=Ku.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;)Yd(n),n=n.parentNode;e&&t.forEach((function(t){Yd(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 Vd(Gd.ATTR_MODIFIED,n,e,e,t,Vd.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(fu.isEmpty(r))return null;var i=n||new fu;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 fu},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 fu).update(r.center,r.halfExtents))})),e){var a=Jh(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new fu),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(!fu.isEmpty(n)){var r=new fu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);fu.isEmpty(i)||(r=new fu).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 vu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new vu((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}(),Qd={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]},Jd=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,tp=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),ep=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),np=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!ep.exec(n)&&!tp.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=Qd.MetricsString+Qd.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Qd.BaselineSymbol).width),c=Qd.HeightMultiplier*s;s=s*Qd.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=T(e)&&"".concat(e,"px")||"16px",s=n.split(","),c=s.length-1;c>=0;c--){var l=s[c].trim();!xd.test(l)&&bd.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 vu(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,_=k,A=0;A<k;A++){var T=y(d[p][A]);if(S+T+v>f){_=A;break}S+=T}d[p]=(d[p]||"").slice(0,_)+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&&Qd.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&Qd.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||!Jd.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(!Jd.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}(),rp={},ip=(Ud=new Td,Xd=new Ad,(qd={})[Wl.CIRCLE]=new Od,qd[Wl.ELLIPSE]=new kd,qd[Wl.RECT]=Ud,qd[Wl.IMAGE]=Ud,qd[Wl.GROUP]=Ud,qd[Wl.LINE]=new Sd,qd[Wl.TEXT]=new Pd(rp),qd[Wl.POLYLINE]=Xd,qd[Wl.POLYGON]=Xd,qd[Wl.PATH]=new _d,qd[Wl.HTML]=null,qd[Wl.MESH]=null,qd),op=function(){var t,e=new Ph,n=new Lh;return(t={})[uf.PERCENTAGE]=null,t[uf.NUMBER]=new zh,t[uf.ANGLE]=new Ah,t[uf.DEFINED_PATH]=new Th,t[uf.PAINT]=e,t[uf.COLOR]=e,t[uf.FILTER]=new Ch,t[uf.LENGTH]=n,t[uf.LENGTH_PERCENTAGE]=n,t[uf.LENGTH_PERCENTAGE_12]=new jh,t[uf.LENGTH_PERCENTAGE_14]=new Rh,t[uf.COORDINATE]=new Dh,t[uf.OFFSET_DISTANCE]=new Gh,t[uf.OPACITY_VALUE]=new Wh,t[uf.PATH]=new $h,t[uf.LIST_OF_POINTS]=new Hh,t[uf.SHADOW_BLUR]=new Vh,t[uf.TEXT]=new Yh,t[uf.TEXT_TRANSFORM]=new qh,t[uf.TRANSFORM]=new wd,t[uf.TRANSFORM_ORIGIN]=new Md,t[uf.Z_INDEX]=new Ed,t[uf.MARKER]=new Fh,t}();rp.CameraContribution=Au,rp.AnimationTimeline=null,rp.EasingFunction=null,rp.offscreenCanvasCreator=new zd,rp.nativeHTMLMap=new WeakMap,rp.sceneGraphSelector=new Hd,rp.sceneGraphService=new Zd(rp),rp.textService=new np(rp),rp.geometryUpdaterFactory=ip,rp.CSSPropertySyntaxFactory=op,rp.styleValueRegistry=new _h(rp),rp.layoutRegistry=null,rp.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Hc?Hc:{},rp.enableCSSParsing=!0,rp.enableDataset=!1,rp.enableStyleSyntax=!0;var ap=0,sp=new Vd(Gd.INSERTED,null,"","","",0,"",""),cp=new Vd(Gd.REMOVED,null,"","","",0,"",""),lp=new Id(Gd.DESTROY),up=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entity=ap++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:Xu.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=rp.enableCSSParsing?{anchor:Ju,opacity:Ju,fillOpacity:Ju,strokeOpacity:Ju,fill:Ju,stroke:Ju,transform:Ju,transformOrigin:Ju,visibility:Ju,pointerEvents:Ju,lineWidth:Ju,lineCap:Ju,lineJoin:Ju,increasedLineWidthForHitTesting:Ju,fontSize:Ju,fontFamily:Ju,fontStyle:Ju,fontWeight:Ju,fontVariant:Ju,textAlign:Ju,textBaseline:Ju,textTransform:Ju,zIndex:Ju,filter:Ju,shadowType:Ju}: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(bu)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return rp.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),sp.relatedNode=this,t.dispatchEvent(sp),t},e.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},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 cp.relatedNode=this,t.dispatchEvent(cp),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),rp.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 rp.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return rp.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return rp.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return rp.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return rp.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return rp.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return rp.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(rp.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(lp),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return rp.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return rp.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return rp.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return rp.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return rp.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 rp.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Hu(t);return e=this.attributes[n],rp.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(bu)},e.prototype.getAttributeNode=function(t){throw new Error(bu)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(bu)},e.prototype.hasAttributeNS=function(t,e){throw new Error(bu)},e.prototype.removeAttributeNS=function(t,e){throw new Error(bu)},e.prototype.removeAttributeNode=function(t){throw new Error(bu)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(bu)},e.prototype.setAttributeNode=function(t){throw new Error(bu)},e.prototype.setAttributeNodeNS=function(t){throw new Error(bu)},e.prototype.toggleAttribute=function(t,e){throw new Error(bu)},e}(Dd);function fp(t){return!!(null==t?void 0:t.nodeName)}var hp,dp=new Vd(Gd.ATTR_MODIFIED,null,null,null,null,Vd.MODIFICATION,null,null),pp={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:""},gp={anchor:[0,0],fill:of,stroke:of,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},mp=fe(fe({},gp),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),yp=ve(ve([],ye(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),vp="data-",bp=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||Wl.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,rp.enableCSSParsing?gp:mp,r.config.initialParsedStyle),rp.enableCSSParsing&&Object.assign(r.attributes,pp),r.initAttributes(r.config.style);var i=rp.globalThis.Proxy?rp.globalThis.Proxy:function(){};return rp.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(vp).concat(Gu(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(vp).concat(Gu(e)),n),!0}})),rp.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];fp(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};rp.enableCSSParsing&&(n.usedAttributes=yp);var r={};for(var i in t){r[Hu(i)]=t[i]}rp.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=Hu(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];rp.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(dp.relatedNode=this,dp.prevValue=o,dp.newValue=e,dp.attrName=t,dp.prevParsedValue=a,dp.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(dp):(dp.target=this,this.ownerDocument.defaultView.dispatchEvent(dp,!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 vu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),rp.sceneGraphService.setOrigin(this,Ql(t,e,n)),this},e.prototype.getOrigin=function(){return rp.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),rp.sceneGraphService.setPosition(this,Ql(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),rp.sceneGraphService.setLocalPosition(this,Ql(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),rp.sceneGraphService.translate(this,Ql(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),rp.sceneGraphService.translateLocal(this,Ql(t,e,n)),this},e.prototype.getPosition=function(){return rp.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return rp.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=Ql(t,e=e||t,n=n||t)),rp.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Ql(t,e=e||t,n=n||t)),rp.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return rp.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return rp.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return tu(ye(eu(jt(),rp.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return tu(ye(eu(jt(),rp.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return rp.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return rp.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return y(e)&&y(n)?rp.sceneGraphService.rotateLocal(this,0,0,t):rp.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return y(e)&&y(n)?rp.sceneGraphService.rotate(this,0,0,t):rp.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return rp.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return rp.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return rp.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return rp.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return rp.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return rp.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return rp.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return rp.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return rp.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){rp.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(eu(jt(),c),3),u=l[0],f=l[2];return nu(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=ye(ru(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(ru(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(){rp.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){rp.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}(up),xp=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;rp.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},wp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Wl.CIRCLE,style:rp.enableCSSParsing?fe({cx:"",cy:"",r:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:rp.enableCSSParsing?null:[lf,lf]}},r))||this}return ue(e,t),e}(bp),Mp=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:rp.enableCSSParsing?fe({x:"",y:""},r):fe({},r)},i))||this).isCustomElement=!0,n}return ue(e,t),e}(bp),Ep=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Wl.ELLIPSE,style:rp.enableCSSParsing?fe({cx:"",cy:"",rx:"",ry:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:rp.enableCSSParsing?null:[lf,lf]}},r))||this}return ue(e,t),e}(bp),Op=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Wl.GROUP,style:rp.enableCSSParsing?fe({x:"",y:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(bp),kp=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:Wl.HTML,style:rp.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 vu(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 fu,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(!fu.isEmpty(e)){var n=new fu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(bp),Sp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Wl.IMAGE,style:rp.enableCSSParsing?fe({x:"",y:"",img:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(bp),_p=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:Wl.LINE,style:fe({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i))||this).markerStartAngle=0,n.markerEndAngle=0;var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&fp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&fp(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&&fp(r)&&(this.markerStartAngle=0,r.remove()),i&&fp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&fp(r)&&(this.markerEndAngle=0,r.remove()),i&&fp(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&&fp(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=Pl(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 yu(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 Tl(t.x1,t.y1,t.x2,t.y2)},e}(bp),Ap=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:Wl.PATH,style:rp.enableCSSParsing?fe({path:"",miterLimit:""},r):fe({},r),initialParsedStyle:rp.enableCSSParsing?null:{miterLimit:4,path:fe({},ff)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&fp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&fp(c)&&n.placeMarkerMid(c),s&&fp(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&&fp(r)&&(this.markerStartAngle=0,r.remove()),i&&fp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&fp(r)&&(this.markerEndAngle=0,r.remove()),i&&fp(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&&fp(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&&fp(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 Wf(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 yu(c[0],c[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Wf(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}(bp),Tp=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:Wl.POLYGON,style:rp.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!0},r):fe({},r),initialParsedStyle:rp.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&&fp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&fp(c)&&n.placeMarkerMid(c),s&&fp(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&&fp(r)&&(this.markerStartAngle=0,r.remove()),i&&fp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&fp(r)&&(this.markerEndAngle=0,r.remove()),i&&fp(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,s=e.defX,c=e.defY,l=(a||{}).points,u=t?n:r;if(u&&fp(u)&&l){var f,h,d,p,g,m,y;if(p=l[0][0]-s,g=l[0][1]-c,t)h=l[1][0]-l[0][0],d=l[1][1]-l[0][1],m=i||0,y=this.markerStartAngle;else{var v=l.length;this.parsedStyle.isClosed?(h=l[v-1][0]-l[0][0],d=l[v-1][1]-l[0][1]):(p=l[v-1][0]-s,g=l[v-1][1]-c,h=l[v-2][0]-l[v-1][0],d=l[v-2][1]-l[v-1][1]),m=o||0,y=this.markerEndAngle}f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*m,g+Math.sin(f)*m)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points,r=e.defX,i=e.defY,o=(n||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&fp(t)&&o)for(var a=1;a<(this.parsedStyle.isClosed?o.length:o.length-1);a++){var s=o[a][0]-r,c=o[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s,c)}},e}(bp),Pp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Wl.POLYLINE,style:rp.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!1},n):fe({},n),initialParsedStyle:rp.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=Pl(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 yu(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}(Tp),Cp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Wl.RECT,style:rp.enableCSSParsing?fe({x:"",y:"",width:"",height:"",radius:""},n):fe({},n)},r))||this}return ue(e,t),e}(bp),Np=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Wl.TEXT,style:rp.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:rp.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}(bp),Lp=function(){function t(){this.registry={},this.define(Wl.CIRCLE,wp),this.define(Wl.ELLIPSE,Ep),this.define(Wl.RECT,Cp),this.define(Wl.IMAGE,Sp),this.define(Wl.LINE,_p),this.define(Wl.GROUP,Op),this.define(Wl.PATH,Ap),this.define(Wl.POLYGON,Tp),this.define(Wl.POLYLINE,Pp),this.define(Wl.TEXT,Np),this.define(Wl.HTML,kp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),jp=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new rp.AnimationTimeline(e)}catch(t){}var n={};return Eh.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=Wu(i)?i(Wl.GROUP):i)})),e.documentElement=new Op({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?Np:Op);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(bu)},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(xu)},e.prototype.insertBefore=function(t,e){throw new Error(xu)},e.prototype.removeChild=function(t,e){throw new Error(xu)},e.prototype.replaceChild=function(t,e,n){throw new Error(xu)},e.prototype.append=function(){throw new Error(xu)},e.prototype.prepend=function(){throw new Error(xu)},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}(Dd),Rp=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 Id(Gd.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),Ip=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new jd(null),this.rootWheelEvent=new Rd(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 yu(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=ed[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=nd.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}(),Bp=[Wl.CIRCLE,Wl.ELLIPSE,Wl.IMAGE,Wl.RECT,Wl.LINE,Wl.POLYLINE,Wl.POLYGON,Wl.TEXT,Wl.PATH,Wl.HTML],Dp=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(fu.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||uu.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==uu.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===uu.OUTSIDE||n===uu.INSIDE)return n;for(var i=uu.INSIDE,o=Bp.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 uu.OUTSIDE;Ht(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),Fp=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;rp.enableCSSParsing&&rp.styleValueRegistry.recalc(e),rp.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),rp.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){a.addEventListener(Gd.MOUNTED,l),a.addEventListener(Gd.UNMOUNTED,u),a.addEventListener(Gd.ATTR_MODIFIED,s),a.addEventListener(Gd.BOUNDS_CHANGED,c)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Gd.MOUNTED,l),a.removeEventListener(Gd.UNMOUNTED,u),a.removeEventListener(Gd.ATTR_MODIFIED,s),a.removeEventListener(Gd.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"}(hp||(hp={}));var zp=new Id(Gd.MOUNTED),Gp=new Id(Gd.UNMOUNTED),Wp=new Id(hp.BEFORE_RENDER),$p=new Id(hp.RERENDER),Hp=new Id(hp.AFTER_RENDER),Vp=function(t){function e(e){var n=t.call(this)||this;n.Element=bp,n.inited=!1,n.context={},n.document=new jp,n.document.defaultView=n,n.customElements=new Lp;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||Xh++;Uh[n]&&Uh[n].destroy(),Uh[n]=e}}(r,n);var O=a,k=s,S=c;return i&&(S=(S=c||Kh&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,O=a||function(t){var e=td(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=td(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(rp.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=d?d:dd.bind(rp.globalThis),n.cancelAnimationFrame=null!=p?p:pd.bind(rp.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in rp.globalThis,n.supportsPointerEvents=null!=m?m:!!rp.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof rp.globalThis.TouchEvent},n.isMouseEvent=null!=E?E:function(t){return!rp.globalThis.MouseEvent||t instanceof rp.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof rp.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 rp.CameraContribution;i.clipSpaceNearZ=n,i.setType(du.EXPLORING,pu.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(Su,(function(){r.context.renderingContext.renderReasons.add(Cd.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 Id(hp.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 Id(hp.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===gu.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Id(hp.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(Wp),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent($p)})),this.dispatchEvent(Hp)},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 Hl,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Ip,new Fp,new Rp([new Dp])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(fe(fe({},rp),this.context)),this.context.renderingService=new Wd(rp,this.context),this.context.eventService=new Fd(rp,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 Id(hp.READY))})):r.dispatchEvent(new Id(hp.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new Id(hp.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(rp)}))},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(rp)})),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(Gp):(Gp.target=t,this.dispatchEvent(Gp,!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(zp):(zp.target=t,this.dispatchEvent(zp,!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}(Bd),Yp=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=Zl(e),this.relAzimuth=Zl(t),this.relRoll=Zl(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===du.EXPLORING){var r=ee(te(),[1,0,0],Jl((this.rotateWorld?1:-1)*this.relElevation)),i=ee(te(),[0,1,0],Jl((this.rotateWorld?1:-1)*this.relAzimuth)),o=ee(te(),[0,0,1],Jl(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===du.ORBITING||this.type===du.EXPLORING?this._getPosition():this.type===du.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=Ql(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===du.ORBITING||this.type===du.EXPLORING?this._getDistance():this.type===du.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 rp.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=_(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=T(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,d=i.onframe,p=void 0===d?void 0:d;if(0===c)return this.syncFromLandmark(r),void(h&&h());this.cancelLandmarkAnimation();var g,m=r.position,y=r.focalPoint,v=r.zoom,b=r.roll,x=u||rp.EasingFunction(a),w=function(){n.setFocalPoint(y),n.setPosition(m),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),h&&h()},M=function(t){void 0===g&&(g=t);var e=t-g;if(e>c)w();else{var r,i,o=x(e/c),a=jt(),s=jt();Yt(a,n.focalPoint,y,o),Yt(s,n.position,m,o),i=n.roll*(1-o)+b*o,r=n.zoom*(1-o)+v*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),Kt(a,y)+Kt(s,m)<=.01&&null==v&&null==b?w():(n.computeMatrix(),n.triggerUpdate(),e<c&&(p&&p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(M)))}};this.canvas.requestAnimationFrame(M)}},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}(Au);rp.CameraContribution=Yp;var qp=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}(Nd),Up=0,Xp=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(Up++),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 qp(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(bu)},t.prototype.addEventListener=function(t,e,n){throw new Error(bu)},t.prototype.removeEventListener=function(t,e,n){throw new Error(bu)},t.prototype.dispatchEvent=function(t){throw new Error(bu)},t.prototype.commitStyles=function(){throw new Error(bu)},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 qp(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 qp(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Kp=.1,Zp="function"==typeof Float32Array,Qp=function(t,e){return 1-3*e+3*t},Jp=function(t,e){return 3*e-6*t},tg=function(t){return 3*t},eg=function(t,e,n){return((Qp(e,n)*t+Jp(e,n))*t+tg(e))*t},ng=function(t,e,n){return 3*Qp(e,n)*t*t+2*Jp(e,n)*t+tg(e)},rg=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=Zp?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=eg(o*Kp,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Kp;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Kp,s=ng(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=ng(e,n,r);if(0===o)return e;e-=(eg(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=eg(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+Kp,t,n)};return function(t){return 0===t||1===t?t:eg(a(t),e,r)}},ig=function(t){return Math.pow(t,2)},og=function(t){return Math.pow(t,3)},ag=function(t){return Math.pow(t,4)},sg=function(t){return Math.pow(t,5)},cg=function(t){return Math.pow(t,6)},lg=function(t){return 1-Math.cos(t*Math.PI/2)},ug=function(t){return 1-Math.sqrt(1-t*t)},fg=function(t){return t*t*(3*t-2)},hg=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)},dg=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=A(Number(i),1,10),c=A(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)},pg=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=A(o,.1,1e3),s=A(s,.1,1e3),l=A(l,.1,1e3),f=A(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},gg=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)(A(t,0,1)*i)/i},mg=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 rg(r,i,o,a)(t)},yg=rg(.42,0,1,1),vg=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},bg=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}},xg=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}},wg={steps:gg,"step-start":function(t){return gg(t,[1,"start"])},"step-end":function(t){return gg(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":mg,ease:function(t){return mg(t,[.25,.1,.25,1])},in:yg,out:vg(yg),"in-out":bg(yg),"out-in":xg(yg),"in-quad":ig,"out-quad":vg(ig),"in-out-quad":bg(ig),"out-in-quad":xg(ig),"in-cubic":og,"out-cubic":vg(og),"in-out-cubic":bg(og),"out-in-cubic":xg(og),"in-quart":ag,"out-quart":vg(ag),"in-out-quart":bg(ag),"out-in-quart":xg(ag),"in-quint":sg,"out-quint":vg(sg),"in-out-quint":bg(sg),"out-in-quint":xg(sg),"in-expo":cg,"out-expo":vg(cg),"in-out-expo":bg(cg),"out-in-expo":xg(cg),"in-sine":lg,"out-sine":vg(lg),"in-out-sine":bg(lg),"out-in-sine":xg(lg),"in-circ":ug,"out-circ":vg(ug),"in-out-circ":bg(ug),"out-in-circ":xg(ug),"in-back":fg,"out-back":vg(fg),"in-out-back":bg(fg),"out-in-back":xg(fg),"in-bounce":hg,"out-bounce":vg(hg),"in-out-bounce":bg(hg),"out-in-bounce":xg(hg),"in-elastic":dg,"out-elastic":vg(dg),"in-out-elastic":bg(dg),"out-in-elastic":xg(dg),spring:pg,"spring-in":pg,"spring-out":vg(pg),"spring-in-out":bg(pg),"spring-out-in":xg(pg)},Mg=function(t){return wg[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)]||wg.linear},Eg=function(t){return t},Og=1,kg=.5,Sg=0;function _g(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Ag="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Tg=new RegExp("cubic-bezier\\("+Ag+","+Ag+","+Ag+","+Ag+"\\)"),Pg=/steps\(\s*(\d+)\s*\)/,Cg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Ng(t){var e=Tg.exec(t);if(e)return rg.apply(void 0,ve([],ye(e.slice(1).map(Number)),!1));var n=Pg.exec(t);if(n)return _g(Number(n[1]),Sg);var r=Cg.exec(t);return r?_g(Number(r[1]),{start:Og,middle:kg,end:Sg}[r[2]]):Mg(t)}function Lg(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 jg=0,Rg=1,Ig=2,Bg=3;function Dg(t,e,n){var r=function(t,e,n){if(null===e)return jg;var r=n.endTime;return e<Math.min(n.delay,r)?Rg:e>=Math.min(n.delay+t+n.endDelay,r)?Ig:Bg}(t,e,n),i=function(t,e,n,r,i){switch(r){case Rg:return"backwards"===e||"both"===e?0:null;case Bg:return n-i;case Ig:return"forwards"===e||"both"===e?t:null;case jg: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!==Rg&&(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!==Ig||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===Ig&&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 Fg(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(zg(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Ng(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:Wg(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)zg(n)&&t.setAttribute(n,null)}}function zg(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Gg=function(t,e,n){return function(r){var i=$g(t,e,r);return!rp.enableCSSParsing&&T(i)?i:n(i)}};function Wg(t,e,n,r){var i=kh[t];if(i&&i.syntax&&i.int){var o=rp.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(rp.enableCSSParsing){var c=rp.styleValueRegistry.parseProperty(t,e,r),l=rp.styleValueRegistry.parseProperty(t,n,r);a=rp.styleValueRegistry.computeProperty(t,c,r),s=rp.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=Gg.apply(void 0,ve([],ye(f),!1));return function(t){return 0===t?e:1===t?n:h(t)}}}}return Gg(!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 Hg=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Eg,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=Ng(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function Vg(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 Yg="backwards|forwards|both|none".split("|"),qg="reverse|alternate|alternate-reverse".split("|");function Ug(t,e){return function(t,e){var n=new Hg;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===Yg.indexOf(t[e]))return;if("direction"===e&&-1===qg.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 Xg=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Ug(n,!1),this.timing.effect=this,this.timing.activeDuration=Lg(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Vg(e,this.timing),this.interpolations=Fg(this.normalizedKeyframes,this.timing,this.target);var i=rp.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=Dg(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=Vg(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 Kg(t,e){return Number(t.id)-Number(e.id)}var Zg=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(Kg),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 Xg(t,e,n),i=new Xp(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(Kg),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 Qg(t){return new Jg([t],null,t,t.ownerDocument)}rp.EasingFunction=Ng,rp.AnimationTimeline=Zg;class Jg{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 Jg(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Jg(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 Jg([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 Jg(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 Jg(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Jg([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 Jg([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 Jg([],r,this._parent,this._document),new Jg(i,null,this._parent,this._document),new Jg(o,null,this._parent,this._document),new Jg([],a,this._parent,this._document),new Jg(s,null,this._parent,this._document)];return new Jg(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Jg(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Jg.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 Jg([],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 tm(t,e,n){return Math.max(e,Math.min(t,n))}function em(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function nm(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function rm(t,e,n,r,i){const o=hs(ls(r,e))+Math.PI,a=hs(ls(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function im(t,e,n,r="y",i="between",o=!1){const a="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,o),c=vr(a),[l,u]=kn(c,(t=>a[t])),f=new na({domain:[l,u],range:[0,100]}),h=t=>f.map(a[t]),d={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`};return`linear-gradient(${s}deg, ${c.sort(((t,e)=>h(t)-h(e))).map(d[i]||d.between).join(",")})`}function om(t){const[e,n,r,i]=t;return[i,e,n,r]}function am(t,e,n){const[r,i,,o]=Rc(t)?om(e):e,[a,s]=n,c=t.getCenter(),l=ds(ls(r,c)),u=ds(ls(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:fs(o,c),outerRadius:fs(r,c)}}function sm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function cm(t,e){if(!Ic(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function lm(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,minHeight:y=-1/0}=i,v=he(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Ic(r)&&!Dc(r)){const n=!!Rc(r),[i,,o]=n?om(e):e,[a,b]=i,[x,w]=ls(o,i),M=(x>0?a:a+x)+s,E=(w>0?b:b+w)+c,O=Math.abs(x)-(s+l),k=Math.abs(w)-(c+u),S=n?tm(O,y,1/0):tm(O,g,m),_=n?tm(k,g,m):tm(k,y,1/0),A=n?M:M-(S-O)/2,T=n?E-(_-k)/2:E-(_-k);return Qg(t.createElement("rect",{})).style("x",A).style("y",T).style("width",S).style("height",_).style("radius",[d,p,h,f]).call(nm,v).node()}const{y:b,y1:x}=n,w=r.getCenter(),M=am(r,e,[b,x]),E=Js().cornerRadius(a).padAngle(o*Math.PI/180);return Qg(t.createElement("path",{})).style("path",E(M)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(nm,v).node()}Jg.registry={g:Op,rect:Cp,circle:wp,path:Ap,text:Np,ellipse:Ep,image:Sp,line:_p,polygon:Tp,polyline:Pp,html:kp};const um=(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:_=S,insetRight:A=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:N,minHeight:L}=a,j=he(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,B=[i?m:w,i?y:M,o?v:E,o?b:O],D=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Rc(s)&&D.push(D.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(D.map(((t,e)=>[t,B[e]])))),{inset:S,insetLeft:_,insetRight:A,insetBottom:T,insetTop:P,minWidth:C,maxWidth:N,minHeight:L});return Qg(lm(c,e,r,s,F)).call(nm,h).style("fill","transparent").style(n,R).style(sm(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(nm,j).node()}};um.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fm=(t,e)=>um(Object.assign({colorAttribute:"fill"},t),e);fm.props=Object.assign(Object.assign({},um.props),{defaultMarker:"square"});const hm=(t,e)=>um(Object.assign({colorAttribute:"stroke"},t),e);function dm(t,e,n){const[r,i,o,a]=t;if(Rc(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]}hm.props=Object.assign(Object.assign({},um.props),{defaultMarker:"hollowSquare"});const pm=(t,e)=>{const{adjustPoints:n=dm}=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=!!Rc(i),[p,g,m,y]=d?om(h):h,{color:v=l,opacity:b}=e,x=oc().curve(wc)([p,g,m,y]);return Qg(o.createElement("path",{})).call(nm,u).style("path",x).style("fill",v).style("fillOpacity",b).call(nm,r).node()}};function gm(t,e,n){const[r,i,o,a]=t;if(Rc(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]}pm.props={defaultMarker:"square"};const mm=(t,e)=>pm(Object.assign({adjustPoints:gm},t),e);function ym(t){const e="function"==typeof t?t:t.render;return class extends Mp{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}mm.props={defaultMarker:"square"};const vm=ym((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;Qg(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(nm,r),Qg(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(nm,i)}));const bm=(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=cm(c,e),x=Rc(c),w=r&&m?im(m,y,v,r,i,x):p,M=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let E;if(Ic(c)){const t=c.getCenter();E=e=>uc(oc().curve(sc)).angle(((n,r)=>ds(ls(e[r],t)))).radius(((n,r)=>fs(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else E=oc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[O,k]=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),S=ur(M,"connect"),_=!!k.length;if(!_||a&&!Object.keys(S).length)return Qg(l.createElement("path",{})).style("d",E(O)||[]).call(nm,M).node();if(_&&!a)return Qg(l.createElement("path",{})).style("d",E(t)).call(nm,M).node();return Qg(new vm).style("style1",Object.assign(Object.assign({},M),S)).style("style2",M).style("d1",(A=k,A.map(E).join(","))).style("d2",E(t)).node();var A}};bm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Ic(n)?wc:nc;return bm(Object.assign({curve:i},t),e)(...r)}};xm.props=Object.assign(Object.assign({},bm.props),{defaultMarker:"line"});const wm=(t,e)=>{const n=he(t,["alpha"]),{coordinate:r}=e;return(...t)=>{const i=Ic(r)?bc:Rc(r)?Pc:Tc;return bm(Object.assign({curve:i},n),e)(...t)}};wm.props=Object.assign(Object.assign({},bm.props),{defaultMarker:"smooth"});const Mm=(t,e)=>bm(Object.assign({curve:jc},t),e);Mm.props=Object.assign(Object.assign({},bm.props),{defaultMarker:"hv"});const Em=(t,e)=>bm(Object.assign({curve:Lc},t),e);Em.props=Object.assign(Object.assign({},bm.props),{defaultMarker:"vh"});const Om=(t,e)=>bm(Object.assign({curve:Nc},t),e);function km(t,e,n,r,i){const o=hs(ls(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=us(e,s),h=us(n,c),d=us(h,l),p=us(n,l),g=ls(p,c),m=ls(n,c),y=ls(e,s),v=ls(y,u),b=ls(e,u),x=ls(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()}Om.props=Object.assign(Object.assign({},bm.props),{defaultMarker:"hvh"});const Sm=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=he(i,["color"]),l=Vs();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)&&km(l,n,r,i,a)}return Qg(n.createElement("path",{})).call(nm,c).style("fill",a||s).style("d",l.toString()).call(nm,t).node()}};Sm.props=Object.assign(Object.assign({},bm.props),{defaultMarker:"line"});const _m=(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"]];_m.style=["fill"];const Am=_m.bind(void 0);Am.style=["stroke","lineWidth"];const Tm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Tm.style=["fill"];const Pm=Tm.bind(void 0);Pm.style=["fill"];const Cm=Tm.bind(void 0);Cm.style=["stroke","lineWidth"];const Nm=(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"]]};Nm.style=["fill"];const Lm=Nm.bind(void 0);Lm.style=["stroke","lineWidth"];const jm=(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"]]};jm.style=["fill"];const Rm=jm.bind(void 0);Rm.style=["stroke","lineWidth"];const Im=(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"]]};Im.style=["fill"];const Bm=Im.bind(void 0);Bm.style=["stroke","lineWidth"];const Dm=(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"]]};Dm.style=["fill"];const Fm=Dm.bind(void 0);Fm.style=["stroke","lineWidth"];const zm=(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"]]};zm.style=["fill"];const Gm=zm.bind(void 0);Gm.style=["stroke","lineWidth"];const Wm=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];Wm.style=["stroke","lineWidth"];const $m=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];$m.style=["stroke","lineWidth"];const Hm=(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]];Hm.style=["stroke","lineWidth"];const Vm=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];Vm.style=["stroke","lineWidth"];const Ym=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Ym.style=["stroke","lineWidth"];const qm=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];qm.style=["stroke","lineWidth"];const Um=qm.bind(void 0);Um.style=["stroke","lineWidth"];const Xm=(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]];Xm.style=["stroke","lineWidth"];const Km=(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]];Km.style=["stroke","lineWidth"];const Zm=(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]];Zm.style=["stroke","lineWidth"];const Qm=(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]];Qm.style=["stroke","lineWidth"];const Jm=(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]];Jm.style=["stroke","lineWidth"];const ty=new Map([["bowtie",zm],["cross",$m],["dash",Um],["diamond",Nm],["dot",qm],["hexagon",Dm],["hollowBowtie",Gm],["hollowDiamond",Lm],["hollowHexagon",Fm],["hollowPoint",Am],["hollowSquare",Cm],["hollowTriangle",Rm],["hollowTriangleDown",Bm],["hv",Km],["hvh",Qm],["hyphen",Ym],["line",Wm],["plus",Vm],["point",_m],["rect",Pm],["smooth",Xm],["square",Tm],["tick",Hm],["triangleDown",Im],["triangle",jm],["vh",Zm],["vhv",Jm]]);const ey=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=he(t,["colorAttribute","symbol","mode"]),a=ty.get(r)||ty.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||zc(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 Qg(c.createElement("path",{})).call(nm,l).style("fill","transparent").style("d",a(m,y,b)).style("lineWidth",h).style("transform",p).style("stroke",d).style(sm(t),g).style(n,d).call(nm,o).node()}};ey.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ny=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);ny.props=Object.assign({defaultMarker:"hollowBowtie"},ey.props);const ry=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);ry.props=Object.assign({defaultMarker:"hollowDiamond"},ey.props);const iy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);iy.props=Object.assign({defaultMarker:"hollowHexagon"},ey.props);const oy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);oy.props=Object.assign({defaultMarker:"hollowPoint"},ey.props);const ay=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);ay.props=Object.assign({defaultMarker:"hollowSquare"},ey.props);const sy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);sy.props=Object.assign({defaultMarker:"hollowTriangle"},ey.props);const cy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);cy.props=Object.assign({defaultMarker:"hollowTriangleDown"},ey.props);const ly=(t,e)=>ey(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);ly.props=Object.assign({defaultMarker:"bowtie"},ey.props);const uy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);uy.props=Object.assign({defaultMarker:"cross"},ey.props);const fy=(t,e)=>ey(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);fy.props=Object.assign({defaultMarker:"diamond"},ey.props);const hy=(t,e)=>ey(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);hy.props=Object.assign({defaultMarker:"hexagon"},ey.props);const dy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);dy.props=Object.assign({defaultMarker:"hyphen"},ey.props);const py=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);py.props=Object.assign({defaultMarker:"line"},ey.props);const gy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);gy.props=Object.assign({defaultMarker:"plus"},ey.props);const my=(t,e)=>ey(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);my.props=Object.assign({defaultMarker:"point"},ey.props);const yy=(t,e)=>ey(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);yy.props=Object.assign({defaultMarker:"square"},ey.props);const vy=(t,e)=>ey(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);vy.props=Object.assign({defaultMarker:"tick"},ey.props);const by=(t,e)=>ey(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);by.props=Object.assign({defaultMarker:"triangle"},ey.props);const xy=(t,e)=>ey(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);xy.props=Object.assign({defaultMarker:"triangleDown"},ey.props);const wy=(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=Vs();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*fs(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 Qg(o.createElement("path",{})).call(nm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(nm,i).node()}};function My(t,e){e(t),t.children&&t.children.forEach((function(t){t&&My(t,e)}))}function Ey(t){ky(t,!0)}function Oy(t){ky(t,!1)}function ky(t,e){var n=e?"visible":"hidden";My(t,(function(t){t.attr("visibility",n)}))}wy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Sy=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(Gd.INSERTED,(function(){Oy(r)})),r}return ue(e,t),e}(Op);function _y(t){var e=t.appendChild(new Sy({class:"offscreen"}));return Oy(e),e}var Ay=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=_y(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Np);function Ty(t){return t*Math.PI/180}function Py(t){return Number((180*t/Math.PI).toPrecision(5))}var Cy=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 Ny(t,e){return m(t)?t.apply(void 0,ve([],ye(e),!1)):t}var Ly,jy=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},Ry=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?Ry(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)}))},Iy=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)Ry(t,e[r]);return t},By=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},Dy=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=_(t)?t:t.style.text.toString(),r=e||Fy(t),i=r.fontSize,o=r.fontFamily,a=r.fontWeight,s=r.fontStyle,c=r.fontVariant;return Ly||(Ly=document.createElement("canvas").getContext("2d")),Ly.font=[s,c,a,"".concat(i,"px"),o].join(" "),Ly.measureText(n).width}),(function(t,e){return[_(t)?t:t.style.text.toString(),Object.values(e||Fy(t)).join()].join("")}),4096),Fy=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 zy(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Gy(t,e){var n=zy(t);n&&n.attr(e)}function Wy(t,e,n){void 0===n&&(n="..."),Gy(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function $y(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 Hy(t){return"function"==typeof t?t():_(t)||T(t)?new Ay({style:{text:String(t)}}):t}function Vy(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 Yy(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 qy=function(t,e){return function(n){return t*(1-n)+e*n}};function Uy(t,e){return"number"==typeof t&&"number"==typeof e?qy(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]=Uy(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]=Uy(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 Xy(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 Cy(e,n,r-e,i-n)}var Ky=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 Cy(o,a,n,r)})),v=Xy(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=Cy.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));Xy(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=Cy.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=Cy.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},Zy=function(t,e,n){return[]};function Qy(t,e){return[t[0]*e,t[1]*e]}function Jy(t,e){return[t[0]+e[0],t[1]+e[1]]}function tv(t,e){return[t[0]-e[0],t[1]-e[1]]}function ev(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function nv(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function rv(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function iv(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 ov(t,e){return+t.toPrecision(e)}function av(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 sv(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=ev(h,y=t[p]),d=nv(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=Qy(v=tv(a=t[n?(p+1)%m:p+1],o),e);var b=rv(y,o),x=rv(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=Qy(v,-b),E=Qy(v,x);c=Jy(y,M),s=ev(s=Jy(y,E),nv(a,y)),s=nv(s,ev(a,y)),c=ev(c=Jy(y,M=Qy(M=tv(s,y),-b/x)),nv(o,y)),s=Jy(y,E=Qy(E=tv(y,c=nv(c,ev(o,y))),x/b)),f&&(c=ev(c=nv(c,h),d),s=ev(s=nv(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 cv=["$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 lv(t){return cv.includes(t)}function uv(t){var e={};for(var n in t)lv(n)&&(e[n]=t[n]);return e}function fv(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 hv=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:Op,rect:Cp,circle:wp,path:Ap,text:Ay,ellipse:Ep,image:Sp,line:_p,polygon:Tp,polyline:Pp,html:kp},t}();function dv(t){return new hv([t],null,t,t.ownerDocument)}function pv(t){if(T(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 gv(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 mv(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 yv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function vv(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 bv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function xv(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(bv(o,"show")&&bv(vv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(yv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(yv(e)),"")]=a;else if(!bv(o,"show")&&bv(o,e)!==n){var s=vv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function wv(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(yv(i))]=o,t}),{})}function Mv(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 Ev(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 Ov(){ky(this,"hidden"!==this.attributes.visibility)}var kv=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,Iy({},{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=_y(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&&Ov.call(this)},e.prototype.update=function(t,e){var n;return this.attr(Iy({},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}(Mp),Sv=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"]]},_v=Sv,Av=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Tv=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Pv=Tv;var Cv=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function Nv(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(_(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 Lv=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=Nv(r);Vy(!!s,dv(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.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(kv);Lv.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]]})),Lv.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),Lv.registerSymbol("line",Av),Lv.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),Lv.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]]})),Lv.registerSymbol("circle",Sv),Lv.registerSymbol("point",_v),Lv.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"]]})),Lv.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"]]})),Lv.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"]]})),Lv.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),Lv.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"]]})),Lv.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"]]})),Lv.registerSymbol("line",Av),Lv.registerSymbol("dot",Tv),Lv.registerSymbol("dash",Pv),Lv.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]]})),Lv.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]]})),Lv.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]]})),Lv.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]]})),Lv.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 jv=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 Op({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes.columns;dv(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(Iy({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(bp),Rv=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 Op),n.areasGroup=n.appendChild(new Op),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(Iy({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){dv(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){dv(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}(bp);function Iv(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 Bv(t,e){if(void 0===e&&(e=!1),t.length<=2)return Iv(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=sv(n,!1);return e?a.unshift(ve(["M"],ye(t[r-1]),!1)):a.unshift(ve(["M"],ye(t[0]),!1)),a}function Dv(t,e,n){var r=G(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function Fv(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 zv(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 Gv=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 T(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?zv(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=xv(this.attributes,"area"),a=xv(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),A(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=Bv(o),s=void 0;if(0===i)s=Dv(a,e,n);else{var c=Bv(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=Iv(t[i]),a=void 0;if(0===i)a=Dv(o,e,n);else{var s=Iv(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 Dv(e?Bv(t):Iv(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return fe({stroke:t.getColor(n),path:i?Bv(e):Iv(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=xv(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=zv(s));var c=this.createScales(s),l=c.x,u=c.y,f=ye(Fv(s),2),h=f[0],d=f[1],p=new na({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)?dv(n).select(r):dv(n).append(i)).attr("className","container").node();var o=t.type,a="spark".concat(o),s="line"===o?this.linesStyle:this.columnsStyle;dv(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new Rv({className:a,style:s}):new jv({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(Fv(t),2),d=h[0],p=h[1],g=new na({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 na({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Do({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}(kv);function Wv(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 $v(t,e){t?t.finished.then(e):e()}function Hv(t,e){"update"in t?t.update(e):t.attr(e)}function Vv(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Hv(t,{style:e.slice(-1)[0]}),null)}function Yv(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?Vv(t,[r,i],fe({fill:"both"},n)):(Hv(t,i),null)}function qv(t,e){return t.style.opacity||(t.style.opacity=1),Yv(t,{opacity:0},e)}var Uv={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Xv={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Kv={orientation:"horizontal",showLabel:!0,type:"start"},Zv=jy({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Qv=jy({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Jv=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=dv(e).maybeAppendByClassName(Qv.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(Qv.iconLine,"-1"),"line").styles(fe({x1:f,x2:f,y1:d,y2:p},s)),u.maybeAppendByClassName("".concat(Qv.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}(kv),tb=function(t){function e(e){return t.call(this,e,Kv)||this}return ue(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=xv(this.attributes,"label"),i=r.transform,o=ye(Mv(he(r,["transform"]),[]),2),a=o[0],s=o[1],c=dv(t).maybeAppendByClassName(Qv.labelGroup,"g").styles(s),l=fe(fe({},Xv),a),u=l.text,f=he(l,["text"]);Vy(!!n,c,(function(t){e.label=t.maybeAppendByClassName(Qv.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},Uv),xv(this.attributes,"icon")),o=this.attributes.iconShape,a=void 0===o?function(){return new Jv({style:i})}:o;dv(t).maybeAppendByClassName(Qv.iconGroup,"g").selectAll(Qv.icon.class).data([a]).join((function(t){return t.append("string"==typeof a?a:function(){return a(r)}).attr("className",Qv.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}(kv),eb=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},wv(Kv,"handle")),wv(Uv,"handleIcon")),wv(Xv,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal($y(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($y(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 Id("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=xv(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(pv(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(Zv.selection.class).each((function(n,r){Yv(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Yv(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Yv(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=xv(this.attributes,"track");this.trackShape=dv(t).maybeAppendByClassName(Zv.track,"rect").styles(fe(fe({},this.shape),e))},e.prototype.renderBrushArea=function(t){var e=this.attributes.brushable;this.brushArea=dv(t).maybeAppendByClassName(Zv.brushArea,"rect").styles(fe({fill:"transparent",cursor:e?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this;Vy("horizontal"===this.attributes.orientation,dv(t).maybeAppendByClassName(Zv.sparklineGroup,"g"),(function(t){var n=e.sparklineStyle;t.maybeAppendByClassName(Zv.sparkline,(function(){return new Gv({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(Zv.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 tb({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Zv.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=dv(t).maybeAppendByClassName(Zv.foreground,"g");var i=xv(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(Zv.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",Zv.selection.name).call(o).each((function(t,e){var n=this;1===e?(a.selectionShape=dv(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 ov(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 ov(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,A(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=xv(this.attributes,"handle"),c=xv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new Ay({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,_=E.height,A=l+u;if("horizontal"===i){var T=A+g/2;if("start"===t)v=O-A-g>0?-T:T;else v=w-O-S-A>g?T:-T}else{var P=m+A;b="start"===t?k-u>m?-P:A:M-(k+_)-u>m?P:-A}return{x:v,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=xv(this.attributes,"handleLabel");return fe(fe(fe({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=xv(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({},wv(this.getHandleIconStyle(),"icon")),wv(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 Id(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}(kv),nb=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 Id("scroll",r)),n.dispatchEvent(new Id("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($y(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Id("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Id("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Id("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Id("trackMouseleave",{detail:t.detail}))},n}return ue(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return pv(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 A(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=xv(this.attributes,"track"),s=xv(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()},wv(a,"track")),wv(s,"selection"));this.slider=dv(t).maybeAppendByClassName("scrollbar",(function(){return new eb({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(A(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}(kv),rb={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 Ap({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({},rb,{style:{type:"arc"}}),Y({},rb,{style:{}});var ib=jy({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"),ob=jy({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function ab(t){return t.reduce((function(t,e,n){return t.push(ve([0===n?"M":"L"],ye(e),!1)),t}),[])}function sb(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 ab(t);if(!o)return[];var a=rv(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):ab(t)}function cb(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=ye([sb(t,n),sb(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([rv(h,o),rv(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 lb=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=dv(e).maybeAppendByClassName(ob.lineGroup,"g"),o=dv(e).maybeAppendByClassName(ob.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:sb(t.points,n)}}));return t.selectAll(ob.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Ny(uv(fe({path:t.path},r)),[t,e,a]);this.attr(fe({class:ob.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return Yv(this,Ny(uv(fe({path:t.path},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=qv(this,i.exit);return $v(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=cb(u[0],u[1],n);c.push({path:f,fill:s(l)})}return t.selectAll(ob.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Ny(t,[t,e,c]);this.attr(n)})).attr("className",ob.region.name)}),(function(t){return t.transition((function(t,e){return Yv(this,Ny(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=qv(this,r.exit);return $v(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return ve(ve([],ye(a),!1),ye(s),!1)},e}(kv);function ub(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=ye(t,2);return[n[0],Ny(n[1],e)]})))}function fb(t,e){return e&&m(e)?t.filter(e):t}function hb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function db(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 iv([a[0],a[1]])}var s=Ty(hb(t,e));return[-Math.sin(s),Math.cos(s)]}function pb(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(db(t,n),"positive"!==e)}function gb(t,e){return pb(t,e.labelDirection,e)}function mb(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=Ty(hb(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function yb(t){return 0===db(0,t)[1]}function vb(t){return 0===db(0,t)[0]}function bb(t,e){return e-t==360}function xb(t,e,n,r,i){var o=e-t,a=ye([i,i],2),s=a[0],c=a[1],l=ye([Ty(t),Ty(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(bb(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 wb(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(ib.line.class).data([{path:xb.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",ib.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=Uy(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=xb.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 Mb(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 Eb(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(ib.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(ib.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Yv(this,Mb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Yv(this,Mb(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:ib.line.name}]);var M=ye(s,2),E=M[0],O=M[1],k=p-f,S=g-h,_=ye([f+k*E,h+S*E],2),A=_[0],T=_[1],P=ye([f+k*O,h+S*O],2),C=P[0],N=P[1];return w([{line:[[f+y,h+v],[A,T]],className:ib.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:ib.lineSecond.name}])}function Ob(t,e,n){var r,i=e.type,o=xv(e,"line");return r="linear"===i?Eb(t,e,av(o,"arrow"),n):wb(t,e,av(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(ib.line.class):a?t.select(ib.lineSecond.class):t.select(ib.line.class),!o||!s||"arc"===n.type&&bb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Hy(s);f.attr(r),fv(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function kb(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Sb(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=ye(mb(i,e),2),a=o[0],s=o[1],c=ye(Qy(function(t,e){return pb(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function _b(t,e,n,r){var i=xv(n,"grid"),o=i.type,a=i.areaFill,s=kb(n),c=fb(e,n.gridFilter),l="segment"===o?Sb(c,n):function(t,e){var n=e.gridControlAngles,r=kb(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(mb(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=Ty(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 Ny(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(ib.grid.class).data([1]).join((function(t){return t.append((function(){return new lb({style:u})})).attr("className",ib.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var Ab=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 Tb(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=Pb(t),f=u.width,h=u.height,d=0,p=0,g=o,m=a,y=zy(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(pv(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,_=x[3],A=new Ab((d+=o)-(void 0===_?O:_),(p+=a)-M,d+f+O,p+h+S);return t.setEulerAngles(n),A.rotatedPoints(Ty(n),g,m)}function Pb(t){return t.__bbox__?t.__bbox__:t.getBBox()}function Cb(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 Nb(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 Lb(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=Nb((r=h)[0],r[1],i[0]),a=Nb(r[0],r[1],i[1]),s=Nb(i[0],i[1],r[0]),c=Nb(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&Cb(r,i[0])||0===a&&Cb(r,i[1])||0===s&&Cb(i,r[0])||0===c&&Cb(i,r[1])){if(0===Nb(h[0],e,h[1]))return Cb(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function jb(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 Rb(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(pv(e),4),p=d[0],g=d[1],m=d[2],y=d[3];return new Ab(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(vb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=O[0],S=O[1],_=O[2],A=O[3],T=Qy(gb(0,t),i),P=new Ab(b,x,M,E);return P.x1+=A,P.y1+=k,P.x2+=S+T[0],P.y2+=_+T[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 Lb([[r,o],[i,o],[i,a],[r,a]],Tb(e,n))}(c,t)},u=function(t,e){return!t||!function(t,e,n){var r,i,o=Tb(t,n).flat(1),a=Tb(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(jb(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,pv(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 Ib(t,e){return void 0===e&&(e={}),y(t)?0:"number"==typeof t?t:Math.floor(Dy(t,e))}var Bb=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Oy(t),!1)}))};var Db=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=Bb,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 Pb(t).width}))),!1));if("linear"===n.type&&(yb(n)||vb(n))){var m=gv(t[0]).left,y=gv(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&&Rb((l=c?ve(ve([c],ye(p),!1),[s],!1):ve([s],ye(p),!1),l.filter(By)),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),Rb(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=Fy(r.getTextShape(t[0])),p=Ib(u,d),g=a?Ib(a,d):p,m=Ib(c,d);(y(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return Pb(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=Rb(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&&yb(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),Rb(t,n,f).length<1)return;l&&g(h)}}]]);function Fb(){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 zb(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function Gb(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 Wb(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=gb(t.value,n),a=db(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Yy(e,-90,90)||(e+=180),e}(Py("perpendicular"===i?Gb([1,0],o):Gb([a[0]<0?-1:1,0],a)))}function $b(t,e,n){var r=n.type,i=n.labelAlign,o=gb(t,n),a=zb(e),s=zb(Py(Gb([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?(Yy(a,0,90,!1,!0)||Yy(a,0,90)||Yy(a,270,360))&&(c="start"):90===s?Yy(a,0,90,!1,!0)?c="start":(Yy(a,90,180)||Yy(a,270,360))&&(c="end"):270===s?Yy(a,0,90,!1,!0)?c="end":(Yy(a,90,180)||Yy(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(Yy(a,0,90)||Yy(a,270,360))&&(c="end")):c="center":"parallel"===i?l=Yy(s,0,180,!0)?"top":"bottom":"horizontal"===i?Yy(s,90,270,!1)?c="end":(Yy(s,270,360,!1)||Yy(s,0,90))&&(c="start"):"perpendicular"===i&&(c=Yy(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function Hb(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=Ny(s,[t,c,e]),u=ye([gb(t.value,n),Fb(a,o)],2),f=ye(Jy(Qy(u[0],l+(1===u[1]?Ny(r?i:0,[t,c,e]):0)),mb(t.value,n)),2);return{x:f[0],y:f[1]}}function Vb(t,e){"text"===t.nodeName&&t.attr(e)}function Yb(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=Db.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:Oy,show:Ey,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=$b(e.__data__.value,t,n),i=e.querySelector(ib.labelItem.class);i&&Vb(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Wy(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"),Gy(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function qb(t,e,n,r,i){var o=n.indexOf(e),a=dv(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return Hy(Ny(i,[t,e,n,gb(t.value,r)]))}:function(){return Hy(t.label||"")}}(e,o,n,i)).attr("className",ib.labelItem.name).node(),s=ye(Mv(ub(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=he(l,["transform"]);Ev(t,u);var h=Wb(e,t,i);return t.setLocalEulerAngles(+h),Vb(a,fe(fe({},$b(e.value,h,i)),c)),Ev(t,u),t.attr(f),a}function Ub(t,e,n,r){var i=fb(e,n.labelFilter),o=xv(n,"label");return t.selectAll(ib.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",ib.label.name).transition((function(t){return qb(this,t,e,o,n),this.attr(Hb(t,e,n)),this.__bbox__=t.bbox,null})).call((function(){return Yb.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&&Oy(t),e.isVisible()&&Ey(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 $v(O,i),[E,O]}(this.querySelector(ib.labelItem.class),qb(this,t,e,o,n),r.update),a=Yv(this,Hb(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(By);i=function(){return Yb.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=qv(this.childNodes[0],r.exit);return $v(e,(function(){return dv(t).remove()})),e}))})).transitions()}function Xb(t,e){return pb(t,e.tickDirection,e)}function Kb(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,Ny(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 Zb(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=Xb(e.value,i),s="line";return m(o)&&(s=function(){return Ny(o,[e,n,r,a])}),t.append(s).attr("className",ib.tickItem.name)}(dv(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=Xb(t.value,o),c=Kb(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=ye(Mv(ub(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(mb(t.value,r),2);return Yv(this,{x:s[0],y:s[1]},o)}var Qb=jy({text:"text"},"title");function Jb(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function tx(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 ex=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(Qb.text.class);if(!a)return new Cy(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=ye(pv(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=Jb(r);if(x.includes("i"))return new Cy(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(pv(o),4),M=w[0],E=w[1],O=w[2],k=w[3],S=ye([k+E,M+O],2),_=S[0],A=S[1];return new Cy(m+k,y+M,v-_,b-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Cy(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=he(t,["width","height","position","spacing"]),i=ye(Mv(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=Jb(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;Vy(!!r.text,dv(e),(function(t){n.title=t.maybeAppendByClassName(Qb.text,"text").styles(i).call(tx,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(kv);function nx(t,e,n,r,i){var o=ye(Mv(xv(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);Ev(t.node(),u);var f=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=Jb(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(pv(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,_=ye("start"===i?[k,S]:[S,k],2),A=_[0],T=_[1],P=ye(Qy(iv([-T[0]+A[0],-T[1]+A[1]]),w),2),C=P[0],N=P[1];return{x:A[0]+C,y:A[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}}(dv(n._offscreen||n.querySelector(ib.mainGroup.class)),e,r),h=f.x,d=f.y,p=Yv(e.node(),{x:h,y:d},i);return Ev(t.node(),u),p}function rx(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Vy(i,e.maybeAppendByClassName(ib.lineGroup,"g"),(function(e){return Ob(e,t,r)}))||[],c=Vy(o,e.maybeAppendByClassName(ib.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=fb(e,n.tickFilter),o=xv(n,"tick");return t.selectAll(ib.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",ib.tick.name).transition((function(t,e){return Zb.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Zb.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=qv(this.childNodes[0],r.exit);return $v(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=Vy(a,e.maybeAppendByClassName(ib.labelGroup,"g"),(function(e){return Ub(e,n,t,r)}))||[];return ve(ve(ve([],ye(s),!1),ye(c),!1),ye(l),!1).filter((function(t){return!!t}))}var ix=function(t){function e(e){return t.call(this,e,rb)||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=Wv(void 0===n?a:n),d=Vy(c,dv(e).maybeAppendByClassName(ib.gridGroup,"g"),(function(e){return _b(e,f,t,h)}))||[],p=dv(e).maybeAppendByClassName(ib.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&rx(t,dv(this.offscreenGroup),f,Wv(!1));var g=rx(t,dv(p.node()),f,h),m=Vy(s,dv(e).maybeAppendByClassName(ib.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(ib.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 Hy(i)})).attr("className",ib.title.name).transition((function(){return nx(dv(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return nx(dv(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}(kv),ox=jy({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"),ax=function(t){function e(e){var n=t.call(this,e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:Cv(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 Op({class:ox.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Op({class:ox.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return ue(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return A(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 Cy(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=Vv(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return $v(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:A(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:A(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(ox.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)?Ey(e):Oy(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),_=S[0],A=S[1],T=v.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,M),r.setLocalPosition(O,k),n.setLocalPosition(_,A)},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(ox.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(ox.controller,"g");if(ky(s.node(),a),a){var c=xv(this.attributes,"button"),l=xv(this.attributes,"pageNum"),u=ye(Mv(c),2),f=u[0],h=u[1],d=f.size,p=he(f,["size"]),g=!s.select(ox.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(ox.prevBtnGroup,"g").styles(h);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(ox.prevBtn,"path"),v=s.maybeAppendByClassName(ox.nextBtnGroup,"g").styles(h);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(ox.nextBtn,"path")].forEach((function(t){t.styles(fe(fe({},p),{transformOrigin:"center"})),fv(t.node(),d,!0)}));var b=s.maybeAppendByClassName(ox.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(ox.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=dv(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(Gd.INSERTED,e),this.playWindow.addEventListener(Gd.REMOVED,e)},e}(kv);function sx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}Lv.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"]]})),Lv.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]]})),Lv.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 cx=jy({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 lx=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new wp({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(pv(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(pv(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(cx.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=xv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(cx.markerGroup,"g").style("zIndex",0),Vy(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(cx.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),dv(i).styles(r)):(i.remove(),dv(o).attr("className",cx.marker.name).styles(r),t.appendChild(o)):(dv(o).attr("className",cx.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),fv(e.markerGroup.node(),e.scaleSize,!0)}))},e.prototype.renderLabel=function(t){var e=xv(this.attributes,"label"),n=e.text,r=he(e,["text"]);this.labelGroup=t.maybeAppendByClassName(cx.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(cx.label,(function(){return Hy(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=xv(this.attributes,"value"),r=n.text,i=he(n,["text"]);this.valueGroup=t.maybeAppendByClassName(cx.valueGroup,"g").style("zIndex",0),Vy(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(cx.value,(function(){return Hy(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=xv(this.attributes,"background");this.background=t.maybeAppendByClassName(cx.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(cx.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}),Wy(this.labelGroup.select(cx.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:s,y:c}),Wy(this.valueGroup.select(cx.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=dv(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(kv),ux=jy({page:"item-page",navigator:"navigator",item:"item"},"items"),fx=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},hx=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=xv(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],Ny(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&&fx(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&&fx(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 sx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(ux.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(ux.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);dv(t).selectAll(ux.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new lx({style:e})})).attr("className",ux.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 Op({className:ux.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=_(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=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=xv(this.attributes,"nav"),r=Iy({orientation:e},n),i=this;return t.selectAll(ux.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new ax({style:r})})).attr("className",ux.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(dv(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Id(t,{detail:e});this.dispatchEvent(n)},e}(kv),dx=jy({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),px={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},gx=function(t){function e(e){return t.call(this,e,px)||this}return ue(e,t),e.prototype.render=function(t,e){var n=dv(e).maybeAppendByClassName(dx.markerGroup,"g");this.renderMarker(n);var r=dv(e).maybeAppendByClassName(dx.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?sx(r,"horizontalHandle","verticalHandle"):i;Vy(!!o,t,(function(t){var n=xv(e.attributes,"marker"),r=fe({symbol:o},n);e.marker=t.maybeAppendByClassName(dx.marker,(function(){return new Lv({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;Vy(r,t,(function(t){var n,r=xv(e.attributes,"label"),o=r.text,c=he(r,["text"]),l=(null===(n=t.select(dx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=ye(sx(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(dx.label,"text").styles(fe(fe({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(kv),mx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},yx=Iy({},mx,{}),vx=Iy({},mx,wv(px,"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"}),bx=jy({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"),xx=function(t){function e(e){return t.call(this,e,yx)||this}return ue(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=ye(Mv(xv(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(bx.titleGroup,"g").styles(c);var l=fe(fe({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(bx.title,(function(){return new ex({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(Mv(xv(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(bx.itemsGroup,"g").styles(fe({x:n,y:r},c));var u=this;this.itemsGroup.selectAll(bx.items.class).data(["items"]).join((function(t){return t.append((function(){return new hx({style:l})})).attr("className",bx.items.name).each((function(){u.items=dv(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 Cy(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=Jb(r),u=ye(pv(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye(pv(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 Cy(s.x,s.y,c.width+s.width+w+O,Math.max(c.height+k,s.height));if("t"===l[0])return new Cy(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),_=S[0],A=S[1];return new Cy(c.x,c.y,_+s.width+w+O,A+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=dv(e);this.renderTitle(i,n,r),this.renderItems(i,this.availableSpace),this.adjustLayout()},e}(kv),wx={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},Mx=jy({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Ex=function(t){function e(e){var n=t.call(this,e,wx)||this;return n.point=[0,0],n.group=n.appendChild(new Op({})),n.isMutationObserved=!0,n}return ue(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=ye(pv(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 Cy(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=xv(this.attributes,"background");this.background=dv(this.group).maybeAppendByClassName(Mx.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(Mv(xv(this.attributes,"label")),2),i=r[0],o=r[1],a=he(i,["text"]);(this.label=dv(this.group).maybeAppendByClassName(Mx.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Mx.label,(function(){return Hy(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=mv.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?Oy(this):Ey(this)},e.prototype.bindEvents=function(){this.label.on(Gd.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(kv);function Ox(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 kx=jy({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Sx(t){var e=t.orientation,n=t.size,r=t.length;return sx(e,[r,n],[n,r])}function _x(t){var e=t.type,n=ye(Sx(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 Ax(t){return _x(t)}function Tx(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 Of(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(sx(n,"0","270"),")")):""}function Px(t){var e=t.orientation,n=t.range;if(!n)return[];var r=ye(Sx(t),2),i=r[0],o=r[1],a=ye(n,2),s=a[0],c=a[1],l=sx(e,s*i,0),u=sx(e,0,s*o),f=sx(e,c*i,i),h=sx(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var Cx=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=xv(e,"track");t.maybeAppendByClassName(kx.track,"path").styles(fe({path:_x(e)},n))}(dv(e).maybeAppendByClassName(kx.trackGroup,"g"),t),function(t,e){var n=xv(e,"selection"),r=Tx(e),i=t.maybeAppendByClassName(kx.selection,"path").styles(fe({path:Ax(e),fill:r},n)),o=i.maybeAppendByClassName(kx.clipPath,"path").styles({path:Px(e)}).node();i.style("clip-path",o)}(dv(e).maybeAppendByClassName(kx.selectionGroup,"g"),t)},e}(kv);var Nx=function(t){function e(e){var n=t.call(this,e,vx)||this;return n.eventToOffsetScale=new na({}),n.innerRibbonScale=new na({}),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=Ox(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 Cy(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(dv(e));var i=this.availableSpace,o=i.x,a=i.y,s=dv(e).maybeAppendByClassName(bx.contentGroup,"g").styles({x:o,y:a});Vy(!!r,s.maybeAppendByClassName(bx.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(bx.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(bx.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 sx(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=xv(this.attributes,"title"),s=fe(fe({},a),{width:i,height:o,text:r}),c=this;t.selectAll(bx.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new ex({style:s})})).attr("className",bx.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 Cy(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 Cy(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(ib.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Cy(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 Cy(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=xv(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=Iy({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(bx.ribbon,(function(){return new Cx({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(bx.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=xv(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)?gx:tb,u=this;this.handlesGroup.selectAll(bx.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(bx.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(bx.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 Cy(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 Cy(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=xv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(bx.indicator,(function(){return new Ex({})})).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=xv(this.attributes,"tick"),s=xv(this.attributes,"label"),c=s.align,l=Iy(fe({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),wv(a,"tick"),wv(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(bx.label,(function(){return new ix({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=A(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}),Ey(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Oy(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)?ov(.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?Ox(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($y(t)),!1))-c;return A(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 Id("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new Id("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(kv);function Lx(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 jx={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Rx(t){var e;void 0===t&&(t="");var n=Lx(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},jx),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)"},jx),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 Ix=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=Lx(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:Rx(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=Lx(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}(kv),Bx=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[Gd.BOUNDS_CHANGED,Gd.INSERTED,Gd.REMOVED],n.$margin=pv(0),n.$padding=pv(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=pv(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=pv(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 Cy(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 Cy(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:Ky,grid:Zy},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}(Op);function Dx(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 oc()([[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=fs(t,e),i=fs(e,n),o=fs(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 oc()(u)}const Fx=ym((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(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 _;_=v?Qg(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(nm,Object.assign({transform:a,transformOrigin:s},b)).node():Qg(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(nm,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const A=Qg(t).maybeAppend("background","rect").style("zIndex",-1).call(nm,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}}(_,w)).call(nm,d?M:{}).node(),P=Dx(A,S,O,y),C=g&&new Lv({id:"startMarker",style:Object.assign({x:0,y:0},ur(b,"startMarker"))}),N=m&&new Lv({id:"endMarker",style:Object.assign({x:0,y:0},ur(b,"endMarker"))});Qg(t).maybeAppend("connector","path").style("zIndex",0).style("path",P).style("markerStart",C).style("markerEnd",N).call(nm,p?k:{})})),zx=(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 Qg(new Fx).style("x",f).style("y",h).call(nm,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(nm,u).call(nm,t).node()}};zx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gx=ym((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=Qg(t).maybeAppend("marker",(()=>new Lv({}))).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);Qg(t).maybeAppend("text","text").style("x",a).style("y",s).call(nm,e)})),Wx=(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 Qg(new Gx).call(nm,o).style("x",l).style("y",u).call(nm,c).call(nm,n).node()}};Wx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $x=ym((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;Qg(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(nm,i),Qg(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(nm,r)})),Hx=(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=Rc(s),m=cm(s,e),y=r&&h?im(h,d,p,r,void 0,g):f,v=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:y,fill:y}),m&&{transform:m}),a),[b,x]=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),w=ur(v,"connect"),M=!!x.length,E=t=>Qg(c.createElement("path",{})).style("d",t||"").call(nm,v).node();if(Ic(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=ac().curve(sc),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 uc(n())},delete t.lineX0,t.lineEndAngle=function(){return uc(r())},delete t.lineX1,t.lineInnerRadius=function(){return uc(i())},delete t.lineY0,t.lineOuterRadius=function(){return uc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(lc(t)):e()._curve},t}().angle(((t,n)=>ds(ls(r[n],e)))).outerRadius(((t,n)=>fs(r[n],e))).innerRadius(((t,n)=>fs(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!M||o&&!Object.keys(w).length?E(e(b)):M&&!o?E(e(t)):Qg(new $x).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?ac().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):ac().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!M||o&&!Object.keys(w).length?E(e(b)):M&&!o?E(e(t)):Qg(new $x).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};Hx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Vx=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Ic(n)?wc:nc;return Hx(Object.assign({curve:i},t),e)(...r)}};Vx.props=Object.assign(Object.assign({},Hx.props),{defaultMarker:"square"});const Yx=(t,e)=>{const{alpha:n=.5}=t,r=he(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=Ic(i)?bc:yc;return Hx(Object.assign({curve:o.alpha(n)},r),e)(...t)}};Yx.props=Object.assign(Object.assign({},Hx.props),{defaultMarker:"smooth"});const qx=(t,e)=>(...n)=>Hx(Object.assign({curve:Nc},t),e)(...n);qx.props=Object.assign(Object.assign({},Hx.props),{defaultMarker:"hvh"});const Ux=(t,e)=>(...n)=>Hx(Object.assign({curve:Lc},t),e)(...n);Ux.props=Object.assign(Object.assign({},Hx.props),{defaultMarker:"vh"});const Xx=(t,e)=>(...n)=>Hx(Object.assign({curve:jc},t),e)(...n);Xx.props=Object.assign(Object.assign({},Hx.props),{defaultMarker:"hv"});const Kx=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>wy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Kx.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Zx=(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=Vs();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]),Qg(r.createElement("path",{})).call(nm,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(nm,n).node()}};function Qx(t,e,n,r){const i=Vs();if(Ic(n)){const o=n.getCenter(),a=fs(t,o),s=(fs(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),rm(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Rc(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)}Zx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jx=(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=Qx(f,h,i,n);return Qg(o.createElement("path",{})).call(nm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(nm,r).node()}};Jx.props={defaultMarker:"vhv",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,f]=t,h=Vs();if(h.moveTo(u[0],u[1]),Ic(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{rm(h,u,f,ms(u,f),fs(u,f)/2)}return Qg(i.createElement("path",{})).call(nm,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(nm,n).node()}};function ew(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 nw(t={}){return[...ew(t),{name:"title",scale:"identity"}]}function rw(){return[{type:Br,channel:"color"},{type:Ur,channel:["x","y"]}]}function iw(){return[{type:Br,channel:"x"},{type:Ur,channel:["y"]}]}function ow(t={}){return ew(t)}function aw(){return[{type:Wr}]}function sw(t,e){return t.getBandWidth(t.invert(e))}function cw(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?sw(a,r[e]):0,l=d?sw(s,i[e]):0,g=p&&o?(sw(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function lw(t){return parseFloat(t)/100}function uw(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?lw(e)*a:+e,"string"==typeof n?lw(n)*s:+n]]}))]}tw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fw=(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?lw(h)*m:h,d="string"==typeof d?lw(d)*y:d;const v=p-Number(h)/2,b=g-Number(d)/2;return Qg(r.createElement("image",{})).call(nm,s).style("x",v).style("y",b).style("img",l).style("stroke",c).style("transform",f).call(nm,t).style("width",h).style("height",d).node()}};function hw(t,e){const n=Vs();if(Ic(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>fs(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?rm(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)}fw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dw=(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=hw(e,n);return Qg(r.createElement("path",{})).call(nm,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(nm,t).node()}};function pw(t,e){const[n,r,i,o]=t,a=Vs();if(Ic(e)){const t=e.getCenter(),s=fs(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),rm(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),rm(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}dw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gw=(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=pw(t,r);return Qg(i.createElement("path",{})).call(nm,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(nm,n).node()}};function mw(t,e){const n=Vs();if(Ic(e)){const r=e.getCenter(),[i,o]=r,a=hs(ls(t[0],r)),s=hs(ls(t[1],r)),c=fs(r,t[2]),l=fs(r,t[3]),u=fs(r,t[8]),f=fs(r,t[10]),h=fs(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}gw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yw=(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=mw(e,n);return Qg(r.createElement("path",{})).call(nm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(nm,t).node()}};function vw(t,e,n=4){const r=Vs();if(!Ic(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=fs(i,t[3]),c=fs(i,t[8]),l=fs(i,t[10]),u=hs(ls(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}yw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bw=(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=vw(e,n,4);return Qg(r.createElement("path",{})).call(nm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(nm,t).node()}};bw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xw=(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(!Ic(e))return oc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return Js()({startAngle:0,endAngle:2*Math.PI,outerRadius:fs(t[0],n),innerRadius:fs(t[1],n)})}(t,o),g=function(t,e){if(!Ic(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return Qg(a.createElement("path",{})).call(nm,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(nm,i).node()}};function ww(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}xw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Mw=(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(Rc(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 Qg(new Ap).call(nm,f).style("path",function(t){return oc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new Lv({className:"marker",style:Object.assign(Object.assign({},g),{symbol:ww})}):null).call(nm,s).node()}};function Ew(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Ow(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 kw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=am(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=_w(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Sw(c,p,i):ms(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Sw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function _w(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Aw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=am(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:_w(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=Sw(d,p,v);return Object.assign({x:b,y:x},g)}function Tw(t){return void 0===t?null:t}function Pw(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:Tw(o[0]),y:Tw(o[1])}}function Cw(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Pw(0,0,n);return(Bc(r)?kw:Gc(r)?Aw:Ow)(t,e,n,r)}function Nw(t,e,n){const r=am(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function Lw(t,e,n){const r=am(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function jw(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=Lw(e,n,r),d=Math.sin(h)>0?1:-1,p=_w(h,i,o),g={textAlign:d>0||Bc(r)?"start":"end",textBaseline:"middle",rotate:p},m=Nw(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,E]]=function(t,e,n,r,i){const[o,a]=Sw(t,e,n),[s,c]=Sw(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)}Mw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Rw=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=hs(ls(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:Cw,bottomLeft:Cw,bottomRight:Cw,inside:Cw,left:Cw,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?Pw(0,0,n):(Bc(r)?kw:Gc(r)?jw:Ow)(t,e,n,r)},right:Cw,spider:function(t,e,n,r){if(!Gc(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(jw(0,e,n,r),[]),c=r.getCenter(),l=Nw(e,n,r),u=Lw(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(!Gc(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(jw(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(Gc(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=ds([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,m]=Sw(u,d,h);return s.x=g+(o+a)*p,s.y=m,s},top:Cw,topLeft:Cw,topRight:Cw});function Iw(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:Gc(e)?"inside":Rc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=Rw[Ew(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const Bw=(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=Iw(e,o,n,r,t),{rotate:p=0,transform:g=""}=d,m=he(d,["rotate","transform"]);return Qg(new Fx).call(nm,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(nm,h).node()}};Bw.props={defaultMarker:"point"};const Dw=(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 Qg(a.createElement("path",{})).call(nm,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(nm,i).node()}};Dw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fw=(t,e)=>Dw(Object.assign({colorAttribute:"fill"},t),e);Fw.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const zw=(t,e)=>Dw(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);zw.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gw=(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=Vs();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),Qg(n.createElement("path",{})).call(nm,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(nm,t).node()}};function Ww(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}Gw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$(3);const $w=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=Ww(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 Hw(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=Ww(a,t,e).getContext("2d"),l=function(t,e){const n=Ww(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=$w(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=Ww(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const Vw=(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?Hw(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 Qg(f.createElement("image",{})).call(nm,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(nm,c).node()}};Vw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Yw=(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 qw(t,e){return t.getBandWidth(t.invert(e))}Yw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Uw={rect:fm,hollow:hm,funnel:pm,pyramid:mm},Xw=()=>(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=qw(l,i[t]),n=e*(u?qw(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]};Xw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Uw,channels:[...nw({shapes:Object.keys(Uw)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...aw(),{type:hn},{type:Dr}],postInference:[...iw()],interaction:{shareTooltip:!0}};const Kw={rect:fm,hollow:hm},Zw=()=>(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]};Zw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Kw,channels:[...nw({shapes:Object.keys(Kw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...aw(),{type:hn}],postInference:[...iw()],interaction:{shareTooltip:!0}};const Qw={line:xm,smooth:wm,hv:Mm,vh:Em,hvh:Om,trail:Sm},Jw=(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]},tM=(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}))]},eM=()=>(t,e,n,r)=>(Fc(r)?tM:Jw)(t,e,n,r);eM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:Qw,channels:[...nw({shapes:Object.keys(Qw)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...aw(),{type:Jr},{type:$r}],postInference:[...iw(),{type:Br,channel:"color"},{type:Ur,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const nM={hollow:oy,hollowDiamond:ry,hollowHexagon:iy,hollowSquare:ay,hollowTriangleDown:cy,hollowTriangle:sy,hollowBowtie:ny,point:my,plus:gy,diamond:fy,square:yy,triangle:by,hexagon:hy,cross:uy,bowtie:ly,hyphen:dy,line:py,tick:vy,triangleDown:xy},rM=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=cw(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))]))]};rM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:nM,channels:[...nw({shapes:Object.keys(nM)}),{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:[...aw(),{type:Dr},{type:Fr}],postInference:[{type:Gr},...rw()]};const iM={text:zx,badge:Wx},oM=t=>{const{cartesian:e=!1}=t;return e?uw:(e,n,r,i)=>{const{x:o,y:a}=r,s=cw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};oM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:iM,channels:[...nw({shapes:Object.keys(iM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...aw(),{type:Qr},{type:Kr}],postInference:[...rw()]};const aM={cell:fm,hollow:hm},sM=()=>(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]};sM.props={defaultShape:"cell",defaultLabelShape:"label",shape:aM,composite:!1,channels:[...nw({shapes:Object.keys(aM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...aw(),{type:Dr},{type:Fr},{type:Xr}],postInference:[...rw()]};const cM={area:Vx,smooth:Yx,hvh:qx,vh:Ux,hv:Xx},lM=()=>(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]};lM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:cM,channels:[...nw({shapes:Object.keys(cM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...aw(),{type:$r},{type:hn},{type:Xr}],postInference:[...iw()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const uM={link:Kx,arc:tw,smooth:Zx,vhv:Jx},fM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=cw(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]};fM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:uM,channels:[...nw({shapes:Object.keys(uM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...aw(),{type:Yr},{type:qr}],postInference:[...rw()]};const hM={image:fw},dM=t=>{const{cartesian:e}=t;return e?uw:(e,n,r,i)=>{const{x:o,y:a}=r,s=cw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};dM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:hM,channels:[...nw({shapes:Object.keys(hM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...aw(),{type:Qr},{type:Kr}],postInference:[...rw()]};const pM={polygon:dw,ribbon:gw},gM=()=>(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]};gM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:pM,channels:[...nw({shapes:Object.keys(pM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...aw()],postInference:[...rw()]};const mM={box:yw,violin:bw},yM=()=>(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]};yM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:mM,channels:[...nw({shapes:Object.keys(mM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...aw(),{type:Dr}],postInference:[...iw()],interaction:{shareTooltip:!0}};const vM={vector:wy},bM=()=>(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]};bM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:vM,channels:[...nw({shapes:Object.keys(vM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...aw()],postInference:[...rw()]};const xM={line:xw},wM=t=>(e,n,r,i)=>{const{y:o}=r,a=cw(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]};wM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:xM,channels:[...ow({shapes:Object.keys(xM)}),{name:"y",required:!0}],preInference:[...aw(),{type:Hr}],postInference:[]};const MM={line:xw},EM=t=>(e,n,r,i)=>{const{x:o}=r,a=cw(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]};EM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:MM,channels:[...ow({shapes:Object.keys(MM)}),{name:"x",required:!0}],preInference:[...aw(),{type:Vr}],postInference:[]};const OM={connector:Mw},kM=(...t)=>fM(...t);function SM(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 _M(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=SM("x",e,i,r.x),s=SM("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]}}kM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:OM,channels:[...ow({shapes:Object.keys(OM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...aw()],postInference:[]};const AM={range:fm},TM=()=>_M();TM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:AM,channels:[...ow({shapes:Object.keys(AM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...aw()],postInference:[]};const PM={range:fm},CM=()=>_M({extendY:!0});CM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...ow({shapes:Object.keys(PM)}),{name:"x",required:!0}],preInference:[...aw()],postInference:[]};const NM={range:fm},LM=()=>_M({extendX:!0});LM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...ow({shapes:Object.keys(NM)}),{name:"y",required:!0}],preInference:[...aw()],postInference:[]};const jM={path:Fw,hollow:zw},RM=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];RM.props={defaultShape:"path",defaultLabelShape:"label",shape:jM,composite:!1,channels:[...nw({shapes:Object.keys(jM)}),{name:"d",scale:"identity"}],preInference:[...aw()],postInference:[]};const IM=t=>{const{cartesian:e}=t;return e?uw:(e,n,r,i)=>{const{x:o,y:a}=r,s=cw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};IM.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:Yw},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...aw(),{type:Qr},{type:Kr},{type:Zr}]};var BM={},DM={};function FM(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function zM(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 GM(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function WM(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+GM(-t,6):t>9999?"+"+GM(t,6):GM(t,4)}(t.getUTCFullYear())+"-"+GM(t.getUTCMonth()+1,2)+"-"+GM(t.getUTCDate(),2)+(i?"T"+GM(e,2)+":"+GM(n,2)+":"+GM(r,2)+"."+GM(i,3)+"Z":r?"T"+GM(e,2)+":"+GM(n,2)+":"+GM(r,2)+"Z":n||e?"T"+GM(e,2)+":"+GM(n,2)+"Z":"")}function $M(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 DM;if(l)return l=!1,BM;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())!==DM;){for(var f=[];r!==BM&&r!==DM;)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?WM(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=FM(t);return function(r,i){return e(n(r),i,t)}}(t,e):FM(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=zM(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=zM(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function HM(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;VM&&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 VM=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),YM=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 $M(r).parse(e,i?HM:rr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};YM.props={};const qM=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 UM(t){return null!=t&&!Number.isNaN(t)}qM.props={};const XM=t=>{const{callback:e=UM}=t;return t=>t.filter(e)};XM.props={};const KM=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};KM.props={};const ZM=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)))};ZM.props={};const QM=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)),{})))};QM.props={};const JM=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)))};JM.props={};const tE=t=>{const{value:e}=t;return()=>e};tE.props={};const eE=t=>{const{callback:e=rr}=t;return t=>e(t)};eE.props={};const nE=t=>{const{callback:e=rr}=t;return t=>Array.isArray(t)?t.map(e):t};function rE(t){return"string"==typeof t?e=>e[t]:t}nE.props={};const iE=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=rE(s),l=rE(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)),{}))}))};iE.props={};const oE=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};oE.props={};var aE={exports:{}},sE={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}}(sE),function(t){var e=Math.log(2),n=t.exports,r=sE.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)}}}(aE);var cE=aE.exports;const lE=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=cE.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})}))}};lE.props={};const uE=()=>t=>(console.log("G2 data section:",t),t);uE.props={};const fE={density:Gw},hE=()=>(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]};hE.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:fE,channels:[...nw({shapes:Object.keys(fE)}),{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:[...aw(),{type:hn},{type:Dr}],postInference:[...iw()],interaction:{shareTooltip:!0}};const dE={heatmap:Vw},pE=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]}))]]};pE.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:dE,channels:[...nw({shapes:Object.keys(dE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...aw(),{type:Dr},{type:Fr}],postInference:[...rw()]};const gE=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];gE.props={};const mE=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];mE.props={};const yE=t=>new Do(t);yE.props={};const vE=t=>new na(t);vE.props={};const bE=t=>new Ro(t);bE.props={};const xE=t=>new Zo(t);xE.props={};const wE=t=>new ra(t);wE.props={};const ME=t=>new Sa(t);ME.props={};const EE=t=>new la(t);EE.props={};const OE=t=>new oa(t);OE.props={};const kE=t=>new sa(t);kE.props={};const SE=t=>new ha(t);SE.props={};const _E=t=>new ua(t);_E.props={};const AE=t=>new aa(t);AE.props={};const TE=t=>new Ta(t);TE.props={};const PE=t=>new zo(t);function CE({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,lineCap:"round"}},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",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",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",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"}}}PE.props={};const NE=CE({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}),LE=t=>Y({},NE,t);LE.props={};const jE=t=>Y({},LE(),{category10:"category10",category20:"category20"},t);jE.props={};const RE=CE({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}),IE=t=>Y({},RE,{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),BE=t=>Object.assign({},IE(),{category10:"category10",category20:"category20"},t);BE.props={};const DE=CE({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}),FE=t=>Y({},DE,{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 zE(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)]}FE.props={};var GE,WE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $E(t){if(!(e=WE.exec(t)))throw new Error("invalid format: "+t);var e;return new HE({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 HE(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 VE(t,e){var n=zE(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")}$E.prototype=HE.prototype,HE.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 YE={"%":(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)=>VE(100*t,e),r:VE,s:function(t,e){var n=zE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(GE=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")+zE(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function qE(t){return t}var UE,XE,KE=Array.prototype.map,ZE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function QE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?qE:(e=KE.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?qE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(KE.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=$E(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"):YE[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=YE[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?ZE[8+GE/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=$E(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=zE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=ZE[8+r/3];return function(t){return n(i*t)+o}}}}function JE(t,e,n){return t.querySelector(e)?Qg(t).select(e):Qg(t).append(n)}function tO(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function eO(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)}UE=QE({thousands:",",grouping:[3],currency:["$",""]}),XE=UE.format;class nO extends Bx{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 rO extends nO{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function iO(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function oO(t){return"vertical"===t||t===-Math.PI/2}function aO(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 sO(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 cO(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function lO(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function uO(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(Ic(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 na({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(!zc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new na({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new na({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Ic(s)||Rc(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:Bc(s)&&"center"===a||Rc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Rc(s)&&g(a)?1-l:l,label:f(h(em(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(em(e),n,r)),id:String(n)}}))}function fO(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 hO(t,e,n){return!function(t){return Ic(t)&&Rc(t)}(e)&&!Fc(e)&&(void 0===t?!!n.getTicks:t)}function dO(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:oO(o)?10:0,tick:"center"!==r&&void 0}):a}const pO=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?XE(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)}},gO=pO((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=dO(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]=lO(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]=Wc(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),_=uO(i,w,f,r,h,d,s,v),A=g?_.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):_,T=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},E),{type:"linear",data:A,crossSize:c,titleText:tO(u),labelOverlap:fO(p,E),grid:hO(E.grid,v,i),gridLength:O,line:!0,indexBBox:g}),E.line?null:{lineOpacity:0}),k),S),n),P=T.labelOverlap.find((t=>"hide"===t.type));return P&&(T.crossSize=!1),new ix({className:"axis",style:sO(T)})}})),mO=pO((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=uO(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]=Wc(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]=lO(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=sO(Y({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:tO(h),grid:d},p),l)));return new ix({style:K(E,["transform"])})}}));gO.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},mO.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const yO=t=>(...e)=>{const n=gO(Object.assign({},{crossPadding:50},t))(...e);return cO(n,t),n};yO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"bottom"});const vO=t=>(...e)=>{const n=gO(Object.assign({},{crossPadding:10},t))(...e);return cO(n,t),n};function bO(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))})}vO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"left"});const xO=t=>{const{important:e={}}=t,n=he(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return gO(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({},bO(t,i,o,a)),e)}))(r)}};function wO(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=iO(t,"shape"),r=iO(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=ty.get(t)||ty.get("point");return(...t)=>new Ap({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 iO(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 MO(t){const e=iO(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function EO(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=iO(t,"size");return n instanceof Zo?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:wO(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:MO(r)},s="string"==typeof n?XE(n):n,c=iO(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)})))})}xO.props=Object.assign(Object.assign({},gO.props),{defaultPosition:"center"});const OO=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}=aO(t,e,n);return{width:i,height:o}}(r,t,OO),d=eO(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:tO(s)}),EO(t,e)),{legendCategory:g={}}=i,m=sO(Object.assign({},g,p,u)),y=new rO({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:m})});return y.appendChild(new xx({className:"legend-category",style:m})),y}};function kO(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 SO(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],xr(e)];return[n,r]}function _O(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:[Of(e).toString()]})),r}(s,c),[u,f]=SO(l),[h,d]=SO([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof zo))));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)||c,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 AO(t,e,n,r,i,o){const a=iO(t,"color"),s=function(t,e,n){const{size:r}=e,i=aO(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 sa){const{range:t}=a.getOptions(),[e,n]=SO(a);return a instanceof ua||a instanceof ha?kO(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 _O(s,a,iO(t,"size"),iO(t,"opacity"),e,o)}OO.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const TO=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=eO(o,n),{legendContinuous:y={}}=a,v=sO(Object.assign({},y,Object.assign(Object.assign({titleText:tO(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>XE(e)(t.label):e},AO(r,l,i,t,TO,a)),c),f)),b=new nO({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},m),{subOptions:v})});return b.appendChild(new Nx({className:"legend-continuous",style:v})),b}};TO.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const PO=t=>(...e)=>TO(Object.assign({},{block:!0},t))(...e);PO.props=Object.assign(Object.assign({},TO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const CO=t=>e=>{const{scales:n}=e,r=iO(n,"size");return TO(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};CO.props=Object.assign(Object.assign({},TO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const NO=t=>CO(Object.assign({},{block:!0},t));function LO(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"}}}NO.props=Object.assign(Object.assign({},TO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const jO=(RO={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=JE(e,".title","text").attr("className","title").call(nm,Object.assign(Object.assign(Object.assign({},LO(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),c)).node().getLocalBounds();JE(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({},LO(0,u.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),l))}))}},class extends Mp{constructor(t){super(t),this.descriptor=RO}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 RO;const IO=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new jO({style:Y({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function BO(t){return!!t.getBandWidth}function DO(t,e,n){if(!BO(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 FO(t,e,n){if(!e)return t.getOptions().domain;if(!BO(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 zO(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[DO(a,n,e),DO(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[FO(a,[l[0],u[0]]),FO(s,[l[1],u[1]])]}function GO(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}IO.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const WO=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+""),g="string"==typeof n?XE(n):n,m="horizontal"===e,y=Rc(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 eb({className:"slider",style:Object.assign({},d,Object.assign(Object.assign({x:b,y:x,trackLength:m?f:h,orientation:e,formatter:e=>(g||p)(DO(t,y?1-e:e,!0))},i),a))})}};WO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const $O=t=>WO(Object.assign(Object.assign({},t),{orientation:"horizontal"}));$O.props=Object.assign(Object.assign({},WO.props),{defaultPosition:"bottom"});const HO=t=>WO(Object.assign(Object.assign({},t),{orientation:"vertical"}));HO.props=Object.assign(Object.assign({},WO.props),{defaultPosition:"left"});const VO=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 nb({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}))})}};VO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const YO=t=>VO(Object.assign(Object.assign({},t),{orientation:"horizontal"}));YO.props=Object.assign(Object.assign({},VO.props),{defaultPosition:"bottom"});const qO=t=>VO(Object.assign(Object.assign({},t),{orientation:"vertical"}));qO.props=Object.assign(Object.assign({},VO.props),{defaultPosition:"left"});const UO=t=>()=>new Op;UO.props={};const XO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(h,Object.assign(Object.assign({},i),t))}},KO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},ZO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(h,Object.assign(Object.assign({},i),t))}},QO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Rc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},JO=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))};JO.props={};const tk=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 ek(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}tk.props={};const nk=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function rk(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function ik(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 ok(t,e){const[n,r,i,o]=rk(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(ik([t,o,e,l]))}f-=t,u+=1}return c}function ak(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function sk(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function ck(t){const e=th(t);if(e&&!function(t){return!sk(t,"m")||!sk(t,"M")}(e))return e}function lk(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=ck(e),s=ck(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){const[r,i,o,a]=rk(t),{transform:s}=t.style,{transform:c}=e.style;ak(e,t);const[l,u,f,h]=rk(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})`},ek(t,nk)),Object.assign({transform:(c?c+" ":"")+"translate(0, 0) scale(1, 1)"},ek(e,nk))];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 Ap({style:Object.assign(Object.assign({},ek(t,nk)),{d:e})});return ak(r,t),r}(t,a),l=[Object.assign({path:a},ek(e,nk)),Object.assign({path:s},ek(n,nk))],u=c.animate(l,r);return u.onfinish=()=>{c.style.transform="none",sr(c,n)},c.style.transform="none",u}const uk=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:ok}(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 lk(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)=>lk(e,new Ap({style:Object.assign({path:i[r]},ek(t,nk))}),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)=>lk(t,t,new Ap({style:{path:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};uk.props={};const fk=(t,e)=>{const n=1e-4;xp({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:uf.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Ic(r))return XO(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=Js().cornerRadius(f).padAngle(h*Math.PI/180),x=am(r,m,[y,v]),{startAngle:w,endAngle:M}=x,E=new Ap({}),O=t=>{E.attr({d:b(t),transform:`translate(${c[0]}, ${c[1]})`});const e=th(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}};fk.props={};const hk=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},dk=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(1)`.trimStart(),transformOrigin:l},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},pk=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))};pk.props={};const gk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Ap({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return XO(t,e)([c],r,i)};gk.props={};const mk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Ap({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return ZO(t,e)([c],r,i)};mk.props={};const yk="main-layer",vk="label-layer",bk="element",xk="view",wk="plot",Mk="component",Ek="label",Ok="area";function kk(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function Sk(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 _k(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&&fp(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&&fp(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 Ak(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&&fp(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&&fp(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],_=d[O+1],A=0===O&&(0!==g||0!==m),T=(O===d.length-1||_&&("M"===_[0]||"Z"===_[0]))&&0!==y&&0!==v;switch(S){case"M":A?(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?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&&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&&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&&t.lineTo(k[6]-o+y,k[7]-s+v);break;case"Z":t.closePath()}}}function Tk(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&&fp(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&&fp(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 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.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&&fp(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&&fp(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 Ck(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 A(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 Nk=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={})[Wl.CIRCLE]=kk,t[Wl.ELLIPSE]=Sk,t[Wl.RECT]=Ck,t[Wl.LINE]=_k,t[Wl.POLYLINE]=Pk,t[Wl.POLYGON]=Tk,t[Wl.PATH]=Ak,t[Wl.TEXT]=void 0,t[Wl.GROUP]=void 0,t[Wl.IMAGE]=void 0,t[Wl.HTML]=void 0,t[Wl.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(Vl),Lk=jt(),jk=jt(),Rk=jt(),Ik=rt(),Bk=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(Ik,r),s=qt(jk,Ft(Rk,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 yu(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(Lk,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=Jh(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 Dk(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=Ml(i,i,e.x,e.y),h=ye(rd(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 Fk(t,e,n,r){return t/(n*n)+e/(r*r)}function zk(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(rd(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?Fk(y,v,i+m,o+m)<=1:p?Fk(y,v,i,o)<=1:!!g&&(Fk(y,v,i-m,o-m)>=1&&Fk(y,v,i+m,o+m)<=1)}function Gk(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function Wk(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 Ml(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&&Cl(t,e,n,r,o,a)<=i/2}function Hk(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 Vk=1e-6;function Yk(t){return Math.abs(t)<Vk?0:t<0?-1:1}function qk(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 Uk(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(qk(a,s,[e,n]))return!0;Yk(a[1]-n)>0!=Yk(s[1]-n)>0&&Yk(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function Xk(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=Uk(t[i],e,n))break}return r}function Kk(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(rd(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 Zk(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(rd(m,(null==x?void 0:x.length)&&u,l),2),M=w[0],E=w[1],O=Wf(t),k=!1;return M||n?k=v?r(t,e):Xk(x,e.x+h,e.y+p)||Xk(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||Gk(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=zl(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Rl(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=Rl(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 Qk(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(rd(r.pointerEvents,o,i),2),p=d[0],g=!1;return(d[1]||n)&&(g=Hk(c.points,(a||0)+(s||0),e.x+u,e.y+h,!0)),g||!p&&!n||(g=Uk(c.points,e.x+u,e.y+h)),g}function Jk(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(rd(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&Hk(a.points,(i||0)+(o||0),e.x+c,e.y+u,!1)}function tS(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(rd(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)||Wk(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||Wk(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||Wk(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||Wk(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(0,0,f,h,a.map((function(t){return A(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?Gk(0-v,0-v,f+v,h+v,e.x,e.y):p?Gk(0,0,f,h,e.x,e.y):!!g&&function(t,e,n,r,i,o,a){var s=i/2;return Gk(t-s,e-s,n,i,o,a)||Gk(t+n-s,e-s,i,r,o,a)||Gk(t+s,e+r-s,n,i,o,a)||Gk(t-s,e+s,i,r,o,a)}(0,0,f,h,m,e.x,e.y)}function eS(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[Wl.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 nS=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={})[Wl.CIRCLE]=Dk,t[Wl.ELLIPSE]=zk,t[Wl.RECT]=tS,t[Wl.LINE]=Kk,t[Wl.POLYLINE]=Jk,t[Wl.POLYGON]=Qk,t[Wl.PATH]=Zk,t[Wl.TEXT]=function(){return!0},t[Wl.GROUP]=null,t[Wl.IMAGE]=eS,t[Wl.HTML]=null,t[Wl.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new Bk)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Vl),rS=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(Gd.UNMOUNTED,h),f.addEventListener(Gd.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(Gd.UNMOUNTED,h),f.removeEventListener(Gd.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 fu;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],fu.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),_=Math.ceil(E-w);t.save(),r.clearRect(t,O,k,S,_,i.background),t.beginPath(),t.rect(O,k,S,_),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 Id(hp.DIRTY_RECTANGLE,{dirtyRect:{x:O,y:k,width:S,height:_}})),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)&Dd.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!==Wl.LINE&&t.nodeName!==Wl.PATH&&t.nodeName!==Wl.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 fu;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 fu);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 fu;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),iS=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,_="inner"===g,A=M&&k&&(S===Wl.PATH||S===Wl.LINE||S===Wl.POLYLINE||E||_);w&&(t.globalAlpha=c*l,A||oS(n,t,k),this.fill(t,n,a,s,r,i,o),A||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),A&&(_&&(t.globalCompositeOperation="source-atop"),oS(n,t,!0),_&&(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()})):(Mf(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()})):(Mf(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===Nu.LinearGradient||t.type===Nu.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 oS(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 aS=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)?r=this.imagePool.getImageSync(a):(l||(l=a.width),u||(u=a.height),r=a),r){oS(n,t,!y(s)&&c>0);try{t.drawImage(r,0,0,l,u)}catch(t){}}},t}(),sS=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,_=b.lineHeight,A=b.lineMetrics;t.font=O,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var T=l;o.enableCSSParsing||"alphabetic"!==T||(T="bottom"),t.lineJoin=u,y(f)||(t.miterLimit=f);var P=0;"middle"===l?P=-S/2-_/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?P=-S:"top"!==l&&"hanging"!==l||(P=-_);var C=x||0;P+=w||0,1===k.length&&("bottom"===T?(T="middle",P-=.5*S):"top"===T&&(T="middle",P+=.5*S)),t.textBaseline=T,oS(n,t,!y(M)&&E>0);for(var N=0;N<k.length;N++){var L=s/2+C;P+=_,y(d)||d.isNone||!s||this.drawLetterSpacing(t,k[N],A[N],c,L,P,h,g,m,v,!0),y(p)||this.drawLetterSpacing(t,k[N],A[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)}(iS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(iS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(iS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(iS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(iS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(iS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(iS);var cS=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 iS(n),i=((t={})[Wl.CIRCLE]=r,t[Wl.ELLIPSE]=r,t[Wl.RECT]=r,t[Wl.IMAGE]=new aS(n),t[Wl.TEXT]=new sS,t[Wl.LINE]=r,t[Wl.POLYLINE]=r,t[Wl.POLYGON]=r,t[Wl.PATH]=r,t[Wl.GROUP]=void 0,t[Wl.HTML]=void 0,t[Wl.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new rS(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Vl),lS=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}(),uS=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 lS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Vl),fS=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===Wl.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===Wl.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===Wl.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;if(e.nodeName===Wl.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(hp.RESIZE,d),s.addEventListener(Gd.MOUNTED,l),s.addEventListener(Gd.UNMOUNTED,u),s.addEventListener(Gd.ATTR_MODIFIED,f),s.addEventListener(Gd.BOUNDS_CHANGED,h)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Cd.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(hp.RESIZE,d),s.removeEventListener(Gd.MOUNTED,l),s.removeEventListener(Gd.UNMOUNTED,u),s.removeEventListener(Gd.ATTR_MODIFIED,f),s.removeEventListener(Gd.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;_(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=T(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=T(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="";Ef(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="";Ef(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}(),hS=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 fS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Vl),dS=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.imageCache[t]):this.getOrCreateImage(t).then((function(t){e&&e(t)})),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):Kh&&(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;_(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?Bh(fh(l),new bp({})):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===Nu.LinearGradient){var h=function(t,e,n){var r=Jl(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===Nu.RadialGradient){var y=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===wu.kPercentage&&(o=n.value/100*t),r.unit===wu.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 qu?s=i.value:i instanceof Fu&&("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===wu.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 _(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),pS=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,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},s=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===Wl.IMAGE){var s=o.img,c=o.keepAspectRatio;_(s)&&i.getImageSync(s,(function(t){var r=t.width,i=t.height;c&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))}},c=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===Wl.IMAGE&&"img"===r&&_(o)&&i.getOrCreateImage(o).then((function(t){var r=t.width,i=t.height;e.attributes.keepAspectRatio&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(Gd.MOUNTED,s),o.addEventListener(Gd.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(Gd.MOUNTED,s),o.removeEventListener(Gd.ATTR_MODIFIED,c)}))},t.tag="LoadImage",t}(),gS=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 dS(this.context.config),this.addRenderingPlugin(new pS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Vl),mS=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=_(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||Kh&&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){Kh&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Cd.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}(),yS=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=mS},e.prototype.destroy=function(){delete this.context.ContextService},e}(Vl),vS=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new yS),n.registerPlugin(new gS),n.registerPlugin(new Nk),n.registerPlugin(new cS),n.registerPlugin(new uS),n.registerPlugin(new nS),n.registerPlugin(new hS),n}return ue(e,t),e}(Yl),bS=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}(),xS=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 bS(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}(Vl),wS=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}(),MS=wS;const ES={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"},OS=[["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 kS(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):Ji}function SS(t){return t instanceof Float32Array||t instanceof Array}var _S=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=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 TS(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var 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=function(t,e,n,r,i){var o,a,s=PS(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},NS=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},LS=function(t,e,n,r,i){var o=new na({range:[e,e+r]}),a=new na({range:[n,n+i]});return{transform:function(t){var e=NS(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=NS(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},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},RS=function(t,e,n,r,i){return(0,jS(t,1)[0])(e,n,r,i)},IS=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){return IS(t,1)[0]},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},FS=function(t,e,n,r,i){var o=DS(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new na({range:[c,l]}),f=new na({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=DS(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=DS(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=TS(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},zS=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},GS=function(t,e,n,r,i){return{transform:function(t){var e=zS(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=zS(t,2),n=e[0];return[e[1],n]}}},WS=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=WS(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},HS=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},VS=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))},YS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return $S.apply(void 0,VS([[-1,-1]],HS(e),!1))},qS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return $S.apply(void 0,VS([[-1,1]],HS(e),!1))},US=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return $S.apply(void 0,VS([[1,-1]],HS(e),!1))},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},KS=function(t,e,n,r,i){var o=XS(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)},ZS=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},QS=function(t,e,n,r,i){var o=ZS(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 na({range:[c,c+.99*l]}),h=new na({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=ZS(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=ZS(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=TS(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*d;return[h.invert(d),f.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},t_=function(t,e,n,r,i){var o=JS(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new na({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new ra({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}}},e_=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 n_(t){return 1/Math.tan(t)}var r_=function(t,e,n,r,i){var o=n_(e_(t,1)[0]);return{transform:function(t){var e=e_(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=e_(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},i_=function(t,e,n,r,i){var o=n_(e_(t,1)[0]);return{transform:function(t){var e=e_(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=e_(t,2),n=e[0];return[n,e[1]-n*o]}}},o_=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 a_(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 s_(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 c_(t,e,n){return n?new na({range:[0,1],domain:[0,e]}).map(t):t}var l_=function(t,e,n,r,i){var o=o_(t,3),a=o[0],s=o[1],c=o[2],l=c_(a,r,void 0!==c&&c);return{transform:function(t){var e=o_(t,2),n=e[0],r=e[1];return[a_(n,l,s,0,1),r]},untransform:function(t){var e=o_(t,2),n=e[0],r=e[1];return[s_(n,l,s,0,1),r]}}},u_=function(t,e,n,r,i){var o=o_(t,3),a=o[0],s=o[1],c=o[2],l=c_(a,i,void 0!==c&&c);return{transform:function(t){var e=o_(t,2);return[e[0],a_(e[1],l,s,0,1)]},untransform:function(t){var e=o_(t,2);return[e[0],s_(e[1],l,s,0,1)]}}},f_=function(t,e,n,r,i){var o=o_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=c_(a,r,f),d=c_(s,i,f);return{transform:function(t){var e=o_(t,2),n=e[0],r=e[1];return[a_(n,h,c,0,1),a_(r,d,l,0,1)]},untransform:function(t){var e=o_(t,2),n=e[0],r=e[1];return[s_(n,h,c,0,1),s_(r,d,l,0,1)]}}},h_=function(t,e,n,r,i){var o=o_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new na({range:[0,r]}),d=new na({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=o_(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=a_(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=o_(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=s_(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)]}}},d_=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},p_=function(t,e,n,r,i,o,a){var s=new na({range:[e,e+i]}),c=new na({range:[n,n+o]}),l=new na({range:[r,r+a]});return{transform:function(t){var e=d_(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=d_(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},g_=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},m_=function(t,e,n,r,i,o,a){var s=g_(t,3),c=s[0],l=s[1],u=s[2];return mt(rt(),[c,l,u])},y_=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},v_=function(t,e,n,r,i,o,a){return{transform:function(t){var e=y_(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=y_(t,3),n=e[0];return[e[1],n,e[2]]}}},b_=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},x_=function(t,e,n,r,i,o,a){var s=b_(t,3),c=s[0],l=s[1],u=s[2];return yt(rt(),[c,l,u])},w_=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},M_=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))},E_=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.")},O_=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:LS,translate:CS,custom:RS,matrix:BS,polar:FS,transpose:GS,scale:$S,"shear.x":r_,"shear.y":i_,reflect:YS,"reflect.x":qS,"reflect.y":US,rotate:KS,helix:QS,parallel:t_,fisheye:f_,"fisheye.x":l_,"fisheye.y":u_,"fisheye.circular":h_},this.update(t)}return t.prototype.update=function(t){this.options=Zi({},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:M_(M_([],w_(n),!1),[M_([],w_(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?M_([],w_(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,AS([],_S(o),!1))}return n}}(t):t)};try{for(var c=E_(r),l=c.next();!l.done;l=c.next()){var u=w_(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(M_([],w_(h),!1),g,m,y,v);if(SS(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||Ji,"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 kS.apply(void 0,M_([],w_(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}(),k_=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_=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))},__=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.")},A_=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:p_,translate3D:m_,scale3D:x_,transpose3D:v_},this.update(t)}return t.prototype.update=function(t){this.options=Zi({},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:S_(S_([],k_(n),!1),[S_([],k_(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?S_([],k_(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,AS([],_S(o),!1))}return n}}(t):t)};try{for(var c=__(r),l=c.next();!l.done;l=c.next()){var u=k_(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(S_([],k_(h),!1),g,m,y,v,b,x);if(SS(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||Ji,!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 kS.apply(void 0,S_([],k_(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&<(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 T_(t){return(e,...n)=>Y({},t(e,...n),e)}function P_(t){return(e,...n)=>Y({},e,t(e,...n))}function C_(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 N_=()=>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:C_(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};N_.props={};const L_=()=>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=C_(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};L_.props={};const j_=()=>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:C_(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"})]};j_.props={};const R_=({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:_,key:A,frame:T,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:_,key:A,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:T,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:`${A}-0`,data:x}),t&&{title:j})]})]};R_.props={};class I_{constructor(t){this.$value=t}static of(t){return new I_(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const B_=T_((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"))}}})),D_=T_((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)}}})),F_=T_((()=>({animate:{enterType:"fadeIn"}}))),z_=P_((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),G_=P_((()=>({type:"cell"}))),W_=P_((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]}}})),$_=P_(((t,e=H_,n=Y_,r=q_,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)])),_=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),A=_.map((t=>d.filter(t))),T=f?qn(A,(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=A[t];return C[t].map((m=>{var M,E,{scale:O,key:k,facet:S=!0,axis:_={},legend:A={}}=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)||_.y,N=(null===(E=null==O?void 0:O.x)||void 0===E?void 0:E.guide)||_.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:U_(N,n)(c,j),y:U_(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:T,scale:Y(L,O,R),axis:Y({},_,I),legend:!1},P),i)}))}))}}}));function H_(t){const{points:e}=t;return gs(e)}function V_(t,e){return e.length?Y({title:!1,tick:null,label:null},t):Y({title:!1,tick:null,label:null,grid:null},t)}function Y_(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return V_(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Y({title:s,grid:c},t)}}function q_(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return V_(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Y({title:o,grid:a},t)}}function U_(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const X_=()=>t=>[I_.of(t).call(G_).call(D_).call(F_).call(B_).call(z_).call(W_).call($_).value()];X_.props={};const K_=T_((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),Z_=P_((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})=>gs(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:J_(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:tA(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)}))}))}}})),Q_=P_((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 J_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return V_(t,n)}}function tA(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return V_(t,n)}}const eA=()=>t=>[I_.of(t).call(G_).call(D_).call(Z_).call(Q_).call(F_).call(z_).call(K_).value()],nA=T_((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),rA=T_((t=>({coordinate:{type:"polar"}}))),iA=t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function oA(t){return t=>null}function aA(t){const{points:e}=t,[n,r,i,o]=e,a=fs(n,o),s=ls(n,o),c=ps(s,ls(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=ds(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const sA=()=>t=>[I_.of(t).call(G_).call(iA).call(D_).call(rA).call(W_).call($_,aA,oA,oA,{frame:!1}).call(F_).call(z_).call(nA).value()];function cA(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 lA=()=>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]=cA(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 fA(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function hA(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=fA(o,(t=>"element"===t.className));const c=function(t){return fA(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 dA(){return(t,e,n)=>{const{container:r,view:i}=t,o=hA(ES.CLICK,i,n,(t=>1===t.detail)),a=hA(ES.DBLCLICK,i,n,(t=>2===t.detail)),s=hA(ES.POINTER_TAP,i,n),c=hA(ES.POINTER_DOWN,i,n),l=hA(ES.POINTER_UP,i,n),u=hA(ES.POINTER_OVER,i,n),f=hA(ES.POINTER_OUT,i,n),h=hA(ES.POINTER_MOVE,i,n),d=hA(ES.POINTER_ENTER,i,n),p=hA(ES.POINTER_LEAVE,i,n),g=hA(ES.POINTER_UPOUTSIDE,i,n),m=hA(ES.DRAG_START,i,n),y=hA(ES.DRAG,i,n),v=hA(ES.DRAG_END,i,n),b=hA(ES.DRAG_ENTER,i,n),x=hA(ES.DRAG_LEAVE,i,n),w=hA(ES.DRAG_OVER,i,n),M=hA(ES.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 pA(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":xO,"component.axisLinear":gO,"component.axisArc":mO,"component.legendContinuousBlock":PO,"component.legendContinuousBlockSize":NO,"component.legendContinuousSize":CO,"interaction.event":dA,"composition.mark":R_,"composition.view":j_,"shape.label.label":Bw}),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 gA(t){const{canvas:e,group:n}=t;return n?n.ownerDocument:e.document}function mA(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]=pA("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 yA(t,e){return t.filter((t=>t.type===e))}function vA(t){return yA(t,"polar").length>0}function bA(t){return yA(t,"transpose").length%2==1}function xA(t){return yA(t,"theta").length>0}function wA(t){return yA(t,"radial").length>0}function MA(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}lA.props={},dA.props={reapplyWhenUpdate:!0};var EA=MA("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),OA=MA("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),kA=MA("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),SA=MA("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),_A=MA("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),AA=MA("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),TA=MA("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),PA=MA("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),CA=MA("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),NA=MA("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function LA(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function jA(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function RA(){}var IA=.7,BA=1/IA,DA="\\s*([+-]?\\d+)\\s*",FA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",GA=/^#([0-9a-f]{3,8})$/,WA=new RegExp(`^rgb\\(${DA},${DA},${DA}\\)$`),$A=new RegExp(`^rgb\\(${zA},${zA},${zA}\\)$`),HA=new RegExp(`^rgba\\(${DA},${DA},${DA},${FA}\\)$`),VA=new RegExp(`^rgba\\(${zA},${zA},${zA},${FA}\\)$`),YA=new RegExp(`^hsl\\(${FA},${zA},${zA}\\)$`),qA=new RegExp(`^hsla\\(${FA},${zA},${zA},${FA}\\)$`),UA={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 XA(){return this.rgb().formatHex()}function KA(){return this.rgb().formatRgb()}function ZA(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=GA.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?QA(e):3===n?new nT(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?JA(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?JA(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=WA.exec(t))?new nT(e[1],e[2],e[3],1):(e=$A.exec(t))?new nT(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=HA.exec(t))?JA(e[1],e[2],e[3],e[4]):(e=VA.exec(t))?JA(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=YA.exec(t))?cT(e[1],e[2]/100,e[3]/100,1):(e=qA.exec(t))?cT(e[1],e[2]/100,e[3]/100,e[4]):UA.hasOwnProperty(t)?QA(UA[t]):"transparent"===t?new nT(NaN,NaN,NaN,0):null}function QA(t){return new nT(t>>16&255,t>>8&255,255&t,1)}function JA(t,e,n,r){return r<=0&&(t=e=n=NaN),new nT(t,e,n,r)}function tT(t){return t instanceof RA||(t=ZA(t)),t?new nT((t=t.rgb()).r,t.g,t.b,t.opacity):new nT}function eT(t,e,n,r){return 1===arguments.length?tT(t):new nT(t,e,n,null==r?1:r)}function nT(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function rT(){return`#${sT(this.r)}${sT(this.g)}${sT(this.b)}`}function iT(){const t=oT(this.opacity);return`${1===t?"rgb(":"rgba("}${aT(this.r)}, ${aT(this.g)}, ${aT(this.b)}${1===t?")":`, ${t})`}`}function oT(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function aT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function sT(t){return((t=aT(t))<16?"0":"")+t.toString(16)}function cT(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 lT(t){if(t instanceof uT)return new uT(t.h,t.s,t.l,t.opacity);if(t instanceof RA||(t=ZA(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 fT(t){return(t=(t||0)%360)<0?t+360:t}function hT(t){return Math.max(0,Math.min(1,t||0))}function dT(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}LA(RA,ZA,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:XA,formatHex:XA,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return lT(this).formatHsl()},formatRgb:KA,toString:KA}),LA(nT,eT,jA(RA,{brighter(t){return t=null==t?BA:Math.pow(BA,t),new nT(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?IA:Math.pow(IA,t),new nT(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new nT(aT(this.r),aT(this.g),aT(this.b),oT(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:rT,formatHex:rT,formatHex8:function(){return`#${sT(this.r)}${sT(this.g)}${sT(this.b)}${sT(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:iT,toString:iT})),LA(uT,(function(t,e,n,r){return 1===arguments.length?lT(t):new uT(t,e,n,null==r?1:r)}),jA(RA,{brighter(t){return t=null==t?BA:Math.pow(BA,t),new uT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?IA:Math.pow(IA,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 nT(dT(t>=240?t-240:t+120,i,r),dT(t,i,r),dT(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new uT(fT(this.h),hT(this.s),hT(this.l),oT(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=oT(this.opacity);return`${1===t?"hsl(":"hsla("}${fT(this.h)}, ${100*hT(this.s)}%, ${100*hT(this.l)}%${1===t?")":`, ${t})`}`}}));const pT=Math.PI/180,gT=180/Math.PI;var mT=-.14861,yT=1.78277,vT=-.29227,bT=-.90649,xT=1.97294,wT=xT*bT,MT=xT*yT,ET=yT*vT-bT*mT;function OT(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof kT)return new kT(t.h,t.s,t.l,t.opacity);t instanceof nT||(t=tT(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(ET*r+wT*e-MT*n)/(ET+wT-MT),o=r-i,a=(xT*(n-i)-vT*o)/bT,s=Math.sqrt(a*a+o*o)/(xT*i*(1-i)),c=s?Math.atan2(a,o)*gT-120:NaN;return new kT(c<0?c+360:c,s,i,t.opacity)}(t):new kT(t,e,n,null==r?1:r)}function kT(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}LA(kT,OT,jA(RA,{brighter(t){return t=null==t?BA:Math.pow(BA,t),new kT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?IA:Math.pow(IA,t),new kT(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*pT,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new nT(255*(e+n*(mT*r+yT*i)),255*(e+n*(vT*r+bT*i)),255*(e+n*(xT*r)),this.opacity)}}));var ST=t=>()=>t;function _T(t,e){return function(n){return t+n*e}}function AT(t){return 1==(t=+t)?TT: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):ST(isNaN(e)?n:e)}}function TT(t,e){var n=e-t;return n?_T(t,n):ST(isNaN(t)?e:t)}!function t(e){var n=AT(e);function r(t,e){var r=n((t=eT(t)).r,(e=eT(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=TT(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 PT,CT=(PT=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=eT(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=PT(i),o=PT(o),a=PT(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function NT(t){return function e(n){function r(e,r){var i=t((e=OT(e)).h,(r=OT(r)).h),o=TT(e.s,r.s),a=TT(e.l,r.l),s=TT(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)}NT((function(t,e){var n=e-t;return n?_T(t,n>180||n<-180?n-360*Math.round(n/360):n):ST(isNaN(t)?e:t)}));var LT=NT(TT),jT=t=>CT(t[t.length-1]),RT=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(MA),IT=jT(RT),BT=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(MA),DT=jT(BT),FT=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(MA),zT=jT(FT),GT=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(MA),WT=jT(GT),$T=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(MA),HT=jT($T),VT=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(MA),YT=jT(VT),qT=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(MA),UT=jT(qT),XT=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(MA),KT=jT(XT),ZT=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(MA),QT=jT(ZT),JT=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(MA),tP=jT(JT),eP=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(MA),nP=jT(eP),rP=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(MA),iP=jT(rP),oP=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(MA),aP=jT(oP),sP=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(MA),cP=jT(sP),lP=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(MA),uP=jT(lP),fP=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(MA),hP=jT(fP),dP=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(MA),pP=jT(dP),gP=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(MA),mP=jT(gP),yP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(MA),vP=jT(yP),bP=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(MA),xP=jT(bP),wP=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(MA),MP=jT(wP),EP=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(MA),OP=jT(EP),kP=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(MA),SP=jT(kP),_P=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(MA),AP=jT(_P),TP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(MA),PP=jT(TP),CP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(MA),NP=jT(CP),LP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(MA),jP=jT(LP);var RP=LT(OT(300,.5,0),OT(-240,.5,1)),IP=LT(OT(-100,.75,.35),OT(80,1.5,.8)),BP=LT(OT(260,.75,.35),OT(80,1.5,.8)),DP=OT();var FP=eT(),zP=Math.PI/3,GP=2*Math.PI/3;function WP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var $P=WP(MA("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),HP=WP(MA("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),VP=WP(MA("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),YP=WP(MA("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),qP=Object.freeze({__proto__:null,schemeCategory10:EA,schemeAccent:OA,schemeDark2:kA,schemePaired:SA,schemePastel1:_A,schemePastel2:AA,schemeSet1:TA,schemeSet2:PA,schemeSet3:CA,schemeTableau10:NA,interpolateBrBG:IT,schemeBrBG:RT,interpolatePRGn:DT,schemePRGn:BT,interpolatePiYG:zT,schemePiYG:FT,interpolatePuOr:WT,schemePuOr:GT,interpolateRdBu:HT,schemeRdBu:$T,interpolateRdGy:YT,schemeRdGy:VT,interpolateRdYlBu:UT,schemeRdYlBu:qT,interpolateRdYlGn:KT,schemeRdYlGn:XT,interpolateSpectral:QT,schemeSpectral:ZT,interpolateBuGn:tP,schemeBuGn:JT,interpolateBuPu:nP,schemeBuPu:eP,interpolateGnBu:iP,schemeGnBu:rP,interpolateOrRd:aP,schemeOrRd:oP,interpolatePuBuGn:cP,schemePuBuGn:sP,interpolatePuBu:uP,schemePuBu:lP,interpolatePuRd:hP,schemePuRd:fP,interpolateRdPu:pP,schemeRdPu:dP,interpolateYlGnBu:mP,schemeYlGnBu:gP,interpolateYlGn:vP,schemeYlGn:yP,interpolateYlOrBr:xP,schemeYlOrBr:bP,interpolateYlOrRd:MP,schemeYlOrRd:wP,interpolateBlues:OP,schemeBlues:EP,interpolateGreens:SP,schemeGreens:kP,interpolateGreys:AP,schemeGreys:_P,interpolatePurples:PP,schemePurples:TP,interpolateReds:NP,schemeReds:CP,interpolateOranges:jP,schemeOranges:LP,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:RP,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return DP.h=360*t-100,DP.s=1.5-1.5*e,DP.l=.8-.9*e,DP+""},interpolateWarm:IP,interpolateCool:BP,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,FP.r=255*(e=Math.sin(t))*e,FP.g=255*(e=Math.sin(t+zP))*e,FP.b=255*(e=Math.sin(t+GP))*e,FP+""},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:$P,interpolateMagma:HP,interpolateInferno:VP,interpolatePlasma:YP});function UP(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 fC(t,pr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return oC(t,s);if(void 0!==i)return lC([i])?oC(t,s):uC(e)?"time":aC(t,o,a);return lC(e)?oC(t,s):uC(e)?"time":aC(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 sC(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 cC(n);case"quantile":return function(t){return cC(t).sort()}(n);case"sequential":return sC(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(eC({type:t}))return function(t,e,n){const r=t.map(Number),i=new na({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 nC({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=ko,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?xA(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=qP[`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:rC(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function XP(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 KP(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();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 ZP(t,e){const[n]=pA("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 QP(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));tC(e,"x"),tC(e,"y")}function JP(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 tC(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(eC)?kn(r):n.every(nC)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function eC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function nC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function rC(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=iC(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 iC(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function iC(t,e,n,r,i){const[o]=pA("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=qP[`scheme${r}`],o=qP[`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 oC(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function aC(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function sC(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 cC(t){return Array.from(new Set(t.flat()))}function lC(t){return fC(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function uC(t){return fC(t,(t=>t instanceof Date))}function fC(t,e){for(const n of t)if(n.some(e))return!0;return!1}const hC={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},dC={threshold:"threshold",quantize:"quantize",quantile:"quantile"},pC={ordinal:"ordinal",band:"band",point:"point"},gC={constant:"constant"};function mC(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=pA("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=pA("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?bA(n)?`${e}Y`:`${e}X`:"y"===t?bA(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[...bC(n),...wC(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]=OC(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 yC(t,e,n,r,i){const[o]=pA("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 vC(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 bC(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,xC(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 OS)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 xC(t){const{type:e}=t;return"string"!=typeof e?null:e in hC?"continuous":e in pC?"discrete":e in dC?"distribution":e in gC?"constant":null}function wC(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return yA(t,"helix").length>0}(e)||xA(e))return null;if(bA(e)&&(vA(e)||wA(e)))return null;if(n.startsWith("x"))return vA(e)?["axisArc",[t]]:wA(e)?["axisLinear",[t]]:[bA(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return vA(e)?["axisLinear",[t]]:wA(e)?["axisArc",[t]]:[bA(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return yA(t,"radar").length>0}(e))return["axisRadar",[t]];if(!vA(e))return["axisY",[t]]}return null})).filter(cr)}function MC(t){const e=yA(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=yA(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 EC(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]=MC(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return yA(t,"parallel").length>0}(i))return bA(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=MC(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:vA(i)||wA(i)?["center",null]:"axisX"===t&&function(t){return yA(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return yA(t,"reflectY").length>0}(i)?["top",null]:e}function OC(t,e,n,r,i,o,a){const[s]=MC(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?EC(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&vA(a)&&"center"===r.position?["center","vertical"]:c}function kC(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")?SC:s.startsWith("legendContinuous")?CC:"legendCategory"===s?NC:s.startsWith("slider")?TC:"title"===s?AC:s.startsWith("scrollbar")?_C:()=>{})(t,e,n,r,i,o)}function SC(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=>kC(t,e,n,r,i,o)));const c=qn(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function _C(t,e,n,r,i,o){const{trackSize:a=6}=Y({},i.scrollbar,t);t.size=a}function AC(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=DC(s,ur(u,"title"));t.size=e.height}if(c){const e=DC(c,ur(u,"subtitle"));t.size+=l+e.height}}function TC(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=IC(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,h=he(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),d=LC(t,o),p=jC(h,d),g=c+l;if(p&&p.length){const r=qn(p,(t=>t.width)),i=qn(p,(t=>t.height));if(a)t.size=r+g;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=BC(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}(d,p,e,n,o)||a||!1===f||null===f?t.size=i+g:(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=c;const m=RC(h);m&&(t.size+=a?u+m.width:u+m.height)}function CC(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=jC(l,LC(t,o));if(m){const e=u?"width":"height",n=qn(m,(t=>t[e]));t.size+=n+s}const y=RC(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function NC(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=RC(p),M=jC(p,LC(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 LC(t,e){const[n]=pA("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 jC(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=BC(t,n),i=r.map((t=>"number"==typeof t?em(t):t)),o=e?"string"==typeof e?XE(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)=>DC(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 RC(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 DC(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function IC(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 BC(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function DC(t,e){const n=function(t){return t instanceof bp?t:new Np({style:{text:`${t}`}})}(t),r=he(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function FC(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(!vA(i)&&!wA(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=>IC(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)=>jC(a[e],LC(t,r)))).filter(cr),l=qn(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>RC(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),_=(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]},A=t=>"auto"===t?20:null!=t?t:20,T=A(S),P=A(E),C=zC(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-v-w,[R,I]=_(j,O,k,N,L),B=j-R-I,D=zC(t,B,[R+v,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=D,G=s-b-x,[W,$]=_(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 zC(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(Ew(t))}`,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):(kC(r,e,n,t,o,a),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=Xn(i,(t=>t.order)),m=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(m.length&&(m[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=vC(i,p?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 GC({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 WC(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 Fc(t)&&Ic(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):Ic(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):Fc(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]=Wc(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]=Wc(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 $C(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 HC(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 VC(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=pA("data",t),o=function(t){if(T(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 YC(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 qC(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 UC(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 XC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=pA("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:nN(n)})}(o),s=yr(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function KC(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 ZC(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?XE(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 QC(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 JC(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 tN(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 eN(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]=pA("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[HC,VC,YC,qC,UC,XC,QC,tN,JC,KC,...o.map(i),...s.map(i),...a.map(i),ZC];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 nN(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function rN(t,e,n,r){var i,o;return pe(this,void 0,void 0,(function*(){const[a]=pA("composition",n),[s]=pA("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?lN(e,t,n):yield aN(t,n);m.set(r,t),g.push(r);const o=i.flatMap(p).map((t=>mA(t,n)));if(v.push(...o),o.every(h)){const t=yield Promise.all(o.map((t=>sN(t,n))));QP(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 ON(t,n));Array.isArray(e)?v.push(...e):"function"==typeof e&&b.push(e())}}r.emitter.emit(ES.BEFORE_PAINT);const x=new Map,w=new Map,M=[];e.selectAll(AN(xk)).data(g,(t=>t.key)).join((t=>t.append("g").attr("className",xk).attr("id",(t=>t.key)).call(iN).each((function(t,e,i){uN(t,Qg(i),M,n,r),x.set(t,i)}))),(t=>t.call(iN).each((function(t,e,i){uN(t,Qg(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=m.get(t),a=function(t,e,n,r){const[,i]=pA("interaction",n),o=EN(e),a=o.map((t=>[t[0],i(t[0])])).filter((t=>t[1].props&&t[1].props.reapplyWhenUpdate)).map((t=>t[0]));return(e,i)=>pe(this,void 0,void 0,(function*(){const o=[],[s,c]=yield aN(e,n);uN(s,t,o,n,r);for(const o of a.filter((t=>t!==i)))oN(o,t,e,s,n,r);for(const e of c)rN(e,t,n,r);return{options:e,view:s}}))}(Qg(e),o,n,r);return{view:t,container:e,options:o,setState:(t,e=(t=>t))=>i.set(t,e),update:t=>pe(this,void 0,void 0,(function*(){const e=ir(Array.from(i.values()))(o);return yield a(e,t)}))}})),O=E(x);for(const t of O){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of EN(e)){const[e,o]=i;if(o){const i=cN(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 EN(e)){const[e,a]=n,c=o.get(e);if(c&&(null===(i=c.destroy)||void 0===i||i.call(c)),a){const n=cN(t.view,e,a,s)(t,k,r.emitter);o.set(e,{destroy:n})}}}const{width:S,height:_}=t,A=[];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:_},i);yield rN(t,e,n,r)}i()}))));A.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(ES.AFTER_PAINT);const T=M.filter(cr).map(bN).map((t=>t.finished));return Promise.all([...T,...A])}))}function iN(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function oN(t,e,n,r,i,o){var a;const[s]=pA("interaction",i),c=e.node().nameInteraction,l=EN(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=cN(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],o.emitter);c.set(t,{destroy:d})}function aN(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]=pA("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 ON(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=mA(r,e);return lN(yield sN(i,e),i,e)}))}function sN(t,e){return pe(this,void 0,void 0,(function*(){const[n]=pA("theme",e),[,r]=pA("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(MN(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield eN(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({},UP(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function cN(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Y(o,Object.assign({type:e},n)))}function lN(t,e,n){const[r]=pA("mark",n),[i]=pA("theme",n),[o]=pA("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,h=i(MN(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=JP(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}))}(mC(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=FC(g,e,h,n),y=function(t,e,n){const[r]=pA("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 A_(p):new O_(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:GC({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:GC({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:GC({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&&WC(a,e,o,i),s.length&&$C(n,0,o)}}(vC(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=ZP(t,n);r.push(i),KP(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=>ZP(t,n)));KP(b,d);const p=XP(u,d),g=r(e),[v,w,M]=fN(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])),_=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=_,i.index=v;const A=null==t?void 0:t(_,d,m);x.push(...A||[])}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 uN(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=>A[t].x)).style("y",(t=>A[t].y)).style("width",(t=>A[t].width)).style("height",(t=>A[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Qg(n),w[t])}));let O=0,k=0,S=m,_=y;const A=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,_-=r+i,{x:O,y:k,width:S,height:_}}));e.selectAll(AN(Ok)).data(x.filter((t=>cr(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",Ok).style("zIndex",-2).call(E)),(t=>t.call(E)),(t=>t.remove()));const T=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=!!T&&{duration:T[1]};for(const[,t]of Cn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(AN(Mk)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",Mk).append((t=>yC(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=yC(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(AN(wk)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",wk).call(kN).call(_N,Array.from(c.keys())).call(TN,h)),(t=>t.call(_N,Array.from(c.keys())).call((t=>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,T):kN(t))).call(TN,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=gN(o,a,t,r,i),d=vN(o,a,t,r),p=xN(o,a,t,r),g=wN(o,a,t,r),m=dN(e,f,l,"element"),y=f.selectAll(AN(bk)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",bk).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){pN(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=bk,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",bk)}))),(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",bk).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Jg(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new Jg([],n.__toData__,n.parentNode).append(h).attr("className",bk).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=pA("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(AN(vk)).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]=pA("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:gA(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=>hN(t,r,e,a))),{shape:m=c,text:y}=g,v=he(g,["shape","text"]),b="string"==typeof i?XE(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,mN(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(AN(bk)).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=Qg(c).selectAll(AN(Ek)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",Ek)),(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 fN([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 hN(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function dN(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 pN(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 gN(t,e,n,r,i){const[o]=pA("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:gA(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=>hN(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:SN(t,r)}),g))(i,y,mN(f,d,r,s),u)}}function mN(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 yN(t,e,n,r,i){var o,a;const[,s]=pA("shape",i),[c]=pA("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(SN(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 vN(t,e,n,r){return yN("enter",t,e,n,r)}function bN(t){return t.finished.then((()=>{t.cancel()})),t}function xN(t,e,n,r){return yN("update",t,e,n,r)}function wN(t,e,n,r){return yN("exit",t,e,n,r)}function MN(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 EN(t){const{interaction:e={}}=t;return Object.entries(Y({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function ON(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 VC(0,{data:r},n);return Object.assign({data:o},i)}))}function kN(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 SN(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function _N(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(AN(yk)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",yk).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(AN(vk)).node()||t.append("g").attr("className",vk).style("zIndex",0)}function AN(...t){return t.map((t=>`.${t}`)).join("")}function TN(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 Cp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function PN(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 CN(t,e){const n=new vS;return n.registerPlugin(new xS),new Vp({width:t,height:e,container:document.createElement("div"),renderer:n})}function NN(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=PN(t),{canvas:c=CN(i,o),emitter:l=new MS,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(ES.BEFORE_RENDER);const d=Qg(c.document.documentElement);return c.ready.then((()=>rN(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(ES.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function LN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${xk}`);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 jN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function RN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:jN[e]}function IN(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>IN(t,e,n,r)))}function BN(t){IN(t,"visibility","hidden",!0)}function DN(t){IN(t,"visibility","visible",!0)}function FN(t){return Qg(t).selectAll(`.${bk}`).nodes().filter((t=>!t.__removed__))}function zN(t,e){return GN(t,e).flatMap((({container:t})=>FN(t)))}function GN(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function WN(t){return Qg(t).select(`.${wk}`).node()}function $N(t){if("rect"!==t.nodeName)return t.getRenderBounds();const{x:e,y:n,width:r,height:i}=t.style;return{min:[e,n],max:[e+r,n+i]}}function HN(t,e){const{offsetX:n,offsetY:r}=e,i=$N(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function VN(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 YN(t){return t=>t.__data__.color}function qN(t){return t=>t.__data__.x}function UN(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[KN(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(KN(i,r))[e]}}function XN(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=RN(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 KN(t,e){return`${t},${e}`}function ZN(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[KN(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=KN(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 QN(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 JN(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=Vs(),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 Ap({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 tL(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Ic(n)){const{points:i}=t.__data__,[o,a]=Rc(n)?om(i):i,s=n.getCenter(),c=ls(o,s),l=ls(a,s),u=hs(c)+ps(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Rc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function eL(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(!BO(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(!BO(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 lm(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(BO)})()?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 nL(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 rL(t){nL(t,t.cursor)}function iL(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function oL(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=QN(h,n),[m,y]=JN(Object.assign({elements:h,valueof:g,link:i,coordinate:c},ur(u.active,"link"))),[v,b,x]=eL(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 tL(h[n],e,c)}})}),{setState:M,removeState:E,hasState:O}=XN(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)}})},_=(t=!0)=>{for(const t of h)E(t,"active","inactive"),b(t),y(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},A=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{_(),k=null}),a)):_())},T=()=>{_()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",A),t.addEventListener("pointerleave",T);const P=t=>{const{nativeEvent:e}=t;e||_(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=iL(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",A),t.removeEventListener("pointerleave",T),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),y(t)}}function aL(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 oL(WN(c),Object.assign({elements:FN,datum:UN(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:ZN(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function sL(t){return aL(Object.assign(Object.assign({},t),{createGroup:qN}))}function cL(t){return aL(Object.assign(Object.assign({},t),{createGroup:YN}))}function lL(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=QN(h,n),[m,y]=JN(Object.assign({link:i,elements:h,valueof:g,coordinate:a},ur(u.selected,"link"))),[v,b]=eL(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 tL(h[n],e,a)}})}),{setState:w,removeState:M,hasState:E}=XN(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=iL(h,t,n);k({target:e,nativeEvent:!1})}},_=()=>{O(!1)};return l.on("element:select",S),l.on("element:unselect",_),()=>{for(const t of h)y(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",_)}}function uL(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 lL(WN(s),Object.assign({elements:FN,datum:UN(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:ZN(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function fL(t){return uL(Object.assign(Object.assign({},t),{createGroup:qN}))}function hL(t){return uL(Object.assign(Object.assign({},t),{createGroup:YN}))}function dL(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=WN(s),x=s.getElementsByClassName(bk),w=Pn(s.getElementsByClassName(Ek),(t=>t.__data__.key.split("-")[0])),M=new _p({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ur(o,"rule"))}),E=new Np({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 _=Z((t=>{const e=HN(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("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",_),b.addEventListener("pointermove",_),b.addEventListener("pointerleave",_),()=>{M.remove(),b.removeEventListener("pointerenter",_),b.removeEventListener("pointermove",_),b.removeEventListener("pointerleave",_)}}}function pL({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=WN(s),l=Z((t=>{const e=HN(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 gL(t,e,n,r,i,o,a,s={}){const c=new Ix({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 mL({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=gL(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 yL({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 vL({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 bL(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function xL(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function wL(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function ML(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=wL(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=xL(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 Do)&&!(t instanceof zo);if(s(r))return r.clone().invert(a);if(a&&r instanceof Do&&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(bL);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:wL(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function EL(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=hs(ls([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 _p({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 OL(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function kL(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function SL(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function _L(t,e){return void 0===t?e:t}function AL(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function TL(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:_={}}=e,A=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 T=n(t),P=Rc(a),C=Ic(a),N=Y(S,A),{innerWidth:L,innerHeight:j,width:R,height:B,insetLeft:D,insetTop:F}=a.getOptions(),z=[],G=[];for(const t of T){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=n.filter(cr),[o,a]=Rn([i[0],i[i.length-1]]);if(!W&&(r<o||r>a))return null;const s=gn((t=>n[+t])).center;return e[s(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=HN(t,e);if(!n)return;const f=$N(t),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=[],A=[];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]);A.push([Object.assign(Object.assign({},e),{element:t}),o])}}const T=Array.from(new Set(A.map((t=>t[0].x)))),I=T[Kn(T,(t=>Math.abs(t-U(E))))],V=A.filter((t=>t[0].x===I)),Y=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],Z=[...S,...k],Q=ML(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||AL(Q))J();else{if(m&&mL({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:_}),s){const e=V.map((t=>t[1])),n=ur(N,"crosshairs");EL(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 wp({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:DO(o.x,U(E),!0)}}}))}}),f,{leading:h,trailing:d}),J=()=>{yL({root:t,single:y,emitter:u}),s&&OL(t),O&&kL(t)},tt=()=>{vL({root:t,single:y}),s&&OL(t),O&&kL(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=()=>{yL({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?yL({root:t,single:y,emitter:u,nativeEvent:!1}):tt()}}function PL(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),_=Pn(k,f),A=Z((e=>{const{target:c}=e;if(!S.has(c))return void yL({root:t,single:h,emitter:s});const l=f(c),u=_.get(l),g=1!==u.length||x?ML(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=xL(t)}=e,r=he(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(bL);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)),AL(g))return void yL({root:t,single:h,emitter:s});const{offsetX:M,offsetY:E}=e;w&&mL({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}),T=e=>{const{target:n}=e;S.has(n)&&yL({root:t,single:h,emitter:s})},P=()=>{M||(t.addEventListener("pointerover",A),t.addEventListener("pointermove",A),t.addEventListener("pointerout",T))},C=()=>{M||(t.removeEventListener("pointerover",A),t.removeEventListener("pointermove",A),t.removeEventListener("pointerout",T))},N=({nativeEvent:t,data:e})=>{if(t)return;const n=iL(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;A({target:n,offsetX:i+a/2,offsetY:o+s/2})},L=({nativeEvent:e}={})=>{e||yL({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(),vL({root:t,single:h})})),P(),()=>{C(),s.off("tooltip:show",N),s.off("tooltip:hide",L),E?yL({root:t,single:h,emitter:s,nativeEvent:!1}):vL({root:t,single:h})}}function CL(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=SL(h,"seriesTooltip"),m=SL(h,"crosshairs"),y=WN(l),v=_L(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 TL(y,Object.assign(Object.assign({},s),{theme:p,elements:FN,scale:f,coordinate:d,crosshairs:_L(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=zN(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),TL(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:d,crosshairs:_L(n,m),item:o,startX:u,startY:f,emitter:c}))}return PL(y,Object.assign(Object.assign({},s),{datum:UN(u),elements:FN,scale:f,coordinate:d,groupKey:e?t=>t.__data__.x:void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}aL.props={reapplyWhenUpdate:!0},sL.props={reapplyWhenUpdate:!0},cL.props={reapplyWhenUpdate:!0},uL.props={reapplyWhenUpdate:!0},fL.props={reapplyWhenUpdate:!0},hL.props={reapplyWhenUpdate:!0},dL.props={reapplyWhenUpdate:!0},CL.props={reapplyWhenUpdate:!0};const NL="legend-category",LL="legend-continuous",jL="items-item",RL="legend-category-item-marker",IL="legend-category-item-label";function BL(t){return t.getElementsByClassName(RL)[0]}function DL(t){return t.getElementsByClassName(IL)[0]}function FL(t){return t.getElementsByClassName(jL)}function zL(t){return t.getElementsByClassName(NL)}function GL(t){return t.getElementsByClassName(LL)}function WL(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function $L(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 HL(t,e){for(const n of t)$L(n,Object.assign(Object.assign({},e),{facet:!0}))}function VL(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>WL(t).scales.map((t=>t.name)),s=[...zL(r),...GL(r)],c=s.flatMap(a),l=Z(o?HL:$L,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=WL(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===NL?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}=XN(d,void 0),{setState:y,removeState:v}=XN(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=()=>{nL(t,"pointer")},r=()=>{rL(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:FL,marker:BL,label:DL,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 YL(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=zL(r),s=FN(r),c=t=>WL(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=ZN(o,["active","inactive"]),f=QN(s,UN(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=FL(t),o=l(r),a=Pn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:m}=XN(u,f),y={inactive:ur(p,"marker")},v={inactive:ur(p,"label")},{setState:b,removeState:x}=XN(y),{setState:w,removeState:M}=XN(v),E=t=>{for(const e of i){const n=BL(e),r=DL(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})},_=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)},A=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",_),n.on("legend:unhighlight",A);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",_),n.off("legend:unhighlight",A);for(const[t,e]of k)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function qL(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function UL(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function XL(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const KL=ym((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,_=he(k,["render"]),A=ur(u,"handleNE"),{render:T=h}=A,P=he(A,["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=ym((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=Qg(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(XL,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(XL,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(XL,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(XL,w),D.maybeAppend("handle-w",B(E)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(XL,O),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(XL,_),D.maybeAppend("handle-ne",B(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(XL,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(XL,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(XL,I)}));function ZL(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=UL(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;nL(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();_()},S=()=>{b=new Ap({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),v=new KL({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},_=()=>{v=new KL({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)},A=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,m=null,y=null,x=!1,v=null,b=null,r(t)},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]=VN(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=VN(t,e);if(!g)return;if(!y)return T(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];T(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 T([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=VN(t,e);const[n,r,o,s]=T(g,m);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;v&&!L(e)&&A()},z=e=>{const{target:n}=e;v&&L(n)&&!x?R(n)?nL(t,"move"):j(n)&&nL(t,N[n.id].cursor):nL(t,"crosshair")},G=()=>{nL(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([t,e],[n,r],i)},remove(t=!0){v&&A(t)},destroy(){v&&A(!1),nL(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 QL(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 JL(t,e,n){return QL(t,e,n).map((t=>t.options))}function tj(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=QN(y,o),w=ur(m,"mask"),{setState:M,removeState:E}=XN(p,x),O=new Map,{width:k,height:S,x:_=0,y:A=0}=d(t),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;qL([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 Cp({style:{x:t+_,y:e+A,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},j=ZL(t,Object.assign(Object.assign({},w),{extent:T,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=zO(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=zO(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=zO(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=GO(o,r),c=GO(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 ej(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=WN(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 tj(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>zN(t,i),datum:UN(GN(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:ZN(GN(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=tj(l,Object.assign(Object.assign({elements:FN,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return QL(t,e,n).map((t=>WN(t.container)))}(t,i,n),datum:UN([s,...QL(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:ZN([c,...JL(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function nj(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function rj(t){return ej(Object.assign(Object.assign({},t),{brushRegion:nj,selectedHandles:["handle-e","handle-w"]}))}function ij(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function oj(t){return ej(Object.assign(Object.assign({},t),{brushRegion:ij,selectedHandles:["handle-n","handle-s"]}))}const aj="axis",sj="axis-line",cj="axis-main-group",lj="axis-hot-area";function uj(t){return t.getElementsByClassName(aj)}function fj(t){return t.getElementsByClassName(sj)[0]}function hj(t){return function(t){return t.getElementsByClassName(cj)[0]}(t).getLocalBounds()}function dj(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=he(e,["cross","offsetX","offsetY"]);const a=hj(t),s=fj(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:ij,hotZone:new Cp({className:lj,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 pj(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=he(e,["offsetY","offsetX","cross"]);const a=hj(t),s=fj(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:nj,hotZone:new Cp({className:lj,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 gj(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=WN(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=QN(p,a),{setState:y,removeState:v}=XN(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,A(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)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})()}})},_=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},A=(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(FO(n,i))},T=g.some(o)&&g.some((t=>!o(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?pj:dj,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=ZL(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?_(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:FN,axes:uj,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:UN(o),state:ZN(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function mj(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=WN(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=ZL(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 zO(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 yj(t){return mj(Object.assign(Object.assign({hideX:!0},t),{brushRegion:nj}))}function vj(t){return mj(Object.assign(Object.assign({hideY:!0},t),{brushRegion:ij}))}const bj="slider";function xj(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 wj(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return FO(e,[DO(e,o(r),!0),DO(e,o(i),!1)])}function Mj(t){return[t[0],t[t.length-1]]}function Ej({initDomain:t={},className:e=bj,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=Rc(v),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},A=new Map,T=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]=_(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=Mj(P.x),r=Mj(P.y)]=e;return h?[FO(O,n,g),FO(k,r,v)]:[FO(k,r,v),FO(O,n,g)]}const{value:n}=t.detail;return[wj(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:[Mj(t),Mj(n)]}}))}p(t,(t=>Object.assign(Object.assign({},xj(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 Id("valuechange",{data:i,nativeEvent:!1}));const c=h?GO(a,O):GO(s,k);r(t,c)};u.on(f,N),t.addEventListener("valuechange",C),A.set(t,C),T.add([f,N])}return d(),()=>{for(const[t,e]of A)t.removeEventListener("valuechange",e);for(const[t,e]of T)u.off(t,e)}}}const Oj="g2-scrollbar";function kj(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(Oj).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 Ej(Object.assign(Object.assign({},t),{initDomain:l,className:Oj,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(e,n,r)}}function Sj(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 _j={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 Aj(t){return"text"===t.nodeName&&!!t.isOverflowing()}function Tj(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(!Aj(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 kp({className:"poptip",style:{innerHTML:Sj("div",d,Object.assign(Object.assign({},_j),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;Aj(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 Pj(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function Cj(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}Tj.props={reapplyWhenUpdate:!0};const Nj=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{DN(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]}(Pj(e),Pj(t.getLocalBounds()))));r?BN(t):n.push(t)})),t}};function Lj([t,e],[n,r]){return r>t&&e>n}function jj(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function Rj(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 Ij=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]=jj(),[s,c]=jj(),[l,u]=jj(),[f,h]=jj();for(const e of t){const{min:t,max:n}=Rj(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])&&!Lj(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 Dj(t,e,n){return.2126*Bj(t)+.7152*Bj(e)+.0722*Bj(n)}function Fj(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=Dj(n,r,i),l=Dj(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function zj(t,e){const n=Un(e,(e=>Fj(t,function(t){return"object"==typeof t?t:Of(t)}(e))));return e[n]}const Gj=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;Fj(t.parsedStyle.fill,r)<e&&t.attr("fill",zj(r,n))})),t)},Wj=()=>t=>(t.forEach((t=>{DN(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(Cj(n,e)&&Cj(r,e))}(Pj(t.getLocalBounds()),e);n&&BN(t)})),t);function $j(){return{"data.fetch":YM,"data.inline":tE,"data.sortBy":JM,"data.sort":KM,"data.filter":XM,"data.pick":ZM,"data.rename":QM,"data.fold":qM,"data.slice":oE,"data.custom":eE,"data.map":nE,"data.join":iE,"data.kde":lE,"data.log":uE,"transform.stackY":Nr,"transform.binX":Ms,"transform.bin":ws,"transform.dodgeX":ti,"transform.jitter":Na,"transform.jitterX":La,"transform.symmetryY":ja,"transform.diffY":Ra,"transform.stackEnter":ei,"transform.normalizeY":ni,"transform.select":za,"transform.selectX":Ga,"transform.selectY":Wa,"transform.groupX":ts,"transform.groupY":es,"transform.groupColor":ns,"transform.group":Ja,"transform.sortX":os,"transform.sortY":ss,"transform.sortColor":as,"transform.flexX":cs,"transform.pack":vs,"transform.sample":Os,"transform.filter":ks,"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":Xw,"mark.rect":Zw,"mark.line":eM,"mark.point":rM,"mark.text":oM,"mark.cell":sM,"mark.area":lM,"mark.link":fM,"mark.image":dM,"mark.polygon":gM,"mark.box":yM,"mark.vector":bM,"mark.lineX":EM,"mark.lineY":wM,"mark.connector":kM,"mark.range":TM,"mark.rangeX":CM,"mark.rangeY":LM,"mark.path":RM,"mark.shape":IM,"mark.density":hE,"mark.heatmap":pE,"palette.category10":gE,"palette.category20":mE,"scale.linear":vE,"scale.ordinal":bE,"scale.band":yE,"scale.identity":xE,"scale.point":wE,"scale.time":ME,"scale.log":EE,"scale.pow":OE,"scale.sqrt":AE,"scale.threshold":kE,"scale.quantile":SE,"scale.quantize":_E,"scale.sequential":TE,"scale.constant":PE,"theme.classic":jE,"theme.classicDark":BE,"theme.academy":FE,"theme.light":LE,"theme.dark":IE,"component.axisX":yO,"component.axisY":vO,"component.legendCategory":OO,"component.legendContinuous":TO,"component.legends":UO,"component.title":IO,"component.sliderX":$O,"component.sliderY":HO,"component.scrollbarX":YO,"component.scrollbarY":qO,"animation.scaleInX":XO,"animation.scaleOutX":KO,"animation.scaleInY":ZO,"animation.scaleOutY":QO,"animation.waveIn":fk,"animation.fadeIn":JO,"animation.fadeOut":tk,"animation.zoomIn":hk,"animation.zoomOut":dk,"animation.pathIn":pk,"animation.morphing":uk,"animation.growInX":gk,"animation.growInY":mk,"interaction.elementHighlight":aL,"interaction.elementHighlightByX":sL,"interaction.elementHighlightByColor":cL,"interaction.elementSelect":uL,"interaction.elementSelectByX":fL,"interaction.elementSelectByColor":hL,"interaction.fisheye":pL,"interaction.chartIndex":dL,"interaction.tooltip":CL,"interaction.legendFilter":VL,"interaction.legendHighlight":YL,"interaction.brushHighlight":ej,"interaction.brushXHighlight":rj,"interaction.brushYHighlight":oj,"interaction.brushAxisHighlight":gj,"interaction.brushFilter":mj,"interaction.brushXFilter":yj,"interaction.brushYFilter":vj,"interaction.sliderFilter":Ej,"interaction.scrollbarFilter":kj,"interaction.poptip":Tj,"composition.spaceLayer":N_,"composition.spaceFlex":L_,"composition.facetRect":X_,"composition.repeatMatrix":eA,"composition.facetCircle":sA,"composition.timingKeyframe":lA,"labelTransform.overlapHide":Nj,"labelTransform.overlapDodgeY":Ij,"labelTransform.overflowHide":Wj,"labelTransform.contrastReverse":Gj}}function Hj(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const Vj={};const Yj=t=>t?parseInt(t):0;function qj(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 Uj{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 qj(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return qj(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return qj(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 Xj=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],Kj="__remove__",Zj="__callback__";function Qj(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function Jj(t,e){const{width:n=640,height:r=480,autoFit:i,depth:o=0}=t;let a=n,s=r;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||Yj(e.width),r=t.clientHeight||Yj(e.height);return{width:n-(Yj(e.paddingLeft)+Yj(e.paddingRight)),height:r-(Yj(e.paddingTop)+Yj(e.paddingBottom))}}(e);a=t||a,s=n||s}return{width:Math.max(T(a)?a:1,1),height:Math.max(T(s)?s:1,1),depth:o}}function tR(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of Xj)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,Qj(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===Zj)e.children=t.value;else{const i=Qj(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function eR(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 Xj)void 0!==s[t]&&(a[t]=s[t],delete s[t]);return Object.assign(Object.assign({},a),{children:[s]})}function nR(t,e,n){if("function"==typeof t){const e=new Uj;return e.value=t,e.type=Zj,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 rR(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 iR(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=nR(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 oR(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function aR(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 sR(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 cR(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 lR(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function uR(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function fR(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?oR(e,n,r):"array"===t?aR(e,n,r):"object"===t?sR(e,n,r):"node"===t?lR(e,n,r):"container"===t?uR(e,n,r):"mix"===t&&cR(e,n)}return e}}function hR(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const dR={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"}},pR=Object.assign(Object.assign({},dR),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),gR=Object.assign(Object.assign({},dR),{labelTransform:{type:"array"}});let mR=class extends Uj{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()&&DN(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&BN(t)}};mR=de([fR(gR)],mR);let yR=class extends Uj{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)}};yR=de([fR(pR)],yR);const vR="G2_CHART_KEY";class bR extends mR{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 vS,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[Kj]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new MS,this._context={library:Object.assign(Object.assign({},o),Vj),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)=>NN(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 tR(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,eR(t,e,n,r)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){rR(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 iR(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(ES.BEFORE_CLEAR),this._reset(),LN(0,this._context,!1),this.emit(ES.AFTER_CLEAR)}destroy(){this.options();this.emit(ES.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),LN(0,this._context,!0),this._container[Kj]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(ES.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=Jj(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(ES.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(ES.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(ES.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(ES.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 yR{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 mR{constructor(){super({},e)}};return n=de([fR(hR(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))fR(hR(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=vR}=t,{width:n,height:r,depth:i}=Jj(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}=Jj(this.options(),this._container);this._plugins.push(new xS),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new Vp({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))}}rp.enableCSSParsing=!1;const xR=Hj(bR,Object.assign({},$j()));t.AREA_CLASS_NAME=Ok,t.Academy=FE,t.Bin=ws,t.BinX=Ms,t.COMPONENT_CLASS_NAME=Mk,t.Chart=xR,t.ChartEvent=ES,t.Classic=jE,t.ClassicDark=BE,t.Dark=IE,t.DiffY=Ra,t.DodgeX=ti,t.ELEMENT_CLASS_NAME=bk,t.Filter=ks,t.FlexX=cs,t.Group=Ja,t.GroupColor=ns,t.GroupX=ts,t.GroupY=es,t.Jitter=Na,t.JitterX=La,t.LABEL_CLASS_NAME=Ek,t.LABEL_LAYER_CLASS_NAME=vk,t.Light=LE,t.LinearAxis=gO,t.MAIN_LAYER_CLASS_NAME=yk,t.MASK_CLASS_NAME="mask",t.MaybeFunctionAttribute=Zr,t.MaybeGradient=Jr,t.MaybeIdentityX=qr,t.MaybeIdentityY=Yr,t.MaybeKey=Wr,t.MaybeSeries=$r,t.MaybeSize=Gr,t.MaybeStackY=jr,t.MaybeTitle=Br,t.MaybeTooltip=Ur,t.MaybeTuple=Qr,t.MaybeTupleX=Vr,t.MaybeTupleY=Hr,t.MaybeVisualPosition=Kr,t.MaybeZeroPadding=Xr,t.MaybeZeroX=Dr,t.MaybeZeroY=Fr,t.MaybeZeroY1=hn,t.MaybeZeroZ=zr,t.NormalizeY=ni,t.PLOT_CLASS_NAME=wk,t.Pack=vs,t.Runtime=bR,t.Sample=Os,t.Select=za,t.SelectX=Ga,t.SelectY=Wa,t.Selection=Jg,t.SortColor=as,t.SortX=os,t.SortY=ss,t.StackEnter=ei,t.StackY=Nr,t.SymmetryY=ja,t.VIEW_CLASS_NAME=xk,t.corelib=$j,t.extend=Hj,t.register=function(t,e){Object.assign(Vj,{[t]:e})},t.render=NN,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480}=t,a=PN(t),{group:s=new Op,emitter:c=new MS,library:l}=e;(null==s?void 0:s.parentElement)||ar("renderToMountedElement can't render chart to unmounted group.");const u=Qg(s);return e.group=s,e.emitter=c,c.emit(ES.BEFORE_RENDER),rN(Object.assign(Object.assign({},a),{width:i,height:o}),u,l,e).then((()=>{s.ownerDocument.defaultView.requestAnimationFrame((()=>{c.emit(ES.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),s},t.select=Qg,Object.defineProperty(t,"__esModule",{value:!0})}));
|