@orbcharts/plugins-basic 3.0.0-alpha.73 → 3.0.0-alpha.74

Sign up to get free protection for your applications and to get access to all the features.
@@ -5081,12 +5081,12 @@ function DT({ chartType: t, config: e, initFn: n }) {
5081
5081
  throw new Error(PT({
5082
5082
  columnName: p,
5083
5083
  expectToBe: d,
5084
- from: "Chart.constructor"
5084
+ from: `${e.name}.params$`
5085
5085
  }));
5086
5086
  return h === "warning" && console.warn(MT({
5087
5087
  columnName: p,
5088
5088
  expectToBe: d,
5089
- from: "Chart.constructor"
5089
+ from: `${e.name}.params$`
5090
5090
  })), Bl(f, c);
5091
5091
  } catch (h) {
5092
5092
  throw new Error(h.message);
@@ -6,7 +6,7 @@
6
6
 
7
7
  ----> find in '${n}'`}function UT({columnName:t,expectToBe:e,from:n}){return`Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
8
8
 
9
- ----> find in '${n}'`}function WT({chartType:t,config:e,initFn:n}){const r=new Lr,i=new WeakMap;let o=()=>{},a;const s=new ig(e.defaultParams),u=new ig({}),l=s.pipe(Il(c=>u.pipe(Ag(r),kr(f=>{try{const{status:h,columnName:p,expectToBe:d}=e.validator(f,{validateColumns:X_});if(h==="error")throw new Error(YT({columnName:p,expectToBe:d,from:"Chart.constructor"}));return h==="warning"&&console.warn(UT({columnName:p,expectToBe:d,from:"Chart.constructor"})),al(f,c)}catch(h){throw new Error(h.message)}}),Sg(f=>(console.error(zT(f)),uT)))),OT(1));return{params$:u,name:e.name,chartType:t,defaultParams:e.defaultParams,layerIndex:e.layerIndex,init(){a&&(o=n(a)??(()=>{}),i.set(a.selection,a))},destroy(){o(),a&&(a.selection.remove(),a=void 0),r.next(void 0)},setPresetParams:c=>{s.next(al(c,e.defaultParams))},setContext:c=>{a=c,a.observer.fullParams$=l}}}const Ii=t=>function(e){return function(n){return class{constructor(){const r=WT({chartType:t,config:e,initFn:n});this.params$=r.params$,this.name=r.name,this.chartType=r.chartType,this.defaultParams=r.defaultParams,this.layerIndex=r.layerIndex,this.init=r.init,this.destroy=r.destroy,this.setPresetParams=r.setPresetParams,this.setContext=r.setContext}}}},Fn=Ii("series"),ue=Ii("grid"),de=Ii("multiGrid"),HT=Ii("noneData"),Lg=Ii("tree");function _t(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function kg(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Sa(t){let e,n,r;t.length!==2?(e=_t,n=(s,u)=>_t(t(s),u),r=(s,u)=>t(s)-u):(e=t===_t||t===kg?t:XT,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function XT(){return 0}function Aa(t){return t===null?NaN:+t}function*jT(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const Rg=Sa(_t),Eg=Rg.right,VT=Rg.left,qT=Sa(Aa).center,On=Eg;function ZT(t,e){if(!((e=+e)>=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=Nl(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const Ig=Ng(Nl),KT=Ng(QT);function Ng(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const s=n&&t(n),u=r&&t(r),l=i.slice();return s&&u?(Rr(s,l,i,o,a),Rr(s,i,l,o,a),Rr(s,l,i,o,a),Er(u,i,l,o,a),Er(u,l,i,o,a),Er(u,i,l,o,a)):s?(Rr(s,i,l,o,a),Rr(s,l,i,o,a),Rr(s,i,l,o,a)):u&&(Er(u,i,l,o,a),Er(u,l,i,o,a),Er(u,i,l,o,a)),e}}function Rr(t,e,n,r,i){for(let o=0,a=r*i;o<a;)t(e,n,o,o+=r,1)}function Er(t,e,n,r,i){for(let o=0,a=r*i;o<r;++o)t(e,n,o,o+a,r)}function QT(t){const e=Nl(t);return(n,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,e(n,r,i+0,o+0,a),e(n,r,i+1,o+1,a),e(n,r,i+2,o+2,a),e(n,r,i+3,o+3,a)}}function Nl(t){const e=Math.floor(t);if(e===t)return JT(t);const n=t-e,r=2*t+1;return(i,o,a,s,u)=>{if(!((s-=u)>=a))return;let l=e*o[a];const c=u*e,f=c+u;for(let h=a,p=a+c;h<p;h+=u)l+=o[Math.min(s,h)];for(let h=a,p=s;h<=p;h+=u)l+=o[Math.min(s,h+c)],i[h]=(l+n*(o[Math.max(a,h-f)]+o[Math.min(s,h+f)]))/r,l-=o[Math.max(a,h-c)]}}function JT(t){const e=2*t+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let l=i,c=i+u;l<c;l+=a)s+=r[Math.min(o,l)];for(let l=i,c=o;l<=c;l+=a)s+=r[Math.min(o,l+u)],n[l]=s/e,s-=r[Math.max(i,l-u)]}}function Ta(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function t3(t){return t.length|0}function e3(t){return!(t>0)}function n3(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function r3(t){return e=>t(...e)}function i3(...t){const e=typeof t[t.length-1]=="function"&&r3(t.pop());t=t.map(n3);const n=t.map(t3),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(e3))return o;for(;;){o.push(i.map((s,u)=>t[u][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return e?o.map(e):o;i[a--]=0}}}function o3(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?i=>n+=+i||0:i=>n+=+e(i,r++,t)||0)}function Bg(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of t)(s=e(s,++a,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function Fg(t,e){const n=Bg(t,e);return n&&Math.sqrt(n)}function Ni(t,e){let n,r;if(e===void 0)for(const i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Ct{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=e+o,s=Math.abs(e)<Math.abs(o)?e-(a-o):o-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,i=e[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function a3(t,e){const n=new Ct;if(e===void 0)for(let r of t)(r=+r)&&n.add(r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function s3(t,e){const n=new Ct;let r=-1;return Float64Array.from(t,e===void 0?i=>n.add(+i||0):i=>n.add(+e(i,++r,t)||0))}class Bi extends Map{constructor(e,n=zg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Bl(this,e))}has(e){return super.has(Bl(this,e))}set(e,n){return super.set(Og(this,e),n)}delete(e){return super.delete(Gg(this,e))}}class Gn extends Set{constructor(e,n=zg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(Bl(this,e))}add(e){return super.add(Og(this,e))}delete(e){return super.delete(Gg(this,e))}}function Bl({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Og({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Gg({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function zg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Ir(t){return t}function Yg(t,...e){return Nr(t,Ir,Ir,e)}function Ug(t,...e){return Nr(t,Array.from,Ir,e)}function Wg(t,e){for(let n=1,r=e.length;n<r;++n)t=t.flatMap(i=>i.pop().map(([o,a])=>[...i,o,a]));return t}function u3(t,...e){return Wg(Ug(t,...e),e)}function l3(t,e,...n){return Wg(Xg(t,e,...n),n)}function Hg(t,e,...n){return Nr(t,Ir,e,n)}function Xg(t,e,...n){return Nr(t,Array.from,e,n)}function c3(t,...e){return Nr(t,Ir,jg,e)}function f3(t,...e){return Nr(t,Array.from,jg,e)}function jg(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function Nr(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new Bi,u=r[a++];let l=-1;for(const c of o){const f=u(c,++l,o),h=s.get(f);h?h.push(c):s.set(f,[c])}for(const[c,f]of s)s.set(c,i(f,a));return e(s)}(t,0)}function Vg(t,e){return Array.from(e,n=>t[n])}function Fl(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,o)=>o);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,o)=>{for(const a of e){const s=Br(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>Br(n[i],n[o]))),Vg(t,r)}return t.sort(Ol(n))}function Ol(t=_t){if(t===_t)return Br;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Br(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function h3(t,e,n){return(e.length!==2?Fl(Hg(t,e,n),([r,i],[o,a])=>_t(i,a)||_t(r,o)):Fl(Yg(t,n),([r,i],[o,a])=>e(i,a)||_t(r,o))).map(([r])=>r)}var p3=Array.prototype,d3=p3.slice;function Gl(t){return()=>t}const g3=Math.sqrt(50),m3=Math.sqrt(10),y3=Math.sqrt(2);function Pa(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>=g3?10:o>=m3?5:o>=y3?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?Pa(t,e,n*2):[s,u,l]}function zn(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Pa(e,t,n):Pa(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function Yn(t,e,n){return e=+e,t=+t,n=+n,Pa(t,e,n)[2]}function Ma(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Yn(e,t,n):Yn(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function zl(t,e,n){let r;for(;;){const i=Yn(t,e,n);if(i===r||i===0||!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}}function Yl(t){return Math.max(1,Math.ceil(Math.log(Ta(t))/Math.LN2)+1)}function qg(){var t=Ir,e=Ni,n=Yl;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,u,l=new Array(a);for(o=0;o<a;++o)l[o]=t(i[o],o,i);var c=e(l),f=c[0],h=c[1],p=n(l,f,h);if(!Array.isArray(p)){const v=h,x=+p;if(e===Ni&&([f,h]=zl(f,h,x)),p=zn(f,h,x),p[0]<=f&&(u=Yn(f,h,x)),p[p.length-1]>=h)if(v>=h&&e===Ni){const S=Yn(f,h,x);isFinite(S)&&(S>0?h=(Math.floor(h/S)+1)*S:S<0&&(h=(Math.ceil(h*-S)+1)/-S))}else p.pop()}for(var d=p.length,g=0,m=d;p[g]<=f;)++g;for(;p[m-1]>h;)--m;(g||m<d)&&(p=p.slice(g,m),d=m-g);var y=new Array(d+1),b;for(o=0;o<=d;++o)b=y[o]=[],b.x0=o>0?p[o-1]:f,b.x1=o<d?p[o]:h;if(isFinite(u)){if(u>0)for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[Math.min(d,Math.floor((s-f)/u))].push(i[o]);else if(u<0){for(o=0;o<a;++o)if((s=l[o])!=null&&f<=s&&s<=h){const v=Math.floor((f-s)*u);y[Math.min(d,v+(p[v]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[On(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(t=typeof i=="function"?i:Gl(i),r):t},r.domain=function(i){return arguments.length?(e=typeof i=="function"?i:Gl([i[0],i[1]]),r):e},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Gl(Array.isArray(i)?d3.call(i):i),r):n},r}function Fi(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Ul(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Da(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Wl(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Ca(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=i===void 0?Br:Ol(i);r>n;){if(r-n>600){const u=r-n+1,l=e-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),p=Math.max(n,Math.floor(e-l*f/u+h)),d=Math.min(r,Math.floor(e+(u-l)*f/u+h));Ca(t,e,p,d,i)}const o=t[e];let a=n,s=r;for(Oi(t,n,e),i(t[r],o)>0&&Oi(t,n,r);a<s;){for(Oi(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?Oi(t,n,s):(++s,Oi(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Oi(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Zg(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)>0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function Gi(t,e,n){if(t=Float64Array.from(jT(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Da(t);if(e>=1)return Fi(t);var r,i=(r-1)*e,o=Math.floor(i),a=Fi(Ca(t,o).subarray(0,o+1)),s=Da(t.subarray(o+1));return a+(s-a)*(i-o)}}function Kg(t,e,n=Aa){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function Qg(t,e,n=Aa){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,u)=>Aa(n(t[u],u,t))),e<=0)return Wl(r);if(e>=1)return Ul(r);var r,i=Uint32Array.from(t,(s,u)=>u),o=r.length-1,a=Math.floor(o*e);return Ca(i,a,0,o,(s,u)=>Br(r[s],r[u])),a=Zg(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function b3(t,e,n){const r=Ta(t),i=Gi(t,.75)-Gi(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function x3(t,e,n){const r=Ta(t),i=Fg(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function v3(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function _3(t,e){return Gi(t,.5,e)}function w3(t,e){return Qg(t,.5,e)}function*$3(t){for(const e of t)yield*e}function Hl(t){return Array.from($3(t))}function S3(t,e){const n=new Bi;if(e===void 0)for(let o of t)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let a of t)(a=e(a,++o,t))!=null&&a>=a&&n.set(a,(n.get(a)||0)+1)}let r,i=0;for(const[o,a]of n)a>i&&(i=a,r=o);return r}function A3(t,e=T3){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function T3(t,e){return[t,e]}function mn(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function P3(t,e=_t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t);const r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=_t);const i=(s,u)=>e(n[s],n[u]);let o,a;return t=Uint32Array.from(n,(s,u)=>u),t.sort(e===_t?(s,u)=>Br(n[s],n[u]):Ol(i)),t.forEach((s,u)=>{const l=i(s,o===void 0?s:o);l>=0?((o===void 0||l>0)&&(o=s,a=u),r[s]=a):r[s]=NaN}),r}function M3(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)<0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)<0:e(i,i)===0)&&(n=i,r=!0);return n}function Jg(t,e=_t){if(e.length===1)return Wl(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)<0)&&(n=o,r=i);return r}function D3(t,e=_t){if(e.length===1)return Ul(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)>0)&&(n=o,r=i);return r}function C3(t,e){const n=Jg(t,e);return n<0?void 0:n}const L3=t0(Math.random);function t0(t){return function(n,r=0,i=n.length){let o=i-(r=+r);for(;o;){const a=t()*o--|0,s=n[o+r];n[o+r]=n[a+r],n[a+r]=s}return n}}function e0(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function n0(t){if(!(o=t.length))return[];for(var e=-1,n=Da(t,k3),r=new Array(n);++e<n;)for(var i=-1,o,a=r[e]=new Array(o);++i<o;)a[i]=t[i][e];return r}function k3(t){return t.length}function R3(){return n0(arguments)}function E3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(!e(r,++n,t))return!1;return!0}function I3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(e(r,++n,t))return!0;return!1}function N3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of t)e(i,++r,t)&&n.push(i);return n}function B3(t,e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof e!="function")throw new TypeError("mapper is not a function");return Array.from(t,(n,r)=>e(n,r,t))}function F3(t,e,n){if(typeof e!="function")throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if({done:i,value:n}=r.next(),i)return;++a}for(;{done:i,value:o}=r.next(),!i;)n=e(n,o,++a,t);return n}function O3(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function G3(t,...e){t=new Gn(t);for(const n of e)for(const r of n)t.delete(r);return t}function z3(t,e){const n=e[Symbol.iterator](),r=new Gn;for(const i of t){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=n.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function Y3(t,...e){t=new Gn(t),e=e.map(U3);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function U3(t){return t instanceof Gn?t:new Gn(t)}function r0(t,e){const n=t[Symbol.iterator](),r=new Set;for(const i of e){const o=i0(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const u=i0(a);if(r.add(u),Object.is(o,u))break}}return!0}function i0(t){return t!==null&&typeof t=="object"?t.valueOf():t}function W3(t,e){return r0(e,t)}function H3(...t){const e=new Gn;for(const n of t)for(const r of n)e.add(r);return e}function X3(t){return t}var La=1,ka=2,Xl=3,zi=4,o0=1e-6;function j3(t){return"translate("+t+",0)"}function V3(t){return"translate(0,"+t+")"}function q3(t){return e=>+t(e)}function Z3(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function K3(){return!this.__axis}function Ra(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===La||t===zi?-1:1,c=t===zi||t===ka?"x":"y",f=t===La||t===Xl?j3:V3;function h(p){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),g=i??(e.tickFormat?e.tickFormat.apply(e,n):X3),m=Math.max(o,0)+s,y=e.range(),b=+y[0]+u,v=+y[y.length-1]+u,x=(e.bandwidth?Z3:q3)(e.copy(),u),S=p.selection?p.selection():p,$=S.selectAll(".domain").data([null]),R=S.selectAll(".tick").data(d,e).order(),T=R.exit(),w=R.enter().append("g").attr("class","tick"),P=R.select("line"),_=R.select("text");$=$.merge($.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(w),P=P.merge(w.append("line").attr("stroke","currentColor").attr(c+"2",l*o)),_=_.merge(w.append("text").attr("fill","currentColor").attr(c,l*m).attr("dy",t===La?"0em":t===Xl?"0.71em":"0.32em")),p!==S&&($=$.transition(p),R=R.transition(p),P=P.transition(p),_=_.transition(p),T=T.transition(p).attr("opacity",o0).attr("transform",function(N){return isFinite(N=x(N))?f(N+u):this.getAttribute("transform")}),w.attr("opacity",o0).attr("transform",function(N){var D=this.parentNode.__axis;return f((D&&isFinite(D=D(N))?D:x(N))+u)})),T.remove(),$.attr("d",t===zi||t===ka?a?"M"+l*a+","+b+"H"+u+"V"+v+"H"+l*a:"M"+u+","+b+"V"+v:a?"M"+b+","+l*a+"V"+u+"H"+v+"V"+l*a:"M"+b+","+u+"H"+v),R.attr("opacity",1).attr("transform",function(N){return f(x(N)+u)}),P.attr(c+"2",l*o),_.attr(c,l*m).text(g),S.filter(K3).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ka?"start":t===zi?"end":"middle"),S.each(function(){this.__axis=x})}return h.scale=function(p){return arguments.length?(e=p,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(o=a=+p,h):o},h.tickSizeInner=function(p){return arguments.length?(o=+p,h):o},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(s=+p,h):s},h.offset=function(p){return arguments.length?(u=+p,h):u},h}function Q3(t){return Ra(La,t)}function J3(t){return Ra(ka,t)}function a0(t){return Ra(Xl,t)}function s0(t){return Ra(zi,t)}var t5={value:()=>{}};function Un(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ea(n)}function Ea(t){this._=t}function e5(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ea.prototype=Un.prototype={constructor:Ea,on:function(t,e){var n=this._,r=e5(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=n5(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=u0(n[i],t.name,e);else if(e==null)for(i in n)n[i]=u0(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ea(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function n5(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function u0(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=t5,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var jl="http://www.w3.org/1999/xhtml";const Vl={svg:"http://www.w3.org/2000/svg",xhtml:jl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yi(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Vl.hasOwnProperty(e)?{space:Vl[e],local:t}:t}function r5(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===jl&&e.documentElement.namespaceURI===jl?e.createElement(t):e.createElementNS(n,t)}}function i5(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ia(t){var e=Yi(t);return(e.local?i5:r5)(e)}function o5(){}function Na(t){return t==null?o5:function(){return this.querySelector(t)}}function a5(t){typeof t!="function"&&(t=Na(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new Wt(r,this._parents)}function l0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function s5(){return[]}function ql(t){return t==null?s5:function(){return this.querySelectorAll(t)}}function u5(t){return function(){return l0(t.apply(this,arguments))}}function l5(t){typeof t=="function"?t=u5(t):t=ql(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new Wt(r,i)}function Zl(t){return function(){return this.matches(t)}}function c0(t){return function(e){return e.matches(t)}}var c5=Array.prototype.find;function f5(t){return function(){return c5.call(this.children,t)}}function h5(){return this.firstElementChild}function p5(t){return this.select(t==null?h5:f5(typeof t=="function"?t:c0(t)))}var d5=Array.prototype.filter;function g5(){return Array.from(this.children)}function m5(t){return function(){return d5.call(this.children,t)}}function y5(t){return this.selectAll(t==null?g5:m5(typeof t=="function"?t:c0(t)))}function b5(t){typeof t!="function"&&(t=Zl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Wt(r,this._parents)}function f0(t){return new Array(t.length)}function x5(){return new Wt(this._enter||this._groups.map(f0),this._parents)}function Ba(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ba.prototype={constructor:Ba,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function v5(t){return function(){return t}}function _5(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ba(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function w5(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new Ba(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function $5(t){return t.__data__}function S5(t,e){if(!arguments.length)return Array.from(this,$5);var n=e?w5:_5,r=this._parents,i=this._groups;typeof t!="function"&&(t=v5(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=A5(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var b=0,v=0,x,S;b<d;++b)if(x=g[b]){for(b>=v&&(v=b+1);!(S=m[v])&&++v<d;);x._next=S||null}}return a=new Wt(a,r),a._enter=s,a._exit=u,a}function A5(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function T5(){return new Wt(this._exit||this._groups.map(f0),this._parents)}function P5(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function M5(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new Wt(s,this._parents)}function D5(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function C5(t){t||(t=L5);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new Wt(i,this._parents).order()}function L5(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function k5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function R5(){return Array.from(this)}function E5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function I5(){let t=0;for(const e of this)++t;return t}function N5(){return!this.node()}function B5(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function F5(t){return function(){this.removeAttribute(t)}}function O5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function G5(t,e){return function(){this.setAttribute(t,e)}}function z5(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Y5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function U5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function W5(t,e){var n=Yi(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?O5:F5:typeof e=="function"?n.local?U5:Y5:n.local?z5:G5)(n,e))}function Kl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function H5(t){return function(){this.style.removeProperty(t)}}function X5(t,e,n){return function(){this.style.setProperty(t,e,n)}}function j5(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function V5(t,e,n){return arguments.length>1?this.each((e==null?H5:typeof e=="function"?j5:X5)(t,e,n??"")):Wn(this.node(),t)}function Wn(t,e){return t.style.getPropertyValue(e)||Kl(t).getComputedStyle(t,null).getPropertyValue(e)}function q5(t){return function(){delete this[t]}}function Z5(t,e){return function(){this[t]=e}}function K5(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Q5(t,e){return arguments.length>1?this.each((e==null?q5:typeof e=="function"?K5:Z5)(t,e)):this.node()[t]}function h0(t){return t.trim().split(/^|\s+/)}function Ql(t){return t.classList||new p0(t)}function p0(t){this._node=t,this._names=h0(t.getAttribute("class")||"")}p0.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function d0(t,e){for(var n=Ql(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function g0(t,e){for(var n=Ql(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function J5(t){return function(){d0(this,t)}}function t6(t){return function(){g0(this,t)}}function e6(t,e){return function(){(e.apply(this,arguments)?d0:g0)(this,t)}}function n6(t,e){var n=h0(t+"");if(arguments.length<2){for(var r=Ql(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?e6:e?J5:t6)(n,e))}function r6(){this.textContent=""}function i6(t){return function(){this.textContent=t}}function o6(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function a6(t){return arguments.length?this.each(t==null?r6:(typeof t=="function"?o6:i6)(t)):this.node().textContent}function s6(){this.innerHTML=""}function u6(t){return function(){this.innerHTML=t}}function l6(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function c6(t){return arguments.length?this.each(t==null?s6:(typeof t=="function"?l6:u6)(t)):this.node().innerHTML}function f6(){this.nextSibling&&this.parentNode.appendChild(this)}function h6(){return this.each(f6)}function p6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function d6(){return this.each(p6)}function g6(t){var e=typeof t=="function"?t:Ia(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function m6(){return null}function y6(t,e){var n=typeof t=="function"?t:Ia(t),r=e==null?m6:typeof e=="function"?e:Na(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function b6(){var t=this.parentNode;t&&t.removeChild(this)}function x6(){return this.each(b6)}function v6(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _6(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function w6(t){return this.select(t?_6:v6)}function $6(t){return arguments.length?this.property("__data__",t):this.node().__data__}function S6(t){return function(e){t.call(this,e,this.__data__)}}function A6(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function T6(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function P6(t,e,n){return function(){var r=this.__on,i,o=S6(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function M6(t,e,n){var r=A6(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?P6:T6,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function m0(t,e,n){var r=Kl(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function D6(t,e){return function(){return m0(this,t,e)}}function C6(t,e){return function(){return m0(this,t,e.apply(this,arguments))}}function L6(t,e){return this.each((typeof e=="function"?C6:D6)(t,e))}function*k6(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Jl=[null];function Wt(t,e){this._groups=t,this._parents=e}function Hn(){return new Wt([[document.documentElement]],Jl)}function R6(){return this}Wt.prototype=Hn.prototype={constructor:Wt,select:a5,selectAll:l5,selectChild:p5,selectChildren:y5,filter:b5,data:S5,enter:x5,exit:T5,join:P5,merge:M5,selection:R6,order:D5,sort:C5,call:k5,nodes:R5,node:E5,size:I5,empty:N5,each:B5,attr:W5,style:V5,property:Q5,classed:n6,text:a6,html:c6,raise:h6,lower:d6,append:g6,insert:y6,remove:x6,clone:w6,datum:$6,on:M6,dispatch:L6,[Symbol.iterator]:k6};function V(t){return typeof t=="string"?new Wt([[document.querySelector(t)]],[document.documentElement]):new Wt([[t]],Jl)}function E6(t){return V(Ia(t).call(document.documentElement))}var I6=0;function y0(){return new tc}function tc(){this._="@"+(++I6).toString(36)}tc.prototype=y0.prototype={constructor:tc,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};function b0(t){let e;for(;e=t.sourceEvent;)t=e;return t}function le(t,e){if(t=b0(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function N6(t,e){return t.target&&(t=b0(t),e===void 0&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,n=>le(n,e))}function B6(t){return typeof t=="string"?new Wt([document.querySelectorAll(t)],[document.documentElement]):new Wt([l0(t)],Jl)}const F6={passive:!1},Ui={capture:!0,passive:!1};function ec(t){t.stopImmediatePropagation()}function Fr(t){t.preventDefault(),t.stopImmediatePropagation()}function Fa(t){var e=t.document.documentElement,n=V(t).on("dragstart.drag",Fr,Ui);"onselectstart"in e?n.on("selectstart.drag",Fr,Ui):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Oa(t,e){var n=t.document.documentElement,r=V(t).on("dragstart.drag",null);e&&(r.on("click.drag",Fr,Ui),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ga=t=>()=>t;function nc(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}nc.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function O6(t){return!t.ctrlKey&&!t.button}function G6(){return this.parentNode}function z6(t,e){return e??{x:t.x,y:t.y}}function Y6(){return navigator.maxTouchPoints||"ontouchstart"in this}function x0(){var t=O6,e=G6,n=z6,r=Y6,i={},o=Un("start","drag","end"),a=0,s,u,l,c,f=0;function h(x){x.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,F6).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,S){if(!(c||!t.call(this,x,S))){var $=v(this,e.call(this,x,S),x,S,"mouse");$&&(V(x.view).on("mousemove.drag",d,Ui).on("mouseup.drag",g,Ui),Fa(x.view),ec(x),l=!1,s=x.clientX,u=x.clientY,$("start",x))}}function d(x){if(Fr(x),!l){var S=x.clientX-s,$=x.clientY-u;l=S*S+$*$>f}i.mouse("drag",x)}function g(x){V(x.view).on("mousemove.drag mouseup.drag",null),Oa(x.view,l),Fr(x),i.mouse("end",x)}function m(x,S){if(t.call(this,x,S)){var $=x.changedTouches,R=e.call(this,x,S),T=$.length,w,P;for(w=0;w<T;++w)(P=v(this,R,x,S,$[w].identifier,$[w]))&&(ec(x),P("start",x,$[w]))}}function y(x){var S=x.changedTouches,$=S.length,R,T;for(R=0;R<$;++R)(T=i[S[R].identifier])&&(Fr(x),T("drag",x,S[R]))}function b(x){var S=x.changedTouches,$=S.length,R,T;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),R=0;R<$;++R)(T=i[S[R].identifier])&&(ec(x),T("end",x,S[R]))}function v(x,S,$,R,T,w){var P=o.copy(),_=le(w||$,S),N,D,A;if((A=n.call(x,new nc("beforestart",{sourceEvent:$,target:h,identifier:T,active:a,x:_[0],y:_[1],dx:0,dy:0,dispatch:P}),R))!=null)return N=A.x-_[0]||0,D=A.y-_[1]||0,function L(M,G,O){var E=_,k;switch(M){case"start":i[T]=L,k=a++;break;case"end":delete i[T],--a;case"drag":_=le(O||G,S),k=a;break}P.call(M,x,new nc(M,{sourceEvent:G,subject:A,target:h,identifier:T,active:k,x:_[0]+N,y:_[1]+D,dx:_[0]-E[0],dy:_[1]-E[1],dispatch:P}),R)}}return h.filter=function(x){return arguments.length?(t=typeof x=="function"?x:Ga(!!x),h):t},h.container=function(x){return arguments.length?(e=typeof x=="function"?x:Ga(x),h):e},h.subject=function(x){return arguments.length?(n=typeof x=="function"?x:Ga(x),h):n},h.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:Ga(!!x),h):r},h.on=function(){var x=o.on.apply(o,arguments);return x===o?h:x},h.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,h):Math.sqrt(f)},h}function Or(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Wi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function yn(){}var Xn=.7,Gr=1/Xn,zr="\\s*([+-]?\\d+)\\s*",Hi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Be="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",U6=/^#([0-9a-f]{3,8})$/,W6=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),H6=new RegExp(`^rgb\\(${Be},${Be},${Be}\\)$`),X6=new RegExp(`^rgba\\(${zr},${zr},${zr},${Hi}\\)$`),j6=new RegExp(`^rgba\\(${Be},${Be},${Be},${Hi}\\)$`),V6=new RegExp(`^hsl\\(${Hi},${Be},${Be}\\)$`),q6=new RegExp(`^hsla\\(${Hi},${Be},${Be},${Hi}\\)$`),v0={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};Or(yn,bn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_0,formatHex:_0,formatHex8:Z6,formatHsl:K6,formatRgb:w0,toString:w0});function _0(){return this.rgb().formatHex()}function Z6(){return this.rgb().formatHex8()}function K6(){return P0(this).formatHsl()}function w0(){return this.rgb().formatRgb()}function bn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=U6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?$0(e):n===3?new Rt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?za(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?za(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=W6.exec(t))?new Rt(e[1],e[2],e[3],1):(e=H6.exec(t))?new Rt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=X6.exec(t))?za(e[1],e[2],e[3],e[4]):(e=j6.exec(t))?za(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=V6.exec(t))?T0(e[1],e[2]/100,e[3]/100,1):(e=q6.exec(t))?T0(e[1],e[2]/100,e[3]/100,e[4]):v0.hasOwnProperty(t)?$0(v0[t]):t==="transparent"?new Rt(NaN,NaN,NaN,0):null}function $0(t){return new Rt(t>>16&255,t>>8&255,t&255,1)}function za(t,e,n,r){return r<=0&&(t=e=n=NaN),new Rt(t,e,n,r)}function rc(t){return t instanceof yn||(t=bn(t)),t?(t=t.rgb(),new Rt(t.r,t.g,t.b,t.opacity)):new Rt}function Yr(t,e,n,r){return arguments.length===1?rc(t):new Rt(t,e,n,r??1)}function Rt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Or(Rt,Yr,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new Rt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new Rt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Rt(jn(this.r),jn(this.g),jn(this.b),Ya(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:S0,formatHex:S0,formatHex8:Q6,formatRgb:A0,toString:A0}));function S0(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}`}function Q6(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}${Vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function A0(){const t=Ya(this.opacity);return`${t===1?"rgb(":"rgba("}${jn(this.r)}, ${jn(this.g)}, ${jn(this.b)}${t===1?")":`, ${t})`}`}function Ya(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Vn(t){return t=jn(t),(t<16?"0":"")+t.toString(16)}function T0(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Te(t,e,n,r)}function P0(t){if(t instanceof Te)return new Te(t.h,t.s,t.l,t.opacity);if(t instanceof yn||(t=bn(t)),!t)return new Te;if(t instanceof Te)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Te(a,s,u,t.opacity)}function Ua(t,e,n,r){return arguments.length===1?P0(t):new Te(t,e,n,r??1)}function Te(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Or(Te,Ua,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new Te(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new Te(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,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 Rt(ic(t>=240?t-240:t+120,i,r),ic(t,i,r),ic(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Te(M0(this.h),Wa(this.s),Wa(this.l),Ya(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=Ya(this.opacity);return`${t===1?"hsl(":"hsla("}${M0(this.h)}, ${Wa(this.s)*100}%, ${Wa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function M0(t){return t=(t||0)%360,t<0?t+360:t}function Wa(t){return Math.max(0,Math.min(1,t||0))}function ic(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const D0=Math.PI/180,C0=180/Math.PI,Ha=18,L0=.96422,k0=1,R0=.82521,E0=4/29,Ur=6/29,I0=3*Ur*Ur,J6=Ur*Ur*Ur;function N0(t){if(t instanceof Pe)return new Pe(t.l,t.a,t.b,t.opacity);if(t instanceof Fe)return F0(t);t instanceof Rt||(t=rc(t));var e=uc(t.r),n=uc(t.g),r=uc(t.b),i=oc((.2225045*e+.7168786*n+.0606169*r)/k0),o,a;return e===n&&n===r?o=a=i:(o=oc((.4360747*e+.3850649*n+.1430804*r)/L0),a=oc((.0139322*e+.0971045*n+.7141733*r)/R0)),new Pe(116*i-16,500*(o-i),200*(i-a),t.opacity)}function tP(t,e){return new Pe(t,0,0,e??1)}function Xa(t,e,n,r){return arguments.length===1?N0(t):new Pe(t,e,n,r??1)}function Pe(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Or(Pe,Xa,Wi(yn,{brighter(t){return new Pe(this.l+Ha*(t??1),this.a,this.b,this.opacity)},darker(t){return new Pe(this.l-Ha*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=L0*ac(e),t=k0*ac(t),n=R0*ac(n),new Rt(sc(3.1338561*e-1.6168667*t-.4906146*n),sc(-.9787684*e+1.9161415*t+.033454*n),sc(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function oc(t){return t>J6?Math.pow(t,1/3):t/I0+E0}function ac(t){return t>Ur?t*t*t:I0*(t-E0)}function sc(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function uc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function B0(t){if(t instanceof Fe)return new Fe(t.h,t.c,t.l,t.opacity);if(t instanceof Pe||(t=N0(t)),t.a===0&&t.b===0)return new Fe(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*C0;return new Fe(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function eP(t,e,n,r){return arguments.length===1?B0(t):new Fe(n,e,t,r??1)}function ja(t,e,n,r){return arguments.length===1?B0(t):new Fe(t,e,n,r??1)}function Fe(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function F0(t){if(isNaN(t.h))return new Pe(t.l,0,0,t.opacity);var e=t.h*D0;return new Pe(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Or(Fe,ja,Wi(yn,{brighter(t){return new Fe(this.h,this.c,this.l+Ha*(t??1),this.opacity)},darker(t){return new Fe(this.h,this.c,this.l-Ha*(t??1),this.opacity)},rgb(){return F0(this).rgb()}}));var O0=-.14861,lc=1.78277,cc=-.29227,Va=-.90649,Xi=1.97294,G0=Xi*Va,z0=Xi*lc,Y0=lc*cc-Va*O0;function nP(t){if(t instanceof qn)return new qn(t.h,t.s,t.l,t.opacity);t instanceof Rt||(t=rc(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Y0*r+G0*e-z0*n)/(Y0+G0-z0),o=r-i,a=(Xi*(n-i)-cc*o)/Va,s=Math.sqrt(a*a+o*o)/(Xi*i*(1-i)),u=s?Math.atan2(a,o)*C0-120:NaN;return new qn(u<0?u+360:u,s,i,t.opacity)}function Me(t,e,n,r){return arguments.length===1?nP(t):new qn(t,e,n,r??1)}function qn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Or(qn,Me,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new qn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new qn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*D0,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Rt(255*(e+n*(O0*r+lc*i)),255*(e+n*(cc*r+Va*i)),255*(e+n*(Xi*r)),this.opacity)}}));function U0(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}function W0(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 U0((n-r/e)*e,a,i,o,s)}}function H0(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return U0((n-r/e)*e,i,o,a,s)}}const qa=t=>()=>t;function X0(t,e){return function(n){return t+n*e}}function rP(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)}}function Za(t,e){var n=e-t;return n?X0(t,n>180||n<-180?n-360*Math.round(n/360):n):qa(isNaN(t)?e:t)}function iP(t){return(t=+t)==1?Et:function(e,n){return n-e?rP(e,n,t):qa(isNaN(e)?n:e)}}function Et(t,e){var n=e-t;return n?X0(t,n):qa(isNaN(t)?e:t)}const ji=function t(e){var n=iP(e);function r(i,o){var a=n((i=Yr(i)).r,(o=Yr(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=Et(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function j0(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Yr(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(u){return s.r=r(u),s.g=i(u),s.b=o(u),s+""}}}var V0=j0(W0),oP=j0(H0);function fc(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function q0(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function aP(t,e){return(q0(e)?fc:Z0)(t,e)}function Z0(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Ze(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function K0(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function ge(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Q0(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Ze(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var hc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pc=new RegExp(hc.source,"g");function sP(t){return function(){return t}}function uP(t){return function(e){return t(e)+""}}function dc(t,e){var n=hc.lastIndex=pc.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=hc.exec(t))&&(i=pc.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:ge(r,i)})),n=pc.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?uP(u[0].x):sP(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function Ze(t,e){var n=typeof e,r;return e==null||n==="boolean"?qa(e):(n==="number"?ge:n==="string"?(r=bn(e))?(e=r,ji):dc:e instanceof bn?ji:e instanceof Date?K0:q0(e)?fc:Array.isArray(e)?Z0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Q0:ge)(t,e)}function lP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function cP(t,e){var n=Za(+t,+e);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function Ka(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var J0=180/Math.PI,gc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tm(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*J0,skewX:Math.atan(u)*J0,scaleX:a,scaleY:s}}var Qa;function fP(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?gc:tm(e.a,e.b,e.c,e.d,e.e,e.f)}function hP(t){return t==null||(Qa||(Qa=document.createElementNS("http://www.w3.org/2000/svg","g")),Qa.setAttribute("transform",t),!(t=Qa.transform.baseVal.consolidate()))?gc:(t=t.matrix,tm(t.a,t.b,t.c,t.d,t.e,t.f))}function em(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:ge(l,f)},{i:g-2,x:ge(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:ge(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:ge(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:ge(l,f)},{i:g-2,x:ge(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var nm=em(fP,"px, ","px)","deg)"),rm=em(hP,", ",")",")"),pP=1e-12;function im(t){return((t=Math.exp(t))+1/t)/2}function dP(t){return((t=Math.exp(t))-1/t)/2}function gP(t){return((t=Math.exp(2*t))-1)/(t+1)}const om=function t(e,n,r){function i(o,a){var s=o[0],u=o[1],l=o[2],c=a[0],f=a[1],h=a[2],p=c-s,d=f-u,g=p*p+d*d,m,y;if(g<pP)y=Math.log(h/l)/e,m=function(R){return[s+R*p,u+R*d,l*Math.exp(e*R*y)]};else{var b=Math.sqrt(g),v=(h*h-l*l+r*g)/(2*l*n*b),x=(h*h-l*l-r*g)/(2*h*n*b),S=Math.log(Math.sqrt(v*v+1)-v),$=Math.log(Math.sqrt(x*x+1)-x);y=($-S)/e,m=function(R){var T=R*y,w=im(S),P=l/(n*b)*(w*gP(e*T+S)-dP(S));return[s+P*p,u+P*d,l*w/im(e*T+S)]}}return m.duration=y*1e3*e/Math.SQRT2,m}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,u=s*s;return t(a,s,u)},i}(Math.SQRT2,2,4);function am(t){return function(e,n){var r=t((e=Ua(e)).h,(n=Ua(n)).h),i=Et(e.s,n.s),o=Et(e.l,n.l),a=Et(e.opacity,n.opacity);return function(s){return e.h=r(s),e.s=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const mP=am(Za);var yP=am(Et);function bP(t,e){var n=Et((t=Xa(t)).l,(e=Xa(e)).l),r=Et(t.a,e.a),i=Et(t.b,e.b),o=Et(t.opacity,e.opacity);return function(a){return t.l=n(a),t.a=r(a),t.b=i(a),t.opacity=o(a),t+""}}function sm(t){return function(e,n){var r=t((e=ja(e)).h,(n=ja(n)).h),i=Et(e.c,n.c),o=Et(e.l,n.l),a=Et(e.opacity,n.opacity);return function(s){return e.h=r(s),e.c=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const xP=sm(Za);var vP=sm(Et);function um(t){return function e(n){n=+n;function r(i,o){var a=t((i=Me(i)).h,(o=Me(o)).h),s=Et(i.s,o.s),u=Et(i.l,o.l),l=Et(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=u(Math.pow(c,n)),i.opacity=l(c),i+""}}return r.gamma=e,r}(1)}const _P=um(Za);var Ja=um(Et);function lm(t,e){e===void 0&&(e=t,t=Ze);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function wP(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Wr=0,Vi=0,qi=0,cm=1e3,ts,Zi,es=0,Zn=0,ns=0,Ki=typeof performance=="object"&&performance.now?performance:Date,fm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Qi(){return Zn||(fm($P),Zn=Ki.now()+ns)}function $P(){Zn=0}function Ji(){this._call=this._time=this._next=null}Ji.prototype=rs.prototype={constructor:Ji,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Qi():+n)+(e==null?0:+e),!this._next&&Zi!==this&&(Zi?Zi._next=this:ts=this,Zi=this),this._call=t,this._time=n,mc()},stop:function(){this._call&&(this._call=null,this._time=1/0,mc())}};function rs(t,e,n){var r=new Ji;return r.restart(t,e,n),r}function hm(){Qi(),++Wr;for(var t=ts,e;t;)(e=Zn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Wr}function pm(){Zn=(es=Ki.now())+ns,Wr=Vi=0;try{hm()}finally{Wr=0,AP(),Zn=0}}function SP(){var t=Ki.now(),e=t-es;e>cm&&(ns-=e,es=t)}function AP(){for(var t,e=ts,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ts=n);Zi=t,mc(r)}function mc(t){if(!Wr){Vi&&(Vi=clearTimeout(Vi));var e=t-Zn;e>24?(t<1/0&&(Vi=setTimeout(pm,t-Ki.now()-ns)),qi&&(qi=clearInterval(qi))):(qi||(es=Ki.now(),qi=setInterval(SP,cm)),Wr=1,fm(pm))}}function yc(t,e,n){var r=new Ji;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}function TP(t,e,n){var r=new Ji,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?Qi():+s,r._restart(function u(l){l+=i,r._restart(u,i+=a,s),o(l)},a,s)},r.restart(t,e,n),r)}var PP=Un("start","end","cancel","interrupt"),MP=[],dm=0,bc=1,xc=2,is=3,gm=4,vc=5,os=6;function as(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;DP(t,n,{name:e,index:r,group:i,on:PP,tween:MP,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:dm})}function _c(t,e){var n=De(t,e);if(n.state>dm)throw new Error("too late; already scheduled");return n}function Oe(t,e){var n=De(t,e);if(n.state>is)throw new Error("too late; already running");return n}function De(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function DP(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=rs(o,0,n.time);function o(l){n.state=bc,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==bc)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===is)return yc(a);p.state===gm?(p.state=os,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=os,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(yc(function(){n.state===is&&(n.state=gm,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=xc,n.on.call("start",t,t.__data__,n.index,n.group),n.state===xc){for(n.state=is,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=vc,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===vc&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=os,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Kn(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>xc&&r.state<vc,r.state=os,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function CP(t){return this.each(function(){Kn(this,t)})}function LP(t,e){var n,r;return function(){var i=Oe(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function kP(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Oe(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function RP(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=De(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?LP:kP)(n,t,e))}function wc(t,e,n){var r=t._id;return t.each(function(){var i=Oe(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return De(i,r).value[e]}}function mm(t,e){var n;return(typeof e=="number"?ge:e instanceof bn?ji:(n=bn(e))?(e=n,ji):dc)(t,e)}function EP(t){return function(){this.removeAttribute(t)}}function IP(t){return function(){this.removeAttributeNS(t.space,t.local)}}function NP(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function BP(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function FP(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function OP(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function GP(t,e){var n=Yi(t),r=n==="transform"?rm:mm;return this.attrTween(t,typeof e=="function"?(n.local?OP:FP)(n,r,wc(this,"attr."+t,e)):e==null?(n.local?IP:EP)(n):(n.local?BP:NP)(n,r,e))}function zP(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function YP(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function UP(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&YP(t,o)),n}return i._value=e,i}function WP(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&zP(t,o)),n}return i._value=e,i}function HP(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Yi(t);return this.tween(n,(r.local?UP:WP)(r,e))}function XP(t,e){return function(){_c(this,t).delay=+e.apply(this,arguments)}}function jP(t,e){return e=+e,function(){_c(this,t).delay=e}}function VP(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?XP:jP)(e,t)):De(this.node(),e).delay}function qP(t,e){return function(){Oe(this,t).duration=+e.apply(this,arguments)}}function ZP(t,e){return e=+e,function(){Oe(this,t).duration=e}}function KP(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?qP:ZP)(e,t)):De(this.node(),e).duration}function QP(t,e){if(typeof e!="function")throw new Error;return function(){Oe(this,t).ease=e}}function JP(t){var e=this._id;return arguments.length?this.each(QP(e,t)):De(this.node(),e).ease}function t8(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Oe(this,t).ease=n}}function e8(t){if(typeof t!="function")throw new Error;return this.each(t8(this._id,t))}function n8(t){typeof t!="function"&&(t=Zl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Ge(r,this._parents,this._name,this._id)}function r8(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Ge(a,this._parents,this._name,this._id)}function i8(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function o8(t,e,n){var r,i,o=i8(e)?_c:Oe;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function a8(t,e){var n=this._id;return arguments.length<2?De(this.node(),n).on.on(t):this.each(o8(n,t,e))}function s8(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function u8(){return this.on("end.remove",s8(this._id))}function l8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Na(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,as(l[h],e,n,h,l,De(c,n)));return new Ge(o,this._parents,e,n)}function c8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ql(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=De(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&as(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ge(o,a,e,n)}var f8=Hn.prototype.constructor;function h8(){return new f8(this._groups,this._parents)}function p8(t,e){var n,r,i;return function(){var o=Wn(this,t),a=(this.style.removeProperty(t),Wn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function ym(t){return function(){this.style.removeProperty(t)}}function d8(t,e,n){var r,i=n+"",o;return function(){var a=Wn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function g8(t,e,n){var r,i,o;return function(){var a=Wn(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),Wn(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function m8(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Oe(this,t),l=u.on,c=u.value[o]==null?s||(s=ym(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function y8(t,e,n){var r=(t+="")=="transform"?nm:mm;return e==null?this.styleTween(t,p8(t,r)).on("end.style."+t,ym(t)):typeof e=="function"?this.styleTween(t,g8(t,r,wc(this,"style."+t,e))).each(m8(this._id,t)):this.styleTween(t,d8(t,r,e),n).on("end.style."+t,null)}function b8(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function x8(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&b8(t,a,n)),r}return o._value=e,o}function v8(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,x8(t,e,n??""))}function _8(t){return function(){this.textContent=t}}function w8(t){return function(){var e=t(this);this.textContent=e??""}}function $8(t){return this.tween("text",typeof t=="function"?w8(wc(this,"text",t)):_8(t==null?"":t+""))}function S8(t){return function(e){this.textContent=t.call(this,e)}}function A8(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&S8(i)),e}return r._value=t,r}function T8(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,A8(t))}function P8(){for(var t=this._name,e=this._id,n=xm(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=De(u,e);as(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ge(r,this._parents,t,n)}function M8(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Oe(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var D8=0;function Ge(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function bm(t){return Hn().transition(t)}function xm(){return++D8}var Ke=Hn.prototype;Ge.prototype=bm.prototype={constructor:Ge,select:l8,selectAll:c8,selectChild:Ke.selectChild,selectChildren:Ke.selectChildren,filter:n8,merge:r8,selection:h8,transition:P8,call:Ke.call,nodes:Ke.nodes,node:Ke.node,size:Ke.size,empty:Ke.empty,each:Ke.each,on:a8,attr:GP,attrTween:HP,style:y8,styleTween:v8,text:$8,textTween:T8,remove:u8,tween:RP,delay:VP,duration:KP,ease:JP,easeVarying:e8,end:M8,[Symbol.iterator]:Ke[Symbol.iterator]};const C8=t=>+t;function L8(t){return t*t}function k8(t){return t*(2-t)}function vm(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function R8(t){return t*t*t}function E8(t){return--t*t*t+1}function to(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $c=3,I8=function t(e){e=+e;function n(r){return Math.pow(r,e)}return n.exponent=t,n}($c),N8=function t(e){e=+e;function n(r){return 1-Math.pow(1-r,e)}return n.exponent=t,n}($c),_m=function t(e){e=+e;function n(r){return((r*=2)<=1?Math.pow(r,e):2-Math.pow(2-r,e))/2}return n.exponent=t,n}($c),wm=Math.PI,$m=wm/2;function B8(t){return+t==1?1:1-Math.cos(t*$m)}function F8(t){return Math.sin(t*$m)}function Sm(t){return(1-Math.cos(wm*t))/2}function xn(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function O8(t){return xn(1-+t)}function G8(t){return 1-xn(t)}function Am(t){return((t*=2)<=1?xn(1-t):2-xn(t-1))/2}function z8(t){return 1-Math.sqrt(1-t*t)}function Y8(t){return Math.sqrt(1- --t*t)}function Tm(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Sc=4/11,U8=6/11,W8=8/11,H8=3/4,X8=9/11,j8=10/11,V8=15/16,q8=21/22,Z8=63/64,ss=1/Sc/Sc;function K8(t){return 1-eo(1-t)}function eo(t){return(t=+t)<Sc?ss*t*t:t<W8?ss*(t-=U8)*t+H8:t<j8?ss*(t-=X8)*t+V8:ss*(t-=q8)*t+Z8}function Q8(t){return((t*=2)<=1?1-eo(1-t):eo(t-1)+1)/2}var Ac=1.70158,J8=function t(e){e=+e;function n(r){return(r=+r)*r*(e*(r-1)+r)}return n.overshoot=t,n}(Ac),tM=function t(e){e=+e;function n(r){return--r*r*((r+1)*e+r)+1}return n.overshoot=t,n}(Ac),Pm=function t(e){e=+e;function n(r){return((r*=2)<1?r*r*((e+1)*r-e):(r-=2)*r*((e+1)*r+e)+2)/2}return n.overshoot=t,n}(Ac),Hr=2*Math.PI,Tc=1,Pc=.3,eM=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return e*xn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),no=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return 1-e*xn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),nM=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return((o=o*2-1)<0?e*xn(-o)*Math.sin((r-o)/n):2-e*xn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),rM={time:null,delay:0,duration:250,ease:to};function iM(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function oM(t){var e,n;t instanceof Ge?(e=t._id,t=t._name):(e=xm(),(n=rM).time=Qi(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&as(u,t,e,l,a,n||iM(u,e));return new Ge(r,this._parents,t,e)}Hn.prototype.interrupt=CP,Hn.prototype.transition=oM;var aM=[null];function sM(t,e){var n=t.__transition,r,i;if(n){e=e==null?null:e+"";for(i in n)if((r=n[i]).state>bc&&r.name===e)return new Ge([[t]],aM,e,+i)}return null}const Mc=t=>()=>t;function uM(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function lM(t){t.stopImmediatePropagation()}function Dc(t){t.preventDefault(),t.stopImmediatePropagation()}var Mm={name:"drag"},Cc={name:"space"},Xr={name:"handle"},jr={name:"center"};const{abs:Dm,max:Ft,min:Ot}=Math;function Cm(t){return[+t[0],+t[1]]}function Lc(t){return[Cm(t[0]),Cm(t[1])]}var us={name:"x",handles:["w","e"].map(ro),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ls={name:"y",handles:["n","s"].map(ro),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},cM={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(ro),input:function(t){return t==null?null:Lc(t)},output:function(t){return t}},Qe={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Lm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},km={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},fM={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},hM={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ro(t){return{type:t}}function pM(t){return!t.ctrlKey&&!t.button}function dM(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function gM(){return navigator.maxTouchPoints||"ontouchstart"in this}function kc(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function mM(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function yM(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function bM(){return Rc(us)}function xM(){return Rc(ls)}function vM(){return Rc(cM)}function Rc(t){var e=dM,n=pM,r=gM,i=!0,o=Un("start","brush","end"),a=6,s;function u(m){var y=m.property("__brush",g).selectAll(".overlay").data([ro("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Qe.overlay).merge(y).each(function(){var v=kc(this).extent;V(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),m.selectAll(".selection").data([ro("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Qe.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=m.selectAll(".handle").data(t.handles,function(v){return v.type});b.exit().remove(),b.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return Qe[v.type]}),m.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}u.move=function(m,y,b){m.tween?m.on("start.brush",function(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,x=v.__brush,S=c(v,arguments),$=x.selection,R=t.input(typeof y=="function"?y.apply(this,arguments):y,x.extent),T=Ze($,R);function w(P){x.selection=P===1&&R===null?null:T(P),l.call(v),S.brush()}return $!==null&&R!==null?w:w(1)}):m.each(function(){var v=this,x=arguments,S=v.__brush,$=t.input(typeof y=="function"?y.apply(v,x):y,S.extent),R=c(v,x).beforestart();Kn(v),S.selection=$===null?null:$,l.call(v),R.start(b).brush(b).end(b)})},u.clear=function(m,y){u.move(m,null,y)};function l(){var m=V(this),y=kc(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?y[1][1]-y[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,y,b){var v=m.__brush.emitter;return v&&(!b||!v.clean)?v:new f(m,y,b)}function f(m,y,b){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=b}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,b){var v=V(this.that).datum();o.call(m,this.that,new uM(m,{sourceEvent:y,target:u,selection:t.output(this.state.selection),mode:b,dispatch:o}),v)}};function h(m){if(s&&!m.touches||!n.apply(this,arguments))return;var y=this,b=m.target.__data__.type,v=(i&&m.metaKey?b="overlay":b)==="selection"?Mm:i&&m.altKey?jr:Xr,x=t===ls?null:fM[b],S=t===us?null:hM[b],$=kc(y),R=$.extent,T=$.selection,w=R[0][0],P,_,N=R[0][1],D,A,L=R[1][0],M,G,O=R[1][1],E,k,C=0,F=0,X,Q=x&&S&&i&&m.shiftKey,z,Z,Y=Array.from(m.touches||[m],st=>{const Pt=st.identifier;return st=le(st,y),st.point0=st.slice(),st.identifier=Pt,st});Kn(y);var q=c(y,arguments,!0).beforestart();if(b==="overlay"){T&&(X=!0);const st=[Y[0],Y[1]||Y[0]];$.selection=T=[[P=t===ls?w:Ot(st[0][0],st[1][0]),D=t===us?N:Ot(st[0][1],st[1][1])],[M=t===ls?L:Ft(st[0][0],st[1][0]),E=t===us?O:Ft(st[0][1],st[1][1])]],Y.length>1&&mt(m)}else P=T[0][0],D=T[0][1],M=T[1][0],E=T[1][1];_=P,A=D,G=M,k=E;var j=V(y).attr("pointer-events","none"),rt=j.selectAll(".overlay").attr("cursor",Qe[b]);if(m.touches)q.moved=H,q.ended=ht;else{var ut=V(m.view).on("mousemove.brush",H,!0).on("mouseup.brush",ht,!0);i&&ut.on("keydown.brush",Ut,!0).on("keyup.brush",ee,!0),Fa(m.view)}l.call(y),q.start(m,v.name);function H(st){for(const Pt of st.changedTouches||[st])for(const Xo of Y)Xo.identifier===Pt.identifier&&(Xo.cur=le(Pt,y));if(Q&&!z&&!Z&&Y.length===1){const Pt=Y[0];Dm(Pt.cur[0]-Pt[0])>Dm(Pt.cur[1]-Pt[1])?Z=!0:z=!0}for(const Pt of Y)Pt.cur&&(Pt[0]=Pt.cur[0],Pt[1]=Pt.cur[1]);X=!0,Dc(st),mt(st)}function mt(st){const Pt=Y[0],Xo=Pt.point0;var kn;switch(C=Pt[0]-Xo[0],F=Pt[1]-Xo[1],v){case Cc:case Mm:{x&&(C=Ft(w-P,Ot(L-M,C)),_=P+C,G=M+C),S&&(F=Ft(N-D,Ot(O-E,F)),A=D+F,k=E+F);break}case Xr:{Y[1]?(x&&(_=Ft(w,Ot(L,Y[0][0])),G=Ft(w,Ot(L,Y[1][0])),x=1),S&&(A=Ft(N,Ot(O,Y[0][1])),k=Ft(N,Ot(O,Y[1][1])),S=1)):(x<0?(C=Ft(w-P,Ot(L-P,C)),_=P+C,G=M):x>0&&(C=Ft(w-M,Ot(L-M,C)),_=P,G=M+C),S<0?(F=Ft(N-D,Ot(O-D,F)),A=D+F,k=E):S>0&&(F=Ft(N-E,Ot(O-E,F)),A=D,k=E+F));break}case jr:{x&&(_=Ft(w,Ot(L,P-C*x)),G=Ft(w,Ot(L,M+C*x))),S&&(A=Ft(N,Ot(O,D-F*S)),k=Ft(N,Ot(O,E+F*S)));break}}G<_&&(x*=-1,kn=P,P=M,M=kn,kn=_,_=G,G=kn,b in Lm&&rt.attr("cursor",Qe[b=Lm[b]])),k<A&&(S*=-1,kn=D,D=E,E=kn,kn=A,A=k,k=kn,b in km&&rt.attr("cursor",Qe[b=km[b]])),$.selection&&(T=$.selection),z&&(_=T[0][0],G=T[1][0]),Z&&(A=T[0][1],k=T[1][1]),(T[0][0]!==_||T[0][1]!==A||T[1][0]!==G||T[1][1]!==k)&&($.selection=[[_,A],[G,k]],l.call(y),q.brush(st,v.name))}function ht(st){if(lM(st),st.touches){if(st.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else Oa(st.view,X),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);j.attr("pointer-events","all"),rt.attr("cursor",Qe.overlay),$.selection&&(T=$.selection),mM(T)&&($.selection=null,l.call(y)),q.end(st,v.name)}function Ut(st){switch(st.keyCode){case 16:{Q=x&&S;break}case 18:{v===Xr&&(x&&(M=G-C*x,P=_+C*x),S&&(E=k-F*S,D=A+F*S),v=jr,mt(st));break}case 32:{(v===Xr||v===jr)&&(x<0?M=G-C:x>0&&(P=_-C),S<0?E=k-F:S>0&&(D=A-F),v=Cc,rt.attr("cursor",Qe.selection),mt(st));break}default:return}Dc(st)}function ee(st){switch(st.keyCode){case 16:{Q&&(z=Z=Q=!1,mt(st));break}case 18:{v===jr&&(x<0?M=G:x>0&&(P=_),S<0?E=k:S>0&&(D=A),v=Xr,mt(st));break}case 32:{v===Cc&&(st.altKey?(x&&(M=G-C*x,P=_+C*x),S&&(E=k-F*S,D=A+F*S),v=jr):(x<0?M=G:x>0&&(P=_),S<0?E=k:S>0&&(D=A),v=Xr),rt.attr("cursor",Qe[b]),mt(st));break}default:return}Dc(st)}}function p(m){c(this,arguments).moved(m)}function d(m){c(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Lc(e.apply(this,arguments)),m.dim=t,m}return u.extent=function(m){return arguments.length?(e=typeof m=="function"?m:Mc(Lc(m)),u):e},u.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Mc(!!m),u):n},u.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Mc(!!m),u):r},u.handleSize=function(m){return arguments.length?(a=+m,u):a},u.keyModifiers=function(m){return arguments.length?(i=!!m,u):i},u.on=function(){var m=o.on.apply(o,arguments);return m===o?u:m},u}var Rm=Math.abs,Vr=Math.cos,qr=Math.sin,Em=Math.PI,cs=Em/2,Im=Em*2,Nm=Math.max,Ec=1e-12;function Ic(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function _M(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function wM(){return Nc(!1,!1)}function $M(){return Nc(!1,!0)}function SM(){return Nc(!0,!1)}function Nc(t,e){var n=0,r=null,i=null,o=null;function a(s){var u=s.length,l=new Array(u),c=Ic(0,u),f=new Array(u*u),h=new Array(u),p=0,d;s=Float64Array.from({length:u*u},e?(g,m)=>s[m%u][m/u|0]:(g,m)=>s[m/u|0][m%u]);for(let g=0;g<u;++g){let m=0;for(let y=0;y<u;++y)m+=s[g*u+y]+t*s[y*u+g];p+=l[g]=m}p=Nm(0,Im-n*u)/p,d=p?n:Im/u;{let g=0;r&&c.sort((m,y)=>r(l[m],l[y]));for(const m of c){const y=g;if(t){const b=Ic(~u+1,u).filter(v=>v<0?s[~v*u+m]:s[m*u+v]);i&&b.sort((v,x)=>i(v<0?-s[~v*u+m]:s[m*u+v],x<0?-s[~x*u+m]:s[m*u+x]));for(const v of b)if(v<0){const x=f[~v*u+m]||(f[~v*u+m]={source:null,target:null});x.target={index:m,startAngle:g,endAngle:g+=s[~v*u+m]*p,value:s[~v*u+m]}}else{const x=f[m*u+v]||(f[m*u+v]={source:null,target:null});x.source={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}else{const b=Ic(0,u).filter(v=>s[m*u+v]||s[v*u+m]);i&&b.sort((v,x)=>i(s[m*u+v],s[m*u+x]));for(const v of b){let x;if(m<v?(x=f[m*u+v]||(f[m*u+v]={source:null,target:null}),x.source={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]}):(x=f[v*u+m]||(f[v*u+m]={source:null,target:null}),x.target={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]},m===v&&(x.source=x.target)),x.source&&x.target&&x.source.value<x.target.value){const S=x.source;x.source=x.target,x.target=S}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}g+=d}}return f=Object.values(f),f.groups=h,o?f.sort(o):f}return a.padAngle=function(s){return arguments.length?(n=Nm(0,s),a):n},a.sortGroups=function(s){return arguments.length?(r=s,a):r},a.sortSubgroups=function(s){return arguments.length?(i=s,a):i},a.sortChords=function(s){return arguments.length?(s==null?o=null:(o=_M(s))._=s,a):o&&o._},a}const Bc=Math.PI,Fc=2*Bc,Qn=1e-6,AM=Fc-Qn;function Bm(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function TM(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Bm;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let io=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Bm:TM(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,u=r-e,l=i-n,c=a-e,f=s-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>Qn)if(!(Math.abs(f*u-l*c)>Qn)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,d=i-s,g=u*u+l*l,m=p*p+d*d,y=Math.sqrt(g),b=Math.sqrt(h),v=o*Math.tan((Bc-Math.acos((g+h-m)/(2*y*b)))/2),x=v/b,S=v/y;Math.abs(x-1)>Qn&&this._append`L${e+x*c},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*p>c*d)},${this._x1=e+S*u},${this._y1=n+S*l}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=e+s,c=n+u,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Qn||Math.abs(this._y1-c)>Qn)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%Fc+Fc),h>AM?this._append`A${r},${r},0,1,${f},${e-s},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:h>Qn&&this._append`A${r},${r},0,${+(h>=Bc)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Oc(){return new io}Oc.prototype=io.prototype;function PM(t=3){return new io(+t)}var MM=Array.prototype.slice;function Jn(t){return function(){return t}}function DM(t){return t.source}function CM(t){return t.target}function Fm(t){return t.radius}function LM(t){return t.startAngle}function kM(t){return t.endAngle}function RM(){return 0}function EM(){return 10}function Om(t){var e=DM,n=CM,r=Fm,i=Fm,o=LM,a=kM,s=RM,u=null;function l(){var c,f=e.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=MM.call(arguments),g=+r.apply(this,(d[0]=f,d)),m=o.apply(this,d)-cs,y=a.apply(this,d)-cs,b=+i.apply(this,(d[0]=h,d)),v=o.apply(this,d)-cs,x=a.apply(this,d)-cs;if(u||(u=c=Oc()),p>Ec&&(Rm(y-m)>p*2+Ec?y>m?(m+=p,y-=p):(m-=p,y+=p):m=y=(m+y)/2,Rm(x-v)>p*2+Ec?x>v?(v+=p,x-=p):(v-=p,x+=p):v=x=(v+x)/2),u.moveTo(g*Vr(m),g*qr(m)),u.arc(0,0,g,m,y),m!==v||y!==x)if(t){var S=+t.apply(this,arguments),$=b-S,R=(v+x)/2;u.quadraticCurveTo(0,0,$*Vr(v),$*qr(v)),u.lineTo(b*Vr(R),b*qr(R)),u.lineTo($*Vr(x),$*qr(x))}else u.quadraticCurveTo(0,0,b*Vr(v),b*qr(v)),u.arc(0,0,b,v,x);if(u.quadraticCurveTo(0,0,g*Vr(m),g*qr(m)),u.closePath(),c)return u=null,c+""||null}return t&&(l.headRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Jn(+c),l):t}),l.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:Jn(+c),l):r},l.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Jn(+c),l):r},l.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:Jn(+c),l):i},l.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Jn(+c),l):o},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Jn(+c),l):a},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Jn(+c),l):s},l.source=function(c){return arguments.length?(e=c,l):e},l.target=function(c){return arguments.length?(n=c,l):n},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function IM(){return Om()}function NM(){return Om(EM)}var BM=Array.prototype,Gm=BM.slice;function FM(t,e){return t-e}function OM(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}const vn=t=>()=>t;function GM(t,e){for(var n=-1,r=e.length,i;++n<r;)if(i=zM(t,e[n]))return i;return 0}function zM(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],l=u[0],c=u[1],f=t[s],h=f[0],p=f[1];if(YM(u,f,e))return 0;c>r!=p>r&&n<(h-l)*(r-c)/(p-c)+l&&(i=-i)}return i}function YM(t,e,n){var r;return UM(t,e,n)&&WM(t[r=+(t[0]===e[0])],n[r],e[r])}function UM(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function WM(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function HM(){}var Je=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Gc(){var t=1,e=1,n=Yl,r=u;function i(l){var c=n(l);if(Array.isArray(c))c=c.slice().sort(FM);else{const f=Ni(l,XM);for(c=zn(...zl(f[0],f[1],c),c);c[c.length-1]>=f[1];)c.pop();for(;c[1]<f[0];)c.shift()}return c.map(f=>o(l,f))}function o(l,c){const f=c==null?NaN:+c;if(isNaN(f))throw new Error(`invalid value: ${c}`);var h=[],p=[];return a(l,f,function(d){r(d,l,f),OM(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var g=0,m=h.length,y;g<m;++g)if(GM((y=h[g])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:h}}function a(l,c,f){var h=new Array,p=new Array,d,g,m,y,b,v;for(d=g=-1,y=tr(l[0],c),Je[y<<1].forEach(x);++d<t-1;)m=y,y=tr(l[d+1],c),Je[m|y<<1].forEach(x);for(Je[y<<0].forEach(x);++g<e-1;){for(d=-1,y=tr(l[g*t+t],c),b=tr(l[g*t],c),Je[y<<1|b<<2].forEach(x);++d<t-1;)m=y,y=tr(l[g*t+t+d+1],c),v=b,b=tr(l[g*t+d+1],c),Je[m|y<<1|b<<2|v<<3].forEach(x);Je[y|b<<3].forEach(x)}for(d=-1,b=l[g*t]>=c,Je[b<<2].forEach(x);++d<t-1;)v=b,b=tr(l[g*t+d+1],c),Je[b<<2|v<<3].forEach(x);Je[b<<3].forEach(x);function x(S){var $=[S[0][0]+d,S[0][1]+g],R=[S[1][0]+d,S[1][1]+g],T=s($),w=s(R),P,_;(P=p[T])?(_=h[w])?(delete p[P.end],delete h[_.start],P===_?(P.ring.push(R),f(P.ring)):h[P.start]=p[_.end]={start:P.start,end:_.end,ring:P.ring.concat(_.ring)}):(delete p[P.end],P.ring.push(R),p[P.end=w]=P):(P=h[w])?(_=p[T])?(delete h[P.start],delete p[_.end],P===_?(P.ring.push(R),f(P.ring)):h[_.start]=p[P.end]={start:_.start,end:P.end,ring:_.ring.concat(P.ring)}):(delete h[P.start],P.ring.unshift($),h[P.start=T]=P):h[T]=p[w]={start:T,end:w,ring:[$,R]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function u(l,c,f){l.forEach(function(h){var p=h[0],d=h[1],g=p|0,m=d|0,y=zc(c[m*t+g]);p>0&&p<t&&g===p&&(h[0]=zm(p,zc(c[m*t+g-1]),y,f)),d>0&&d<e&&m===d&&(h[1]=zm(d,zc(c[(m-1)*t+g]),y,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[t,e];var c=Math.floor(l[0]),f=Math.floor(l[1]);if(!(c>=0&&f>=0))throw new Error("invalid size");return t=c,e=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?vn(Gm.call(l)):vn(l),i):n},i.smooth=function(l){return arguments.length?(r=l?u:HM,i):r===u},i}function XM(t){return isFinite(t)?t:NaN}function tr(t,e){return t==null?!1:+t>=e}function zc(t){return t==null||isNaN(t=+t)?-1/0:t}function zm(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function jM(t){return t[0]}function VM(t){return t[1]}function qM(){return 1}function ZM(){var t=jM,e=VM,n=qM,r=960,i=500,o=20,a=2,s=o*3,u=r+s*2>>a,l=i+s*2>>a,c=vn(20);function f(b){var v=new Float32Array(u*l),x=Math.pow(2,-a),S=-1;for(const D of b){var $=(t(D,++S,b)+s)*x,R=(e(D,S,b)+s)*x,T=+n(D,S,b);if(T&&$>=0&&$<u&&R>=0&&R<l){var w=Math.floor($),P=Math.floor(R),_=$-w-.5,N=R-P-.5;v[w+P*u]+=(1-_)*(1-N)*T,v[w+1+P*u]+=_*(1-N)*T,v[w+1+(P+1)*u]+=_*N*T,v[w+(P+1)*u]+=(1-_)*N*T}}return Ig({data:v,width:u,height:l},o*x),v}function h(b){var v=f(b),x=c(v),S=Math.pow(2,2*a);return Array.isArray(x)||(x=zn(Number.MIN_VALUE,Fi(v)/S,x)),Gc().size([u,l]).thresholds(x.map($=>$*S))(v).map(($,R)=>($.value=+x[R],p($)))}h.contours=function(b){var v=f(b),x=Gc().size([u,l]),S=Math.pow(2,2*a),$=R=>{R=+R;var T=p(x.contour(v,R*S));return T.value=R,T};return Object.defineProperty($,"max",{get:()=>Fi(v)/S}),$};function p(b){return b.coordinates.forEach(d),b}function d(b){b.forEach(g)}function g(b){b.forEach(m)}function m(b){b[0]=b[0]*Math.pow(2,a)-s,b[1]=b[1]*Math.pow(2,a)-s}function y(){return s=o*3,u=r+s*2>>a,l=i+s*2>>a,h}return h.x=function(b){return arguments.length?(t=typeof b=="function"?b:vn(+b),h):t},h.y=function(b){return arguments.length?(e=typeof b=="function"?b:vn(+b),h):e},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:vn(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var v=+b[0],x=+b[1];if(!(v>=0&&x>=0))throw new Error("invalid size");return r=v,i=x,y()},h.cellSize=function(b){if(!arguments.length)return 1<<a;if(!((b=+b)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(b)/Math.LN2),y()},h.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?vn(Gm.call(b)):vn(b),h):c},h.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},h}const tn=11102230246251565e-32,Gt=134217729,KM=(3+8*tn)*tn;function Yc(t,e,n,r,i){let o,a,s,u,l=e[0],c=r[0],f=0,h=0;c>l==c>-l?(o=l,l=e[++f]):(o=c,c=r[++h]);let p=0;if(f<t&&h<n)for(c>l==c>-l?(a=l+o,s=o-(a-l),l=e[++f]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,s!==0&&(i[p++]=s);f<t&&h<n;)c>l==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h]),o=a,s!==0&&(i[p++]=s);for(;f<t;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f],o=a,s!==0&&(i[p++]=s);for(;h<n;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function QM(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function oo(t){return new Float64Array(t)}const JM=(3+16*tn)*tn,t4=(2+12*tn)*tn,e4=(9+64*tn)*tn*tn,Zr=oo(4),Ym=oo(8),Um=oo(12),Wm=oo(16),Ht=oo(4);function n4(t,e,n,r,i,o,a){let s,u,l,c,f,h,p,d,g,m,y,b,v,x,S,$,R,T;const w=t-i,P=n-i,_=e-o,N=r-o;x=w*N,h=Gt*w,p=h-(h-w),d=w-p,h=Gt*N,g=h-(h-N),m=N-g,S=d*m-(x-p*g-d*g-p*m),$=_*P,h=Gt*_,p=h-(h-_),d=_-p,h=Gt*P,g=h-(h-P),m=P-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Zr[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Zr[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Zr[2]=b-(T-f)+(y-f),Zr[3]=T;let D=QM(4,Zr),A=t4*a;if(D>=A||-D>=A||(f=t-w,s=t-(w+f)+(f-i),f=n-P,l=n-(P+f)+(f-i),f=e-_,u=e-(_+f)+(f-o),f=r-N,c=r-(N+f)+(f-o),s===0&&u===0&&l===0&&c===0)||(A=e4*a+KM*Math.abs(D),D+=w*c+N*s-(_*l+P*u),D>=A||-D>=A))return D;x=s*N,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*N,g=h-(h-N),m=N-g,S=d*m-(x-p*g-d*g-p*m),$=u*P,h=Gt*u,p=h-(h-u),d=u-p,h=Gt*P,g=h-(h-P),m=P-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const L=Yc(4,Zr,4,Ht,Ym);x=w*c,h=Gt*w,p=h-(h-w),d=w-p,h=Gt*c,g=h-(h-c),m=c-g,S=d*m-(x-p*g-d*g-p*m),$=_*l,h=Gt*_,p=h-(h-_),d=_-p,h=Gt*l,g=h-(h-l),m=l-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const M=Yc(L,Ym,4,Ht,Um);x=s*c,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*c,g=h-(h-c),m=c-g,S=d*m-(x-p*g-d*g-p*m),$=u*l,h=Gt*u,p=h-(h-u),d=u-p,h=Gt*l,g=h-(h-l),m=l-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const G=Yc(M,Um,4,Ht,Wm);return Wm[G-1]}function fs(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),u=a-s,l=Math.abs(a+s);return Math.abs(u)>=JM*l?u:-n4(t,e,n,r,i,o,l)}const Hm=Math.pow(2,-52),hs=new Uint32Array(512);class ps{static from(e,n=s4,r=u4){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=e[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new ps(o)}constructor(e){const n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=e.length>>1;let s=1/0,u=1/0,l=-1/0,c=-1/0;for(let w=0;w<a;w++){const P=e[2*w],_=e[2*w+1];P<s&&(s=P),_<u&&(u=_),P>l&&(l=P),_>c&&(c=_),this._ids[w]=w}const f=(s+l)/2,h=(u+c)/2;let p,d,g;for(let w=0,P=1/0;w<a;w++){const _=Uc(f,h,e[2*w],e[2*w+1]);_<P&&(p=w,P=_)}const m=e[2*p],y=e[2*p+1];for(let w=0,P=1/0;w<a;w++){if(w===p)continue;const _=Uc(m,y,e[2*w],e[2*w+1]);_<P&&_>0&&(d=w,P=_)}let b=e[2*d],v=e[2*d+1],x=1/0;for(let w=0;w<a;w++){if(w===p||w===d)continue;const P=o4(m,y,b,v,e[2*w],e[2*w+1]);P<x&&(g=w,x=P)}let S=e[2*g],$=e[2*g+1];if(x===1/0){for(let _=0;_<a;_++)this._dists[_]=e[2*_]-e[0]||e[2*_+1]-e[1];Kr(this._ids,this._dists,0,a-1);const w=new Uint32Array(a);let P=0;for(let _=0,N=-1/0;_<a;_++){const D=this._ids[_],A=this._dists[D];A>N&&(w[P++]=D,N=A)}this.hull=w.subarray(0,P),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(fs(m,y,b,v,S,$)<0){const w=d,P=b,_=v;d=g,b=S,v=$,g=w,S=P,$=_}const R=a4(m,y,b,v,S,$);this._cx=R.x,this._cy=R.y;for(let w=0;w<a;w++)this._dists[w]=Uc(e[2*w],e[2*w+1],R.x,R.y);Kr(this._ids,this._dists,0,a-1),this._hullStart=p;let T=3;r[p]=n[g]=d,r[d]=n[p]=g,r[g]=n[d]=p,i[p]=0,i[d]=1,i[g]=2,o.fill(-1),o[this._hashKey(m,y)]=p,o[this._hashKey(b,v)]=d,o[this._hashKey(S,$)]=g,this.trianglesLen=0,this._addTriangle(p,d,g,-1,-1,-1);for(let w=0,P,_;w<this._ids.length;w++){const N=this._ids[w],D=e[2*N],A=e[2*N+1];if(w>0&&Math.abs(D-P)<=Hm&&Math.abs(A-_)<=Hm||(P=D,_=A,N===p||N===d||N===g))continue;let L=0;for(let k=0,C=this._hashKey(D,A);k<this._hashSize&&(L=o[(C+k)%this._hashSize],!(L!==-1&&L!==r[L]));k++);L=n[L];let M=L,G;for(;G=r[M],fs(D,A,e[2*M],e[2*M+1],e[2*G],e[2*G+1])>=0;)if(M=G,M===L){M=-1;break}if(M===-1)continue;let O=this._addTriangle(M,N,r[M],-1,-1,i[M]);i[N]=this._legalize(O+2),i[M]=O,T++;let E=r[M];for(;G=r[E],fs(D,A,e[2*E],e[2*E+1],e[2*G],e[2*G+1])<0;)O=this._addTriangle(E,N,G,i[N],-1,i[E]),i[N]=this._legalize(O+2),r[E]=E,T--,E=G;if(M===L)for(;G=n[M],fs(D,A,e[2*G],e[2*G+1],e[2*M],e[2*M+1])<0;)O=this._addTriangle(G,N,M,-1,i[M],i[G]),this._legalize(O+2),i[G]=O,r[M]=M,T--,M=G;this._hullStart=n[N]=M,r[M]=n[E]=N,r[N]=E,o[this._hashKey(D,A)]=N,o[this._hashKey(e[2*M],e[2*M+1])]=M}this.hull=new Uint32Array(T);for(let w=0,P=this._hullStart;w<T;w++)this.hull[w]=P,P=r[P];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(r4(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[e],u=e-e%3;if(a=u+(e+2)%3,s===-1){if(o===0)break;e=hs[--o];continue}const l=s-s%3,c=u+(e+1)%3,f=l+(s+2)%3,h=n[a],p=n[e],d=n[c],g=n[f];if(i4(i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*d],i[2*d+1],i[2*g],i[2*g+1])){n[e]=g,n[s]=h;const y=r[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=e;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(e,y),this._link(s,r[a]),this._link(a,f);const b=l+(s+1)%3;o<hs.length&&(hs[o++]=b)}else{if(o===0)break;e=hs[--o]}}return a}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=e,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}}function r4(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function Uc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function i4(t,e,n,r,i,o,a,s){const u=t-a,l=e-s,c=n-a,f=r-s,h=i-a,p=o-s,d=u*u+l*l,g=c*c+f*f,m=h*h+p*p;return u*(f*m-g*p)-l*(c*m-g*h)+d*(c*p-f*h)<0}function o4(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=(l*c-s*f)*h,d=(a*f-u*c)*h;return p*p+d*d}function a4(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=t+(l*c-s*f)*h,d=e+(a*f-u*c)*h;return{x:p,y:d}}function Kr(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],a=e[o];let s=i-1;for(;s>=n&&e[t[s]]>a;)t[s+1]=t[s--];t[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;ao(t,i,o),e[t[n]]>e[t[r]]&&ao(t,n,r),e[t[o]]>e[t[r]]&&ao(t,o,r),e[t[n]]>e[t[o]]&&ao(t,n,o);const s=t[o],u=e[s];for(;;){do o++;while(e[t[o]]<u);do a--;while(e[t[a]]>u);if(a<o)break;ao(t,o,a)}t[n+1]=t[a],t[a]=s,r-o+1>=a-n?(Kr(t,e,o,r),Kr(t,e,n,a-1)):(Kr(t,e,n,a-1),Kr(t,e,o,r))}}function ao(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function s4(t){return t[0]}function u4(t){return t[1]}const Xm=1e-6;class er{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Xm||Math.abs(this._y1-o)>Xm)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Wc{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}class jm{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,a;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,y=r.length,b,v;g<y;g+=3,m+=2){const x=r[g]*2,S=r[g+1]*2,$=r[g+2]*2,R=e[x],T=e[x+1],w=e[S],P=e[S+1],_=e[$],N=e[$+1],D=w-R,A=P-T,L=_-R,M=N-T,G=(D*M-A*L)*2;if(Math.abs(G)<1e-9){if(o===void 0){o=a=0;for(const E of n)o+=e[E*2],a+=e[E*2+1];o/=n.length,a/=n.length}const O=1e9*Math.sign((o-R)*M-(a-T)*L);b=(R+_)/2-O*M,v=(T+N)/2+O*L}else{const O=1/G,E=D*D+A*A,k=L*L+M*M;b=R+(M*E-A*k)*O,v=T+(D*k-L*E)*O}s[m]=b,s[m+1]=v}let u=n[n.length-1],l,c=u*4,f,h=e[2*u],p,d=e[2*u+1];i.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=h,p=d,c=u*4,h=e[2*u],d=e[2*u+1],i[l+2]=i[c]=p-d,i[l+3]=i[c+1]=h-f}render(e){const n=e==null?e=new er:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,f=r.length;c<f;++c){const h=r[c];if(h<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(h/3)*2,g=a[p],m=a[p+1],y=a[d],b=a[d+1];this._renderSegment(g,m,y,b,e)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(i[l]/3)*2,h=a[f],p=a[f+1],d=u*4,g=this._project(h,p,s[d+2],s[d+3]);g&&this._renderSegment(h,p,g[0],g[1],e)}return n&&n.value()}renderBounds(e){const n=e==null?e=new er:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){const r=n==null?n=new er:void 0,i=this._clip(e);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(e){const n=new Wc;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,i,o){let a;const s=this._regioncode(e,n),u=this._regioncode(r,i);s===0&&u===0?(o.moveTo(e,n),o.lineTo(r,i)):(a=this._clipSegment(e,n,r,i,s,u))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){const n=this._clip(e);if(n)for(const r of this.delaunay.neighbors(e)){const i=this._clip(r);if(i){t:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,u=i.length;s<u;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+u-2)%u]&&n[(o+3)%a]===i[(s+u-1)%u]){yield r;break t}}}}_cell(e){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[e];if(a===-1)return null;const s=[];let u=a;do{const l=Math.floor(u/3);if(s.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==e)break;u=i[u]}while(u!==a&&u!==-1);return s}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(e);if(n===null)return null;const{vectors:r}=this,i=e*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(e,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(e,n))}_clipFinite(e,n){const r=n.length;let i=null,o,a,s=n[r-2],u=n[r-1],l,c=this._regioncode(s,u),f,h=0;for(let p=0;p<r;p+=2)if(o=s,a=u,s=n[p],u=n[p+1],l=c,c=this._regioncode(s,u),l===0&&c===0)f=h,h=0,i?i.push(s,u):i=[s,u];else{let d,g,m,y,b;if(l===0){if((d=this._clipSegment(o,a,s,u,l,c))===null)continue;[g,m,y,b]=d}else{if((d=this._clipSegment(s,u,o,a,c,l))===null)continue;[y,b,g,m]=d,f=h,h=this._edgecode(g,m),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(g,m):i=[g,m]}f=h,h=this._edgecode(y,b),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(e,f,h,i,i.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(e,n,r,i,o,a){const s=o<a;for(s&&([e,n,r,i,o,a]=[r,i,e,n,a,o]);;){if(o===0&&a===0)return s?[r,i,e,n]:[e,n,r,i];if(o&a)return null;let u,l,c=o||a;c&8?(u=e+(r-e)*(this.ymax-n)/(i-n),l=this.ymax):c&4?(u=e+(r-e)*(this.ymin-n)/(i-n),l=this.ymin):c&2?(l=n+(i-n)*(this.xmax-e)/(r-e),u=this.xmax):(l=n+(i-n)*(this.xmin-e)/(r-e),u=this.xmin),o?(e=u,n=l,o=this._regioncode(e,n)):(r=u,i=l,a=this._regioncode(r,i))}}_clipInfinite(e,n,r,i,o,a){let s=Array.from(n),u;if((u=this._project(s[0],s[1],r,i))&&s.unshift(u[0],u[1]),(u=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(u[0],u[1]),s=this._clipFinite(e,s))for(let l=0,c=s.length,f,h=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)f=h,h=this._edgecode(s[l],s[l+1]),f&&h&&(l=this._edge(e,f,h,s,l),c=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(e,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(e,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(e,n,r,i){let o=1/0,a,s,u;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(u=this.ymin,s=e+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(u=this.ymax,s=e+(o=a)*r)}if(r>0){if(e>=this.xmax)return null;(a=(this.xmax-e)/r)<o&&(s=this.xmax,u=n+(o=a)*i)}else if(r<0){if(e<=this.xmin)return null;(a=(this.xmin-e)/r)<o&&(s=this.xmin,u=n+(o=a)*i)}return[s,u]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){const r=(n+2)%e.length,i=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[i]||e[n+1]===e[r+1]&&e[r+1]===e[i+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}}const l4=2*Math.PI,Qr=Math.pow;function c4(t){return t[0]}function f4(t){return t[1]}function h4(t){const{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){const i=2*e[r],o=2*e[r+1],a=2*e[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function p4(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Hc{static from(e,n=c4,r=f4,i){return new Hc("length"in e?d4(e,n,r,i):Float64Array.from(g4(e,n,r,i)))}constructor(e){this._delaunator=new ps(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&h4(e)){this.collinear=Int32Array.from({length:n.length/2},(h,p)=>p).sort((h,p)=>n[2*h]-n[2*p]||n[2*h+1]-n[2*p+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let h=0,p=n.length/2;h<p;++h){const d=p4(n[2*h],n[2*h+1],f);n[2*h]=d[0],n[2*h+1]=d[1]}this._delaunator=new ps(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let u=0,l=r.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(r[u]===-1||a[c]===-1)&&(a[c]=u)}for(let u=0,l=i.length;u<l;++u)s[i[u]]=u;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new jm(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const f=s.indexOf(e);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+1]);return}const u=n[e];if(u===-1)return;let l=u,c=-1;do{if(yield c=a[l],l=l%3===2?l-2:l+1,a[l]!==e)return;if(l=o[l],l===-1){const f=r[(i[e]+1)%r.length];f!==c&&(yield f);return}}while(l!==u)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,e,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:u,points:l}=this;if(i[e]===-1||!l.length)return(e+1)%(l.length>>1);let c=e,f=Qr(n-l[e*2],2)+Qr(r-l[e*2+1],2);const h=i[e];let p=h;do{let d=u[p];const g=Qr(n-l[d*2],2)+Qr(r-l[d*2+1],2);if(g<f&&(f=g,c=d),p=p%3===2?p-2:p+1,u[p]!==e)break;if(p=s[p],p===-1){if(p=o[(a[e]+1)%o.length],p!==d&&Qr(n-l[p*2],2)+Qr(r-l[p*2+1],2)<f)return p;break}}while(p!==h);return c}render(e){const n=e==null?e=new er:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const u=i[a];if(u<a)continue;const l=o[a]*2,c=o[u]*2;e.moveTo(r[l],r[l+1]),e.lineTo(r[c],r[c+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;const r=e==null?e=new er:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],u=i[o+1];e.moveTo(s+n,u),e.arc(s,u,n,0,l4)}return r&&r.value()}renderHull(e){const n=e==null?e=new er:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;e.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const u=2*r[s];e.lineTo(i[u],i[u+1])}return e.closePath(),n&&n.value()}hullPolygon(){const e=new Wc;return this.renderHull(e),e.value()}renderTriangle(e,n){const r=n==null?n=new er:void 0,{points:i,triangles:o}=this,a=o[e*=3]*2,s=o[e+1]*2,u=o[e+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[u],i[u+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){const n=new Wc;return this.renderTriangle(e,n),n.value()}}function d4(t,e,n,r){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=t[a];o[a*2]=e.call(r,s,a,t),o[a*2+1]=n.call(r,s,a,t)}return o}function*g4(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}var Vm={},Xc={},jc=34,so=10,Vc=13;function qm(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function m4(t,e){var n=qm(t);return function(r,i){return e(n(r),i,t)}}function Zm(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function ie(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function y4(t){return t<0?"-"+ie(-t,6):t>9999?"+"+ie(t,6):ie(t,4)}function b4(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":y4(t.getUTCFullYear())+"-"+ie(t.getUTCMonth()+1,2)+"-"+ie(t.getUTCDate(),2)+(i?"T"+ie(e,2)+":"+ie(n,2)+":"+ie(r,2)+"."+ie(i,3)+"Z":r?"T"+ie(e,2)+":"+ie(n,2)+":"+ie(r,2)+"Z":n||e?"T"+ie(e,2)+":"+ie(n,2)+"Z":"")}function ds(t){var e=new RegExp('["'+t+`
9
+ ----> find in '${n}'`}function WT({chartType:t,config:e,initFn:n}){const r=new Lr,i=new WeakMap;let o=()=>{},a;const s=new ig(e.defaultParams),u=new ig({}),l=s.pipe(Il(c=>u.pipe(Ag(r),kr(f=>{try{const{status:h,columnName:p,expectToBe:d}=e.validator(f,{validateColumns:X_});if(h==="error")throw new Error(YT({columnName:p,expectToBe:d,from:`${e.name}.params$`}));return h==="warning"&&console.warn(UT({columnName:p,expectToBe:d,from:`${e.name}.params$`})),al(f,c)}catch(h){throw new Error(h.message)}}),Sg(f=>(console.error(zT(f)),uT)))),OT(1));return{params$:u,name:e.name,chartType:t,defaultParams:e.defaultParams,layerIndex:e.layerIndex,init(){a&&(o=n(a)??(()=>{}),i.set(a.selection,a))},destroy(){o(),a&&(a.selection.remove(),a=void 0),r.next(void 0)},setPresetParams:c=>{s.next(al(c,e.defaultParams))},setContext:c=>{a=c,a.observer.fullParams$=l}}}const Ii=t=>function(e){return function(n){return class{constructor(){const r=WT({chartType:t,config:e,initFn:n});this.params$=r.params$,this.name=r.name,this.chartType=r.chartType,this.defaultParams=r.defaultParams,this.layerIndex=r.layerIndex,this.init=r.init,this.destroy=r.destroy,this.setPresetParams=r.setPresetParams,this.setContext=r.setContext}}}},Fn=Ii("series"),ue=Ii("grid"),de=Ii("multiGrid"),HT=Ii("noneData"),Lg=Ii("tree");function _t(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function kg(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Sa(t){let e,n,r;t.length!==2?(e=_t,n=(s,u)=>_t(t(s),u),r=(s,u)=>t(s)-u):(e=t===_t||t===kg?t:XT,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function XT(){return 0}function Aa(t){return t===null?NaN:+t}function*jT(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const Rg=Sa(_t),Eg=Rg.right,VT=Rg.left,qT=Sa(Aa).center,On=Eg;function ZT(t,e){if(!((e=+e)>=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=Nl(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const Ig=Ng(Nl),KT=Ng(QT);function Ng(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const s=n&&t(n),u=r&&t(r),l=i.slice();return s&&u?(Rr(s,l,i,o,a),Rr(s,i,l,o,a),Rr(s,l,i,o,a),Er(u,i,l,o,a),Er(u,l,i,o,a),Er(u,i,l,o,a)):s?(Rr(s,i,l,o,a),Rr(s,l,i,o,a),Rr(s,i,l,o,a)):u&&(Er(u,i,l,o,a),Er(u,l,i,o,a),Er(u,i,l,o,a)),e}}function Rr(t,e,n,r,i){for(let o=0,a=r*i;o<a;)t(e,n,o,o+=r,1)}function Er(t,e,n,r,i){for(let o=0,a=r*i;o<r;++o)t(e,n,o,o+a,r)}function QT(t){const e=Nl(t);return(n,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,e(n,r,i+0,o+0,a),e(n,r,i+1,o+1,a),e(n,r,i+2,o+2,a),e(n,r,i+3,o+3,a)}}function Nl(t){const e=Math.floor(t);if(e===t)return JT(t);const n=t-e,r=2*t+1;return(i,o,a,s,u)=>{if(!((s-=u)>=a))return;let l=e*o[a];const c=u*e,f=c+u;for(let h=a,p=a+c;h<p;h+=u)l+=o[Math.min(s,h)];for(let h=a,p=s;h<=p;h+=u)l+=o[Math.min(s,h+c)],i[h]=(l+n*(o[Math.max(a,h-f)]+o[Math.min(s,h+f)]))/r,l-=o[Math.max(a,h-c)]}}function JT(t){const e=2*t+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let l=i,c=i+u;l<c;l+=a)s+=r[Math.min(o,l)];for(let l=i,c=o;l<=c;l+=a)s+=r[Math.min(o,l+u)],n[l]=s/e,s-=r[Math.max(i,l-u)]}}function Ta(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function t3(t){return t.length|0}function e3(t){return!(t>0)}function n3(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function r3(t){return e=>t(...e)}function i3(...t){const e=typeof t[t.length-1]=="function"&&r3(t.pop());t=t.map(n3);const n=t.map(t3),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(e3))return o;for(;;){o.push(i.map((s,u)=>t[u][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return e?o.map(e):o;i[a--]=0}}}function o3(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?i=>n+=+i||0:i=>n+=+e(i,r++,t)||0)}function Bg(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of t)(s=e(s,++a,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function Fg(t,e){const n=Bg(t,e);return n&&Math.sqrt(n)}function Ni(t,e){let n,r;if(e===void 0)for(const i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Ct{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=e+o,s=Math.abs(e)<Math.abs(o)?e-(a-o):o-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,i=e[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function a3(t,e){const n=new Ct;if(e===void 0)for(let r of t)(r=+r)&&n.add(r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function s3(t,e){const n=new Ct;let r=-1;return Float64Array.from(t,e===void 0?i=>n.add(+i||0):i=>n.add(+e(i,++r,t)||0))}class Bi extends Map{constructor(e,n=zg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Bl(this,e))}has(e){return super.has(Bl(this,e))}set(e,n){return super.set(Og(this,e),n)}delete(e){return super.delete(Gg(this,e))}}class Gn extends Set{constructor(e,n=zg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(Bl(this,e))}add(e){return super.add(Og(this,e))}delete(e){return super.delete(Gg(this,e))}}function Bl({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Og({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Gg({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function zg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Ir(t){return t}function Yg(t,...e){return Nr(t,Ir,Ir,e)}function Ug(t,...e){return Nr(t,Array.from,Ir,e)}function Wg(t,e){for(let n=1,r=e.length;n<r;++n)t=t.flatMap(i=>i.pop().map(([o,a])=>[...i,o,a]));return t}function u3(t,...e){return Wg(Ug(t,...e),e)}function l3(t,e,...n){return Wg(Xg(t,e,...n),n)}function Hg(t,e,...n){return Nr(t,Ir,e,n)}function Xg(t,e,...n){return Nr(t,Array.from,e,n)}function c3(t,...e){return Nr(t,Ir,jg,e)}function f3(t,...e){return Nr(t,Array.from,jg,e)}function jg(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function Nr(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new Bi,u=r[a++];let l=-1;for(const c of o){const f=u(c,++l,o),h=s.get(f);h?h.push(c):s.set(f,[c])}for(const[c,f]of s)s.set(c,i(f,a));return e(s)}(t,0)}function Vg(t,e){return Array.from(e,n=>t[n])}function Fl(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,o)=>o);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,o)=>{for(const a of e){const s=Br(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>Br(n[i],n[o]))),Vg(t,r)}return t.sort(Ol(n))}function Ol(t=_t){if(t===_t)return Br;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Br(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function h3(t,e,n){return(e.length!==2?Fl(Hg(t,e,n),([r,i],[o,a])=>_t(i,a)||_t(r,o)):Fl(Yg(t,n),([r,i],[o,a])=>e(i,a)||_t(r,o))).map(([r])=>r)}var p3=Array.prototype,d3=p3.slice;function Gl(t){return()=>t}const g3=Math.sqrt(50),m3=Math.sqrt(10),y3=Math.sqrt(2);function Pa(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>=g3?10:o>=m3?5:o>=y3?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?Pa(t,e,n*2):[s,u,l]}function zn(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Pa(e,t,n):Pa(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function Yn(t,e,n){return e=+e,t=+t,n=+n,Pa(t,e,n)[2]}function Ma(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Yn(e,t,n):Yn(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function zl(t,e,n){let r;for(;;){const i=Yn(t,e,n);if(i===r||i===0||!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}}function Yl(t){return Math.max(1,Math.ceil(Math.log(Ta(t))/Math.LN2)+1)}function qg(){var t=Ir,e=Ni,n=Yl;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,u,l=new Array(a);for(o=0;o<a;++o)l[o]=t(i[o],o,i);var c=e(l),f=c[0],h=c[1],p=n(l,f,h);if(!Array.isArray(p)){const v=h,x=+p;if(e===Ni&&([f,h]=zl(f,h,x)),p=zn(f,h,x),p[0]<=f&&(u=Yn(f,h,x)),p[p.length-1]>=h)if(v>=h&&e===Ni){const S=Yn(f,h,x);isFinite(S)&&(S>0?h=(Math.floor(h/S)+1)*S:S<0&&(h=(Math.ceil(h*-S)+1)/-S))}else p.pop()}for(var d=p.length,g=0,m=d;p[g]<=f;)++g;for(;p[m-1]>h;)--m;(g||m<d)&&(p=p.slice(g,m),d=m-g);var y=new Array(d+1),b;for(o=0;o<=d;++o)b=y[o]=[],b.x0=o>0?p[o-1]:f,b.x1=o<d?p[o]:h;if(isFinite(u)){if(u>0)for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[Math.min(d,Math.floor((s-f)/u))].push(i[o]);else if(u<0){for(o=0;o<a;++o)if((s=l[o])!=null&&f<=s&&s<=h){const v=Math.floor((f-s)*u);y[Math.min(d,v+(p[v]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[On(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(t=typeof i=="function"?i:Gl(i),r):t},r.domain=function(i){return arguments.length?(e=typeof i=="function"?i:Gl([i[0],i[1]]),r):e},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Gl(Array.isArray(i)?d3.call(i):i),r):n},r}function Fi(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Ul(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Da(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Wl(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Ca(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=i===void 0?Br:Ol(i);r>n;){if(r-n>600){const u=r-n+1,l=e-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),p=Math.max(n,Math.floor(e-l*f/u+h)),d=Math.min(r,Math.floor(e+(u-l)*f/u+h));Ca(t,e,p,d,i)}const o=t[e];let a=n,s=r;for(Oi(t,n,e),i(t[r],o)>0&&Oi(t,n,r);a<s;){for(Oi(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?Oi(t,n,s):(++s,Oi(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Oi(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Zg(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)>0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function Gi(t,e,n){if(t=Float64Array.from(jT(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Da(t);if(e>=1)return Fi(t);var r,i=(r-1)*e,o=Math.floor(i),a=Fi(Ca(t,o).subarray(0,o+1)),s=Da(t.subarray(o+1));return a+(s-a)*(i-o)}}function Kg(t,e,n=Aa){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function Qg(t,e,n=Aa){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,u)=>Aa(n(t[u],u,t))),e<=0)return Wl(r);if(e>=1)return Ul(r);var r,i=Uint32Array.from(t,(s,u)=>u),o=r.length-1,a=Math.floor(o*e);return Ca(i,a,0,o,(s,u)=>Br(r[s],r[u])),a=Zg(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function b3(t,e,n){const r=Ta(t),i=Gi(t,.75)-Gi(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function x3(t,e,n){const r=Ta(t),i=Fg(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function v3(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function _3(t,e){return Gi(t,.5,e)}function w3(t,e){return Qg(t,.5,e)}function*$3(t){for(const e of t)yield*e}function Hl(t){return Array.from($3(t))}function S3(t,e){const n=new Bi;if(e===void 0)for(let o of t)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let a of t)(a=e(a,++o,t))!=null&&a>=a&&n.set(a,(n.get(a)||0)+1)}let r,i=0;for(const[o,a]of n)a>i&&(i=a,r=o);return r}function A3(t,e=T3){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function T3(t,e){return[t,e]}function mn(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function P3(t,e=_t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t);const r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=_t);const i=(s,u)=>e(n[s],n[u]);let o,a;return t=Uint32Array.from(n,(s,u)=>u),t.sort(e===_t?(s,u)=>Br(n[s],n[u]):Ol(i)),t.forEach((s,u)=>{const l=i(s,o===void 0?s:o);l>=0?((o===void 0||l>0)&&(o=s,a=u),r[s]=a):r[s]=NaN}),r}function M3(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)<0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)<0:e(i,i)===0)&&(n=i,r=!0);return n}function Jg(t,e=_t){if(e.length===1)return Wl(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)<0)&&(n=o,r=i);return r}function D3(t,e=_t){if(e.length===1)return Ul(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)>0)&&(n=o,r=i);return r}function C3(t,e){const n=Jg(t,e);return n<0?void 0:n}const L3=t0(Math.random);function t0(t){return function(n,r=0,i=n.length){let o=i-(r=+r);for(;o;){const a=t()*o--|0,s=n[o+r];n[o+r]=n[a+r],n[a+r]=s}return n}}function e0(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function n0(t){if(!(o=t.length))return[];for(var e=-1,n=Da(t,k3),r=new Array(n);++e<n;)for(var i=-1,o,a=r[e]=new Array(o);++i<o;)a[i]=t[i][e];return r}function k3(t){return t.length}function R3(){return n0(arguments)}function E3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(!e(r,++n,t))return!1;return!0}function I3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(e(r,++n,t))return!0;return!1}function N3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of t)e(i,++r,t)&&n.push(i);return n}function B3(t,e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof e!="function")throw new TypeError("mapper is not a function");return Array.from(t,(n,r)=>e(n,r,t))}function F3(t,e,n){if(typeof e!="function")throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if({done:i,value:n}=r.next(),i)return;++a}for(;{done:i,value:o}=r.next(),!i;)n=e(n,o,++a,t);return n}function O3(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function G3(t,...e){t=new Gn(t);for(const n of e)for(const r of n)t.delete(r);return t}function z3(t,e){const n=e[Symbol.iterator](),r=new Gn;for(const i of t){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=n.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function Y3(t,...e){t=new Gn(t),e=e.map(U3);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function U3(t){return t instanceof Gn?t:new Gn(t)}function r0(t,e){const n=t[Symbol.iterator](),r=new Set;for(const i of e){const o=i0(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const u=i0(a);if(r.add(u),Object.is(o,u))break}}return!0}function i0(t){return t!==null&&typeof t=="object"?t.valueOf():t}function W3(t,e){return r0(e,t)}function H3(...t){const e=new Gn;for(const n of t)for(const r of n)e.add(r);return e}function X3(t){return t}var La=1,ka=2,Xl=3,zi=4,o0=1e-6;function j3(t){return"translate("+t+",0)"}function V3(t){return"translate(0,"+t+")"}function q3(t){return e=>+t(e)}function Z3(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function K3(){return!this.__axis}function Ra(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===La||t===zi?-1:1,c=t===zi||t===ka?"x":"y",f=t===La||t===Xl?j3:V3;function h(p){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),g=i??(e.tickFormat?e.tickFormat.apply(e,n):X3),m=Math.max(o,0)+s,y=e.range(),b=+y[0]+u,v=+y[y.length-1]+u,x=(e.bandwidth?Z3:q3)(e.copy(),u),S=p.selection?p.selection():p,$=S.selectAll(".domain").data([null]),R=S.selectAll(".tick").data(d,e).order(),T=R.exit(),w=R.enter().append("g").attr("class","tick"),P=R.select("line"),_=R.select("text");$=$.merge($.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(w),P=P.merge(w.append("line").attr("stroke","currentColor").attr(c+"2",l*o)),_=_.merge(w.append("text").attr("fill","currentColor").attr(c,l*m).attr("dy",t===La?"0em":t===Xl?"0.71em":"0.32em")),p!==S&&($=$.transition(p),R=R.transition(p),P=P.transition(p),_=_.transition(p),T=T.transition(p).attr("opacity",o0).attr("transform",function(N){return isFinite(N=x(N))?f(N+u):this.getAttribute("transform")}),w.attr("opacity",o0).attr("transform",function(N){var D=this.parentNode.__axis;return f((D&&isFinite(D=D(N))?D:x(N))+u)})),T.remove(),$.attr("d",t===zi||t===ka?a?"M"+l*a+","+b+"H"+u+"V"+v+"H"+l*a:"M"+u+","+b+"V"+v:a?"M"+b+","+l*a+"V"+u+"H"+v+"V"+l*a:"M"+b+","+u+"H"+v),R.attr("opacity",1).attr("transform",function(N){return f(x(N)+u)}),P.attr(c+"2",l*o),_.attr(c,l*m).text(g),S.filter(K3).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ka?"start":t===zi?"end":"middle"),S.each(function(){this.__axis=x})}return h.scale=function(p){return arguments.length?(e=p,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(o=a=+p,h):o},h.tickSizeInner=function(p){return arguments.length?(o=+p,h):o},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(s=+p,h):s},h.offset=function(p){return arguments.length?(u=+p,h):u},h}function Q3(t){return Ra(La,t)}function J3(t){return Ra(ka,t)}function a0(t){return Ra(Xl,t)}function s0(t){return Ra(zi,t)}var t5={value:()=>{}};function Un(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ea(n)}function Ea(t){this._=t}function e5(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ea.prototype=Un.prototype={constructor:Ea,on:function(t,e){var n=this._,r=e5(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=n5(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=u0(n[i],t.name,e);else if(e==null)for(i in n)n[i]=u0(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ea(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function n5(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function u0(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=t5,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var jl="http://www.w3.org/1999/xhtml";const Vl={svg:"http://www.w3.org/2000/svg",xhtml:jl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yi(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Vl.hasOwnProperty(e)?{space:Vl[e],local:t}:t}function r5(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===jl&&e.documentElement.namespaceURI===jl?e.createElement(t):e.createElementNS(n,t)}}function i5(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ia(t){var e=Yi(t);return(e.local?i5:r5)(e)}function o5(){}function Na(t){return t==null?o5:function(){return this.querySelector(t)}}function a5(t){typeof t!="function"&&(t=Na(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new Wt(r,this._parents)}function l0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function s5(){return[]}function ql(t){return t==null?s5:function(){return this.querySelectorAll(t)}}function u5(t){return function(){return l0(t.apply(this,arguments))}}function l5(t){typeof t=="function"?t=u5(t):t=ql(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new Wt(r,i)}function Zl(t){return function(){return this.matches(t)}}function c0(t){return function(e){return e.matches(t)}}var c5=Array.prototype.find;function f5(t){return function(){return c5.call(this.children,t)}}function h5(){return this.firstElementChild}function p5(t){return this.select(t==null?h5:f5(typeof t=="function"?t:c0(t)))}var d5=Array.prototype.filter;function g5(){return Array.from(this.children)}function m5(t){return function(){return d5.call(this.children,t)}}function y5(t){return this.selectAll(t==null?g5:m5(typeof t=="function"?t:c0(t)))}function b5(t){typeof t!="function"&&(t=Zl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Wt(r,this._parents)}function f0(t){return new Array(t.length)}function x5(){return new Wt(this._enter||this._groups.map(f0),this._parents)}function Ba(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ba.prototype={constructor:Ba,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function v5(t){return function(){return t}}function _5(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ba(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function w5(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new Ba(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function $5(t){return t.__data__}function S5(t,e){if(!arguments.length)return Array.from(this,$5);var n=e?w5:_5,r=this._parents,i=this._groups;typeof t!="function"&&(t=v5(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=A5(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var b=0,v=0,x,S;b<d;++b)if(x=g[b]){for(b>=v&&(v=b+1);!(S=m[v])&&++v<d;);x._next=S||null}}return a=new Wt(a,r),a._enter=s,a._exit=u,a}function A5(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function T5(){return new Wt(this._exit||this._groups.map(f0),this._parents)}function P5(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function M5(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new Wt(s,this._parents)}function D5(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function C5(t){t||(t=L5);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new Wt(i,this._parents).order()}function L5(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function k5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function R5(){return Array.from(this)}function E5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function I5(){let t=0;for(const e of this)++t;return t}function N5(){return!this.node()}function B5(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function F5(t){return function(){this.removeAttribute(t)}}function O5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function G5(t,e){return function(){this.setAttribute(t,e)}}function z5(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Y5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function U5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function W5(t,e){var n=Yi(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?O5:F5:typeof e=="function"?n.local?U5:Y5:n.local?z5:G5)(n,e))}function Kl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function H5(t){return function(){this.style.removeProperty(t)}}function X5(t,e,n){return function(){this.style.setProperty(t,e,n)}}function j5(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function V5(t,e,n){return arguments.length>1?this.each((e==null?H5:typeof e=="function"?j5:X5)(t,e,n??"")):Wn(this.node(),t)}function Wn(t,e){return t.style.getPropertyValue(e)||Kl(t).getComputedStyle(t,null).getPropertyValue(e)}function q5(t){return function(){delete this[t]}}function Z5(t,e){return function(){this[t]=e}}function K5(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Q5(t,e){return arguments.length>1?this.each((e==null?q5:typeof e=="function"?K5:Z5)(t,e)):this.node()[t]}function h0(t){return t.trim().split(/^|\s+/)}function Ql(t){return t.classList||new p0(t)}function p0(t){this._node=t,this._names=h0(t.getAttribute("class")||"")}p0.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function d0(t,e){for(var n=Ql(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function g0(t,e){for(var n=Ql(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function J5(t){return function(){d0(this,t)}}function t6(t){return function(){g0(this,t)}}function e6(t,e){return function(){(e.apply(this,arguments)?d0:g0)(this,t)}}function n6(t,e){var n=h0(t+"");if(arguments.length<2){for(var r=Ql(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?e6:e?J5:t6)(n,e))}function r6(){this.textContent=""}function i6(t){return function(){this.textContent=t}}function o6(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function a6(t){return arguments.length?this.each(t==null?r6:(typeof t=="function"?o6:i6)(t)):this.node().textContent}function s6(){this.innerHTML=""}function u6(t){return function(){this.innerHTML=t}}function l6(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function c6(t){return arguments.length?this.each(t==null?s6:(typeof t=="function"?l6:u6)(t)):this.node().innerHTML}function f6(){this.nextSibling&&this.parentNode.appendChild(this)}function h6(){return this.each(f6)}function p6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function d6(){return this.each(p6)}function g6(t){var e=typeof t=="function"?t:Ia(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function m6(){return null}function y6(t,e){var n=typeof t=="function"?t:Ia(t),r=e==null?m6:typeof e=="function"?e:Na(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function b6(){var t=this.parentNode;t&&t.removeChild(this)}function x6(){return this.each(b6)}function v6(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _6(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function w6(t){return this.select(t?_6:v6)}function $6(t){return arguments.length?this.property("__data__",t):this.node().__data__}function S6(t){return function(e){t.call(this,e,this.__data__)}}function A6(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function T6(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function P6(t,e,n){return function(){var r=this.__on,i,o=S6(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function M6(t,e,n){var r=A6(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?P6:T6,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function m0(t,e,n){var r=Kl(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function D6(t,e){return function(){return m0(this,t,e)}}function C6(t,e){return function(){return m0(this,t,e.apply(this,arguments))}}function L6(t,e){return this.each((typeof e=="function"?C6:D6)(t,e))}function*k6(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Jl=[null];function Wt(t,e){this._groups=t,this._parents=e}function Hn(){return new Wt([[document.documentElement]],Jl)}function R6(){return this}Wt.prototype=Hn.prototype={constructor:Wt,select:a5,selectAll:l5,selectChild:p5,selectChildren:y5,filter:b5,data:S5,enter:x5,exit:T5,join:P5,merge:M5,selection:R6,order:D5,sort:C5,call:k5,nodes:R5,node:E5,size:I5,empty:N5,each:B5,attr:W5,style:V5,property:Q5,classed:n6,text:a6,html:c6,raise:h6,lower:d6,append:g6,insert:y6,remove:x6,clone:w6,datum:$6,on:M6,dispatch:L6,[Symbol.iterator]:k6};function V(t){return typeof t=="string"?new Wt([[document.querySelector(t)]],[document.documentElement]):new Wt([[t]],Jl)}function E6(t){return V(Ia(t).call(document.documentElement))}var I6=0;function y0(){return new tc}function tc(){this._="@"+(++I6).toString(36)}tc.prototype=y0.prototype={constructor:tc,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};function b0(t){let e;for(;e=t.sourceEvent;)t=e;return t}function le(t,e){if(t=b0(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function N6(t,e){return t.target&&(t=b0(t),e===void 0&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,n=>le(n,e))}function B6(t){return typeof t=="string"?new Wt([document.querySelectorAll(t)],[document.documentElement]):new Wt([l0(t)],Jl)}const F6={passive:!1},Ui={capture:!0,passive:!1};function ec(t){t.stopImmediatePropagation()}function Fr(t){t.preventDefault(),t.stopImmediatePropagation()}function Fa(t){var e=t.document.documentElement,n=V(t).on("dragstart.drag",Fr,Ui);"onselectstart"in e?n.on("selectstart.drag",Fr,Ui):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Oa(t,e){var n=t.document.documentElement,r=V(t).on("dragstart.drag",null);e&&(r.on("click.drag",Fr,Ui),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ga=t=>()=>t;function nc(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}nc.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function O6(t){return!t.ctrlKey&&!t.button}function G6(){return this.parentNode}function z6(t,e){return e??{x:t.x,y:t.y}}function Y6(){return navigator.maxTouchPoints||"ontouchstart"in this}function x0(){var t=O6,e=G6,n=z6,r=Y6,i={},o=Un("start","drag","end"),a=0,s,u,l,c,f=0;function h(x){x.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,F6).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,S){if(!(c||!t.call(this,x,S))){var $=v(this,e.call(this,x,S),x,S,"mouse");$&&(V(x.view).on("mousemove.drag",d,Ui).on("mouseup.drag",g,Ui),Fa(x.view),ec(x),l=!1,s=x.clientX,u=x.clientY,$("start",x))}}function d(x){if(Fr(x),!l){var S=x.clientX-s,$=x.clientY-u;l=S*S+$*$>f}i.mouse("drag",x)}function g(x){V(x.view).on("mousemove.drag mouseup.drag",null),Oa(x.view,l),Fr(x),i.mouse("end",x)}function m(x,S){if(t.call(this,x,S)){var $=x.changedTouches,R=e.call(this,x,S),T=$.length,w,P;for(w=0;w<T;++w)(P=v(this,R,x,S,$[w].identifier,$[w]))&&(ec(x),P("start",x,$[w]))}}function y(x){var S=x.changedTouches,$=S.length,R,T;for(R=0;R<$;++R)(T=i[S[R].identifier])&&(Fr(x),T("drag",x,S[R]))}function b(x){var S=x.changedTouches,$=S.length,R,T;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),R=0;R<$;++R)(T=i[S[R].identifier])&&(ec(x),T("end",x,S[R]))}function v(x,S,$,R,T,w){var P=o.copy(),_=le(w||$,S),N,D,A;if((A=n.call(x,new nc("beforestart",{sourceEvent:$,target:h,identifier:T,active:a,x:_[0],y:_[1],dx:0,dy:0,dispatch:P}),R))!=null)return N=A.x-_[0]||0,D=A.y-_[1]||0,function L(M,G,O){var E=_,k;switch(M){case"start":i[T]=L,k=a++;break;case"end":delete i[T],--a;case"drag":_=le(O||G,S),k=a;break}P.call(M,x,new nc(M,{sourceEvent:G,subject:A,target:h,identifier:T,active:k,x:_[0]+N,y:_[1]+D,dx:_[0]-E[0],dy:_[1]-E[1],dispatch:P}),R)}}return h.filter=function(x){return arguments.length?(t=typeof x=="function"?x:Ga(!!x),h):t},h.container=function(x){return arguments.length?(e=typeof x=="function"?x:Ga(x),h):e},h.subject=function(x){return arguments.length?(n=typeof x=="function"?x:Ga(x),h):n},h.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:Ga(!!x),h):r},h.on=function(){var x=o.on.apply(o,arguments);return x===o?h:x},h.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,h):Math.sqrt(f)},h}function Or(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Wi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function yn(){}var Xn=.7,Gr=1/Xn,zr="\\s*([+-]?\\d+)\\s*",Hi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Be="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",U6=/^#([0-9a-f]{3,8})$/,W6=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),H6=new RegExp(`^rgb\\(${Be},${Be},${Be}\\)$`),X6=new RegExp(`^rgba\\(${zr},${zr},${zr},${Hi}\\)$`),j6=new RegExp(`^rgba\\(${Be},${Be},${Be},${Hi}\\)$`),V6=new RegExp(`^hsl\\(${Hi},${Be},${Be}\\)$`),q6=new RegExp(`^hsla\\(${Hi},${Be},${Be},${Hi}\\)$`),v0={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};Or(yn,bn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_0,formatHex:_0,formatHex8:Z6,formatHsl:K6,formatRgb:w0,toString:w0});function _0(){return this.rgb().formatHex()}function Z6(){return this.rgb().formatHex8()}function K6(){return P0(this).formatHsl()}function w0(){return this.rgb().formatRgb()}function bn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=U6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?$0(e):n===3?new Rt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?za(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?za(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=W6.exec(t))?new Rt(e[1],e[2],e[3],1):(e=H6.exec(t))?new Rt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=X6.exec(t))?za(e[1],e[2],e[3],e[4]):(e=j6.exec(t))?za(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=V6.exec(t))?T0(e[1],e[2]/100,e[3]/100,1):(e=q6.exec(t))?T0(e[1],e[2]/100,e[3]/100,e[4]):v0.hasOwnProperty(t)?$0(v0[t]):t==="transparent"?new Rt(NaN,NaN,NaN,0):null}function $0(t){return new Rt(t>>16&255,t>>8&255,t&255,1)}function za(t,e,n,r){return r<=0&&(t=e=n=NaN),new Rt(t,e,n,r)}function rc(t){return t instanceof yn||(t=bn(t)),t?(t=t.rgb(),new Rt(t.r,t.g,t.b,t.opacity)):new Rt}function Yr(t,e,n,r){return arguments.length===1?rc(t):new Rt(t,e,n,r??1)}function Rt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Or(Rt,Yr,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new Rt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new Rt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Rt(jn(this.r),jn(this.g),jn(this.b),Ya(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:S0,formatHex:S0,formatHex8:Q6,formatRgb:A0,toString:A0}));function S0(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}`}function Q6(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}${Vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function A0(){const t=Ya(this.opacity);return`${t===1?"rgb(":"rgba("}${jn(this.r)}, ${jn(this.g)}, ${jn(this.b)}${t===1?")":`, ${t})`}`}function Ya(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Vn(t){return t=jn(t),(t<16?"0":"")+t.toString(16)}function T0(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Te(t,e,n,r)}function P0(t){if(t instanceof Te)return new Te(t.h,t.s,t.l,t.opacity);if(t instanceof yn||(t=bn(t)),!t)return new Te;if(t instanceof Te)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Te(a,s,u,t.opacity)}function Ua(t,e,n,r){return arguments.length===1?P0(t):new Te(t,e,n,r??1)}function Te(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Or(Te,Ua,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new Te(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new Te(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,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 Rt(ic(t>=240?t-240:t+120,i,r),ic(t,i,r),ic(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Te(M0(this.h),Wa(this.s),Wa(this.l),Ya(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=Ya(this.opacity);return`${t===1?"hsl(":"hsla("}${M0(this.h)}, ${Wa(this.s)*100}%, ${Wa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function M0(t){return t=(t||0)%360,t<0?t+360:t}function Wa(t){return Math.max(0,Math.min(1,t||0))}function ic(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const D0=Math.PI/180,C0=180/Math.PI,Ha=18,L0=.96422,k0=1,R0=.82521,E0=4/29,Ur=6/29,I0=3*Ur*Ur,J6=Ur*Ur*Ur;function N0(t){if(t instanceof Pe)return new Pe(t.l,t.a,t.b,t.opacity);if(t instanceof Fe)return F0(t);t instanceof Rt||(t=rc(t));var e=uc(t.r),n=uc(t.g),r=uc(t.b),i=oc((.2225045*e+.7168786*n+.0606169*r)/k0),o,a;return e===n&&n===r?o=a=i:(o=oc((.4360747*e+.3850649*n+.1430804*r)/L0),a=oc((.0139322*e+.0971045*n+.7141733*r)/R0)),new Pe(116*i-16,500*(o-i),200*(i-a),t.opacity)}function tP(t,e){return new Pe(t,0,0,e??1)}function Xa(t,e,n,r){return arguments.length===1?N0(t):new Pe(t,e,n,r??1)}function Pe(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Or(Pe,Xa,Wi(yn,{brighter(t){return new Pe(this.l+Ha*(t??1),this.a,this.b,this.opacity)},darker(t){return new Pe(this.l-Ha*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=L0*ac(e),t=k0*ac(t),n=R0*ac(n),new Rt(sc(3.1338561*e-1.6168667*t-.4906146*n),sc(-.9787684*e+1.9161415*t+.033454*n),sc(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function oc(t){return t>J6?Math.pow(t,1/3):t/I0+E0}function ac(t){return t>Ur?t*t*t:I0*(t-E0)}function sc(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function uc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function B0(t){if(t instanceof Fe)return new Fe(t.h,t.c,t.l,t.opacity);if(t instanceof Pe||(t=N0(t)),t.a===0&&t.b===0)return new Fe(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*C0;return new Fe(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function eP(t,e,n,r){return arguments.length===1?B0(t):new Fe(n,e,t,r??1)}function ja(t,e,n,r){return arguments.length===1?B0(t):new Fe(t,e,n,r??1)}function Fe(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function F0(t){if(isNaN(t.h))return new Pe(t.l,0,0,t.opacity);var e=t.h*D0;return new Pe(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Or(Fe,ja,Wi(yn,{brighter(t){return new Fe(this.h,this.c,this.l+Ha*(t??1),this.opacity)},darker(t){return new Fe(this.h,this.c,this.l-Ha*(t??1),this.opacity)},rgb(){return F0(this).rgb()}}));var O0=-.14861,lc=1.78277,cc=-.29227,Va=-.90649,Xi=1.97294,G0=Xi*Va,z0=Xi*lc,Y0=lc*cc-Va*O0;function nP(t){if(t instanceof qn)return new qn(t.h,t.s,t.l,t.opacity);t instanceof Rt||(t=rc(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Y0*r+G0*e-z0*n)/(Y0+G0-z0),o=r-i,a=(Xi*(n-i)-cc*o)/Va,s=Math.sqrt(a*a+o*o)/(Xi*i*(1-i)),u=s?Math.atan2(a,o)*C0-120:NaN;return new qn(u<0?u+360:u,s,i,t.opacity)}function Me(t,e,n,r){return arguments.length===1?nP(t):new qn(t,e,n,r??1)}function qn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Or(qn,Me,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new qn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new qn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*D0,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Rt(255*(e+n*(O0*r+lc*i)),255*(e+n*(cc*r+Va*i)),255*(e+n*(Xi*r)),this.opacity)}}));function U0(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}function W0(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 U0((n-r/e)*e,a,i,o,s)}}function H0(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return U0((n-r/e)*e,i,o,a,s)}}const qa=t=>()=>t;function X0(t,e){return function(n){return t+n*e}}function rP(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)}}function Za(t,e){var n=e-t;return n?X0(t,n>180||n<-180?n-360*Math.round(n/360):n):qa(isNaN(t)?e:t)}function iP(t){return(t=+t)==1?Et:function(e,n){return n-e?rP(e,n,t):qa(isNaN(e)?n:e)}}function Et(t,e){var n=e-t;return n?X0(t,n):qa(isNaN(t)?e:t)}const ji=function t(e){var n=iP(e);function r(i,o){var a=n((i=Yr(i)).r,(o=Yr(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=Et(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function j0(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Yr(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(u){return s.r=r(u),s.g=i(u),s.b=o(u),s+""}}}var V0=j0(W0),oP=j0(H0);function fc(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function q0(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function aP(t,e){return(q0(e)?fc:Z0)(t,e)}function Z0(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Ze(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function K0(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function ge(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Q0(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Ze(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var hc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pc=new RegExp(hc.source,"g");function sP(t){return function(){return t}}function uP(t){return function(e){return t(e)+""}}function dc(t,e){var n=hc.lastIndex=pc.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=hc.exec(t))&&(i=pc.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:ge(r,i)})),n=pc.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?uP(u[0].x):sP(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function Ze(t,e){var n=typeof e,r;return e==null||n==="boolean"?qa(e):(n==="number"?ge:n==="string"?(r=bn(e))?(e=r,ji):dc:e instanceof bn?ji:e instanceof Date?K0:q0(e)?fc:Array.isArray(e)?Z0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Q0:ge)(t,e)}function lP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function cP(t,e){var n=Za(+t,+e);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function Ka(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var J0=180/Math.PI,gc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tm(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*J0,skewX:Math.atan(u)*J0,scaleX:a,scaleY:s}}var Qa;function fP(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?gc:tm(e.a,e.b,e.c,e.d,e.e,e.f)}function hP(t){return t==null||(Qa||(Qa=document.createElementNS("http://www.w3.org/2000/svg","g")),Qa.setAttribute("transform",t),!(t=Qa.transform.baseVal.consolidate()))?gc:(t=t.matrix,tm(t.a,t.b,t.c,t.d,t.e,t.f))}function em(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:ge(l,f)},{i:g-2,x:ge(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:ge(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:ge(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:ge(l,f)},{i:g-2,x:ge(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var nm=em(fP,"px, ","px)","deg)"),rm=em(hP,", ",")",")"),pP=1e-12;function im(t){return((t=Math.exp(t))+1/t)/2}function dP(t){return((t=Math.exp(t))-1/t)/2}function gP(t){return((t=Math.exp(2*t))-1)/(t+1)}const om=function t(e,n,r){function i(o,a){var s=o[0],u=o[1],l=o[2],c=a[0],f=a[1],h=a[2],p=c-s,d=f-u,g=p*p+d*d,m,y;if(g<pP)y=Math.log(h/l)/e,m=function(R){return[s+R*p,u+R*d,l*Math.exp(e*R*y)]};else{var b=Math.sqrt(g),v=(h*h-l*l+r*g)/(2*l*n*b),x=(h*h-l*l-r*g)/(2*h*n*b),S=Math.log(Math.sqrt(v*v+1)-v),$=Math.log(Math.sqrt(x*x+1)-x);y=($-S)/e,m=function(R){var T=R*y,w=im(S),P=l/(n*b)*(w*gP(e*T+S)-dP(S));return[s+P*p,u+P*d,l*w/im(e*T+S)]}}return m.duration=y*1e3*e/Math.SQRT2,m}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,u=s*s;return t(a,s,u)},i}(Math.SQRT2,2,4);function am(t){return function(e,n){var r=t((e=Ua(e)).h,(n=Ua(n)).h),i=Et(e.s,n.s),o=Et(e.l,n.l),a=Et(e.opacity,n.opacity);return function(s){return e.h=r(s),e.s=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const mP=am(Za);var yP=am(Et);function bP(t,e){var n=Et((t=Xa(t)).l,(e=Xa(e)).l),r=Et(t.a,e.a),i=Et(t.b,e.b),o=Et(t.opacity,e.opacity);return function(a){return t.l=n(a),t.a=r(a),t.b=i(a),t.opacity=o(a),t+""}}function sm(t){return function(e,n){var r=t((e=ja(e)).h,(n=ja(n)).h),i=Et(e.c,n.c),o=Et(e.l,n.l),a=Et(e.opacity,n.opacity);return function(s){return e.h=r(s),e.c=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const xP=sm(Za);var vP=sm(Et);function um(t){return function e(n){n=+n;function r(i,o){var a=t((i=Me(i)).h,(o=Me(o)).h),s=Et(i.s,o.s),u=Et(i.l,o.l),l=Et(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=u(Math.pow(c,n)),i.opacity=l(c),i+""}}return r.gamma=e,r}(1)}const _P=um(Za);var Ja=um(Et);function lm(t,e){e===void 0&&(e=t,t=Ze);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function wP(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Wr=0,Vi=0,qi=0,cm=1e3,ts,Zi,es=0,Zn=0,ns=0,Ki=typeof performance=="object"&&performance.now?performance:Date,fm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Qi(){return Zn||(fm($P),Zn=Ki.now()+ns)}function $P(){Zn=0}function Ji(){this._call=this._time=this._next=null}Ji.prototype=rs.prototype={constructor:Ji,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Qi():+n)+(e==null?0:+e),!this._next&&Zi!==this&&(Zi?Zi._next=this:ts=this,Zi=this),this._call=t,this._time=n,mc()},stop:function(){this._call&&(this._call=null,this._time=1/0,mc())}};function rs(t,e,n){var r=new Ji;return r.restart(t,e,n),r}function hm(){Qi(),++Wr;for(var t=ts,e;t;)(e=Zn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Wr}function pm(){Zn=(es=Ki.now())+ns,Wr=Vi=0;try{hm()}finally{Wr=0,AP(),Zn=0}}function SP(){var t=Ki.now(),e=t-es;e>cm&&(ns-=e,es=t)}function AP(){for(var t,e=ts,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ts=n);Zi=t,mc(r)}function mc(t){if(!Wr){Vi&&(Vi=clearTimeout(Vi));var e=t-Zn;e>24?(t<1/0&&(Vi=setTimeout(pm,t-Ki.now()-ns)),qi&&(qi=clearInterval(qi))):(qi||(es=Ki.now(),qi=setInterval(SP,cm)),Wr=1,fm(pm))}}function yc(t,e,n){var r=new Ji;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}function TP(t,e,n){var r=new Ji,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?Qi():+s,r._restart(function u(l){l+=i,r._restart(u,i+=a,s),o(l)},a,s)},r.restart(t,e,n),r)}var PP=Un("start","end","cancel","interrupt"),MP=[],dm=0,bc=1,xc=2,is=3,gm=4,vc=5,os=6;function as(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;DP(t,n,{name:e,index:r,group:i,on:PP,tween:MP,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:dm})}function _c(t,e){var n=De(t,e);if(n.state>dm)throw new Error("too late; already scheduled");return n}function Oe(t,e){var n=De(t,e);if(n.state>is)throw new Error("too late; already running");return n}function De(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function DP(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=rs(o,0,n.time);function o(l){n.state=bc,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==bc)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===is)return yc(a);p.state===gm?(p.state=os,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=os,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(yc(function(){n.state===is&&(n.state=gm,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=xc,n.on.call("start",t,t.__data__,n.index,n.group),n.state===xc){for(n.state=is,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=vc,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===vc&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=os,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Kn(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>xc&&r.state<vc,r.state=os,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function CP(t){return this.each(function(){Kn(this,t)})}function LP(t,e){var n,r;return function(){var i=Oe(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function kP(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Oe(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function RP(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=De(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?LP:kP)(n,t,e))}function wc(t,e,n){var r=t._id;return t.each(function(){var i=Oe(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return De(i,r).value[e]}}function mm(t,e){var n;return(typeof e=="number"?ge:e instanceof bn?ji:(n=bn(e))?(e=n,ji):dc)(t,e)}function EP(t){return function(){this.removeAttribute(t)}}function IP(t){return function(){this.removeAttributeNS(t.space,t.local)}}function NP(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function BP(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function FP(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function OP(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function GP(t,e){var n=Yi(t),r=n==="transform"?rm:mm;return this.attrTween(t,typeof e=="function"?(n.local?OP:FP)(n,r,wc(this,"attr."+t,e)):e==null?(n.local?IP:EP)(n):(n.local?BP:NP)(n,r,e))}function zP(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function YP(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function UP(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&YP(t,o)),n}return i._value=e,i}function WP(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&zP(t,o)),n}return i._value=e,i}function HP(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Yi(t);return this.tween(n,(r.local?UP:WP)(r,e))}function XP(t,e){return function(){_c(this,t).delay=+e.apply(this,arguments)}}function jP(t,e){return e=+e,function(){_c(this,t).delay=e}}function VP(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?XP:jP)(e,t)):De(this.node(),e).delay}function qP(t,e){return function(){Oe(this,t).duration=+e.apply(this,arguments)}}function ZP(t,e){return e=+e,function(){Oe(this,t).duration=e}}function KP(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?qP:ZP)(e,t)):De(this.node(),e).duration}function QP(t,e){if(typeof e!="function")throw new Error;return function(){Oe(this,t).ease=e}}function JP(t){var e=this._id;return arguments.length?this.each(QP(e,t)):De(this.node(),e).ease}function t8(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Oe(this,t).ease=n}}function e8(t){if(typeof t!="function")throw new Error;return this.each(t8(this._id,t))}function n8(t){typeof t!="function"&&(t=Zl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Ge(r,this._parents,this._name,this._id)}function r8(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Ge(a,this._parents,this._name,this._id)}function i8(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function o8(t,e,n){var r,i,o=i8(e)?_c:Oe;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function a8(t,e){var n=this._id;return arguments.length<2?De(this.node(),n).on.on(t):this.each(o8(n,t,e))}function s8(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function u8(){return this.on("end.remove",s8(this._id))}function l8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Na(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,as(l[h],e,n,h,l,De(c,n)));return new Ge(o,this._parents,e,n)}function c8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ql(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=De(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&as(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ge(o,a,e,n)}var f8=Hn.prototype.constructor;function h8(){return new f8(this._groups,this._parents)}function p8(t,e){var n,r,i;return function(){var o=Wn(this,t),a=(this.style.removeProperty(t),Wn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function ym(t){return function(){this.style.removeProperty(t)}}function d8(t,e,n){var r,i=n+"",o;return function(){var a=Wn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function g8(t,e,n){var r,i,o;return function(){var a=Wn(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),Wn(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function m8(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Oe(this,t),l=u.on,c=u.value[o]==null?s||(s=ym(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function y8(t,e,n){var r=(t+="")=="transform"?nm:mm;return e==null?this.styleTween(t,p8(t,r)).on("end.style."+t,ym(t)):typeof e=="function"?this.styleTween(t,g8(t,r,wc(this,"style."+t,e))).each(m8(this._id,t)):this.styleTween(t,d8(t,r,e),n).on("end.style."+t,null)}function b8(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function x8(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&b8(t,a,n)),r}return o._value=e,o}function v8(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,x8(t,e,n??""))}function _8(t){return function(){this.textContent=t}}function w8(t){return function(){var e=t(this);this.textContent=e??""}}function $8(t){return this.tween("text",typeof t=="function"?w8(wc(this,"text",t)):_8(t==null?"":t+""))}function S8(t){return function(e){this.textContent=t.call(this,e)}}function A8(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&S8(i)),e}return r._value=t,r}function T8(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,A8(t))}function P8(){for(var t=this._name,e=this._id,n=xm(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=De(u,e);as(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ge(r,this._parents,t,n)}function M8(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Oe(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var D8=0;function Ge(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function bm(t){return Hn().transition(t)}function xm(){return++D8}var Ke=Hn.prototype;Ge.prototype=bm.prototype={constructor:Ge,select:l8,selectAll:c8,selectChild:Ke.selectChild,selectChildren:Ke.selectChildren,filter:n8,merge:r8,selection:h8,transition:P8,call:Ke.call,nodes:Ke.nodes,node:Ke.node,size:Ke.size,empty:Ke.empty,each:Ke.each,on:a8,attr:GP,attrTween:HP,style:y8,styleTween:v8,text:$8,textTween:T8,remove:u8,tween:RP,delay:VP,duration:KP,ease:JP,easeVarying:e8,end:M8,[Symbol.iterator]:Ke[Symbol.iterator]};const C8=t=>+t;function L8(t){return t*t}function k8(t){return t*(2-t)}function vm(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function R8(t){return t*t*t}function E8(t){return--t*t*t+1}function to(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $c=3,I8=function t(e){e=+e;function n(r){return Math.pow(r,e)}return n.exponent=t,n}($c),N8=function t(e){e=+e;function n(r){return 1-Math.pow(1-r,e)}return n.exponent=t,n}($c),_m=function t(e){e=+e;function n(r){return((r*=2)<=1?Math.pow(r,e):2-Math.pow(2-r,e))/2}return n.exponent=t,n}($c),wm=Math.PI,$m=wm/2;function B8(t){return+t==1?1:1-Math.cos(t*$m)}function F8(t){return Math.sin(t*$m)}function Sm(t){return(1-Math.cos(wm*t))/2}function xn(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function O8(t){return xn(1-+t)}function G8(t){return 1-xn(t)}function Am(t){return((t*=2)<=1?xn(1-t):2-xn(t-1))/2}function z8(t){return 1-Math.sqrt(1-t*t)}function Y8(t){return Math.sqrt(1- --t*t)}function Tm(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Sc=4/11,U8=6/11,W8=8/11,H8=3/4,X8=9/11,j8=10/11,V8=15/16,q8=21/22,Z8=63/64,ss=1/Sc/Sc;function K8(t){return 1-eo(1-t)}function eo(t){return(t=+t)<Sc?ss*t*t:t<W8?ss*(t-=U8)*t+H8:t<j8?ss*(t-=X8)*t+V8:ss*(t-=q8)*t+Z8}function Q8(t){return((t*=2)<=1?1-eo(1-t):eo(t-1)+1)/2}var Ac=1.70158,J8=function t(e){e=+e;function n(r){return(r=+r)*r*(e*(r-1)+r)}return n.overshoot=t,n}(Ac),tM=function t(e){e=+e;function n(r){return--r*r*((r+1)*e+r)+1}return n.overshoot=t,n}(Ac),Pm=function t(e){e=+e;function n(r){return((r*=2)<1?r*r*((e+1)*r-e):(r-=2)*r*((e+1)*r+e)+2)/2}return n.overshoot=t,n}(Ac),Hr=2*Math.PI,Tc=1,Pc=.3,eM=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return e*xn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),no=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return 1-e*xn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),nM=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return((o=o*2-1)<0?e*xn(-o)*Math.sin((r-o)/n):2-e*xn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),rM={time:null,delay:0,duration:250,ease:to};function iM(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function oM(t){var e,n;t instanceof Ge?(e=t._id,t=t._name):(e=xm(),(n=rM).time=Qi(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&as(u,t,e,l,a,n||iM(u,e));return new Ge(r,this._parents,t,e)}Hn.prototype.interrupt=CP,Hn.prototype.transition=oM;var aM=[null];function sM(t,e){var n=t.__transition,r,i;if(n){e=e==null?null:e+"";for(i in n)if((r=n[i]).state>bc&&r.name===e)return new Ge([[t]],aM,e,+i)}return null}const Mc=t=>()=>t;function uM(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function lM(t){t.stopImmediatePropagation()}function Dc(t){t.preventDefault(),t.stopImmediatePropagation()}var Mm={name:"drag"},Cc={name:"space"},Xr={name:"handle"},jr={name:"center"};const{abs:Dm,max:Ft,min:Ot}=Math;function Cm(t){return[+t[0],+t[1]]}function Lc(t){return[Cm(t[0]),Cm(t[1])]}var us={name:"x",handles:["w","e"].map(ro),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ls={name:"y",handles:["n","s"].map(ro),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},cM={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(ro),input:function(t){return t==null?null:Lc(t)},output:function(t){return t}},Qe={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Lm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},km={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},fM={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},hM={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ro(t){return{type:t}}function pM(t){return!t.ctrlKey&&!t.button}function dM(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function gM(){return navigator.maxTouchPoints||"ontouchstart"in this}function kc(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function mM(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function yM(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function bM(){return Rc(us)}function xM(){return Rc(ls)}function vM(){return Rc(cM)}function Rc(t){var e=dM,n=pM,r=gM,i=!0,o=Un("start","brush","end"),a=6,s;function u(m){var y=m.property("__brush",g).selectAll(".overlay").data([ro("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Qe.overlay).merge(y).each(function(){var v=kc(this).extent;V(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),m.selectAll(".selection").data([ro("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Qe.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=m.selectAll(".handle").data(t.handles,function(v){return v.type});b.exit().remove(),b.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return Qe[v.type]}),m.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}u.move=function(m,y,b){m.tween?m.on("start.brush",function(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,x=v.__brush,S=c(v,arguments),$=x.selection,R=t.input(typeof y=="function"?y.apply(this,arguments):y,x.extent),T=Ze($,R);function w(P){x.selection=P===1&&R===null?null:T(P),l.call(v),S.brush()}return $!==null&&R!==null?w:w(1)}):m.each(function(){var v=this,x=arguments,S=v.__brush,$=t.input(typeof y=="function"?y.apply(v,x):y,S.extent),R=c(v,x).beforestart();Kn(v),S.selection=$===null?null:$,l.call(v),R.start(b).brush(b).end(b)})},u.clear=function(m,y){u.move(m,null,y)};function l(){var m=V(this),y=kc(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?y[1][1]-y[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,y,b){var v=m.__brush.emitter;return v&&(!b||!v.clean)?v:new f(m,y,b)}function f(m,y,b){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=b}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,b){var v=V(this.that).datum();o.call(m,this.that,new uM(m,{sourceEvent:y,target:u,selection:t.output(this.state.selection),mode:b,dispatch:o}),v)}};function h(m){if(s&&!m.touches||!n.apply(this,arguments))return;var y=this,b=m.target.__data__.type,v=(i&&m.metaKey?b="overlay":b)==="selection"?Mm:i&&m.altKey?jr:Xr,x=t===ls?null:fM[b],S=t===us?null:hM[b],$=kc(y),R=$.extent,T=$.selection,w=R[0][0],P,_,N=R[0][1],D,A,L=R[1][0],M,G,O=R[1][1],E,k,C=0,F=0,X,Q=x&&S&&i&&m.shiftKey,z,Z,Y=Array.from(m.touches||[m],st=>{const Pt=st.identifier;return st=le(st,y),st.point0=st.slice(),st.identifier=Pt,st});Kn(y);var q=c(y,arguments,!0).beforestart();if(b==="overlay"){T&&(X=!0);const st=[Y[0],Y[1]||Y[0]];$.selection=T=[[P=t===ls?w:Ot(st[0][0],st[1][0]),D=t===us?N:Ot(st[0][1],st[1][1])],[M=t===ls?L:Ft(st[0][0],st[1][0]),E=t===us?O:Ft(st[0][1],st[1][1])]],Y.length>1&&mt(m)}else P=T[0][0],D=T[0][1],M=T[1][0],E=T[1][1];_=P,A=D,G=M,k=E;var j=V(y).attr("pointer-events","none"),rt=j.selectAll(".overlay").attr("cursor",Qe[b]);if(m.touches)q.moved=H,q.ended=ht;else{var ut=V(m.view).on("mousemove.brush",H,!0).on("mouseup.brush",ht,!0);i&&ut.on("keydown.brush",Ut,!0).on("keyup.brush",ee,!0),Fa(m.view)}l.call(y),q.start(m,v.name);function H(st){for(const Pt of st.changedTouches||[st])for(const Xo of Y)Xo.identifier===Pt.identifier&&(Xo.cur=le(Pt,y));if(Q&&!z&&!Z&&Y.length===1){const Pt=Y[0];Dm(Pt.cur[0]-Pt[0])>Dm(Pt.cur[1]-Pt[1])?Z=!0:z=!0}for(const Pt of Y)Pt.cur&&(Pt[0]=Pt.cur[0],Pt[1]=Pt.cur[1]);X=!0,Dc(st),mt(st)}function mt(st){const Pt=Y[0],Xo=Pt.point0;var kn;switch(C=Pt[0]-Xo[0],F=Pt[1]-Xo[1],v){case Cc:case Mm:{x&&(C=Ft(w-P,Ot(L-M,C)),_=P+C,G=M+C),S&&(F=Ft(N-D,Ot(O-E,F)),A=D+F,k=E+F);break}case Xr:{Y[1]?(x&&(_=Ft(w,Ot(L,Y[0][0])),G=Ft(w,Ot(L,Y[1][0])),x=1),S&&(A=Ft(N,Ot(O,Y[0][1])),k=Ft(N,Ot(O,Y[1][1])),S=1)):(x<0?(C=Ft(w-P,Ot(L-P,C)),_=P+C,G=M):x>0&&(C=Ft(w-M,Ot(L-M,C)),_=P,G=M+C),S<0?(F=Ft(N-D,Ot(O-D,F)),A=D+F,k=E):S>0&&(F=Ft(N-E,Ot(O-E,F)),A=D,k=E+F));break}case jr:{x&&(_=Ft(w,Ot(L,P-C*x)),G=Ft(w,Ot(L,M+C*x))),S&&(A=Ft(N,Ot(O,D-F*S)),k=Ft(N,Ot(O,E+F*S)));break}}G<_&&(x*=-1,kn=P,P=M,M=kn,kn=_,_=G,G=kn,b in Lm&&rt.attr("cursor",Qe[b=Lm[b]])),k<A&&(S*=-1,kn=D,D=E,E=kn,kn=A,A=k,k=kn,b in km&&rt.attr("cursor",Qe[b=km[b]])),$.selection&&(T=$.selection),z&&(_=T[0][0],G=T[1][0]),Z&&(A=T[0][1],k=T[1][1]),(T[0][0]!==_||T[0][1]!==A||T[1][0]!==G||T[1][1]!==k)&&($.selection=[[_,A],[G,k]],l.call(y),q.brush(st,v.name))}function ht(st){if(lM(st),st.touches){if(st.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else Oa(st.view,X),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);j.attr("pointer-events","all"),rt.attr("cursor",Qe.overlay),$.selection&&(T=$.selection),mM(T)&&($.selection=null,l.call(y)),q.end(st,v.name)}function Ut(st){switch(st.keyCode){case 16:{Q=x&&S;break}case 18:{v===Xr&&(x&&(M=G-C*x,P=_+C*x),S&&(E=k-F*S,D=A+F*S),v=jr,mt(st));break}case 32:{(v===Xr||v===jr)&&(x<0?M=G-C:x>0&&(P=_-C),S<0?E=k-F:S>0&&(D=A-F),v=Cc,rt.attr("cursor",Qe.selection),mt(st));break}default:return}Dc(st)}function ee(st){switch(st.keyCode){case 16:{Q&&(z=Z=Q=!1,mt(st));break}case 18:{v===jr&&(x<0?M=G:x>0&&(P=_),S<0?E=k:S>0&&(D=A),v=Xr,mt(st));break}case 32:{v===Cc&&(st.altKey?(x&&(M=G-C*x,P=_+C*x),S&&(E=k-F*S,D=A+F*S),v=jr):(x<0?M=G:x>0&&(P=_),S<0?E=k:S>0&&(D=A),v=Xr),rt.attr("cursor",Qe[b]),mt(st));break}default:return}Dc(st)}}function p(m){c(this,arguments).moved(m)}function d(m){c(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Lc(e.apply(this,arguments)),m.dim=t,m}return u.extent=function(m){return arguments.length?(e=typeof m=="function"?m:Mc(Lc(m)),u):e},u.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Mc(!!m),u):n},u.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Mc(!!m),u):r},u.handleSize=function(m){return arguments.length?(a=+m,u):a},u.keyModifiers=function(m){return arguments.length?(i=!!m,u):i},u.on=function(){var m=o.on.apply(o,arguments);return m===o?u:m},u}var Rm=Math.abs,Vr=Math.cos,qr=Math.sin,Em=Math.PI,cs=Em/2,Im=Em*2,Nm=Math.max,Ec=1e-12;function Ic(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function _M(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function wM(){return Nc(!1,!1)}function $M(){return Nc(!1,!0)}function SM(){return Nc(!0,!1)}function Nc(t,e){var n=0,r=null,i=null,o=null;function a(s){var u=s.length,l=new Array(u),c=Ic(0,u),f=new Array(u*u),h=new Array(u),p=0,d;s=Float64Array.from({length:u*u},e?(g,m)=>s[m%u][m/u|0]:(g,m)=>s[m/u|0][m%u]);for(let g=0;g<u;++g){let m=0;for(let y=0;y<u;++y)m+=s[g*u+y]+t*s[y*u+g];p+=l[g]=m}p=Nm(0,Im-n*u)/p,d=p?n:Im/u;{let g=0;r&&c.sort((m,y)=>r(l[m],l[y]));for(const m of c){const y=g;if(t){const b=Ic(~u+1,u).filter(v=>v<0?s[~v*u+m]:s[m*u+v]);i&&b.sort((v,x)=>i(v<0?-s[~v*u+m]:s[m*u+v],x<0?-s[~x*u+m]:s[m*u+x]));for(const v of b)if(v<0){const x=f[~v*u+m]||(f[~v*u+m]={source:null,target:null});x.target={index:m,startAngle:g,endAngle:g+=s[~v*u+m]*p,value:s[~v*u+m]}}else{const x=f[m*u+v]||(f[m*u+v]={source:null,target:null});x.source={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}else{const b=Ic(0,u).filter(v=>s[m*u+v]||s[v*u+m]);i&&b.sort((v,x)=>i(s[m*u+v],s[m*u+x]));for(const v of b){let x;if(m<v?(x=f[m*u+v]||(f[m*u+v]={source:null,target:null}),x.source={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]}):(x=f[v*u+m]||(f[v*u+m]={source:null,target:null}),x.target={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]},m===v&&(x.source=x.target)),x.source&&x.target&&x.source.value<x.target.value){const S=x.source;x.source=x.target,x.target=S}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}g+=d}}return f=Object.values(f),f.groups=h,o?f.sort(o):f}return a.padAngle=function(s){return arguments.length?(n=Nm(0,s),a):n},a.sortGroups=function(s){return arguments.length?(r=s,a):r},a.sortSubgroups=function(s){return arguments.length?(i=s,a):i},a.sortChords=function(s){return arguments.length?(s==null?o=null:(o=_M(s))._=s,a):o&&o._},a}const Bc=Math.PI,Fc=2*Bc,Qn=1e-6,AM=Fc-Qn;function Bm(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function TM(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Bm;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let io=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Bm:TM(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,u=r-e,l=i-n,c=a-e,f=s-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>Qn)if(!(Math.abs(f*u-l*c)>Qn)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,d=i-s,g=u*u+l*l,m=p*p+d*d,y=Math.sqrt(g),b=Math.sqrt(h),v=o*Math.tan((Bc-Math.acos((g+h-m)/(2*y*b)))/2),x=v/b,S=v/y;Math.abs(x-1)>Qn&&this._append`L${e+x*c},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*p>c*d)},${this._x1=e+S*u},${this._y1=n+S*l}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=e+s,c=n+u,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Qn||Math.abs(this._y1-c)>Qn)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%Fc+Fc),h>AM?this._append`A${r},${r},0,1,${f},${e-s},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:h>Qn&&this._append`A${r},${r},0,${+(h>=Bc)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Oc(){return new io}Oc.prototype=io.prototype;function PM(t=3){return new io(+t)}var MM=Array.prototype.slice;function Jn(t){return function(){return t}}function DM(t){return t.source}function CM(t){return t.target}function Fm(t){return t.radius}function LM(t){return t.startAngle}function kM(t){return t.endAngle}function RM(){return 0}function EM(){return 10}function Om(t){var e=DM,n=CM,r=Fm,i=Fm,o=LM,a=kM,s=RM,u=null;function l(){var c,f=e.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=MM.call(arguments),g=+r.apply(this,(d[0]=f,d)),m=o.apply(this,d)-cs,y=a.apply(this,d)-cs,b=+i.apply(this,(d[0]=h,d)),v=o.apply(this,d)-cs,x=a.apply(this,d)-cs;if(u||(u=c=Oc()),p>Ec&&(Rm(y-m)>p*2+Ec?y>m?(m+=p,y-=p):(m-=p,y+=p):m=y=(m+y)/2,Rm(x-v)>p*2+Ec?x>v?(v+=p,x-=p):(v-=p,x+=p):v=x=(v+x)/2),u.moveTo(g*Vr(m),g*qr(m)),u.arc(0,0,g,m,y),m!==v||y!==x)if(t){var S=+t.apply(this,arguments),$=b-S,R=(v+x)/2;u.quadraticCurveTo(0,0,$*Vr(v),$*qr(v)),u.lineTo(b*Vr(R),b*qr(R)),u.lineTo($*Vr(x),$*qr(x))}else u.quadraticCurveTo(0,0,b*Vr(v),b*qr(v)),u.arc(0,0,b,v,x);if(u.quadraticCurveTo(0,0,g*Vr(m),g*qr(m)),u.closePath(),c)return u=null,c+""||null}return t&&(l.headRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Jn(+c),l):t}),l.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:Jn(+c),l):r},l.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Jn(+c),l):r},l.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:Jn(+c),l):i},l.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Jn(+c),l):o},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Jn(+c),l):a},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Jn(+c),l):s},l.source=function(c){return arguments.length?(e=c,l):e},l.target=function(c){return arguments.length?(n=c,l):n},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function IM(){return Om()}function NM(){return Om(EM)}var BM=Array.prototype,Gm=BM.slice;function FM(t,e){return t-e}function OM(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}const vn=t=>()=>t;function GM(t,e){for(var n=-1,r=e.length,i;++n<r;)if(i=zM(t,e[n]))return i;return 0}function zM(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],l=u[0],c=u[1],f=t[s],h=f[0],p=f[1];if(YM(u,f,e))return 0;c>r!=p>r&&n<(h-l)*(r-c)/(p-c)+l&&(i=-i)}return i}function YM(t,e,n){var r;return UM(t,e,n)&&WM(t[r=+(t[0]===e[0])],n[r],e[r])}function UM(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function WM(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function HM(){}var Je=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Gc(){var t=1,e=1,n=Yl,r=u;function i(l){var c=n(l);if(Array.isArray(c))c=c.slice().sort(FM);else{const f=Ni(l,XM);for(c=zn(...zl(f[0],f[1],c),c);c[c.length-1]>=f[1];)c.pop();for(;c[1]<f[0];)c.shift()}return c.map(f=>o(l,f))}function o(l,c){const f=c==null?NaN:+c;if(isNaN(f))throw new Error(`invalid value: ${c}`);var h=[],p=[];return a(l,f,function(d){r(d,l,f),OM(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var g=0,m=h.length,y;g<m;++g)if(GM((y=h[g])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:h}}function a(l,c,f){var h=new Array,p=new Array,d,g,m,y,b,v;for(d=g=-1,y=tr(l[0],c),Je[y<<1].forEach(x);++d<t-1;)m=y,y=tr(l[d+1],c),Je[m|y<<1].forEach(x);for(Je[y<<0].forEach(x);++g<e-1;){for(d=-1,y=tr(l[g*t+t],c),b=tr(l[g*t],c),Je[y<<1|b<<2].forEach(x);++d<t-1;)m=y,y=tr(l[g*t+t+d+1],c),v=b,b=tr(l[g*t+d+1],c),Je[m|y<<1|b<<2|v<<3].forEach(x);Je[y|b<<3].forEach(x)}for(d=-1,b=l[g*t]>=c,Je[b<<2].forEach(x);++d<t-1;)v=b,b=tr(l[g*t+d+1],c),Je[b<<2|v<<3].forEach(x);Je[b<<3].forEach(x);function x(S){var $=[S[0][0]+d,S[0][1]+g],R=[S[1][0]+d,S[1][1]+g],T=s($),w=s(R),P,_;(P=p[T])?(_=h[w])?(delete p[P.end],delete h[_.start],P===_?(P.ring.push(R),f(P.ring)):h[P.start]=p[_.end]={start:P.start,end:_.end,ring:P.ring.concat(_.ring)}):(delete p[P.end],P.ring.push(R),p[P.end=w]=P):(P=h[w])?(_=p[T])?(delete h[P.start],delete p[_.end],P===_?(P.ring.push(R),f(P.ring)):h[_.start]=p[P.end]={start:_.start,end:P.end,ring:_.ring.concat(P.ring)}):(delete h[P.start],P.ring.unshift($),h[P.start=T]=P):h[T]=p[w]={start:T,end:w,ring:[$,R]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function u(l,c,f){l.forEach(function(h){var p=h[0],d=h[1],g=p|0,m=d|0,y=zc(c[m*t+g]);p>0&&p<t&&g===p&&(h[0]=zm(p,zc(c[m*t+g-1]),y,f)),d>0&&d<e&&m===d&&(h[1]=zm(d,zc(c[(m-1)*t+g]),y,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[t,e];var c=Math.floor(l[0]),f=Math.floor(l[1]);if(!(c>=0&&f>=0))throw new Error("invalid size");return t=c,e=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?vn(Gm.call(l)):vn(l),i):n},i.smooth=function(l){return arguments.length?(r=l?u:HM,i):r===u},i}function XM(t){return isFinite(t)?t:NaN}function tr(t,e){return t==null?!1:+t>=e}function zc(t){return t==null||isNaN(t=+t)?-1/0:t}function zm(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function jM(t){return t[0]}function VM(t){return t[1]}function qM(){return 1}function ZM(){var t=jM,e=VM,n=qM,r=960,i=500,o=20,a=2,s=o*3,u=r+s*2>>a,l=i+s*2>>a,c=vn(20);function f(b){var v=new Float32Array(u*l),x=Math.pow(2,-a),S=-1;for(const D of b){var $=(t(D,++S,b)+s)*x,R=(e(D,S,b)+s)*x,T=+n(D,S,b);if(T&&$>=0&&$<u&&R>=0&&R<l){var w=Math.floor($),P=Math.floor(R),_=$-w-.5,N=R-P-.5;v[w+P*u]+=(1-_)*(1-N)*T,v[w+1+P*u]+=_*(1-N)*T,v[w+1+(P+1)*u]+=_*N*T,v[w+(P+1)*u]+=(1-_)*N*T}}return Ig({data:v,width:u,height:l},o*x),v}function h(b){var v=f(b),x=c(v),S=Math.pow(2,2*a);return Array.isArray(x)||(x=zn(Number.MIN_VALUE,Fi(v)/S,x)),Gc().size([u,l]).thresholds(x.map($=>$*S))(v).map(($,R)=>($.value=+x[R],p($)))}h.contours=function(b){var v=f(b),x=Gc().size([u,l]),S=Math.pow(2,2*a),$=R=>{R=+R;var T=p(x.contour(v,R*S));return T.value=R,T};return Object.defineProperty($,"max",{get:()=>Fi(v)/S}),$};function p(b){return b.coordinates.forEach(d),b}function d(b){b.forEach(g)}function g(b){b.forEach(m)}function m(b){b[0]=b[0]*Math.pow(2,a)-s,b[1]=b[1]*Math.pow(2,a)-s}function y(){return s=o*3,u=r+s*2>>a,l=i+s*2>>a,h}return h.x=function(b){return arguments.length?(t=typeof b=="function"?b:vn(+b),h):t},h.y=function(b){return arguments.length?(e=typeof b=="function"?b:vn(+b),h):e},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:vn(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var v=+b[0],x=+b[1];if(!(v>=0&&x>=0))throw new Error("invalid size");return r=v,i=x,y()},h.cellSize=function(b){if(!arguments.length)return 1<<a;if(!((b=+b)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(b)/Math.LN2),y()},h.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?vn(Gm.call(b)):vn(b),h):c},h.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},h}const tn=11102230246251565e-32,Gt=134217729,KM=(3+8*tn)*tn;function Yc(t,e,n,r,i){let o,a,s,u,l=e[0],c=r[0],f=0,h=0;c>l==c>-l?(o=l,l=e[++f]):(o=c,c=r[++h]);let p=0;if(f<t&&h<n)for(c>l==c>-l?(a=l+o,s=o-(a-l),l=e[++f]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,s!==0&&(i[p++]=s);f<t&&h<n;)c>l==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h]),o=a,s!==0&&(i[p++]=s);for(;f<t;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f],o=a,s!==0&&(i[p++]=s);for(;h<n;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function QM(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function oo(t){return new Float64Array(t)}const JM=(3+16*tn)*tn,t4=(2+12*tn)*tn,e4=(9+64*tn)*tn*tn,Zr=oo(4),Ym=oo(8),Um=oo(12),Wm=oo(16),Ht=oo(4);function n4(t,e,n,r,i,o,a){let s,u,l,c,f,h,p,d,g,m,y,b,v,x,S,$,R,T;const w=t-i,P=n-i,_=e-o,N=r-o;x=w*N,h=Gt*w,p=h-(h-w),d=w-p,h=Gt*N,g=h-(h-N),m=N-g,S=d*m-(x-p*g-d*g-p*m),$=_*P,h=Gt*_,p=h-(h-_),d=_-p,h=Gt*P,g=h-(h-P),m=P-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Zr[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Zr[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Zr[2]=b-(T-f)+(y-f),Zr[3]=T;let D=QM(4,Zr),A=t4*a;if(D>=A||-D>=A||(f=t-w,s=t-(w+f)+(f-i),f=n-P,l=n-(P+f)+(f-i),f=e-_,u=e-(_+f)+(f-o),f=r-N,c=r-(N+f)+(f-o),s===0&&u===0&&l===0&&c===0)||(A=e4*a+KM*Math.abs(D),D+=w*c+N*s-(_*l+P*u),D>=A||-D>=A))return D;x=s*N,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*N,g=h-(h-N),m=N-g,S=d*m-(x-p*g-d*g-p*m),$=u*P,h=Gt*u,p=h-(h-u),d=u-p,h=Gt*P,g=h-(h-P),m=P-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const L=Yc(4,Zr,4,Ht,Ym);x=w*c,h=Gt*w,p=h-(h-w),d=w-p,h=Gt*c,g=h-(h-c),m=c-g,S=d*m-(x-p*g-d*g-p*m),$=_*l,h=Gt*_,p=h-(h-_),d=_-p,h=Gt*l,g=h-(h-l),m=l-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const M=Yc(L,Ym,4,Ht,Um);x=s*c,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*c,g=h-(h-c),m=c-g,S=d*m-(x-p*g-d*g-p*m),$=u*l,h=Gt*u,p=h-(h-u),d=u-p,h=Gt*l,g=h-(h-l),m=l-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const G=Yc(M,Um,4,Ht,Wm);return Wm[G-1]}function fs(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),u=a-s,l=Math.abs(a+s);return Math.abs(u)>=JM*l?u:-n4(t,e,n,r,i,o,l)}const Hm=Math.pow(2,-52),hs=new Uint32Array(512);class ps{static from(e,n=s4,r=u4){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=e[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new ps(o)}constructor(e){const n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=e.length>>1;let s=1/0,u=1/0,l=-1/0,c=-1/0;for(let w=0;w<a;w++){const P=e[2*w],_=e[2*w+1];P<s&&(s=P),_<u&&(u=_),P>l&&(l=P),_>c&&(c=_),this._ids[w]=w}const f=(s+l)/2,h=(u+c)/2;let p,d,g;for(let w=0,P=1/0;w<a;w++){const _=Uc(f,h,e[2*w],e[2*w+1]);_<P&&(p=w,P=_)}const m=e[2*p],y=e[2*p+1];for(let w=0,P=1/0;w<a;w++){if(w===p)continue;const _=Uc(m,y,e[2*w],e[2*w+1]);_<P&&_>0&&(d=w,P=_)}let b=e[2*d],v=e[2*d+1],x=1/0;for(let w=0;w<a;w++){if(w===p||w===d)continue;const P=o4(m,y,b,v,e[2*w],e[2*w+1]);P<x&&(g=w,x=P)}let S=e[2*g],$=e[2*g+1];if(x===1/0){for(let _=0;_<a;_++)this._dists[_]=e[2*_]-e[0]||e[2*_+1]-e[1];Kr(this._ids,this._dists,0,a-1);const w=new Uint32Array(a);let P=0;for(let _=0,N=-1/0;_<a;_++){const D=this._ids[_],A=this._dists[D];A>N&&(w[P++]=D,N=A)}this.hull=w.subarray(0,P),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(fs(m,y,b,v,S,$)<0){const w=d,P=b,_=v;d=g,b=S,v=$,g=w,S=P,$=_}const R=a4(m,y,b,v,S,$);this._cx=R.x,this._cy=R.y;for(let w=0;w<a;w++)this._dists[w]=Uc(e[2*w],e[2*w+1],R.x,R.y);Kr(this._ids,this._dists,0,a-1),this._hullStart=p;let T=3;r[p]=n[g]=d,r[d]=n[p]=g,r[g]=n[d]=p,i[p]=0,i[d]=1,i[g]=2,o.fill(-1),o[this._hashKey(m,y)]=p,o[this._hashKey(b,v)]=d,o[this._hashKey(S,$)]=g,this.trianglesLen=0,this._addTriangle(p,d,g,-1,-1,-1);for(let w=0,P,_;w<this._ids.length;w++){const N=this._ids[w],D=e[2*N],A=e[2*N+1];if(w>0&&Math.abs(D-P)<=Hm&&Math.abs(A-_)<=Hm||(P=D,_=A,N===p||N===d||N===g))continue;let L=0;for(let k=0,C=this._hashKey(D,A);k<this._hashSize&&(L=o[(C+k)%this._hashSize],!(L!==-1&&L!==r[L]));k++);L=n[L];let M=L,G;for(;G=r[M],fs(D,A,e[2*M],e[2*M+1],e[2*G],e[2*G+1])>=0;)if(M=G,M===L){M=-1;break}if(M===-1)continue;let O=this._addTriangle(M,N,r[M],-1,-1,i[M]);i[N]=this._legalize(O+2),i[M]=O,T++;let E=r[M];for(;G=r[E],fs(D,A,e[2*E],e[2*E+1],e[2*G],e[2*G+1])<0;)O=this._addTriangle(E,N,G,i[N],-1,i[E]),i[N]=this._legalize(O+2),r[E]=E,T--,E=G;if(M===L)for(;G=n[M],fs(D,A,e[2*G],e[2*G+1],e[2*M],e[2*M+1])<0;)O=this._addTriangle(G,N,M,-1,i[M],i[G]),this._legalize(O+2),i[G]=O,r[M]=M,T--,M=G;this._hullStart=n[N]=M,r[M]=n[E]=N,r[N]=E,o[this._hashKey(D,A)]=N,o[this._hashKey(e[2*M],e[2*M+1])]=M}this.hull=new Uint32Array(T);for(let w=0,P=this._hullStart;w<T;w++)this.hull[w]=P,P=r[P];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(r4(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[e],u=e-e%3;if(a=u+(e+2)%3,s===-1){if(o===0)break;e=hs[--o];continue}const l=s-s%3,c=u+(e+1)%3,f=l+(s+2)%3,h=n[a],p=n[e],d=n[c],g=n[f];if(i4(i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*d],i[2*d+1],i[2*g],i[2*g+1])){n[e]=g,n[s]=h;const y=r[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=e;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(e,y),this._link(s,r[a]),this._link(a,f);const b=l+(s+1)%3;o<hs.length&&(hs[o++]=b)}else{if(o===0)break;e=hs[--o]}}return a}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=e,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}}function r4(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function Uc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function i4(t,e,n,r,i,o,a,s){const u=t-a,l=e-s,c=n-a,f=r-s,h=i-a,p=o-s,d=u*u+l*l,g=c*c+f*f,m=h*h+p*p;return u*(f*m-g*p)-l*(c*m-g*h)+d*(c*p-f*h)<0}function o4(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=(l*c-s*f)*h,d=(a*f-u*c)*h;return p*p+d*d}function a4(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=t+(l*c-s*f)*h,d=e+(a*f-u*c)*h;return{x:p,y:d}}function Kr(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],a=e[o];let s=i-1;for(;s>=n&&e[t[s]]>a;)t[s+1]=t[s--];t[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;ao(t,i,o),e[t[n]]>e[t[r]]&&ao(t,n,r),e[t[o]]>e[t[r]]&&ao(t,o,r),e[t[n]]>e[t[o]]&&ao(t,n,o);const s=t[o],u=e[s];for(;;){do o++;while(e[t[o]]<u);do a--;while(e[t[a]]>u);if(a<o)break;ao(t,o,a)}t[n+1]=t[a],t[a]=s,r-o+1>=a-n?(Kr(t,e,o,r),Kr(t,e,n,a-1)):(Kr(t,e,n,a-1),Kr(t,e,o,r))}}function ao(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function s4(t){return t[0]}function u4(t){return t[1]}const Xm=1e-6;class er{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Xm||Math.abs(this._y1-o)>Xm)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Wc{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}class jm{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,a;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,y=r.length,b,v;g<y;g+=3,m+=2){const x=r[g]*2,S=r[g+1]*2,$=r[g+2]*2,R=e[x],T=e[x+1],w=e[S],P=e[S+1],_=e[$],N=e[$+1],D=w-R,A=P-T,L=_-R,M=N-T,G=(D*M-A*L)*2;if(Math.abs(G)<1e-9){if(o===void 0){o=a=0;for(const E of n)o+=e[E*2],a+=e[E*2+1];o/=n.length,a/=n.length}const O=1e9*Math.sign((o-R)*M-(a-T)*L);b=(R+_)/2-O*M,v=(T+N)/2+O*L}else{const O=1/G,E=D*D+A*A,k=L*L+M*M;b=R+(M*E-A*k)*O,v=T+(D*k-L*E)*O}s[m]=b,s[m+1]=v}let u=n[n.length-1],l,c=u*4,f,h=e[2*u],p,d=e[2*u+1];i.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=h,p=d,c=u*4,h=e[2*u],d=e[2*u+1],i[l+2]=i[c]=p-d,i[l+3]=i[c+1]=h-f}render(e){const n=e==null?e=new er:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,f=r.length;c<f;++c){const h=r[c];if(h<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(h/3)*2,g=a[p],m=a[p+1],y=a[d],b=a[d+1];this._renderSegment(g,m,y,b,e)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(i[l]/3)*2,h=a[f],p=a[f+1],d=u*4,g=this._project(h,p,s[d+2],s[d+3]);g&&this._renderSegment(h,p,g[0],g[1],e)}return n&&n.value()}renderBounds(e){const n=e==null?e=new er:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){const r=n==null?n=new er:void 0,i=this._clip(e);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(e){const n=new Wc;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,i,o){let a;const s=this._regioncode(e,n),u=this._regioncode(r,i);s===0&&u===0?(o.moveTo(e,n),o.lineTo(r,i)):(a=this._clipSegment(e,n,r,i,s,u))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){const n=this._clip(e);if(n)for(const r of this.delaunay.neighbors(e)){const i=this._clip(r);if(i){t:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,u=i.length;s<u;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+u-2)%u]&&n[(o+3)%a]===i[(s+u-1)%u]){yield r;break t}}}}_cell(e){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[e];if(a===-1)return null;const s=[];let u=a;do{const l=Math.floor(u/3);if(s.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==e)break;u=i[u]}while(u!==a&&u!==-1);return s}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(e);if(n===null)return null;const{vectors:r}=this,i=e*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(e,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(e,n))}_clipFinite(e,n){const r=n.length;let i=null,o,a,s=n[r-2],u=n[r-1],l,c=this._regioncode(s,u),f,h=0;for(let p=0;p<r;p+=2)if(o=s,a=u,s=n[p],u=n[p+1],l=c,c=this._regioncode(s,u),l===0&&c===0)f=h,h=0,i?i.push(s,u):i=[s,u];else{let d,g,m,y,b;if(l===0){if((d=this._clipSegment(o,a,s,u,l,c))===null)continue;[g,m,y,b]=d}else{if((d=this._clipSegment(s,u,o,a,c,l))===null)continue;[y,b,g,m]=d,f=h,h=this._edgecode(g,m),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(g,m):i=[g,m]}f=h,h=this._edgecode(y,b),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(e,f,h,i,i.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(e,n,r,i,o,a){const s=o<a;for(s&&([e,n,r,i,o,a]=[r,i,e,n,a,o]);;){if(o===0&&a===0)return s?[r,i,e,n]:[e,n,r,i];if(o&a)return null;let u,l,c=o||a;c&8?(u=e+(r-e)*(this.ymax-n)/(i-n),l=this.ymax):c&4?(u=e+(r-e)*(this.ymin-n)/(i-n),l=this.ymin):c&2?(l=n+(i-n)*(this.xmax-e)/(r-e),u=this.xmax):(l=n+(i-n)*(this.xmin-e)/(r-e),u=this.xmin),o?(e=u,n=l,o=this._regioncode(e,n)):(r=u,i=l,a=this._regioncode(r,i))}}_clipInfinite(e,n,r,i,o,a){let s=Array.from(n),u;if((u=this._project(s[0],s[1],r,i))&&s.unshift(u[0],u[1]),(u=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(u[0],u[1]),s=this._clipFinite(e,s))for(let l=0,c=s.length,f,h=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)f=h,h=this._edgecode(s[l],s[l+1]),f&&h&&(l=this._edge(e,f,h,s,l),c=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(e,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(e,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(e,n,r,i){let o=1/0,a,s,u;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(u=this.ymin,s=e+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(u=this.ymax,s=e+(o=a)*r)}if(r>0){if(e>=this.xmax)return null;(a=(this.xmax-e)/r)<o&&(s=this.xmax,u=n+(o=a)*i)}else if(r<0){if(e<=this.xmin)return null;(a=(this.xmin-e)/r)<o&&(s=this.xmin,u=n+(o=a)*i)}return[s,u]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){const r=(n+2)%e.length,i=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[i]||e[n+1]===e[r+1]&&e[r+1]===e[i+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}}const l4=2*Math.PI,Qr=Math.pow;function c4(t){return t[0]}function f4(t){return t[1]}function h4(t){const{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){const i=2*e[r],o=2*e[r+1],a=2*e[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function p4(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Hc{static from(e,n=c4,r=f4,i){return new Hc("length"in e?d4(e,n,r,i):Float64Array.from(g4(e,n,r,i)))}constructor(e){this._delaunator=new ps(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&h4(e)){this.collinear=Int32Array.from({length:n.length/2},(h,p)=>p).sort((h,p)=>n[2*h]-n[2*p]||n[2*h+1]-n[2*p+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let h=0,p=n.length/2;h<p;++h){const d=p4(n[2*h],n[2*h+1],f);n[2*h]=d[0],n[2*h+1]=d[1]}this._delaunator=new ps(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let u=0,l=r.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(r[u]===-1||a[c]===-1)&&(a[c]=u)}for(let u=0,l=i.length;u<l;++u)s[i[u]]=u;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new jm(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const f=s.indexOf(e);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+1]);return}const u=n[e];if(u===-1)return;let l=u,c=-1;do{if(yield c=a[l],l=l%3===2?l-2:l+1,a[l]!==e)return;if(l=o[l],l===-1){const f=r[(i[e]+1)%r.length];f!==c&&(yield f);return}}while(l!==u)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,e,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:u,points:l}=this;if(i[e]===-1||!l.length)return(e+1)%(l.length>>1);let c=e,f=Qr(n-l[e*2],2)+Qr(r-l[e*2+1],2);const h=i[e];let p=h;do{let d=u[p];const g=Qr(n-l[d*2],2)+Qr(r-l[d*2+1],2);if(g<f&&(f=g,c=d),p=p%3===2?p-2:p+1,u[p]!==e)break;if(p=s[p],p===-1){if(p=o[(a[e]+1)%o.length],p!==d&&Qr(n-l[p*2],2)+Qr(r-l[p*2+1],2)<f)return p;break}}while(p!==h);return c}render(e){const n=e==null?e=new er:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const u=i[a];if(u<a)continue;const l=o[a]*2,c=o[u]*2;e.moveTo(r[l],r[l+1]),e.lineTo(r[c],r[c+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;const r=e==null?e=new er:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],u=i[o+1];e.moveTo(s+n,u),e.arc(s,u,n,0,l4)}return r&&r.value()}renderHull(e){const n=e==null?e=new er:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;e.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const u=2*r[s];e.lineTo(i[u],i[u+1])}return e.closePath(),n&&n.value()}hullPolygon(){const e=new Wc;return this.renderHull(e),e.value()}renderTriangle(e,n){const r=n==null?n=new er:void 0,{points:i,triangles:o}=this,a=o[e*=3]*2,s=o[e+1]*2,u=o[e+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[u],i[u+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){const n=new Wc;return this.renderTriangle(e,n),n.value()}}function d4(t,e,n,r){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=t[a];o[a*2]=e.call(r,s,a,t),o[a*2+1]=n.call(r,s,a,t)}return o}function*g4(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}var Vm={},Xc={},jc=34,so=10,Vc=13;function qm(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function m4(t,e){var n=qm(t);return function(r,i){return e(n(r),i,t)}}function Zm(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function ie(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function y4(t){return t<0?"-"+ie(-t,6):t>9999?"+"+ie(t,6):ie(t,4)}function b4(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":y4(t.getUTCFullYear())+"-"+ie(t.getUTCMonth()+1,2)+"-"+ie(t.getUTCDate(),2)+(i?"T"+ie(e,2)+":"+ie(n,2)+":"+ie(r,2)+"."+ie(i,3)+"Z":r?"T"+ie(e,2)+":"+ie(n,2)+":"+ie(r,2)+"Z":n||e?"T"+ie(e,2)+":"+ie(n,2)+"Z":"")}function ds(t){var e=new RegExp('["'+t+`
10
10
  \r]`),n=t.charCodeAt(0);function r(f,h){var p,d,g=i(f,function(m,y){if(p)return p(m,y-1);d=m,p=h?m4(m,h):qm(m)});return g.columns=d||[],g}function i(f,h){var p=[],d=f.length,g=0,m=0,y,b=d<=0,v=!1;f.charCodeAt(d-1)===so&&--d,f.charCodeAt(d-1)===Vc&&--d;function x(){if(b)return Xc;if(v)return v=!1,Vm;var $,R=g,T;if(f.charCodeAt(R)===jc){for(;g++<d&&f.charCodeAt(g)!==jc||f.charCodeAt(++g)===jc;);return($=g)>=d?b=!0:(T=f.charCodeAt(g++))===so?v=!0:T===Vc&&(v=!0,f.charCodeAt(g)===so&&++g),f.slice(R+1,$-1).replace(/""/g,'"')}for(;g<d;){if((T=f.charCodeAt($=g++))===so)v=!0;else if(T===Vc)v=!0,f.charCodeAt(g)===so&&++g;else if(T!==n)continue;return f.slice(R,$)}return b=!0,f.slice(R,d)}for(;(y=x())!==Xc;){for(var S=[];y!==Vm&&y!==Xc;)S.push(y),y=x();h&&(S=h(S,m++))==null||p.push(S)}return p}function o(f,h){return f.map(function(p){return h.map(function(d){return c(p[d])}).join(t)})}function a(f,h){return h==null&&(h=Zm(f)),[h.map(c).join(t)].concat(o(f,h)).join(`
11
11
  `)}function s(f,h){return h==null&&(h=Zm(f)),o(f,h).join(`
12
12
  `)}function u(f){return f.map(l).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.73",
3
+ "version": "3.0.0-alpha.74",
4
4
  "description": "plugins for OrbCharts",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "vite-plugin-dts": "^3.7.3"
36
36
  },
37
37
  "dependencies": {
38
- "@orbcharts/core": "^3.0.0-alpha.65",
38
+ "@orbcharts/core": "^3.0.0-alpha.66",
39
39
  "@orbcharts/core-types": "^3.0.0-alpha.3",
40
40
  "d3": "^7.8.5",
41
41
  "rxjs": "^7.8.1"