diff --git a/python/inspectus/static/css/charts.css b/python/inspectus/static/css/charts.css index 02c5d24..dbe40c5 100644 --- a/python/inspectus/static/css/charts.css +++ b/python/inspectus/static/css/charts.css @@ -1 +1 @@ -@media(prefers-color-scheme: dark){.attention-visualization{color:#eee}.attention-visualization svg text{stroke:#eee;fill:#eee}.attention-visualization .menu{background-color:#333}}@media(prefers-color-scheme: light){.attention-visualization{color:#333}.attention-visualization svg text{stroke:#333;fill:#333}.attention-visualization .menu{background-color:#eee}}.attention-visualization{font-family:"Roboto Light","Ubuntu Light","Ubuntu",monospace;overflow-y:scroll}.attention-visualization .title{padding-top:10px;padding-bottom:5px;font-size:.8rem}.attention-visualization .title.inline{display:inline-block}.attention-visualization .select-container{padding-top:10px;padding-bottom:5px}.attention-visualization .select-container select{margin-left:10px}.attention-visualization .double-select{display:flex;flex-direction:row;gap:30px}.attention-visualization .double-select .select-container{width:fit-content}.attention-visualization .matrix{margin-bottom:20px}.attention-visualization .matrix .label text{dominant-baseline:central;text-anchor:end;font-family:monospace}.attention-visualization .text-tokens{margin-bottom:10px}.attention-visualization .text-tokens .token{font-family:monospace;display:inline-block;white-space:pre;padding:2px 5px;user-select:none;cursor:pointer;margin-bottom:10px;background-clip:padding-box !important}.attention-visualization .text-tokens .token.new-line{opacity:.6}.attention-visualization .token-value-container{padding-bottom:100px;width:calc(100% - 20px)}.attention-visualization .token-value-container.padding-less .token{border-left:none !important;padding:0;margin-bottom:3px}.attention-visualization .dimension-values{margin-bottom:20px}.attention-visualization .dimension-values .value{font-family:monospace;white-space:pre;display:inline-block;margin:2px;padding:3px 5px;font-size:10px;text-align:center;user-select:none;cursor:pointer;width:3rem}.attention-visualization .hover-container{position:relative;display:inline-block}.attention-visualization .menu{display:none;position:absolute;width:max-content;box-shadow:0px 8px 16px 0px rgba(0,0,0,.2);z-index:1;min-width:100px;max-width:50vw;padding:5px;white-space:nowrap}.attention-visualization .menu pre{background-color:rgba(0,0,0,0);text-wrap:wrap}.attention-visualization .menu.right-align{right:0;left:auto}.attention-visualization .hover-container:hover .menu{display:block} +.attention-visualization{color:#000;background-color:#fff}.attention-visualization .menu{background-color:#eee;color:#000}.attention-visualization .menu pre{color:#000;background-color:#eee}.attention-visualization svg text{fill:#000}.attention-visualization.dark-theme{color:#fff;background-color:#000}.attention-visualization.dark-theme .menu{background-color:#333;color:#fff}.attention-visualization.dark-theme .menu pre{color:#fff;background-color:#333}.attention-visualization.dark-theme svg text{fill:#fff}.attention-visualization{font-family:"Roboto Light","Ubuntu Light","Ubuntu",monospace;overflow-y:scroll}.attention-visualization .title{padding-top:10px;padding-bottom:5px;font-size:.8rem}.attention-visualization .title.inline{display:inline-block}.attention-visualization .select-container{padding-top:10px;padding-bottom:5px}.attention-visualization .select-container select{margin-left:10px}.attention-visualization .double-select{display:flex;flex-direction:row;gap:30px}.attention-visualization .double-select .select-container{width:fit-content}.attention-visualization .matrix{margin-bottom:20px}.attention-visualization .matrix .label text{dominant-baseline:central;text-anchor:end;font-family:monospace}.attention-visualization .text-tokens{margin-bottom:10px}.attention-visualization .text-tokens .token{font-family:monospace;display:inline-block;white-space:pre;padding:2px 5px;user-select:none;cursor:pointer;margin-bottom:10px;background-clip:padding-box !important}.attention-visualization .text-tokens .token.new-line{opacity:.6}.attention-visualization .token-value-container{padding-bottom:100px;width:calc(100% - 20px)}.attention-visualization .token-value-container.padding-less .token{border-left:none !important;padding:0;margin-bottom:3px}.attention-visualization .dimension-values{margin-bottom:20px}.attention-visualization .dimension-values .value{font-family:monospace;white-space:pre;display:inline-block;margin:2px;padding:3px 5px;font-size:10px;text-align:center;user-select:none;cursor:pointer;width:3rem}.attention-visualization .hover-container{position:relative;display:inline-block}.attention-visualization .menu{display:none;position:absolute;width:max-content;box-shadow:0px 8px 16px 0px rgba(0,0,0,.2);z-index:1;min-width:100px;max-width:50vw;padding:5px;white-space:nowrap}.attention-visualization .menu pre{background-color:rgba(0,0,0,0);text-wrap:wrap}.attention-visualization .menu.right-align{right:0;left:auto}.attention-visualization .hover-container:hover .menu{display:block}.attention-visualization .hover-container:hover{border:1px solid #878686} diff --git a/python/inspectus/static/js/charts.js b/python/inspectus/static/js/charts.js index b30d26d..2f3f992 100644 --- a/python/inspectus/static/js/charts.js +++ b/python/inspectus/static/js/charts.js @@ -1 +1 @@ -(()=>{var t={470:function(t,n){!function(t){"use strict";function n(t,n){return null==t||null==n?NaN:tn?1:t>=n?0:NaN}function e(t){let e=t,r=t,i=t;function o(t,n,e=0,o=t.length){if(e>>1;i(t[r],n)<0?e=r+1:o=r}while(et(n)-e,r=n,i=(e,r)=>n(t(e),r)),{left:o,center:function(t,n,r=0,i=t.length){const a=o(t,n,r,i-1);return a>r&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,n,e=0,o=t.length){if(e>>1;i(t[r],n)<=0?e=r+1:o=r}while(e=n&&++e;else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(i=+i)>=i&&++e}return e}function l(t){return 0|t.length}function f(t){return!(t>0)}function h(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function d(t,n){let e,r=0,i=0,o=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(e=n-i,i+=e/++r,o+=e*(n-i));else{let a=-1;for(let u of t)null!=(u=n(u,++a,t))&&(u=+u)>=u&&(e=u-i,i+=e/++r,o+=e*(u-i))}if(r>1)return o/(r-1)}function p(t,n){const e=d(t,n);return e?Math.sqrt(e):e}function g(t,n){let e,r;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=r=n):(e>n&&(e=n),r=o&&(e=r=o):(e>o&&(e=o),r0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}class v extends Map{constructor(t,n=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const[n,e]of t)this.set(n,e)}get(t){return super.get(_(this,t))}has(t){return super.has(_(this,t))}set(t,n){return super.set(b(this,t),n)}delete(t){return super.delete(x(this,t))}}class m extends Set{constructor(t,n=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(_(this,t))}add(t){return super.add(b(this,t))}delete(t){return super.delete(x(this,t))}}function _({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function b({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function x({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function w(t){return null!==t&&"object"==typeof t?t.valueOf():t}function M(t){return t}function k(t,...n){return N(t,M,M,n)}function T(t,...n){return N(t,Array.from,M,n)}function A(t,n){for(let e=1,r=n.length;et.pop().map((([n,e])=>[...t,n,e]))));return t}function S(t,n,...e){return N(t,M,n,e)}function E(t,n,...e){return N(t,Array.from,n,e)}function C(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function N(t,n,e,r){return function t(i,o){if(o>=r.length)return e(i);const a=new v,u=r[o++];let s=-1;for(const t of i){const n=u(t,++s,i),e=a.get(n);e?e.push(t):a.set(n,[t])}for(const[n,e]of a)a.set(n,t(e,o));return n(a)}(t,0)}function P(t,n){return Array.from(n,(n=>t[n]))}function D(t,...n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[e]=n;if(e&&2!==e.length||n.length>1){const r=Uint32Array.from(t,((t,n)=>n));return n.length>1?(n=n.map((n=>t.map(n))),r.sort(((t,e)=>{for(const r of n){const n=L(r[t],r[e]);if(n)return n}}))):(e=t.map(e),r.sort(((t,n)=>L(e[t],e[n])))),P(t,r)}return t.sort(z(e))}function z(t=n){if(t===n)return L;if("function"!=typeof t)throw new TypeError("compare is not a function");return(n,e)=>{const r=t(n,e);return r||0===r?r:(0===t(e,e))-(0===t(n,n))}}function L(t,n){return(null==t||!(t>=t))-(null==n||!(n>=n))||(tn?1:0)}var H=Array.prototype.slice;function R(t){return()=>t}var I=Math.sqrt(50),B=Math.sqrt(10),q=Math.sqrt(2);function F(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n0){let e=Math.round(t/a),r=Math.round(n/a);for(e*an&&--r,o=new Array(i=r-e+1);++un&&--r,o=new Array(i=r-e+1);++u=0?(o>=I?10:o>=B?5:o>=q?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=I?10:o>=B?5:o>=q?2:1)}function U(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=I?i*=10:o>=B?i*=5:o>=q&&(i*=2),n0?(t=Math.floor(t/i)*i,n=Math.ceil(n/i)*i):i<0&&(t=Math.ceil(t*i)/i,n=Math.floor(n*i)/i),r=i}}function G(t){return Math.ceil(Math.log(c(t))/Math.LN2)+1}function V(){var t=M,n=g,e=G;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a=r.length,u=new Array(a);for(i=0;i=f)if(t>=f&&n===g){const t=O(l,f,e);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length;h[0]<=l;)h.shift(),--d;for(;h[d-1]>f;)h.pop(),--d;var p,y=new Array(d+1);for(i=0;i<=d;++i)(p=y[i]=[]).x0=i>0?h[i-1]:l,p.x1=i=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function $(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}function X(t,n,e=0,r=t.length-1,i){for(i=void 0===i?L:z(i);r>e;){if(r-e>600){const o=r-e+1,a=n-e+1,u=Math.log(o),s=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*s*(o-s)/o)*(a-o/2<0?-1:1);X(t,n,Math.max(e,Math.floor(n-a*s/o+c)),Math.min(r,Math.floor(n+(o-a)*s/o+c)),i)}const o=t[n];let a=e,u=r;for(W(t,e,n),i(t[r],o)>0&&W(t,e,r);a0;)--u}0===i(t[e],o)?W(t,e,u):(++u,W(t,u,r)),u<=n&&(e=u+1),n<=u&&(r=u-1)}return t}function W(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function Z(t,n,e){if(r=(t=Float64Array.from(function*(t,n){if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let e=-1;for(let r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}(t,e))).length){if((n=+n)<=0||r<2)return $(t);if(n>=1)return j(t);var r,i=(r-1)*n,o=Math.floor(i),a=j(X(t,o).subarray(0,o+1));return a+($(t.subarray(o+1))-a)*(i-o)}}function K(t,n,e=r){if(i=t.length){if((n=+n)<=0||i<2)return+e(t[0],0,t);if(n>=1)return+e(t[i-1],i-1,t);var i,o=(i-1)*n,a=Math.floor(o),u=+e(t[a],a,t);return u+(+e(t[a+1],a+1,t)-u)*(o-a)}}function Q(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e=o)&&(e=o,r=i);return r}function J(t){return Array.from(function*(t){for(const n of t)yield*n}(t))}function tt(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e>n||void 0===e&&n>=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e>o||void 0===e&&o>=o)&&(e=o,r=i);return r}function nt(t,n){return[t,n]}function et(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r+t(n)}function bt(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function xt(){return!this.__axis}function wt(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,s="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===ht||t===gt?-1:1,l=t===gt||t===dt?"x":"y",f=t===ht||t===pt?vt:mt;function h(h){var d=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,p=null==i?n.tickFormat?n.tickFormat.apply(n,e):ft:i,g=Math.max(o,0)+u,y=n.range(),v=+y[0]+s,m=+y[y.length-1]+s,_=(n.bandwidth?bt:_t)(n.copy(),s),b=h.selection?h.selection():h,x=b.selectAll(".domain").data([null]),w=b.selectAll(".tick").data(d,n).order(),M=w.exit(),k=w.enter().append("g").attr("class","tick"),T=w.select("line"),A=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(k),T=T.merge(k.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),A=A.merge(k.append("text").attr("fill","currentColor").attr(l,c*g).attr("dy",t===ht?"0em":t===pt?"0.71em":"0.32em")),h!==b&&(x=x.transition(h),w=w.transition(h),T=T.transition(h),A=A.transition(h),M=M.transition(h).attr("opacity",yt).attr("transform",(function(t){return isFinite(t=_(t))?f(t+s):this.getAttribute("transform")})),k.attr("opacity",yt).attr("transform",(function(t){var n=this.parentNode.__axis;return f((n&&isFinite(n=n(t))?n:_(t))+s)}))),M.remove(),x.attr("d",t===gt||t===dt?a?"M"+c*a+","+v+"H"+s+"V"+m+"H"+c*a:"M"+s+","+v+"V"+m:a?"M"+v+","+c*a+"V"+s+"H"+m+"V"+c*a:"M"+v+","+s+"H"+m),w.attr("opacity",1).attr("transform",(function(t){return f(_(t)+s)})),T.attr(l+"2",c*o),A.attr(l,c*g).text(p),b.filter(xt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===dt?"start":t===gt?"end":"middle"),b.each((function(){this.__axis=_}))}return h.scale=function(t){return arguments.length?(n=t,h):n},h.ticks=function(){return e=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(e=null==t?[]:Array.from(t),h):e.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(u=+t,h):u},h.offset=function(t){return arguments.length?(s=+t,h):s},h}var Mt={value:()=>{}};function kt(){for(var t,n=0,e=arguments.length,r={};n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Ct.hasOwnProperty(n)?{space:Ct[n],local:t}:t}function Pt(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Et&&n.documentElement.namespaceURI===Et?n.createElement(t):n.createElementNS(e,t)}}function Dt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function zt(t){var n=Nt(t);return(n.local?Dt:Pt)(n)}function Lt(){}function Ht(t){return null==t?Lt:function(){return this.querySelector(t)}}function Rt(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function It(){return[]}function Bt(t){return null==t?It:function(){return this.querySelectorAll(t)}}function qt(t){return function(){return this.matches(t)}}function Ft(t){return function(n){return n.matches(t)}}var Ot=Array.prototype.find;function Ut(){return this.firstElementChild}var Yt=Array.prototype.filter;function Gt(){return Array.from(this.children)}function Vt(t){return new Array(t.length)}function jt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function $t(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;un?1:t>=n?0:NaN}function Qt(t){return function(){this.removeAttribute(t)}}function Jt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tn(t,n){return function(){this.setAttribute(t,n)}}function nn(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function en(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function rn(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function on(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function an(t){return function(){this.style.removeProperty(t)}}function un(t,n,e){return function(){this.style.setProperty(t,n,e)}}function sn(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function cn(t,n){return t.style.getPropertyValue(n)||on(t).getComputedStyle(t,null).getPropertyValue(n)}function ln(t){return function(){delete this[t]}}function fn(t,n){return function(){this[t]=n}}function hn(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function dn(t){return t.trim().split(/^|\s+/)}function pn(t){return t.classList||new gn(t)}function gn(t){this._node=t,this._names=dn(t.getAttribute("class")||"")}function yn(t,n){for(var e=pn(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Bn=[null];function qn(t,n){this._groups=t,this._parents=n}function Fn(){return new qn([[document.documentElement]],Bn)}function On(t){return"string"==typeof t?new qn([[document.querySelector(t)]],[document.documentElement]):new qn([[t]],Bn)}qn.prototype=Fn.prototype={constructor:qn,select:function(t){"function"!=typeof t&&(t=Ht(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=b&&(b=_+1);!(m=y[b])&&++b=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Kt);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?an:"function"==typeof n?sn:un)(t,n,null==e?"":e)):cn(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?ln:"function"==typeof n?hn:fn)(t,n)):this.node()[t]},classed:function(t,n){var e=dn(t+"");if(arguments.length<2){for(var r=pn(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Ln:zn,r=0;r()=>t;function te(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,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:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function ne(t){return!t.ctrlKey&&!t.button}function ee(){return this.parentNode}function re(t,n){return null==n?{x:t.x,y:t.y}:n}function ie(){return navigator.maxTouchPoints||"ontouchstart"in this}function oe(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function ae(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function ue(){}te.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var se=.7,ce=1/se,le="\\s*([+-]?\\d+)\\s*",fe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",he="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",de=/^#([0-9a-f]{3,8})$/,pe=new RegExp("^rgb\\("+[le,le,le]+"\\)$"),ge=new RegExp("^rgb\\("+[he,he,he]+"\\)$"),ye=new RegExp("^rgba\\("+[le,le,le,fe]+"\\)$"),ve=new RegExp("^rgba\\("+[he,he,he,fe]+"\\)$"),me=new RegExp("^hsl\\("+[fe,he,he]+"\\)$"),_e=new RegExp("^hsla\\("+[fe,he,he,fe]+"\\)$"),be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xe(){return this.rgb().formatHex()}function we(){return this.rgb().formatRgb()}function Me(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=de.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?ke(n):3===e?new Ee(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Te(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Te(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=pe.exec(t))?new Ee(n[1],n[2],n[3],1):(n=ge.exec(t))?new Ee(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ye.exec(t))?Te(n[1],n[2],n[3],n[4]):(n=ve.exec(t))?Te(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=me.exec(t))?De(n[1],n[2]/100,n[3]/100,1):(n=_e.exec(t))?De(n[1],n[2]/100,n[3]/100,n[4]):be.hasOwnProperty(t)?ke(be[t]):"transparent"===t?new Ee(NaN,NaN,NaN,0):null}function ke(t){return new Ee(t>>16&255,t>>8&255,255&t,1)}function Te(t,n,e,r){return r<=0&&(t=n=e=NaN),new Ee(t,n,e,r)}function Ae(t){return t instanceof ue||(t=Me(t)),t?new Ee((t=t.rgb()).r,t.g,t.b,t.opacity):new Ee}function Se(t,n,e,r){return 1===arguments.length?Ae(t):new Ee(t,n,e,null==r?1:r)}function Ee(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Ce(){return"#"+Pe(this.r)+Pe(this.g)+Pe(this.b)}function Ne(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Pe(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function De(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new He(t,n,e,r)}function ze(t){if(t instanceof He)return new He(t.h,t.s,t.l,t.opacity);if(t instanceof ue||(t=Me(t)),!t)return new He;if(t instanceof He)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&s<1?0:a,new He(a,u,s,t.opacity)}function Le(t,n,e,r){return 1===arguments.length?ze(t):new He(t,n,e,null==r?1:r)}function He(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Re(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}oe(ue,Me,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xe,formatHex:xe,formatHsl:function(){return ze(this).formatHsl()},formatRgb:we,toString:we}),oe(Ee,Se,ae(ue,{brighter:function(t){return t=null==t?ce:Math.pow(ce,t),new Ee(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?se:Math.pow(se,t),new Ee(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ce,formatHex:Ce,formatRgb:Ne,toString:Ne})),oe(He,Le,ae(ue,{brighter:function(t){return t=null==t?ce:Math.pow(ce,t),new He(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?se:Math.pow(se,t),new He(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Ee(Re(t>=240?t-240:t+120,i,r),Re(t,i,r),Re(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const Ie=Math.PI/180,Be=180/Math.PI,qe=.96422,Fe=1,Oe=.82521,Ue=4/29,Ye=6/29,Ge=3*Ye*Ye,Ve=Ye*Ye*Ye;function je(t){if(t instanceof Xe)return new Xe(t.l,t.a,t.b,t.opacity);if(t instanceof nr)return er(t);t instanceof Ee||(t=Ae(t));var n,e,r=Qe(t.r),i=Qe(t.g),o=Qe(t.b),a=We((.2225045*r+.7168786*i+.0606169*o)/Fe);return r===i&&i===o?n=e=a:(n=We((.4360747*r+.3850649*i+.1430804*o)/qe),e=We((.0139322*r+.0971045*i+.7141733*o)/Oe)),new Xe(116*a-16,500*(n-a),200*(a-e),t.opacity)}function $e(t,n,e,r){return 1===arguments.length?je(t):new Xe(t,n,e,null==r?1:r)}function Xe(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function We(t){return t>Ve?Math.pow(t,1/3):t/Ge+Ue}function Ze(t){return t>Ye?t*t*t:Ge*(t-Ue)}function Ke(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Je(t){if(t instanceof nr)return new nr(t.h,t.c,t.l,t.opacity);if(t instanceof Xe||(t=je(t)),0===t.a&&0===t.b)return new nr(NaN,0=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r()=>t;function vr(t,n){return function(e){return t+e*n}}function mr(t,n){var e=n-t;return e?vr(t,e>180||e<-180?e-360*Math.round(e/360):e):yr(isNaN(t)?n:t)}function _r(t){return 1==(t=+t)?br:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):yr(isNaN(n)?e:n)}}function br(t,n){var e=n-t;return e?vr(t,e):yr(isNaN(t)?n:t)}var xr=function t(n){var e=_r(n);function r(t,n){var r=e((t=Se(t)).r,(n=Se(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=br(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function wr(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:Cr(e,r)})),o=Dr.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Cr(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Cr(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,s),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Cr(t,e)},{i:u-2,x:Cr(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var n,e=-1,r=s.length;++e=0&&n._call.call(void 0,t),n=n._next;--ri}function vi(){si=(ui=li.now())+ci,ri=ii=0;try{yi()}finally{ri=0,function(){for(var t,n,e=ni,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:ni=n);ei=t,_i(r)}(),si=0}}function mi(){var t=li.now(),n=t-ui;n>ai&&(ci-=n,ui=t)}function _i(t){ri||(ii&&(ii=clearTimeout(ii)),t-si>24?(t<1/0&&(ii=setTimeout(vi,t-li.now()-ci)),oi&&(oi=clearInterval(oi))):(oi||(ui=li.now(),oi=setInterval(mi,ai)),ri=1,fi(vi)))}function bi(t,n,e){var r=new pi;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}pi.prototype=gi.prototype={constructor:pi,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?hi():+e)+(null==n?0:+n),this._next||ei===this||(ei?ei._next=this:ni=this,ei=this),this._call=t,this._time=e,_i()},stop:function(){this._call&&(this._call=null,this._time=1/0,_i())}};var xi=kt("start","end","cancel","interrupt"),wi=[],Mi=0,ki=1,Ti=2,Ai=3,Si=4,Ei=5,Ci=6;function Ni(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=ki,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var c,l,f,h;if(e.state!==ki)return s();for(c in i)if((h=i[c]).name===e.name){if(h.state===Ai)return bi(a);h.state===Si?(h.state=Ci,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+cMi)throw new Error("too late; already scheduled");return e}function Di(t,n){var e=zi(t,n);if(e.state>Ai)throw new Error("too late; already running");return e}function zi(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Li(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>Ti&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Pi:Di;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=Nt(t),r="transform"===e?Ur:Bi;return this.attrTween(t,"function"==typeof n?(e.local?Gi:Yi)(e,r,Ii(this,"attr."+t,n)):null==n?(e.local?Fi:qi)(e):(e.local?Ui:Oi)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Nt(t);return this.tween(e,(r.local?Vi:ji)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Or:Bi;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=cn(this,t),a=(this.style.removeProperty(t),cn(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,Qi(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=cn(this,t),u=e(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=cn(this,t)),a===s?null:a===r&&s===i?o:(i=s,o=n(r=a,u))}}(t,r,Ii(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var s=Di(this,t),c=s.on,l=null==s.value[a]?o||(o=Qi(n)):void 0;c===e&&i===l||(r=(e=c).copy()).on(u,i=l),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=cn(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Ii(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=zi(this.node(),e).tween,o=0,a=i.length;o()=>t;function qo(t,{sourceEvent:n,target:e,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Fo(t){t.preventDefault(),t.stopImmediatePropagation()}var Oo={name:"drag"},Uo={name:"space"},Yo={name:"handle"},Go={name:"center"};const{abs:Vo,max:jo,min:$o}=Math;function Xo(t){return[+t[0],+t[1]]}function Wo(t){return[Xo(t[0]),Xo(t[1])]}var Zo={name:"x",handles:["w","e"].map(ia),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Ko={name:"y",handles:["n","s"].map(ia),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Qo={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(ia),input:function(t){return null==t?null:Wo(t)},output:function(t){return t}},Jo={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"},ta={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},na={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ea={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ra={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ia(t){return{type:t}}function oa(t){return!t.ctrlKey&&!t.button}function aa(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function ua(){return navigator.maxTouchPoints||"ontouchstart"in this}function sa(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ca(t){var n,e=aa,r=oa,i=ua,o=!0,a=kt("start","brush","end"),u=6;function s(n){var e=n.property("__brush",g).selectAll(".overlay").data([ia("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Jo.overlay).merge(e).each((function(){var t=sa(this).extent;On(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([ia("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Jo.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Jo[t.type]})),n.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=On(this),n=sa(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,n,e){var r=t.__brush.emitter;return!r||e&&r.clean?new f(t,n,e):r}function f(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function h(e){if((!n||e.touches)&&r.apply(this,arguments)){var i,a,u,s,f,h,d,p,g,y,v,m=this,_=e.target.__data__.type,b="selection"===(o&&e.metaKey?_="overlay":_)?Oo:o&&e.altKey?Go:Yo,x=t===Ko?null:ea[_],w=t===Zo?null:ra[_],M=sa(m),k=M.extent,T=M.selection,A=k[0][0],S=k[0][1],E=k[1][0],C=k[1][1],N=0,P=0,D=x&&w&&o&&e.shiftKey,z=Array.from(e.touches||[e],(t=>{const n=t.identifier;return(t=jn(t,m)).point0=t.slice(),t.identifier=n,t}));Li(m);var L=l(m,arguments,!0).beforestart();if("overlay"===_){T&&(g=!0);const n=[z[0],z[1]||z[0]];M.selection=T=[[i=t===Ko?A:$o(n[0][0],n[1][0]),u=t===Zo?S:$o(n[0][1],n[1][1])],[f=t===Ko?E:jo(n[0][0],n[1][0]),d=t===Zo?C:jo(n[0][1],n[1][1])]],z.length>1&&q(e)}else i=T[0][0],u=T[0][1],f=T[1][0],d=T[1][1];a=i,s=u,h=f,p=d;var H=On(m).attr("pointer-events","none"),R=H.selectAll(".overlay").attr("cursor",Jo[_]);if(e.touches)L.moved=B,L.ended=F;else{var I=On(e.view).on("mousemove.brush",B,!0).on("mouseup.brush",F,!0);o&&I.on("keydown.brush",(function(t){switch(t.keyCode){case 16:D=x&&w;break;case 18:b===Yo&&(x&&(f=h-N*x,i=a+N*x),w&&(d=p-P*w,u=s+P*w),b=Go,q(t));break;case 32:b!==Yo&&b!==Go||(x<0?f=h-N:x>0&&(i=a-N),w<0?d=p-P:w>0&&(u=s-P),b=Uo,R.attr("cursor",Jo.selection),q(t));break;default:return}Fo(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:D&&(y=v=D=!1,q(t));break;case 18:b===Go&&(x<0?f=h:x>0&&(i=a),w<0?d=p:w>0&&(u=s),b=Yo,q(t));break;case 32:b===Uo&&(t.altKey?(x&&(f=h-N*x,i=a+N*x),w&&(d=p-P*w,u=s+P*w),b=Go):(x<0?f=h:x>0&&(i=a),w<0?d=p:w>0&&(u=s),b=Yo),R.attr("cursor",Jo[_]),q(t));break;default:return}Fo(t)}),!0),Kn(e.view)}c.call(m),L.start(e,b.name)}function B(t){for(const n of t.changedTouches||[t])for(const t of z)t.identifier===n.identifier&&(t.cur=jn(n,m));if(D&&!y&&!v&&1===z.length){const t=z[0];Vo(t.cur[0]-t[0])>Vo(t.cur[1]-t[1])?v=!0:y=!0}for(const t of z)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,Fo(t),q(t)}function q(t){const n=z[0],e=n.point0;var r;switch(N=n[0]-e[0],P=n[1]-e[1],b){case Uo:case Oo:x&&(N=jo(A-i,$o(E-f,N)),a=i+N,h=f+N),w&&(P=jo(S-u,$o(C-d,P)),s=u+P,p=d+P);break;case Yo:z[1]?(x&&(a=jo(A,$o(E,z[0][0])),h=jo(A,$o(E,z[1][0])),x=1),w&&(s=jo(S,$o(C,z[0][1])),p=jo(S,$o(C,z[1][1])),w=1)):(x<0?(N=jo(A-i,$o(E-i,N)),a=i+N,h=f):x>0&&(N=jo(A-f,$o(E-f,N)),a=i,h=f+N),w<0?(P=jo(S-u,$o(C-u,P)),s=u+P,p=d):w>0&&(P=jo(S-d,$o(C-d,P)),s=u,p=d+P));break;case Go:x&&(a=jo(A,$o(E,i-N*x)),h=jo(A,$o(E,f+N*x))),w&&(s=jo(S,$o(C,u-P*w)),p=jo(S,$o(C,d+P*w)))}ht+e))}function _a(t,n){var e=0,r=null,i=null,o=null;function a(a){var u,s=a.length,c=new Array(s),l=ma(0,s),f=new Array(s*s),h=new Array(s),d=0;a=Float64Array.from({length:s*s},n?(t,n)=>a[n%s][n/s|0]:(t,n)=>a[n/s|0][n%s]);for(let n=0;nr(c[t],c[n])));for(const e of l){const r=n;if(t){const t=ma(1+~s,s).filter((t=>t<0?a[~t*s+e]:a[e*s+t]));i&&t.sort(((t,n)=>i(t<0?-a[~t*s+e]:a[e*s+t],n<0?-a[~n*s+e]:a[e*s+n])));for(const r of t)r<0?(f[~r*s+e]||(f[~r*s+e]={source:null,target:null})).target={index:e,startAngle:n,endAngle:n+=a[~r*s+e]*d,value:a[~r*s+e]}:(f[e*s+r]||(f[e*s+r]={source:null,target:null})).source={index:e,startAngle:n,endAngle:n+=a[e*s+r]*d,value:a[e*s+r]};h[e]={index:e,startAngle:r,endAngle:n,value:c[e]}}else{const t=ma(0,s).filter((t=>a[e*s+t]||a[t*s+e]));i&&t.sort(((t,n)=>i(a[e*s+t],a[e*s+n])));for(const r of t){let t;if(ewa)if(Math.abs(l*u-s*c)>wa&&i){var h=e-o,d=r-a,p=u*u+s*s,g=h*h+d*d,y=Math.sqrt(p),v=Math.sqrt(f),m=i*Math.tan((ba-Math.acos((p+f-g)/(2*y*v)))/2),_=m/v,b=m/y;Math.abs(_-1)>wa&&(this._+="L"+(t+_*c)+","+(n+_*l)),this._+="A"+i+","+i+",0,0,"+ +(l*h>c*d)+","+(this._x1=t+b*u)+","+(this._y1=n+b*s)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,r,i,o){t=+t,n=+n,o=!!o;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),s=t+a,c=n+u,l=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>wa||Math.abs(this._y1-c)>wa)&&(this._+="L"+s+","+c),e&&(f<0&&(f=f%xa+xa),f>Ma?this._+="A"+e+","+e+",0,1,"+l+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+l+","+(this._x1=s)+","+(this._y1=c):f>wa&&(this._+="A"+e+","+e+",0,"+ +(f>=ba)+","+l+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Aa=Array.prototype.slice;function Sa(t){return function(){return t}}function Ea(t){return t.source}function Ca(t){return t.target}function Na(t){return t.radius}function Pa(t){return t.startAngle}function Da(t){return t.endAngle}function za(){return 0}function La(){return 10}function Ha(t){var n=Ea,e=Ca,r=Na,i=Na,o=Pa,a=Da,u=za,s=null;function c(){var c,l=n.apply(this,arguments),f=e.apply(this,arguments),h=u.apply(this,arguments)/2,d=Aa.call(arguments),p=+r.apply(this,(d[0]=l,d)),g=o.apply(this,d)-pa,y=a.apply(this,d)-pa,v=+i.apply(this,(d[0]=f,d)),m=o.apply(this,d)-pa,_=a.apply(this,d)-pa;if(s||(s=c=Ta()),h>va&&(la(y-g)>2*h+va?y>g?(g+=h,y-=h):(g-=h,y+=h):g=y=(g+y)/2,la(_-m)>2*h+va?_>m?(m+=h,_-=h):(m-=h,_+=h):m=_=(m+_)/2),s.moveTo(p*fa(g),p*ha(g)),s.arc(0,0,p,g,y),g!==m||y!==_)if(t){var b=v-+t.apply(this,arguments),x=(m+_)/2;s.quadraticCurveTo(0,0,b*fa(m),b*ha(m)),s.lineTo(v*fa(x),v*ha(x)),s.lineTo(b*fa(_),b*ha(_))}else s.quadraticCurveTo(0,0,v*fa(m),v*ha(m)),s.arc(0,0,v,m,_);if(s.quadraticCurveTo(0,0,p*fa(g),p*ha(g)),s.closePath(),c)return s=null,c+""||null}return t&&(c.headRadius=function(n){return arguments.length?(t="function"==typeof n?n:Sa(+n),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:Sa(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:Sa(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:Sa(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Sa(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Sa(+t),c):a},c.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:Sa(+t),c):u},c.source=function(t){return arguments.length?(n=t,c):n},c.target=function(t){return arguments.length?(e=t,c):e},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}var Ra=Array.prototype.slice;function Ia(t,n){return t-n}var Ba=t=>()=>t;function qa(t,n){for(var e,r=-1,i=n.length;++rr!=d>r&&e<(h-c)*(r-l)/(d-l)+c&&(i=-i)}return i}function Oa(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function Ua(){}var Ya=[[],[[[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 Ga(){var t=1,n=1,e=G,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(Ia);else{const e=g(t),r=U(e[0],e[1],n);n=F(Math.floor(e[0]/r)*r,Math.floor(e[1]/r-1)*r,n)}return n.map((n=>o(t,n)))}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,s,c,l,f,h=new Array,d=new Array;for(o=u=-1,c=e[0]>=r,Ya[c<<1].forEach(p);++o=r,Ya[s|c<<1].forEach(p);for(Ya[0|c].forEach(p);++u=r,l=e[u*t]>=r,Ya[c<<1|l<<2].forEach(p);++o=r,f=l,l=e[u*t+o+1]>=r,Ya[s|c<<1|l<<2|f<<3].forEach(p);Ya[c|l<<3].forEach(p)}for(o=-1,l=e[u*t]>=r,Ya[l<<2].forEach(p);++o=r,Ya[l<<2|f<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],s=[t[1][0]+o,t[1][1]+u],c=a(r),l=a(s);(n=d[c])?(e=h[l])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(s),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(s),d[n.end=l]=n):(n=h[l])?(e=d[c])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(s),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=c]=n):h[c]=d[l]={start:c,end:l,ring:[r,s]}}Ya[l<<3].forEach(p)}(e,i,(function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)})),u.forEach((function(t){for(var n,e=0,r=o.length;e0&&a0&&u=0&&o>=0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?Ba(Ra.call(t)):Ba(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:Ua,i):r===u},i}function Va(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(s-=t.data[u-o+a*r]),n.data[u-e+a*r]=s/Math.min(u+1,r-1+o-u,o))}function ja(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(s-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=s/Math.min(u+1,i-1+o-u,o))}function $a(t){return t[0]}function Xa(t){return t[1]}function Wa(){return 1}const Za=134217729,Ka=33306690738754706e-32;function Qa(t,n,e,r,i){let o,a,u,s,c=n[0],l=r[0],f=0,h=0;l>c==l>-c?(o=c,c=n[++f]):(o=l,l=r[++h]);let d=0;if(fc==l>-c?(a=c+o,u=o-(a-c),c=n[++f]):(a=l+o,u=o-(a-l),l=r[++h]),o=a,0!==u&&(i[d++]=u);fc==l>-c?(a=o+c,s=a-o,u=o-(a-s)+(c-s),c=n[++f]):(a=o+l,s=a-o,u=o-(a-s)+(l-s),l=r[++h]),o=a,0!==u&&(i[d++]=u);for(;f0!=u>0)return s;const c=Math.abs(a+u);return Math.abs(s)>=33306690738754716e-32*c?s:-function(t,n,e,r,i,o,a){let u,s,c,l,f,h,d,p,g,y,v,m,_,b,x,w,M,k;const T=t-i,A=e-i,S=n-o,E=r-o;b=T*E,h=Za*T,d=h-(h-T),p=T-d,h=Za*E,g=h-(h-E),y=E-g,x=p*y-(b-d*g-p*g-d*y),w=S*A,h=Za*S,d=h-(h-S),p=S-d,h=Za*A,g=h-(h-A),y=A-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,f=x-v,eu[0]=x-(v+f)+(f-M),m=b+v,f=m-b,_=b-(m-f)+(v-f),v=_-w,f=_-v,eu[1]=_-(v+f)+(f-w),k=m+v,f=k-m,eu[2]=m-(k-f)+(v-f),eu[3]=k;let C=function(t,n){let e=n[0];for(let r=1;r=N||-C>=N)return C;if(f=t-T,u=t-(T+f)+(f-i),f=e-A,c=e-(A+f)+(f-i),f=n-S,s=n-(S+f)+(f-o),f=r-E,l=r-(E+f)+(f-o),0===u&&0===s&&0===c&&0===l)return C;if(N=nu*a+Ka*Math.abs(C),C+=T*l+E*u-(S*c+A*s),C>=N||-C>=N)return C;b=u*E,h=Za*u,d=h-(h-u),p=u-d,h=Za*E,g=h-(h-E),y=E-g,x=p*y-(b-d*g-p*g-d*y),w=s*A,h=Za*s,d=h-(h-s),p=s-d,h=Za*A,g=h-(h-A),y=A-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,f=x-v,au[0]=x-(v+f)+(f-M),m=b+v,f=m-b,_=b-(m-f)+(v-f),v=_-w,f=_-v,au[1]=_-(v+f)+(f-w),k=m+v,f=k-m,au[2]=m-(k-f)+(v-f),au[3]=k;const P=Qa(4,eu,4,au,ru);b=T*l,h=Za*T,d=h-(h-T),p=T-d,h=Za*l,g=h-(h-l),y=l-g,x=p*y-(b-d*g-p*g-d*y),w=S*c,h=Za*S,d=h-(h-S),p=S-d,h=Za*c,g=h-(h-c),y=c-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,f=x-v,au[0]=x-(v+f)+(f-M),m=b+v,f=m-b,_=b-(m-f)+(v-f),v=_-w,f=_-v,au[1]=_-(v+f)+(f-w),k=m+v,f=k-m,au[2]=m-(k-f)+(v-f),au[3]=k;const D=Qa(P,ru,4,au,iu);b=u*l,h=Za*u,d=h-(h-u),p=u-d,h=Za*l,g=h-(h-l),y=l-g,x=p*y-(b-d*g-p*g-d*y),w=s*c,h=Za*s,d=h-(h-s),p=s-d,h=Za*c,g=h-(h-c),y=c-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,f=x-v,au[0]=x-(v+f)+(f-M),m=b+v,f=m-b,_=b-(m-f)+(v-f),v=_-w,f=_-v,au[1]=_-(v+f)+(f-w),k=m+v,f=k-m,au[2]=m-(k-f)+(v-f),au[3]=k;const z=Qa(D,iu,4,au,ou);return ou[z-1]}(t,n,e,r,i,o,c)}const su=Math.pow(2,-52),cu=new Uint32Array(512);class lu{static from(t,n=yu,e=vu){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const e=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*e),this._halfedges=new Int32Array(3*e),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).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:e,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,s=-1/0,c=-1/0;for(let n=0;ns&&(s=e),r>c&&(c=r),this._ids[n]=n}const l=(a+s)/2,f=(u+c)/2;let h,d,p,g=1/0;for(let n=0;n0&&(d=n,g=e)}let m=t[2*d],_=t[2*d+1],b=1/0;for(let n=0;nr&&(n[e++]=i,r=this._dists[i])}return this.hull=n.subarray(0,e),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(uu(y,v,m,_,x,w)<0){const t=d,n=m,e=_;d=p,m=x,_=w,p=t,x=n,w=e}const M=function(t,n,e,r,i,o){const a=e-t,u=r-n,s=i-t,c=o-n,l=a*a+u*u,f=s*s+c*c,h=.5/(a*c-u*s);return{x:t+(c*l-u*f)*h,y:n+(a*f-s*l)*h}}(y,v,m,_,x,w);this._cx=M.x,this._cy=M.y;for(let n=0;n0&&Math.abs(c-o)<=su&&Math.abs(l-a)<=su)continue;if(o=c,a=l,s===h||s===d||s===p)continue;let f=0;for(let t=0,n=this._hashKey(c,l);t=0;)if(y=g,y===f){y=-1;break}if(-1===y)continue;let v=this._addTriangle(y,s,e[y],-1,-1,r[y]);r[s]=this._legalize(v+2),r[y]=v,k++;let m=e[y];for(;g=e[m],uu(c,l,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(m,s,g,r[s],-1,r[m]),r[s]=this._legalize(v+2),e[m]=m,k--,m=g;if(y===f)for(;g=n[y],uu(c,l,t[2*g],t[2*g+1],t[2*y],t[2*y+1])<0;)v=this._addTriangle(g,s,y,-1,r[y],r[g]),this._legalize(v+2),r[g]=v,e[y]=y,k--,y=g;this._hullStart=n[s]=y,e[y]=n[m]=s,e[s]=m,i[this._hashKey(c,l)]=s,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(k);for(let t=0,n=this._hullStart;t0?3-e:1+e)/4}(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:e,coords:r}=this;let i=0,o=0;for(;;){const a=e[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=cu[--i];continue}const s=a-a%3,c=u+(t+1)%3,l=s+(a+2)%3,f=n[o],h=n[t],d=n[c],p=n[l];if(hu(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=f;const r=e[l];if(-1===r){let n=this._hullStart;do{if(this._hullTri[n]===l){this._hullTri[n]=t;break}n=this._hullPrev[n]}while(n!==this._hullStart)}this._link(t,r),this._link(a,e[o]),this._link(o,l);const u=s+(a+1)%3;i=e&&n[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=e+1,o=r;gu(t,e+r>>1,i),n[t[e]]>n[t[r]]&&gu(t,e,r),n[t[i]]>n[t[r]]&&gu(t,i,r),n[t[e]]>n[t[i]]&&gu(t,e,i);const a=t[i],u=n[a];for(;;){do{i++}while(n[t[i]]u);if(o=o-e?(pu(t,n,i,r),pu(t,n,e,o-1)):(pu(t,n,e,o-1),pu(t,n,i,r))}}function gu(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function yu(t){return t[0]}function vu(t){return t[1]}const mu=1e-6;class _u{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,e){const r=(t=+t)+(e=+e),i=n=+n;if(e<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>mu||Math.abs(this._y1-i)>mu)&&(this._+="L"+r+","+i),e&&(this._+=`A${e},${e},0,1,1,${t-e},${n}A${e},${e},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,n,e,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+e}v${+r}h${-e}Z`}value(){return this._||null}}class bu{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class xu{constructor(t,[n,e,r,i]=[0,0,960,500]){if(!((r=+r)>=(n=+n)&&(i=+i)>=(e=+e)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=n,this.ymax=i,this.ymin=e,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:e},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,e.length/3*2);for(let n,r,o=0,a=0,u=e.length;o1;)i-=2;for(let t=2;t4)for(let t=0;t0){if(n>=this.ymax)return null;(i=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/e)this.xmax?2:0)|(nthis.ymax?8:0)}}const wu=2*Math.PI,Mu=Math.pow;function ku(t){return t[0]}function Tu(t){return t[1]}function Au(t,n,e){return[t+Math.sin(t+n)*e,n+Math.cos(t-n)*e]}class Su{static from(t,n=ku,e=Tu,r){return new Su("length"in t?function(t,n,e,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a2&&function(t){const{triangles:n,coords:e}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:n.length/2},((t,n)=>n)).sort(((t,e)=>n[2*t]-n[2*e]||n[2*t+1]-n[2*e+1]));const t=this.collinear[0],e=this.collinear[this.collinear.length-1],r=[n[2*t],n[2*t+1],n[2*e],n[2*e+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,e=n.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new xu(this,t)}*neighbors(t){const{inedges:n,hull:e,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const n=a.indexOf(t);return n>0&&(yield a[n-1]),void(n=0&&i!==e&&i!==r;)e=i;return i}_step(t,n,e){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:s}=this;if(-1===r[t]||!s.length)return(t+1)%(s.length>>1);let c=t,l=Mu(n-s[2*t],2)+Mu(e-s[2*t+1],2);const f=r[t];let h=f;do{let r=u[h];const f=Mu(n-s[2*r],2)+Mu(e-s[2*r+1],2);if(f9999?"+"+Hu(t,6):Hu(t,4)}(t.getUTCFullYear())+"-"+Hu(t.getUTCMonth()+1,2)+"-"+Hu(t.getUTCDate(),2)+(i?"T"+Hu(n,2)+":"+Hu(e,2)+":"+Hu(r,2)+"."+Hu(i,3)+"Z":r?"T"+Hu(n,2)+":"+Hu(e,2)+":"+Hu(r,2)+"Z":e||n?"T"+Hu(n,2)+":"+Hu(e,2)+"Z":"")}function Iu(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,s=o<=0,c=!1;function l(){if(s)return Cu;if(c)return c=!1,Eu;var n,r,i=a;if(t.charCodeAt(i)===Nu){for(;a++=o?s=!0:(r=t.charCodeAt(a++))===Pu?c=!0:r===Du&&(c=!0,t.charCodeAt(a)===Pu&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;ais(n,e).then((n=>(new DOMParser).parseFromString(n,t)))}var ls=cs("application/xml"),fs=cs("text/html"),hs=cs("image/svg+xml");function ds(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,s,c,l,f,h,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=n>=(o=(g+v)/2))?g=o:v=o,(l=e>=(a=(y+m)/2))?y=a:m=a,i=d,!(d=d[f=l<<1|c]))return i[f]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),n===u&&e===s)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=n>=(o=(g+v)/2))?g=o:v=o,(l=e>=(a=(y+m)/2))?y=a:m=a}while((f=l<<1|c)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[f]=p,t}function ps(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function gs(t){return t[0]}function ys(t){return t[1]}function vs(t,n,e){var r=new ms(null==n?gs:n,null==e?ys:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ms(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function _s(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var bs=vs.prototype=ms.prototype;function xs(t){return function(){return t}}function ws(t){return 1e-6*(t()-.5)}function Ms(t){return t.x+t.vx}function ks(t){return t.y+t.vy}function Ts(t){return t.index}function As(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}bs.copy=function(){var t,n,e=new ms(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=_s(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=_s(n));return e},bs.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return ds(this.cover(n,e),n,e,t)},bs.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,l=-1/0,f=-1/0;for(e=0;el&&(l=r),if&&(f=i));if(s>l||c>f)return this;for(this.cover(s,c).cover(l,f),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=s.y0)>d||(a=s.x1)=v)<<1|t>=y)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var m=t-+this._x.call(null,g.data),_=n-+this._y.call(null,g.data),b=m*m+_*_;if(b=(u=(p+y)/2))?p=u:y=u,(l=a>=(s=(g+v)/2))?g=s:v=s,n=d,!(d=d[f=l<<1|c]))return this;if(!d.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[f]=i:delete n[f],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},bs.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function Ls(t){return(t=zs(Math.abs(t)))?t[1]:NaN}var Hs,Rs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Is(t){if(!(n=Rs.exec(t)))throw new Error("invalid format: "+t);var n;return new Bs({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function Bs(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function qs(t,n){var e=zs(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Is.prototype=Bs.prototype,Bs.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Fs={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>qs(100*t,n),r:qs,s:function(t,n){var e=zs(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Hs=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+zs(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Os(t){return t}var Us,Ys=Array.prototype.map,Gs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vs(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?Os:(n=Ys.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Os:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(Ys.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var n=(t=Is(t)).fill,e=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,v=t.trim,m=t.type;"n"===m?(g=!0,m="g"):Fs[m]||(void 0===y&&(y=12),v=!0,m="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",b="$"===h?o:/[%p]/.test(m)?s:"",x=Fs[m],w=/[defgprs%]/.test(m);function M(t){var i,o,s,h=_,M=b;if("c"===m)M=x(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:x(Math.abs(t),y),v&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),k&&0==+t&&"+"!==f&&(k=!1),h=(k?"("===f?f:c:"-"===f||"("===f?"":f)+h,M=("s"===m?Gs[8+Hs/3]:"")+M+(k&&"("===f?")":""),w)for(i=-1,o=t.length;++i(s=t.charCodeAt(i))||s>57){M=(46===s?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var T=h.length+t.length+M.length,A=T>1)+h+t+M+A.slice(T);break;default:t=A+h+t+M}return u(t)}return y=void 0===y?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,n){var e=f(((t=Is(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Ls(n)/3))),i=Math.pow(10,-r),o=Gs[8+r/3];return function(t){return e(i*t)+o}}}}function js(n){return Us=Vs(n),t.format=Us.format,t.formatPrefix=Us.formatPrefix,Us}function $s(t){return Math.max(0,-Ls(Math.abs(t)))}function Xs(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ls(n)/3)))-Ls(Math.abs(t)))}function Ws(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Ls(n)-Ls(t))+1}t.format=void 0,t.formatPrefix=void 0,js({thousands:",",grouping:[3],currency:["$",""]});var Zs=1e-6,Ks=1e-12,Qs=Math.PI,Js=Qs/2,tc=Qs/4,nc=2*Qs,ec=180/Qs,rc=Qs/180,ic=Math.abs,oc=Math.atan,ac=Math.atan2,uc=Math.cos,sc=Math.ceil,cc=Math.exp,lc=Math.hypot,fc=Math.log,hc=Math.pow,dc=Math.sin,pc=Math.sign||function(t){return t>0?1:t<0?-1:0},gc=Math.sqrt,yc=Math.tan;function vc(t){return t>1?0:t<-1?Qs:Math.acos(t)}function mc(t){return t>1?Js:t<-1?-Js:Math.asin(t)}function _c(t){return(t=dc(t/2))*t}function bc(){}function xc(t,n){t&&Mc.hasOwnProperty(t.type)&&Mc[t.type](t,n)}var wc={Feature:function(t,n){xc(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=uc(n=(n*=rc)/2+tc),a=dc(n),u=Pc*a,s=Nc*o+u*uc(i),c=u*r*dc(i);Yc.add(ac(c,s)),Cc=t,Nc=o,Pc=a}function Zc(t){return[ac(t[1],t[0]),mc(t[2])]}function Kc(t){var n=t[0],e=t[1],r=uc(e);return[r*uc(n),r*dc(n),dc(e)]}function Qc(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Jc(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function tl(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function nl(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function el(t){var n=gc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var rl,il,ol,al,ul,sl,cl,ll,fl,hl,dl,pl,gl,yl,vl,ml,_l={point:bl,lineStart:wl,lineEnd:Ml,polygonStart:function(){_l.point=kl,_l.lineStart=Tl,_l.lineEnd=Al,Fc=new y,Vc.polygonStart()},polygonEnd:function(){Vc.polygonEnd(),_l.point=bl,_l.lineStart=wl,_l.lineEnd=Ml,Yc<0?(Dc=-(Lc=180),zc=-(Hc=90)):Fc>Zs?Hc=90:Fc<-Zs&&(zc=-90),Uc[0]=Dc,Uc[1]=Lc},sphere:function(){Dc=-(Lc=180),zc=-(Hc=90)}};function bl(t,n){Oc.push(Uc=[Dc=t,Lc=t]),nHc&&(Hc=n)}function xl(t,n){var e=Kc([t*rc,n*rc]);if(qc){var r=Jc(qc,e),i=Jc([r[1],-r[0],0],r);el(i),i=Zc(i);var o,a=t-Rc,u=a>0?1:-1,s=i[0]*ec*u,c=ic(a)>180;c^(u*RcHc&&(Hc=o):c^(u*Rc<(s=(s+360)%360-180)&&sHc&&(Hc=n)),c?tSl(Dc,Lc)&&(Lc=t):Sl(t,Lc)>Sl(Dc,Lc)&&(Dc=t):Lc>=Dc?(tLc&&(Lc=t)):t>Rc?Sl(Dc,t)>Sl(Dc,Lc)&&(Lc=t):Sl(t,Lc)>Sl(Dc,Lc)&&(Dc=t)}else Oc.push(Uc=[Dc=t,Lc=t]);nHc&&(Hc=n),qc=e,Rc=t}function wl(){_l.point=xl}function Ml(){Uc[0]=Dc,Uc[1]=Lc,_l.point=bl,qc=null}function kl(t,n){if(qc){var e=t-Rc;Fc.add(ic(e)>180?e+(e>0?360:-360):e)}else Ic=t,Bc=n;Vc.point(t,n),xl(t,n)}function Tl(){Vc.lineStart()}function Al(){kl(Ic,Bc),Vc.lineEnd(),ic(Fc)>Zs&&(Dc=-(Lc=180)),Uc[0]=Dc,Uc[1]=Lc,qc=null}function Sl(t,n){return(n-=t)<0?n+360:n}function El(t,n){return t[0]-n[0]}function Cl(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nQs?t+Math.round(-t/nc)*nc:t,n]}function Gl(t,n,e){return(t%=nc)?n||e?Ul(jl(t),$l(n,e)):jl(t):n||e?$l(n,e):Yl}function Vl(t){return function(n,e){return[(n+=t)>Qs?n-nc:n<-Qs?n+nc:n,e]}}function jl(t){var n=Vl(t);return n.invert=Vl(-t),n}function $l(t,n){var e=uc(t),r=dc(t),i=uc(n),o=dc(n);function a(t,n){var a=uc(n),u=uc(t)*a,s=dc(t)*a,c=dc(n),l=c*e+u*r;return[ac(s*i-l*o,u*e-c*r),mc(l*i+s*o)]}return a.invert=function(t,n){var a=uc(n),u=uc(t)*a,s=dc(t)*a,c=dc(n),l=c*i-s*o;return[ac(s*i+c*o,u*e+l*r),mc(l*e-u*r)]},a}function Xl(t){function n(n){return(n=t(n[0]*rc,n[1]*rc))[0]*=ec,n[1]*=ec,n}return t=Gl(t[0]*rc,t[1]*rc,t.length>2?t[2]*rc:0),n.invert=function(n){return(n=t.invert(n[0]*rc,n[1]*rc))[0]*=ec,n[1]*=ec,n},n}function Wl(t,n,e,r,i,o){if(e){var a=uc(n),u=dc(n),s=r*e;null==i?(i=n+r*nc,o=n-s/2):(i=Zl(a,i),o=Zl(a,o),(r>0?io)&&(i+=r*nc));for(var c,l=i;r>0?l>o:l1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Ql(t,n){return ic(t[0]-n[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function nf(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,S=A*T,E=S>Qs,C=v*M;if(s.add(ac(C*A*dc(S),m*k+C*uc(S))),a+=E?T+A*nc:T,E^p>=e^x>=e){var N=Jc(Kc(d),Kc(b));el(N);var P=Jc(o,N);el(P);var D=(E^T>=0?-1:1)*mc(P[2]);(r>D||r===D&&(N[0]||N[1]))&&(u+=E^T>=0?1:-1)}}return(a<-Zs||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&s&&h.push(h.pop().concat(h.shift())),a.push(h.filter(af))}return h}}function af(t){return t.length>1}function uf(t,n){return((t=t.x)[0]<0?t[1]-Js-Zs:Js-t[1])-((n=n.x)[0]<0?n[1]-Js-Zs:Js-n[1])}Yl.invert=Yl;var sf=of((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?Qs:-Qs,s=ic(o-e);ic(s-Qs)0?Js:-Js),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&s>=Qs&&(ic(e-i)Zs?oc((dc(n)*(o=uc(r))*dc(e)-dc(r)*(i=uc(n))*dc(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*Js,r.point(-Qs,i),r.point(0,i),r.point(Qs,i),r.point(Qs,0),r.point(Qs,-i),r.point(0,-i),r.point(-Qs,-i),r.point(-Qs,0),r.point(-Qs,i);else if(ic(t[0]-n[0])>Zs){var o=t[0]0,i=ic(n)>Zs;function o(t,e){return uc(t)*uc(e)>n}function a(t,e,r){var i=[1,0,0],o=Jc(Kc(t),Kc(e)),a=Qc(o,o),u=o[0],s=a-u*u;if(!s)return!r&&t;var c=n*a/s,l=-n*u/s,f=Jc(i,o),h=nl(i,c);tl(h,nl(o,l));var d=f,p=Qc(h,d),g=Qc(d,d),y=p*p-g*(Qc(h,h)-1);if(!(y<0)){var v=gc(y),m=nl(d,(-p-v)/g);if(tl(m,h),m=Zc(m),!r)return m;var _,b=t[0],x=e[0],w=t[1],M=e[1];x0^m[1]<(ic(m[0]-b)Qs^(b<=m[0]&&m[0]<=x)){var A=nl(d,(-p+v)/g);return tl(A,h),[m,Zc(A)]}}}function u(n,e){var i=r?t:Qs-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return of(o,(function(t){var n,e,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(f,h){var d,p=[f,h],g=o(f,h),y=r?g?0:u(f,h):g?u(f+(f<0?Qs:-Qs),h):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(!(d=a(n,p))||Ql(n,d)||Ql(p,d))&&(p[2]=1),g!==s)l=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1],2),t.lineEnd()),n=d;else if(i&&n&&r^g){var v;y&e||!(v=a(p,n,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||n&&Ql(n,p)||t.point(p[0],p[1]),n=p,s=g,e=y},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}),(function(n,r,i,o){Wl(o,t,e,i,n,r)}),r?[0,-t]:[-Qs,t-Qs])}var lf,ff,hf,df,pf=1e9,gf=-pf;function yf(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,c){var l=0,f=0;if(null==i||(l=a(i,u))!==(f=a(o,u))||s(i,o)<0^u>0)do{c.point(0===l||3===l?t:e,l>1?r:n)}while((l=(l+u+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return ic(r[0]-t)0?0:3:ic(r[0]-e)0?2:1:ic(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return s(t.x,n.x)}function s(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var s,c,l,f,h,d,p,g,y,v,m,_=a,b=Kl(),x={point:w,lineStart:function(){x.point=M,c&&c.push(l=[]),v=!0,y=!1,p=g=NaN},lineEnd:function(){s&&(M(f,h),d&&y&&b.rejoin(),s.push(b.result())),x.point=w,y&&_.lineEnd()},polygonStart:function(){_=b,s=[],c=[],m=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=c.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=m&&n,i=(s=J(s)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&tf(s,u,n,o,a),a.polygonEnd()),_=a,s=c=l=null}};function w(t,n){i(t,n)&&_.point(t,n)}function M(o,a){var u=i(o,a);if(c&&l.push([o,a]),v)f=o,h=a,d=u,v=!1,u&&(_.lineStart(),_.point(o,a));else if(u&&y)_.point(o,a);else{var s=[p=Math.max(gf,Math.min(pf,p)),g=Math.max(gf,Math.min(pf,g))],b=[o=Math.max(gf,Math.min(pf,o)),a=Math.max(gf,Math.min(pf,a))];!function(t,n,e,r,i,o){var a,u=t[0],s=t[1],c=0,l=1,f=n[0]-u,h=n[1]-s;if(a=e-u,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=i-u,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=o-s,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a0&&(t[0]=u+c*f,t[1]=s+c*h),l<1&&(n[0]=u+l*f,n[1]=s+l*h),!0}}}}}(s,b,t,n,e,r)?u&&(_.lineStart(),_.point(o,a),m=!1):(y||(_.lineStart(),_.point(s[0],s[1])),_.point(b[0],b[1]),u||_.lineEnd(),m=!1)}p=o,g=a,y=u}return x}}var vf={sphere:bc,point:bc,lineStart:function(){vf.point=_f,vf.lineEnd=mf},lineEnd:bc,polygonStart:bc,polygonEnd:bc};function mf(){vf.point=vf.lineEnd=bc}function _f(t,n){ff=t*=rc,hf=dc(n*=rc),df=uc(n),vf.point=bf}function bf(t,n){t*=rc;var e=dc(n*=rc),r=uc(n),i=ic(t-ff),o=uc(i),a=r*dc(i),u=df*e-hf*r*o,s=hf*e+df*r*o;lf.add(ac(gc(a*a+u*u),s)),ff=t,hf=e,df=r}function xf(t){return lf=new y,Ac(t,vf),+lf}var wf=[null,null],Mf={type:"LineString",coordinates:wf};function kf(t,n){return wf[0]=t,wf[1]=n,xf(Mf)}var Tf={Feature:function(t,n){return Sf(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r0&&(i=kf(t[o],t[o-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))Zs})).map(s)).concat(et(sc(o/d)*d,i,d).filter((function(t){return ic(t%g)>Zs})).map(c))}return v.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(e).reverse().slice(1),f(u).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),v.precision(y)):[[r,u],[e,a]]},v.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),v.precision(y)):[[n,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(y=+h,s=zf(o,i,90),c=Lf(n,t,y),l=zf(u,a,90),f=Lf(r,e,y),v):y},v.extentMajor([[-180,-90+Zs],[180,90-Zs]]).extentMinor([[-180,-80-Zs],[180,80+Zs]])}var Rf,If,Bf,qf,Ff=t=>t,Of=new y,Uf=new y,Yf={point:bc,lineStart:bc,lineEnd:bc,polygonStart:function(){Yf.lineStart=Gf,Yf.lineEnd=$f},polygonEnd:function(){Yf.lineStart=Yf.lineEnd=Yf.point=bc,Of.add(ic(Uf)),Uf=new y},result:function(){var t=Of/2;return Of=new y,t}};function Gf(){Yf.point=Vf}function Vf(t,n){Yf.point=jf,Rf=Bf=t,If=qf=n}function jf(t,n){Uf.add(qf*t-Bf*n),Bf=t,qf=n}function $f(){jf(Rf,If)}var Xf=Yf,Wf=1/0,Zf=Wf,Kf=-Wf,Qf=Kf;var Jf,th,nh,eh,rh={point:function(t,n){tKf&&(Kf=t),nQf&&(Qf=n)},lineStart:bc,lineEnd:bc,polygonStart:bc,polygonEnd:bc,result:function(){var t=[[Wf,Zf],[Kf,Qf]];return Kf=Qf=-(Zf=Wf=1/0),t}},ih=0,oh=0,ah=0,uh=0,sh=0,ch=0,lh=0,fh=0,hh=0,dh={point:ph,lineStart:gh,lineEnd:mh,polygonStart:function(){dh.lineStart=_h,dh.lineEnd=bh},polygonEnd:function(){dh.point=ph,dh.lineStart=gh,dh.lineEnd=mh},result:function(){var t=hh?[lh/hh,fh/hh]:ch?[uh/ch,sh/ch]:ah?[ih/ah,oh/ah]:[NaN,NaN];return ih=oh=ah=uh=sh=ch=lh=fh=hh=0,t}};function ph(t,n){ih+=t,oh+=n,++ah}function gh(){dh.point=yh}function yh(t,n){dh.point=vh,ph(nh=t,eh=n)}function vh(t,n){var e=t-nh,r=n-eh,i=gc(e*e+r*r);uh+=i*(nh+t)/2,sh+=i*(eh+n)/2,ch+=i,ph(nh=t,eh=n)}function mh(){dh.point=ph}function _h(){dh.point=xh}function bh(){wh(Jf,th)}function xh(t,n){dh.point=wh,ph(Jf=nh=t,th=eh=n)}function wh(t,n){var e=t-nh,r=n-eh,i=gc(e*e+r*r);uh+=i*(nh+t)/2,sh+=i*(eh+n)/2,ch+=i,lh+=(i=eh*t-nh*n)*(nh+t),fh+=i*(eh+n),hh+=3*i,ph(nh=t,eh=n)}var Mh=dh;function kh(t){this._context=t}kh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,nc)}},result:bc};var Th,Ah,Sh,Eh,Ch,Nh=new y,Ph={point:bc,lineStart:function(){Ph.point=Dh},lineEnd:function(){Th&&zh(Ah,Sh),Ph.point=bc},polygonStart:function(){Th=!0},polygonEnd:function(){Th=null},result:function(){var t=+Nh;return Nh=new y,t}};function Dh(t,n){Ph.point=zh,Ah=Eh=t,Sh=Ch=n}function zh(t,n){Eh-=t,Ch-=n,Nh.add(gc(Eh*Eh+Ch*Ch)),Eh=t,Ch=n}var Lh=Ph;function Hh(){this._string=[]}function Rh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ih(t){return function(n){var e=new Bh;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Bh(){}function qh(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Ac(e,t.stream(rh)),n(rh.result()),null!=r&&t.clipExtent(r),t}function Fh(t,n,e){return qh(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])}),e)}function Oh(t,n,e){return Fh(t,[[0,0],n],e)}function Uh(t,n,e){return qh(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])}),e)}function Yh(t,n,e){return qh(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])}),e)}Hh.prototype={_radius:4.5,_circle:Rh(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=Rh(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Bh.prototype={constructor:Bh,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Gh=16,Vh=uc(30*rc);function jh(t,n){return+n?function(t,n){function e(r,i,o,a,u,s,c,l,f,h,d,p,g,y){var v=c-r,m=l-i,_=v*v+m*m;if(_>4*n&&g--){var b=a+h,x=u+d,w=s+p,M=gc(b*b+x*x+w*w),k=mc(w/=M),T=ic(ic(w)-1)n||ic((v*C+m*N)/_-.5)>.3||a*h+u*d+s*p2?t[2]%360*rc:0,C()):[y*ec,v*ec,m*ec]},S.angle=function(t){return arguments.length?(_=t%360*rc,C()):_*ec},S.reflectX=function(t){return arguments.length?(b=t?-1:1,C()):b<0},S.reflectY=function(t){return arguments.length?(x=t?-1:1,C()):x<0},S.precision=function(t){return arguments.length?(a=jh(u,A=t*t),N()):gc(A)},S.fitExtent=function(t,n){return Fh(S,t,n)},S.fitSize=function(t,n){return Oh(S,t,n)},S.fitWidth=function(t,n){return Uh(S,t,n)},S.fitHeight=function(t,n){return Yh(S,t,n)},function(){return n=t.apply(this,arguments),S.invert=n.invert&&E,C()}}function Kh(t){var n=0,e=Qs/3,r=Zh(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*rc,e=t[1]*rc):[n*ec,e*ec]},i}function Qh(t,n){var e=dc(t),r=(e+dc(n))/2;if(ic(r)0?n<-Js+Zs&&(n=-Js+Zs):n>Js-Zs&&(n=Js-Zs);var e=i/hc(ud(n),r);return[e*dc(r*t),i-e*uc(r*t)]}return o.invert=function(t,n){var e=i-n,o=pc(r)*gc(t*t+e*e),a=ac(t,ic(e))*pc(e);return e*r<0&&(a-=Qs*pc(t)*pc(e)),[a/r,2*oc(hc(i/o,1/r))-Js]},o}function cd(t,n){return[t,n]}function ld(t,n){var e=uc(t),r=t===n?dc(t):(e-uc(n))/(n-t),i=e/r+t;if(ic(r)=0;)n+=e[r].value;else n=1;t.value=n}function Ad(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=Ed)):void 0===n&&(n=Sd);for(var e,r,i,o,a,u=new Pd(t),s=[u];e=s.pop();)if((i=n(e.data))&&(a=(i=Array.from(i)).length))for(e.children=i,o=a-1;o>=0;--o)s.push(r=i[o]=new Pd(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(Nd)}function Sd(t){return t.children}function Ed(t){return Array.isArray(t)?t[1]:null}function Cd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Nd(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Pd(t){this.data=t,this.depth=this.height=0,this.parent=null}function Dd(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(Array.from(t))).length,o=[];r0&&e*e>r*r+i*i}function Rd(t,n){for(var e=0;e(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),e.x=t.x-r*u-o*s,e.y=t.y-r*s+o*u):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),e.x=n.x+r*u-o*s,e.y=n.y+r*s+o*u)):(e.x=n.x+e.r,e.y=n.y)}function Od(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function Ud(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function Yd(t){this._=t,this.next=null,this.previous=null}function Gd(t){if(!(i=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,e,r,i,o,a,u,s,c,l,f;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Fd(e,n,r=t[2]),n=new Yd(n),e=new Yd(e),r=new Yd(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;uZs&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},_d.invert=ed(mc),bd.invert=ed((function(t){return 2*oc(t)})),xd.invert=function(t,n){return[-n,2*oc(cc(t))-Js]},Pd.prototype=Ad.prototype={constructor:Pd,count:function(){return this.eachAfter(Td)},each:function(t,n){let e=-1;for(const r of this)t.call(n,r,++e,this);return this},eachAfter:function(t,n){for(var e,r,i,o=this,a=[o],u=[],s=-1;o=a.pop();)if(u.push(o),e=o.children)for(r=0,i=e.length;r=0;--r)o.push(e[r]);return this},find:function(t,n){let e=-1;for(const r of this)if(t.call(n,r,++e,this))return r},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Ad(this).eachBefore(Cd)},[Symbol.iterator]:function*(){var t,n,e,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,n=i.children)for(e=0,r=n.length;e1&&!up(t,n););return t.slice(0,n)}function up(t,n){if("/"===t[n]){let e=0;for(;n>0&&"\\"===t[--n];)++e;if(!(1&e))return!0}return!1}function sp(t,n){return t.parent===n.parent?1:2}function cp(t){var n=t.children;return n?n[0]:t.t}function lp(t){var n=t.children;return n?n[n.length-1]:t.t}function fp(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function hp(t,n,e){return t.a.parent===n.parent?t.a:e}function dp(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function pp(t,n,e,r,i){for(var o,a=t.children,u=-1,s=a.length,c=t.value&&(i-e)/t.value;++uh&&(h=u),y=l*l*g,(d=Math.max(h/y,y/f))>p){l-=u;break}p=d}v.push(a={value:l,dice:s1?n:1)},e}(gp);var mp=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,s,c,l,f=-1,h=a.length,d=t.value;++f1?n:1)},e}(gp);function _p(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function bp(t,n){return t[0]-n[0]||t[1]-n[1]}function xp(t){const n=t.length,e=[0,1];let r,i=2;for(r=2;r1&&_p(t[e[i-2]],t[e[i-1]],t[r])<=0;)--i;e[i++]=r}return e.slice(0,i)}var wp=Math.random,Mp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(wp),kp=function t(n){function e(t,e){return arguments.length<2&&(e=t,t=0),t=Math.floor(t),e=Math.floor(e)-t,function(){return Math.floor(n()*e+t)}}return e.source=t,e}(wp),Tp=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(wp),Ap=function t(n){var e=Tp.source(n);function r(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(wp),Sp=function t(n){function e(t){return(t=+t)<=0?()=>0:function(){for(var e=0,r=t;r>1;--r)e+=n();return e+r*n()}}return e.source=t,e}(wp),Ep=function t(n){var e=Sp.source(n);function r(t){if(0==(t=+t))return n;var r=e(t);return function(){return r()/t}}return r.source=t,r}(wp),Cp=function t(n){function e(t){return function(){return-Math.log1p(-n())/t}}return e.source=t,e}(wp),Np=function t(n){function e(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-n(),t)}}return e.source=t,e}(wp),Pp=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(n()+t)}}return e.source=t,e}(wp),Dp=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-n())/t)})}return e.source=t,e}(wp),zp=function t(n){var e=Tp.source(n)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-n())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(n(),1/t):()=>1;return function(){do{do{var t=e(),u=1+o*t}while(u<=0);u*=u*u;var s=1-n()}while(s>=1-.0331*t*t*t*t&&Math.log(s)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(wp),Lp=function t(n){var e=zp.source(n);function r(t,n){var r=e(t),i=e(n);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(wp),Hp=function t(n){var e=Dp.source(n),r=Lp.source(n);function i(t,n){return t=+t,(n=+n)>=1?()=>t:n<=0?()=>0:function(){for(var i=0,o=t,a=n;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),s=r(u,o-u+1)();s<=a?(i+=u,o-=u,a=(a-s)/(1-s)):(o=u-1,a/=s)}for(var c=a<.5,l=e(c?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(c?h:o-h)}}return i.source=t,i}(wp),Rp=function t(n){function e(t,e,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=n=>Math.pow(n,t)),e=null==e?0:+e,r=null==r?1:+r,function(){return e+r*i(-Math.log1p(-n()))}}return e.source=t,e}(wp),Ip=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){return t+e*Math.tan(Math.PI*n())}}return e.source=t,e}(wp),Bp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){var r=n();return t+e*Math.log(r/(1-r))}}return e.source=t,e}(wp),qp=function t(n){var e=zp.source(n),r=Hp.source(n);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=e(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var s=-Math.log1p(-n()),c=0;s<=o;++c)s-=Math.log1p(-n());return i+c}}return i.source=t,i}(wp);const Fp=1/4294967296;function Op(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function Up(t,n){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof n?this.interpolator(n):this.range(n)}return this}const Yp=Symbol("implicit");function Gp(){var t=new v,n=[],e=[],r=Yp;function i(i){let o=t.get(i);if(void 0===o){if(r!==Yp)return r;t.set(i,o=n.push(i)-1)}return e[o%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new v;for(const r of e)t.has(r)||t.set(r,n.push(r)-1);return i},i.range=function(t){return arguments.length?(e=Array.from(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Gp(n,e).unknown(r)},Op.apply(i,arguments),i}function Vp(){var t,n,e=Gp().unknown(void 0),r=e.domain,i=e.range,o=0,a=1,u=!1,s=0,c=0,l=.5;function f(){var e=r().length,f=an&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(a[0],a[t-1])),r=t>2?Qp:Kp,i=o=null,f}function f(n){return null==n||isNaN(n=+n)?e:(i||(i=r(a.map(t),u,s)))(t(c(n)))}return f.invert=function(e){return c(n((o||(o=r(u,a.map(t),Cr)))(e)))},f.domain=function(t){return arguments.length?(a=Array.from(t,$p),l()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),l()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),s=Hr,l()},f.clamp=function(t){return arguments.length?(c=!!t||Wp,l()):c!==Wp},f.interpolate=function(t){return arguments.length?(s=t,l()):s},f.unknown=function(t){return arguments.length?(e=t,f):e},function(e,r){return t=e,n=r,l()}}function ng(){return tg()(Wp,Wp)}function eg(n,e,r,i){var o,a=U(n,e,r);switch((i=Is(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=Xs(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=Ws(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=$s(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function rg(t){var n=t.domain;return t.ticks=function(t){var e=n();return F(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return eg(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,o=n(),a=0,u=o.length-1,s=o[a],c=o[u],l=10;for(c0;){if((i=O(s,c,e))===r)return o[a]=s,o[u]=c,n(o);if(i>0)s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function ig(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-n,e)}function fg(n){const e=n(og,ag),r=e.domain;let i,o,a=10;function u(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),n=>Math.log(n)/t)}(a),o=function(t){return 10===t?cg:t===Math.E?Math.exp:n=>Math.pow(t,n)}(a),r()[0]<0?(i=lg(i),o=lg(o),n(ug,sg)):n(og,ag),e}return e.base=function(t){return arguments.length?(a=+t,u()):a},e.domain=function(t){return arguments.length?(r(t),u()):r()},e.ticks=t=>{const n=r();let e=n[0],u=n[n.length-1];const s=u0){for(;f<=h;++f)for(c=1;cu)break;p.push(l)}}else for(;f<=h;++f)for(c=a-1;c>=1;--c)if(l=f>0?c/o(-f):c*o(f),!(lu)break;p.push(l)}2*p.length{if(null==n&&(n=10),null==r&&(r=10===a?"s":","),"function"!=typeof r&&(a%1||null!=(r=Is(r)).precision||(r.trim=!0),r=t.format(r)),n===1/0)return r;const u=Math.max(1,a*n/e.ticks().length);return t=>{let n=t/o(Math.round(i(t)));return n*ar(ig(r(),{floor:t=>o(Math.floor(i(t))),ceil:t=>o(Math.ceil(i(t)))})),e}function hg(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function dg(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function pg(t){var n=1,e=t(hg(n),dg(n));return e.constant=function(e){return arguments.length?t(hg(n=+e),dg(n)):n},rg(e)}function gg(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function yg(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function vg(t){return t<0?-t*t:t*t}function mg(t){var n=t(Wp,Wp),e=1;return n.exponent=function(n){return arguments.length?1===(e=+n)?t(Wp,Wp):.5===e?t(yg,vg):t(gg(e),gg(1/e)):e},rg(n)}function _g(){var t=mg(tg());return t.copy=function(){return Jp(t,_g()).exponent(t.exponent())},Op.apply(t,arguments),t}function bg(t){return Math.sign(t)*t*t}var xg=new Date,wg=new Date;function Mg(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=function(n){return t(n=new Date(+n)),n},i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return xg.setTime(+n),wg.setTime(+r),t(xg),t(wg),Math.floor(e(xg,wg))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var kg=Mg((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));kg.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Mg((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):kg:null};var Tg=kg,Ag=kg.range;const Sg=1e3,Eg=6e4,Cg=36e5,Ng=864e5,Pg=6048e5,Dg=2592e6,zg=31536e6;var Lg=Mg((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+n*Sg)}),(function(t,n){return(n-t)/Sg}),(function(t){return t.getUTCSeconds()})),Hg=Lg,Rg=Lg.range,Ig=Mg((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Sg)}),(function(t,n){t.setTime(+t+n*Eg)}),(function(t,n){return(n-t)/Eg}),(function(t){return t.getMinutes()})),Bg=Ig,qg=Ig.range,Fg=Mg((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Sg-t.getMinutes()*Eg)}),(function(t,n){t.setTime(+t+n*Cg)}),(function(t,n){return(n-t)/Cg}),(function(t){return t.getHours()})),Og=Fg,Ug=Fg.range,Yg=Mg((t=>t.setHours(0,0,0,0)),((t,n)=>t.setDate(t.getDate()+n)),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Eg)/Ng),(t=>t.getDate()-1)),Gg=Yg,Vg=Yg.range;function jg(t){return Mg((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Eg)/Pg}))}var $g=jg(0),Xg=jg(1),Wg=jg(2),Zg=jg(3),Kg=jg(4),Qg=jg(5),Jg=jg(6),ty=$g.range,ny=Xg.range,ey=Wg.range,ry=Zg.range,iy=Kg.range,oy=Qg.range,ay=Jg.range,uy=Mg((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),sy=uy,cy=uy.range,ly=Mg((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));ly.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Mg((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var fy=ly,hy=ly.range,dy=Mg((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*Eg)}),(function(t,n){return(n-t)/Eg}),(function(t){return t.getUTCMinutes()})),py=dy,gy=dy.range,yy=Mg((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+n*Cg)}),(function(t,n){return(n-t)/Cg}),(function(t){return t.getUTCHours()})),vy=yy,my=yy.range,_y=Mg((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/Ng}),(function(t){return t.getUTCDate()-1})),by=_y,xy=_y.range;function wy(t){return Mg((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/Pg}))}var My=wy(0),ky=wy(1),Ty=wy(2),Ay=wy(3),Sy=wy(4),Ey=wy(5),Cy=wy(6),Ny=My.range,Py=ky.range,Dy=Ty.range,zy=Ay.range,Ly=Sy.range,Hy=Ey.range,Ry=Cy.range,Iy=Mg((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),By=Iy,qy=Iy.range,Fy=Mg((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Fy.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Mg((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Oy=Fy,Uy=Fy.range;function Yy(t,n,r,i,o,a){const u=[[Hg,1,Sg],[Hg,5,5e3],[Hg,15,15e3],[Hg,30,3e4],[a,1,Eg],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,Cg],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,Ng],[i,2,1728e5],[r,1,Pg],[n,1,Dg],[n,3,7776e6],[t,1,zg]];function s(n,r,i){const o=Math.abs(r-n)/i,a=e((([,,t])=>t)).right(u,o);if(a===u.length)return t.every(U(n/zg,r/zg,i));if(0===a)return Tg.every(Math.max(U(n,r,i),1));const[s,c]=u[o/u[a-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:pm,s:gm,S:Hv,u:Rv,U:Iv,V:qv,w:Fv,W:Ov,x:null,X:null,y:Uv,Y:Gv,Z:jv,"%":dm},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:$v,e:$v,f:Qv,g:cm,G:fm,H:Xv,I:Wv,j:Zv,L:Kv,m:Jv,M:tm,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:pm,s:gm,S:nm,u:em,U:rm,V:om,w:am,W:um,x:null,X:null,y:sm,Y:lm,Z:hm,"%":dm},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=m.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=y.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:vv,e:vv,f:Mv,g:dv,G:hv,H:_v,I:_v,j:mv,L:wv,m:yv,M:bv,p:function(t,n,e){var r=c.exec(n.slice(e));return r?(t.p=l.get(r[0].toLowerCase()),e+r[0].length):-1},q:gv,Q:Tv,s:Av,S:xv,u:sv,U:cv,V:lv,w:uv,W:fv,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:dv,Y:hv,Z:pv,"%":kv};function w(t,n){return function(e){var r,i,o,a=[],u=-1,s=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Wy(Zy(o.y,0,1))).getUTCDay(),r=i>4||0===i?ky.ceil(r):ky(r),r=by.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Xy(Zy(o.y,0,1))).getDay(),r=i>4||0===i?Xg.ceil(r):Xg(r),r=Gg.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Wy(Zy(o.y,0,1)).getUTCDay():Xy(Zy(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Wy(o)):Xy(o)}}function k(t,n,e,r){for(var i,o,a=0,u=n.length,s=e.length;a=s)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in Jy?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return _.x=w(e,_),_.X=w(r,_),_.c=w(n,_),b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),{format:function(t){var n=w(t+="",_);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}var Qy,Jy={"-":"",_:" ",0:"0"},tv=/^\s*\d+/,nv=/^%/,ev=/[\\^$*+?|[\]().{}]/g;function rv(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),n])))}function uv(t,n,e){var r=tv.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function sv(t,n,e){var r=tv.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function cv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function lv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function fv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function hv(t,n,e){var r=tv.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function dv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function pv(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function gv(t,n,e){var r=tv.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function yv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function vv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function mv(t,n,e){var r=tv.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function _v(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function bv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function xv(t,n,e){var r=tv.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function wv(t,n,e){var r=tv.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Mv(t,n,e){var r=tv.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function kv(t,n,e){var r=nv.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Tv(t,n,e){var r=tv.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Av(t,n,e){var r=tv.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function Sv(t,n){return rv(t.getDate(),n,2)}function Ev(t,n){return rv(t.getHours(),n,2)}function Cv(t,n){return rv(t.getHours()%12||12,n,2)}function Nv(t,n){return rv(1+Gg.count(fy(t),t),n,3)}function Pv(t,n){return rv(t.getMilliseconds(),n,3)}function Dv(t,n){return Pv(t,n)+"000"}function zv(t,n){return rv(t.getMonth()+1,n,2)}function Lv(t,n){return rv(t.getMinutes(),n,2)}function Hv(t,n){return rv(t.getSeconds(),n,2)}function Rv(t){var n=t.getDay();return 0===n?7:n}function Iv(t,n){return rv($g.count(fy(t)-1,t),n,2)}function Bv(t){var n=t.getDay();return n>=4||0===n?Kg(t):Kg.ceil(t)}function qv(t,n){return t=Bv(t),rv(Kg.count(fy(t),t)+(4===fy(t).getDay()),n,2)}function Fv(t){return t.getDay()}function Ov(t,n){return rv(Xg.count(fy(t)-1,t),n,2)}function Uv(t,n){return rv(t.getFullYear()%100,n,2)}function Yv(t,n){return rv((t=Bv(t)).getFullYear()%100,n,2)}function Gv(t,n){return rv(t.getFullYear()%1e4,n,4)}function Vv(t,n){var e=t.getDay();return rv((t=e>=4||0===e?Kg(t):Kg.ceil(t)).getFullYear()%1e4,n,4)}function jv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+rv(n/60|0,"0",2)+rv(n%60,"0",2)}function $v(t,n){return rv(t.getUTCDate(),n,2)}function Xv(t,n){return rv(t.getUTCHours(),n,2)}function Wv(t,n){return rv(t.getUTCHours()%12||12,n,2)}function Zv(t,n){return rv(1+by.count(Oy(t),t),n,3)}function Kv(t,n){return rv(t.getUTCMilliseconds(),n,3)}function Qv(t,n){return Kv(t,n)+"000"}function Jv(t,n){return rv(t.getUTCMonth()+1,n,2)}function tm(t,n){return rv(t.getUTCMinutes(),n,2)}function nm(t,n){return rv(t.getUTCSeconds(),n,2)}function em(t){var n=t.getUTCDay();return 0===n?7:n}function rm(t,n){return rv(My.count(Oy(t)-1,t),n,2)}function im(t){var n=t.getUTCDay();return n>=4||0===n?Sy(t):Sy.ceil(t)}function om(t,n){return t=im(t),rv(Sy.count(Oy(t),t)+(4===Oy(t).getUTCDay()),n,2)}function am(t){return t.getUTCDay()}function um(t,n){return rv(ky.count(Oy(t)-1,t),n,2)}function sm(t,n){return rv(t.getUTCFullYear()%100,n,2)}function cm(t,n){return rv((t=im(t)).getUTCFullYear()%100,n,2)}function lm(t,n){return rv(t.getUTCFullYear()%1e4,n,4)}function fm(t,n){var e=t.getUTCDay();return rv((t=e>=4||0===e?Sy(t):Sy.ceil(t)).getUTCFullYear()%1e4,n,4)}function hm(){return"+0000"}function dm(){return"%"}function pm(t){return+t}function gm(t){return Math.floor(+t/1e3)}function ym(n){return Qy=Ky(n),t.timeFormat=Qy.format,t.timeParse=Qy.parse,t.utcFormat=Qy.utcFormat,t.utcParse=Qy.utcParse,Qy}t.timeFormat=void 0,t.timeParse=void 0,t.utcFormat=void 0,t.utcParse=void 0,ym({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var vm="%Y-%m-%dT%H:%M:%S.%LZ";var mm=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(vm),_m=mm;var bm=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse(vm),xm=bm;function wm(t){return new Date(t)}function Mm(t){return t instanceof Date?+t:+new Date(+t)}function km(t,n,e,r,i,o,a,u,s,c){var l=ng(),f=l.invert,h=l.domain,d=c(".%L"),p=c(":%S"),g=c("%I:%M"),y=c("%I %p"),v=c("%a %d"),m=c("%b %d"),_=c("%B"),b=c("%Y");function x(t){return(s(t)Mr(t[t.length-1]),Um=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Nm),Ym=Om(Um),Gm=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Nm),Vm=Om(Gm),jm=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Nm),$m=Om(jm),Xm=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Nm),Wm=Om(Xm),Zm=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Nm),Km=Om(Zm),Qm=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Nm),Jm=Om(Qm),t_=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Nm),n_=Om(t_),e_=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Nm),r_=Om(e_),i_=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Nm),o_=Om(i_),a_=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Nm),u_=Om(a_),s_=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Nm),c_=Om(s_),l_=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Nm),f_=Om(l_),h_=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Nm),d_=Om(h_),p_=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Nm),g_=Om(p_),y_=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Nm),v_=Om(y_),m_=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Nm),__=Om(m_),b_=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Nm),x_=Om(b_),w_=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Nm),M_=Om(w_),k_=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Nm),T_=Om(k_),A_=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Nm),S_=Om(A_),E_=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Nm),C_=Om(E_),N_=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Nm),P_=Om(N_),D_=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Nm),z_=Om(D_),L_=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Nm),H_=Om(L_),R_=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Nm),I_=Om(R_),B_=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Nm),q_=Om(B_),F_=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Nm),O_=Om(F_);var U_=Jr(fr(300,.5,0),fr(-240,.5,1)),Y_=Jr(fr(-100,.75,.35),fr(80,1.5,.8)),G_=Jr(fr(260,.75,.35),fr(80,1.5,.8)),V_=fr();var j_=Se(),$_=Math.PI/3,X_=2*Math.PI/3;function W_(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var Z_=W_(Nm("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),K_=W_(Nm("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Q_=W_(Nm("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),J_=W_(Nm("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function tb(t){return function(){return t}}var nb=Math.abs,eb=Math.atan2,rb=Math.cos,ib=Math.max,ob=Math.min,ab=Math.sin,ub=Math.sqrt,sb=1e-12,cb=Math.PI,lb=cb/2,fb=2*cb;function hb(t){return t>=1?lb:t<=-1?-lb:Math.asin(t)}function db(t){return t.innerRadius}function pb(t){return t.outerRadius}function gb(t){return t.startAngle}function yb(t){return t.endAngle}function vb(t){return t&&t.padAngle}function mb(t,n,e,r,i,o,a){var u=t-e,s=n-r,c=(a?o:-o)/ub(u*u+s*s),l=c*s,f=-c*u,h=t+l,d=n+f,p=e+l,g=r+f,y=(h+p)/2,v=(d+g)/2,m=p-h,_=g-d,b=m*m+_*_,x=i-o,w=h*g-p*d,M=(_<0?-1:1)*ub(ib(0,x*x*b-w*w)),k=(w*_-m*M)/b,T=(-w*m-_*M)/b,A=(w*_+m*M)/b,S=(-w*m+_*M)/b,E=k-y,C=T-v,N=A-y,P=S-v;return E*E+C*C>N*N+P*P&&(k=A,T=S),{cx:k,cy:T,x01:-l,y01:-f,x11:k*(i/x-1),y11:T*(i/x-1)}}var _b=Array.prototype.slice;function bb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function xb(t){this._context=t}function wb(t){return new xb(t)}function Mb(t){return t[0]}function kb(t){return t[1]}function Tb(t,n){var e=tb(!0),r=null,i=wb,o=null;function a(a){var u,s,c,l=(a=bb(a)).length,f=!1;for(null==r&&(o=i(c=Ta())),u=0;u<=l;++u)!(u=l;--f)u.point(y[f],v[f]);u.lineEnd(),u.areaEnd()}g&&(y[c]=+t(h,c,s),v[c]=+n(h,c,s),u.point(r?+r(h,c,s):y[c],e?+e(h,c,s):v[c]))}if(d)return u=null,d+""||null}function c(){return Tb().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Mb:tb(+t),n="function"==typeof n?n:tb(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?kb:tb(+e),s.x=function(n){return arguments.length?(t="function"==typeof n?n:tb(+n),r=null,s):t},s.x0=function(n){return arguments.length?(t="function"==typeof n?n:tb(+n),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:tb(+t),s):r},s.y=function(t){return arguments.length?(n="function"==typeof t?t:tb(+t),e=null,s):n},s.y0=function(t){return arguments.length?(n="function"==typeof t?t:tb(+t),s):n},s.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:tb(+t),s):e},s.lineX0=s.lineY0=function(){return c().x(t).y(n)},s.lineY1=function(){return c().x(t).y(e)},s.lineX1=function(){return c().x(r).y(n)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:tb(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),s):o},s}function Sb(t,n){return nt?1:n>=t?0:NaN}function Eb(t){return t}xb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var Cb=Pb(wb);function Nb(t){this._curve=t}function Pb(t){function n(n){return new Nb(t(n))}return n._curve=t,n}function Db(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(Pb(t)):n()._curve},t}function zb(){return Db(Tb().curve(Cb))}function Lb(){var t=Ab().curve(Cb),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Db(e())},delete t.lineX0,t.lineEndAngle=function(){return Db(r())},delete t.lineX1,t.lineInnerRadius=function(){return Db(i())},delete t.lineY0,t.lineOuterRadius=function(){return Db(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(Pb(t)):n()._curve},t}function Hb(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}function Rb(t){return t.source}function Ib(t){return t.target}function Bb(t){var n=Rb,e=Ib,r=Mb,i=kb,o=null;function a(){var a,u=_b.call(arguments),s=n.apply(this,u),c=e.apply(this,u);if(o||(o=a=Ta()),t(o,+r.apply(this,(u[0]=s,u)),+i.apply(this,u),+r.apply(this,(u[0]=c,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:tb(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:tb(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function qb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function Fb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function Ob(t,n,e,r,i){var o=Hb(n,e),a=Hb(n,e=(e+i)/2),u=Hb(r,e),s=Hb(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],s[0],s[1])}Nb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Ub={draw:function(t,n){var e=Math.sqrt(n/cb);t.moveTo(e,0),t.arc(0,0,e,0,fb)}},Yb={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Gb=Math.sqrt(1/3),Vb=2*Gb,jb={draw:function(t,n){var e=Math.sqrt(n/Vb),r=e*Gb;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},$b=Math.sin(cb/10)/Math.sin(7*cb/10),Xb=Math.sin(fb/10)*$b,Wb=-Math.cos(fb/10)*$b,Zb={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Xb*e,i=Wb*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=fb*o/5,u=Math.cos(a),s=Math.sin(a);t.lineTo(s*e,-u*e),t.lineTo(u*r-s*i,s*r+u*i)}t.closePath()}},Kb={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Qb=Math.sqrt(3),Jb={draw:function(t,n){var e=-Math.sqrt(n/(3*Qb));t.moveTo(0,2*e),t.lineTo(-Qb*e,-e),t.lineTo(Qb*e,-e),t.closePath()}},tx=-.5,nx=Math.sqrt(3)/2,ex=1/Math.sqrt(12),rx=3*(ex/2+1),ix={draw:function(t,n){var e=Math.sqrt(n/rx),r=e/2,i=e*ex,o=r,a=e*ex+e,u=-o,s=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,s),t.lineTo(tx*r-nx*i,nx*r+tx*i),t.lineTo(tx*o-nx*a,nx*o+tx*a),t.lineTo(tx*u-nx*s,nx*u+tx*s),t.lineTo(tx*r+nx*i,tx*i-nx*r),t.lineTo(tx*o+nx*a,tx*a-nx*o),t.lineTo(tx*u+nx*s,tx*s-nx*u),t.closePath()}},ox=[Ub,Yb,jb,Kb,Zb,Jb,ix];function ax(){}function ux(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function sx(t){this._context=t}function cx(t){this._context=t}function lx(t){this._context=t}sx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ux(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ux(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},cx.prototype={areaStart:ax,areaEnd:ax,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:ux(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},lx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:ux(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};class fx{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}function hx(t,n){this._basis=new sx(t),this._beta=n}hx.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,s=-1;++s<=e;)r=s/e,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*n[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var dx=function t(n){function e(t){return 1===n?new sx(t):new hx(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function px(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function gx(t,n){this._context=t,this._k=(1-n)/6}gx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:px(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:px(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var yx=function t(n){function e(t){return new gx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function vx(t,n){this._context=t,this._k=(1-n)/6}vx.prototype={areaStart:ax,areaEnd:ax,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:px(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var mx=function t(n){function e(t){return new vx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function _x(t,n){this._context=t,this._k=(1-n)/6}_x.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:px(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var bx=function t(n){function e(t){return new _x(t,n)}return e.tension=function(n){return t(+n)},e}(0);function xx(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>sb){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>sb){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-n*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-e*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function wx(t,n){this._context=t,this._alpha=n}wx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:xx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Mx=function t(n){function e(t){return n?new wx(t,n):new gx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function kx(t,n){this._context=t,this._alpha=n}kx.prototype={areaStart:ax,areaEnd:ax,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:xx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Tx=function t(n){function e(t){return n?new kx(t,n):new vx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Ax(t,n){this._context=t,this._alpha=n}Ax.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:xx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Sx=function t(n){function e(t){return n?new Ax(t,n):new _x(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Ex(t){this._context=t}function Cx(t){return t<0?-1:1}function Nx(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Cx(o)+Cx(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Px(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Dx(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function zx(t){this._context=t}function Lx(t){this._context=new Hx(t)}function Hx(t){this._context=t}function Rx(t){this._context=t}function Ix(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function Ox(t,n){return t[n]}function Ux(t){const n=[];return n.key=t,n}function Yx(t){var n=t.map(Gx);return Fx(t).sort((function(t,e){return n[t]-n[e]}))}function Gx(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function Vx(t){var n=t.map(jx);return Fx(t).sort((function(t,e){return n[t]-n[e]}))}function jx(t){for(var n,e=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var $x=t=>()=>t;function Xx(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Wx(t,n,e){this.k=t,this.x=n,this.y=e}Wx.prototype={constructor:Wx,scale:function(t){return 1===t?this:new Wx(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Wx(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Zx=new Wx(1,0,0);function Kx(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Zx;return t.__zoom}function Qx(t){t.stopImmediatePropagation()}function Jx(t){t.preventDefault(),t.stopImmediatePropagation()}function tw(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function nw(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function ew(){return this.__zoom||Zx}function rw(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function iw(){return navigator.maxTouchPoints||"ontouchstart"in this}function ow(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}Kx.prototype=Wx.prototype,t.Adder=y,t.Delaunay=Su,t.FormatSpecifier=Bs,t.InternMap=v,t.InternSet=m,t.Node=Pd,t.Voronoi=xu,t.ZoomTransform=Wx,t.active=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>ki&&e.name===n)return new to([[t]],Io,n,+r);return null},t.arc=function(){var t=db,n=pb,e=tb(0),r=null,i=gb,o=yb,a=vb,u=null;function s(){var s,c,l=+t.apply(this,arguments),f=+n.apply(this,arguments),h=i.apply(this,arguments)-lb,d=o.apply(this,arguments)-lb,p=nb(d-h),g=d>h;if(u||(u=s=Ta()),fsb)if(p>fb-sb)u.moveTo(f*rb(h),f*ab(h)),u.arc(0,0,f,h,d,!g),l>sb&&(u.moveTo(l*rb(d),l*ab(d)),u.arc(0,0,l,d,h,g));else{var y,v,m=h,_=d,b=h,x=d,w=p,M=p,k=a.apply(this,arguments)/2,T=k>sb&&(r?+r.apply(this,arguments):ub(l*l+f*f)),A=ob(nb(f-l)/2,+e.apply(this,arguments)),S=A,E=A;if(T>sb){var C=hb(T/l*ab(k)),N=hb(T/f*ab(k));(w-=2*C)>sb?(b+=C*=g?1:-1,x-=C):(w=0,b=x=(h+d)/2),(M-=2*N)>sb?(m+=N*=g?1:-1,_-=N):(M=0,m=_=(h+d)/2)}var P=f*rb(m),D=f*ab(m),z=l*rb(x),L=l*ab(x);if(A>sb){var H,R=f*rb(_),I=f*ab(_),B=l*rb(b),q=l*ab(b);if(p1?0:t<-1?cb:Math.acos(t)}((F*U+O*Y)/(ub(F*F+O*O)*ub(U*U+Y*Y)))/2),V=ub(H[0]*H[0]+H[1]*H[1]);S=ob(A,(l-V)/(G-1)),E=ob(A,(f-V)/(G+1))}}M>sb?E>sb?(y=mb(B,q,P,D,f,E,g),v=mb(R,I,z,L,f,E,g),u.moveTo(y.cx+y.x01,y.cy+y.y01),Esb&&w>sb?S>sb?(y=mb(z,L,R,I,l,-S,g),v=mb(P,D,B,q,l,-S,g),u.lineTo(y.cx+y.x01,y.cy+y.y01),S>a,c=i+2*u>>a,l=Ba(20);function f(r){var i=new Float32Array(s*c),f=new Float32Array(s*c),d=Math.pow(2,-a);r.forEach((function(r,o,a){var l=(t(r,o,a)+u)*d,f=(n(r,o,a)+u)*d,h=+e(r,o,a);if(l>=0&&l=0&&f>a),ja({width:s,height:c,data:f},{width:s,height:c,data:i},o>>a),Va({width:s,height:c,data:i},{width:s,height:c,data:f},o>>a),ja({width:s,height:c,data:f},{width:s,height:c,data:i},o>>a),Va({width:s,height:c,data:i},{width:s,height:c,data:f},o>>a),ja({width:s,height:c,data:f},{width:s,height:c,data:i},o>>a);var p=l(i);if(!Array.isArray(p)){var g=j(i);p=U(0,g,p),(p=et(0,Math.floor(g/p)*p,p)).shift()}return Ga().thresholds(p).size([s,c])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*a),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function y(){return s=r+2*(u=3*o)>>a,c=i+2*u>>a,f}return f.x=function(n){return arguments.length?(t="function"==typeof n?n:Ba(+n),f):t},f.y=function(t){return arguments.length?(n="function"==typeof t?t:Ba(+t),f):n},f.weight=function(t){return arguments.length?(e="function"==typeof t?t:Ba(+t),f):e},f.size=function(t){if(!arguments.length)return[r,i];var n=+t[0],e=+t[1];if(!(n>=0&&e>=0))throw new Error("invalid size");return r=n,i=e,y()},f.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),y()},f.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Ba(Ra.call(t)):Ba(t),f):l},f.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),y()},f},t.contours=Ga,t.count=c,t.create=function(t){return On(zt(t).call(document.documentElement))},t.creator=zt,t.cross=function(...t){const n="function"==typeof t[t.length-1]&&function(t){return n=>t(...n)}(t.pop()),e=(t=t.map(h)).map(l),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(f))return o;for(;;){o.push(i.map(((n,e)=>t[e][n])));let a=r;for(;++i[a]===e[a];){if(0===a)return n?o.map(n):o;i[a--]=0}}},t.csv=as,t.csvFormat=Ou,t.csvFormatBody=Uu,t.csvFormatRow=Gu,t.csvFormatRows=Yu,t.csvFormatValue=Vu,t.csvParse=qu,t.csvParseRows=Fu,t.cubehelix=fr,t.cumsum=function(t,n){var e=0,r=0;return Float64Array.from(t,void 0===n?t=>e+=+t||0:i=>e+=+n(i,r++,t)||0)},t.curveBasis=function(t){return new sx(t)},t.curveBasisClosed=function(t){return new cx(t)},t.curveBasisOpen=function(t){return new lx(t)},t.curveBumpX=function(t){return new fx(t,!0)},t.curveBumpY=function(t){return new fx(t,!1)},t.curveBundle=dx,t.curveCardinal=yx,t.curveCardinalClosed=mx,t.curveCardinalOpen=bx,t.curveCatmullRom=Mx,t.curveCatmullRomClosed=Tx,t.curveCatmullRomOpen=Sx,t.curveLinear=wb,t.curveLinearClosed=function(t){return new Ex(t)},t.curveMonotoneX=function(t){return new zx(t)},t.curveMonotoneY=function(t){return new Lx(t)},t.curveNatural=function(t){return new Rx(t)},t.curveStep=function(t){return new Bx(t,.5)},t.curveStepAfter=function(t){return new Bx(t,1)},t.curveStepBefore=function(t){return new Bx(t,0)},t.descending=function(t,n){return null==t||null==n?NaN:nt?1:n>=t?0:NaN},t.deviation=p,t.difference=function(t,...n){t=new m(t);for(const e of n)for(const n of e)t.delete(n);return t},t.disjoint=function(t,n){const e=n[Symbol.iterator](),r=new m;for(const n of t){if(r.has(n))return!1;let t,i;for(;({value:t,done:i}=e.next())&&!i;){if(Object.is(n,t))return!1;r.add(t)}}return!0},t.dispatch=kt,t.drag=function(){var t,n,e,r,i=ne,o=ee,a=re,u=ie,s={},c=kt("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",v,$n).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,u){if(!r&&i.call(this,a,u)){var s=_(this,o.call(this,a,u),a,u,"mouse");s&&(On(a.view).on("mousemove.drag",p,Xn).on("mouseup.drag",g,Xn),Kn(a.view),Wn(a),e=!1,t=a.clientX,n=a.clientY,s("start",a))}}function p(r){if(Zn(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>f}s.mouse("drag",r)}function g(t){On(t.view).on("mousemove.drag mouseup.drag",null),Qn(t.view,e),Zn(t),s.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,u=o.call(this,t,n),s=a.length;for(e=0;e+t,t.easePoly=so,t.easePolyIn=ao,t.easePolyInOut=so,t.easePolyOut=uo,t.easeQuad=io,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=io,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=fo,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*lo)},t.easeSinInOut=fo,t.easeSinOut=function(t){return Math.sin(t*lo)},t.every=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(!n(r,++e,t))return!1;return!0},t.extent=g,t.fcumsum=function(t,n){const e=new y;let r=-1;return Float64Array.from(t,void 0===n?t=>e.add(+t||0):i=>e.add(+n(i,++r,t)||0))},t.filter=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");const e=[];let r=-1;for(const i of t)n(i,++r,t)&&e.push(i);return e},t.flatGroup=function(t,...n){return A(T(t,...n),n)},t.flatRollup=function(t,n,...e){return A(E(t,n,...e),e)},t.forceCenter=function(t,n){var e,r=1;function i(){var i,o,a=e.length,u=0,s=0;for(i=0;ic+p||ol+p||as.index){var g=c-u.x-u.vx,y=l-u.y-u.vy,v=g*g+y*y;vt.r&&(t.r=t[n].r)}function s(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r[u(t,n,r),t])));for(a=0,i=new Array(c);a=u)){(t.data!==n||t.next)&&(0===f&&(p+=(f=ws(e))*f),0===h&&(p+=(h=ws(e))*h),p(t=(Ss*t+Es)%Cs)/Cs}();function f(){h(),c.call("tick",n),e1?(null==e?u.delete(t):u.set(t,p(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,s,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,e),n):c.on(t)}}},t.forceX=function(t){var n,e,r,i=xs(.1);function o(t){for(var i,o=0,a=n.length;o=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},l.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),s.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++eSl(r[0],r[1])&&(r[1]=i[1]),Sl(i[0],r[1])>Sl(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=Sl(r[1],i[0]))>a&&(a=u,Dc=i[0],Lc=r[1])}return Oc=Uc=null,Dc===1/0||zc===1/0?[[NaN,NaN],[NaN,NaN]]:[[Dc,zc],[Lc,Hc]]},t.geoCentroid=function(t){rl=il=ol=al=ul=sl=cl=ll=0,fl=new y,hl=new y,dl=new y,Ac(t,Nl);var n=+fl,e=+hl,r=+dl,i=lc(n,e,r);return i2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=xd,t.gray=function(t,n){return new Xe(t,0,0,null==n?1:n)},t.greatest=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)>0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)>0:0===e(n,n))&&(r=n,i=!0);return r},t.greatestIndex=function(t,e=n){if(1===e.length)return Q(t,e);let r,i=-1,o=-1;for(const n of t)++o,(i<0?0===e(n,n):e(n,r)>0)&&(r=n,i=o);return i},t.group=k,t.groupSort=function(t,e,r){return(2!==e.length?D(S(t,e,r),(([t,e],[r,i])=>n(e,i)||n(t,r))):D(k(t,r),(([t,r],[i,o])=>e(r,o)||n(t,i)))).map((([t])=>t))},t.groups=T,t.hcl=tr,t.hierarchy=Ad,t.histogram=V,t.hsl=Le,t.html=fs,t.image=function(t,n){return new Promise((function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t}))},t.index=function(t,...n){return N(t,M,C,n)},t.indexes=function(t,...n){return N(t,Array.from,C,n)},t.interpolate=Lr,t.interpolateArray=function(t,n){return(Ar(n)?Tr:Sr)(t,n)},t.interpolateBasis=pr,t.interpolateBasisClosed=gr,t.interpolateBlues=P_,t.interpolateBrBG=Ym,t.interpolateBuGn=u_,t.interpolateBuPu=c_,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=G_,t.interpolateCubehelix=Qr,t.interpolateCubehelixDefault=U_,t.interpolateCubehelixLong=Jr,t.interpolateDate=Er,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateGnBu=f_,t.interpolateGreens=z_,t.interpolateGreys=H_,t.interpolateHcl=Wr,t.interpolateHclLong=Zr,t.interpolateHsl=jr,t.interpolateHslLong=$r,t.interpolateHue=function(t,n){var e=mr(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateInferno=Q_,t.interpolateLab=function(t,n){var e=br((t=$e(t)).l,(n=$e(n)).l),r=br(t.a,n.a),i=br(t.b,n.b),o=br(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateMagma=K_,t.interpolateNumber=Cr,t.interpolateNumberArray=Tr,t.interpolateObject=Nr,t.interpolateOrRd=d_,t.interpolateOranges=O_,t.interpolatePRGn=Vm,t.interpolatePiYG=$m,t.interpolatePlasma=J_,t.interpolatePuBu=v_,t.interpolatePuBuGn=g_,t.interpolatePuOr=Wm,t.interpolatePuRd=__,t.interpolatePurples=I_,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return V_.h=360*t-100,V_.s=1.5-1.5*n,V_.l=.8-.9*n,V_+""},t.interpolateRdBu=Km,t.interpolateRdGy=Jm,t.interpolateRdPu=x_,t.interpolateRdYlBu=n_,t.interpolateRdYlGn=r_,t.interpolateReds=q_,t.interpolateRgb=xr,t.interpolateRgbBasis=Mr,t.interpolateRgbBasisClosed=kr,t.interpolateRound=Hr,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,j_.r=255*(n=Math.sin(t))*n,j_.g=255*(n=Math.sin(t+$_))*n,j_.b=255*(n=Math.sin(t+X_))*n,j_+""},t.interpolateSpectral=o_,t.interpolateString=zr,t.interpolateTransformCss=Or,t.interpolateTransformSvg=Ur,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=Z_,t.interpolateWarm=Y_,t.interpolateYlGn=T_,t.interpolateYlGnBu=M_,t.interpolateYlOrBr=S_,t.interpolateYlOrRd=C_,t.interpolateZoom=Gr,t.interrupt=Li,t.intersection=function(t,...n){t=new m(t),n=n.map(st);t:for(const e of t)for(const r of n)if(!r.has(e)){t.delete(e);continue t}return t},t.interval=function(t,n,e){var r=new pi,i=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?hi():+e,r._restart((function o(a){a+=i,r._restart(o,i+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)},t.isoFormat=_m,t.isoParse=xm,t.json=function(t,n){return fetch(t,n).then(ss)},t.lab=$e,t.lch=function(t,n,e,r){return 1===arguments.length?Je(t):new nr(e,n,t,null==r?1:r)},t.least=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)<0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)<0:0===e(n,n))&&(r=n,i=!0);return r},t.leastIndex=rt,t.line=Tb,t.lineRadial=zb,t.linkHorizontal=function(){return Bb(qb)},t.linkRadial=function(){var t=Bb(Ob);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return Bb(Fb)},t.local=Yn,t.map=function(t,n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof n)throw new TypeError("mapper is not a function");return Array.from(t,((e,r)=>n(e,r,t)))},t.matcher=qt,t.max=j,t.maxIndex=Q,t.mean=function(t,n){let e=0,r=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(++e,r+=n);else{let i=-1;for(let o of t)null!=(o=n(o,++i,t))&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e},t.median=function(t,n){return Z(t,.5,n)},t.merge=J,t.min=$,t.minIndex=tt,t.mode=function(t,n){const e=new v;if(void 0===n)for(let n of t)null!=n&&n>=n&&e.set(n,(e.get(n)||0)+1);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&i>=i&&e.set(i,(e.get(i)||0)+1)}let r,i=0;for(const[t,n]of e)n>i&&(i=n,r=t);return r},t.namespace=Nt,t.namespaces=Ct,t.nice=Y,t.now=hi,t.pack=function(){var t=null,n=1,e=1,r=$d;function i(i){return i.x=n/2,i.y=e/2,t?i.eachBefore(Zd(t)).eachAfter(Kd(r,.5)).eachBefore(Qd(1)):i.eachBefore(Zd(Wd)).eachAfter(Kd($d,1)).eachAfter(Kd(r,i.r/Math.min(n,e))).eachBefore(Qd(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=Vd(n),i):t},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:Xd(+t),i):r},i},t.packEnclose=Dd,t.packSiblings=function(t){return Gd(t),t},t.pairs=function(t,n=nt){const e=[];let r,i=!1;for(const o of t)i&&e.push(n(r,o)),r=o,i=!0;return e},t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&tp(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a0&&(d+=f);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(a[t],a[n])})),u=0,c=d?(v-h*_)/d:0;u0?f*c:0)+_,g[s]={data:a[s],index:u,value:f,startAngle:y,endAngle:l,padAngle:m};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:tb(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:tb(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:tb(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:tb(+t),a):o},a},t.piecewise=ti,t.pointRadial=Hb,t.pointer=jn,t.pointers=function(t,n){return t.target&&(t=Vn(t),void 0===n&&(n=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>jn(t,n)))},t.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++eu!=c>u&&a<(s-e)*(u-r)/(c-r)+e&&(l=!l),s=e,c=r;return l},t.polygonHull=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)c.push(t[r[o[n]][2]]);for(n=+u;n(n=1664525*n+1013904223|0,Fp*(n>>>0))},t.randomLogNormal=Ap,t.randomLogistic=Bp,t.randomNormal=Tp,t.randomPareto=Np,t.randomPoisson=qp,t.randomUniform=Mp,t.randomWeibull=Rp,t.range=et,t.rank=function(t,e=n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let r=Array.from(t);const i=new Float64Array(r.length);2!==e.length&&(r=r.map(e),e=n);const o=(t,n)=>e(r[t],r[n]);let a,u;return Uint32Array.from(r,((t,n)=>n)).sort(e===n?(t,n)=>L(r[t],r[n]):z(o)).forEach(((t,n)=>{const e=o(t,void 0===a?t:a);e>=0?((void 0===a||e>0)&&(a=t,u=n),i[t]=u):i[t]=NaN})),i},t.reduce=function(t,n,e){if("function"!=typeof n)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:e}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)e=n(e,o,++a,t);return e},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rgb=Se,t.ribbon=function(){return Ha()},t.ribbonArrow=function(){return Ha(La)},t.rollup=S,t.rollups=E,t.scaleBand=Vp,t.scaleDiverging=function t(){var n=rg(Em()(Wp));return n.copy=function(){return Am(n,t())},Up.apply(n,arguments)},t.scaleDivergingLog=function t(){var n=fg(Em()).domain([.1,1,10]);return n.copy=function(){return Am(n,t()).base(n.base())},Up.apply(n,arguments)},t.scaleDivergingPow=Cm,t.scaleDivergingSqrt=function(){return Cm.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function t(){var n=pg(Em());return n.copy=function(){return Am(n,t()).constant(n.constant())},Up.apply(n,arguments)},t.scaleIdentity=function t(n){var e;function r(t){return null==t||isNaN(t=+t)?e:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=Array.from(t,$p),r):n.slice()},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,$p):[0,1],rg(r)},t.scaleImplicit=Yp,t.scaleLinear=function t(){var n=ng();return n.copy=function(){return Jp(n,t())},Op.apply(n,arguments),rg(n)},t.scaleLog=function t(){const n=fg(tg()).domain([1,10]);return n.copy=()=>Jp(n,t()).base(n.base()),Op.apply(n,arguments),n},t.scaleOrdinal=Gp,t.scalePoint=function(){return jp(Vp.apply(null,arguments).paddingInner(1))},t.scalePow=_g,t.scaleQuantile=function t(){var e,r=[],i=[],o=[];function a(){var t=0,n=Math.max(1,i.length);for(o=new Array(n-1);++t0?o[n-1]:r[0],n=i?[o[i-1],r]:[o[n-1],o[n]]},u.unknown=function(t){return arguments.length?(n=t,u):u},u.thresholds=function(){return o.slice()},u.copy=function(){return t().domain([e,r]).range(a).unknown(n)},Op.apply(rg(u),arguments)},t.scaleRadial=function t(){var n,e=ng(),r=[0,1],i=!1;function o(t){var r=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(t));return isNaN(r)?n:i?Math.round(r):r}return o.invert=function(t){return e.invert(bg(t))},o.domain=function(t){return arguments.length?(e.domain(t),o):e.domain()},o.range=function(t){return arguments.length?(e.range((r=Array.from(t,$p)).map(bg)),o):r.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(i=!!t,o):i},o.clamp=function(t){return arguments.length?(e.clamp(t),o):e.clamp()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t(e.domain(),r).round(i).clamp(e.clamp()).unknown(n)},Op.apply(o,arguments),rg(o)},t.scaleSequential=function t(){var n=rg(Tm()(Wp));return n.copy=function(){return Am(n,t())},Up.apply(n,arguments)},t.scaleSequentialLog=function t(){var n=fg(Tm()).domain([1,10]);return n.copy=function(){return Am(n,t()).base(n.base())},Up.apply(n,arguments)},t.scaleSequentialPow=Sm,t.scaleSequentialQuantile=function t(){var e=[],r=Wp;function i(t){if(null!=t&&!isNaN(t=+t))return r((s(e,t,1)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(n),i},i.interpolator=function(t){return arguments.length?(r=t,i):r},i.range=function(){return e.map(((t,n)=>r(n/(e.length-1))))},i.quantiles=function(t){return Array.from({length:t+1},((n,r)=>Z(e,r/t)))},i.copy=function(){return t(r).domain(e)},Up.apply(i,arguments)},t.scaleSequentialSqrt=function(){return Sm.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var n=pg(Tm());return n.copy=function(){return Am(n,t()).constant(n.constant())},Up.apply(n,arguments)},t.scaleSqrt=function(){return _g.apply(null,arguments).exponent(.5)},t.scaleSymlog=function t(){var n=pg(tg());return n.copy=function(){return Jp(n,t()).constant(n.constant())},Op.apply(n,arguments)},t.scaleThreshold=function t(){var n,e=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[s(e,t,0,i)]:n}return o.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,r.length-1),o):e.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(e.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var n=r.indexOf(t);return[e[n-1],e[n]]},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t().domain(e).range(r).unknown(n)},Op.apply(o,arguments)},t.scaleTime=function(){return Op.apply(km(jy,$y,fy,sy,$g,Gg,Og,Bg,Hg,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return Op.apply(km(Gy,Vy,Oy,By,My,by,vy,py,Hg,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,n){const e=rt(t,n);return e<0?void 0:e},t.schemeAccent=Dm,t.schemeBlues=N_,t.schemeBrBG=Um,t.schemeBuGn=a_,t.schemeBuPu=s_,t.schemeCategory10=Pm,t.schemeDark2=zm,t.schemeGnBu=l_,t.schemeGreens=D_,t.schemeGreys=L_,t.schemeOrRd=h_,t.schemeOranges=F_,t.schemePRGn=Gm,t.schemePaired=Lm,t.schemePastel1=Hm,t.schemePastel2=Rm,t.schemePiYG=jm,t.schemePuBu=y_,t.schemePuBuGn=p_,t.schemePuOr=Xm,t.schemePuRd=m_,t.schemePurples=R_,t.schemeRdBu=Zm,t.schemeRdGy=Qm,t.schemeRdPu=b_,t.schemeRdYlBu=t_,t.schemeRdYlGn=e_,t.schemeReds=B_,t.schemeSet1=Im,t.schemeSet2=Bm,t.schemeSet3=qm,t.schemeSpectral=i_,t.schemeTableau10=Fm,t.schemeYlGn=k_,t.schemeYlGnBu=w_,t.schemeYlOrBr=A_,t.schemeYlOrRd=E_,t.select=On,t.selectAll=function(t){return"string"==typeof t?new qn([document.querySelectorAll(t)],[document.documentElement]):new qn([Rt(t)],Bn)},t.selection=Fn,t.selector=Ht,t.selectorAll=Bt,t.shuffle=it,t.shuffler=ot,t.some=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(n(r,++e,t))return!0;return!1},t.sort=D,t.stack=function(){var t=tb([]),n=Fx,e=qx,r=Ox;function i(i){var o,a,u=Array.from(t.apply(this,arguments),Ux),s=u.length,c=-1;for(const t of i)for(o=0,++c;o0)for(var e,r,i,o,a,u,s=0,c=t[n[0]].length;s0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},t.stackOffsetExpand=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,a=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;afunction(t){let n=(t=`${t}`).length;return up(t,n-1)&&!up(t,n-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(n,e,r)))),e=n.map(ap),i=new Set(n).add("");for(const t of e)i.has(t)||(i.add(t),n.push(t),e.push(ap(t)),h.push(rp));d=(t,e)=>n[e],p=(t,n)=>e[n]}for(a=0,i=h.length;a=0&&(c=h[t]).data===rp;--t)c.data=null}if(u.parent=np,u.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Nd),u.parent=null,i>0)throw new Error("cycle");return u}return r.id=function(t){return arguments.length?(n=Vd(t),r):n},r.parentId=function(t){return arguments.length?(e=Vd(t),r):e},r.path=function(n){return arguments.length?(t=Vd(n),r):t},r},t.style=cn,t.subset=function(t,n){return ct(n,t)},t.sum=function(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e},t.superset=ct,t.svg=hs,t.symbol=function(t,n){var e=null;function r(){var r;if(e||(e=r=Ta()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return t="function"==typeof t?t:tb(t||Ub),n="function"==typeof n?n:tb(void 0===n?64:+n),r.type=function(n){return arguments.length?(t="function"==typeof n?n:tb(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:tb(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},t.symbolCircle=Ub,t.symbolCross=Yb,t.symbolDiamond=jb,t.symbolSquare=Kb,t.symbolStar=Zb,t.symbolTriangle=Jb,t.symbolWye=ix,t.symbols=ox,t.text=is,t.thresholdFreedmanDiaconis=function(t,n,e){return Math.ceil((e-n)/(2*(Z(t,.75)-Z(t,.25))*Math.pow(c(t),-1/3)))},t.thresholdScott=function(t,n,e){return Math.ceil((e-n)/(3.5*p(t)*Math.pow(c(t),-1/3)))},t.thresholdSturges=G,t.tickFormat=eg,t.tickIncrement=O,t.tickStep=U,t.ticks=F,t.timeDay=Gg,t.timeDays=Vg,t.timeFormatDefaultLocale=ym,t.timeFormatLocale=Ky,t.timeFriday=Qg,t.timeFridays=oy,t.timeHour=Og,t.timeHours=Ug,t.timeInterval=Mg,t.timeMillisecond=Tg,t.timeMilliseconds=Ag,t.timeMinute=Bg,t.timeMinutes=qg,t.timeMonday=Xg,t.timeMondays=ny,t.timeMonth=sy,t.timeMonths=cy,t.timeSaturday=Jg,t.timeSaturdays=ay,t.timeSecond=Hg,t.timeSeconds=Rg,t.timeSunday=$g,t.timeSundays=ty,t.timeThursday=Kg,t.timeThursdays=iy,t.timeTickInterval=$y,t.timeTicks=jy,t.timeTuesday=Wg,t.timeTuesdays=ey,t.timeWednesday=Zg,t.timeWednesdays=ry,t.timeWeek=$g,t.timeWeeks=ty,t.timeYear=fy,t.timeYears=hy,t.timeout=bi,t.timer=gi,t.timerFlush=yi,t.transition=no,t.transpose=at,t.tree=function(){var t=sp,n=1,e=1,r=null;function i(i){var s=function(t){for(var n,e,r,i,o,a=new dp(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new dp(r[i],i)),e.parent=n;return(a.parent=new dp(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(u);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,d=h-c.x,p=n/(l.x+h+d),g=e/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,s=o.parent.children[0],c=o.m,l=a.m,f=u.m,h=s.m;u=lp(u),o=cp(o),u&&o;)s=cp(s),(a=lp(a)).a=n,(i=u.z+f-o.z-c+t(u._,o._))>0&&(fp(hp(u,n,r),n,i),c+=i,l+=i),f+=u.m,c+=o.m,h+=s.m,l+=a.m;u&&!lp(a)&&(a.t=u,a.m+=f-l),o&&!cp(s)&&(s.t=o,s.m+=c-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=vp,n=!1,e=1,r=1,i=[0],o=$d,a=$d,u=$d,s=$d,c=$d;function l(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(f),i=[0],n&&t.eachBefore(Jd),t}function f(n){var e=i[n.depth],r=n.x0+e,l=n.y0+e,f=n.x1-e,h=n.y1-e;f=e-1){var l=u[n];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=s)}for(var f=c[n],h=r/2+f,d=n+1,p=e-1;d>>1;c[g]s-o){var m=r?(i*v+a*y)/r:a;t(n,d,y,i,o,m,s),t(d,e,v,m,o,a,s)}else{var _=r?(o*v+s*y)/r:s;t(n,d,y,i,o,a,_),t(d,e,v,i,_,a,s)}}(0,s,t.value,n,e,r,i)},t.treemapDice=tp,t.treemapResquarify=mp,t.treemapSlice=pp,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?pp:tp)(t,n,e,r,i)},t.treemapSquarify=vp,t.tsv=us,t.tsvFormat=Wu,t.tsvFormatBody=Zu,t.tsvFormatRow=Qu,t.tsvFormatRows=Ku,t.tsvFormatValue=Ju,t.tsvParse=$u,t.tsvParseRows=Xu,t.union=function(...t){const n=new m;for(const e of t)for(const t of e)n.add(t);return n},t.utcDay=by,t.utcDays=xy,t.utcFriday=Ey,t.utcFridays=Hy,t.utcHour=vy,t.utcHours=my,t.utcMillisecond=Tg,t.utcMilliseconds=Ag,t.utcMinute=py,t.utcMinutes=gy,t.utcMonday=ky,t.utcMondays=Py,t.utcMonth=By,t.utcMonths=qy,t.utcSaturday=Cy,t.utcSaturdays=Ry,t.utcSecond=Hg,t.utcSeconds=Rg,t.utcSunday=My,t.utcSundays=Ny,t.utcThursday=Sy,t.utcThursdays=Ly,t.utcTickInterval=Vy,t.utcTicks=Gy,t.utcTuesday=Ty,t.utcTuesdays=Dy,t.utcWednesday=Ay,t.utcWednesdays=zy,t.utcWeek=My,t.utcWeeks=Ny,t.utcYear=Oy,t.utcYears=Uy,t.variance=d,t.version="7.2.1",t.window=on,t.xml=ls,t.zip=function(){return at(arguments)},t.zoom=function(){var t,n,e,r=tw,i=nw,o=ow,a=rw,u=iw,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Gr,h=kt("start","zoom","end"),d=500,p=150,g=0,y=10;function v(t){t.property("__zoom",ew).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",A).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,n){return(n=Math.max(s[0],Math.min(s[1],n)))===t.k?t:new Wx(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Wx(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=w(t,o).event(r),u=i.apply(t,o),s=null==e?b(u):"function"==typeof e?e.apply(t,o):e,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),l=t.__zoom,h="function"==typeof n?n.apply(t,o):n,d=f(l.invert(s).concat(c/l.k),h.invert(s).concat(c/h.k));return function(t){if(1===t)t=h;else{var n=d(t),e=c/n[2];t=new Wx(e,s[0]-n[0]*e,s[1]-n[1]*e)}a.zoom(null,t)}}))}function w(t,n,e){return!e&&t.__zooming||new M(t,n)}function M(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function k(t,...n){if(r.apply(this,arguments)){var e=w(this,n).event(t),i=this.__zoom,u=Math.max(s[0],Math.min(s[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=jn(t);if(e.wheel)e.mouse[0][0]===l[0]&&e.mouse[0][1]===l[1]||(e.mouse[1]=i.invert(e.mouse[0]=l)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[l,i.invert(l)],Li(this),e.start()}Jx(t),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),p),e.zoom("mouse",o(_(m(i,u),e.mouse[0],e.mouse[1]),e.extent,c))}}function T(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=w(this,n,!0).event(t),u=On(t.view).on("mousemove.zoom",(function(t){if(Jx(t),!a.moved){var n=t.clientX-l,e=t.clientY-f;a.moved=n*n+e*e>g}a.event(t).zoom("mouse",o(_(a.that.__zoom,a.mouse[0]=jn(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),Qn(t.view,a.moved),Jx(t),a.event(t).end()}),!0),s=jn(t,i),l=t.clientX,f=t.clientY;Kn(t.view),Qx(t),a.mouse=[s,this.__zoom.invert(s)],Li(this),a.start()}}function A(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=jn(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),s=e.k*(t.shiftKey?.5:2),f=o(_(m(e,s),a,u),i.apply(this,n),c);Jx(t),l>0?On(this).transition().duration(l).call(x,f,a,t):On(this).call(v.transform,f,a,t)}}function S(e,...i){if(r.apply(this,arguments)){var o,a,u,s,c=e.touches,l=c.length,f=w(this,i,e.changedTouches.length===l).event(e);for(Qx(e),a=0;a{"use strict";var t;!function(t){t.AttentionMatrix="attention_matrix",t.SrcTokenHeatmap="query_token_heatmap",t.DestTokenHeatmap="key_token_heatmap",t.DimensionHeatmap="dimension_heatmap",t.TokenDimHeatmap="token_dim_heatmap",t.LineGrid="line_grid",t.TokenLoss="token_loss"}(t||(t={}));class n{constructor(t){this.chart_types=t.chart_types,this.src_tokens=t.src_tokens,this.tgt_tokens=t.tgt_tokens,this.dimensions=[];for(let n in t.dimensions)this.dimensions.push({name:t.dimensions[n].name});this.attention=[];for(let n in t.attention){let e=i(t.attention[n].values,t.attention[n].shape);this.attention.push({values:e,info:t.attention[n].info})}}}function r(t,n){if(1===n.length)return t;let e=[],i=n[0];n=n.slice(1);let o=t.length/i;for(let a=0;a2)throw Error("Invalid Definition: "+t);return e.length>1&&(n.classes=e.slice(1)),n}const l={h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0};let f=function(){function t(t,n){for(let e in n){let r=n[e];null!=r?t.style.setProperty(e,r):t.style.removeProperty(e)}}function n(t,n){for(let e in n){let r=e.split("|");for(let i of r)t.addEventListener(i,n[e],!1)}}function e(t,n){for(let e in n)t[e]=n[e]}let r;function i(t,n){null!=n.id&&(t.id=n.id);for(let e of n.classes)t.classList.add(e)}function a(t,n){if(null!=n.id&&(t.id=n.id),n.classes.length>0){let e=n.classes.join(" ");t.setAttribute("class",e)}}return function(){let t=o.document.createElementNS("http://www.w3.org/2000/svg","g");r=t.classList?i:a}(),function i(...a){let f,h=function(t){let n={def:null,text:null,attrs:null,func:null,parent:null};if(0==t.length)n.def=c("div");else if("string"==typeof t[0]){let e=t[0];if(function(t){if(null!=l[t])return!0;for(let n of t)if(n.toLowerCase()!==n||n.toUpperCase()===n)return!1;return!0}(e)&&t.length>1&&"string"==typeof t[1]){const n=t[1];n.length>1&&("."===n[0]||"#"===n[0])&&(e+=n,t=t.slice(1))}n.def=c(e),t=t.slice(1)}for(let e of t)switch(typeof e){case"function":n.func=e;break;case"object":e instanceof HTMLElement||e instanceof SVGElement?n.parent=e:n.attrs=e;break;case"string":n.text=e}return n}(a),d=h.parent;if(null!=this&&null!=this._elem){if(null!=d)throw Error("Cannot set a parent within a context");d=this._elem}if(null==h.def)f=d;else{let i=h.def.tag,a=s[u[i]];f=null!=a?o.document.createElementNS(a,i):o.document.createElement(i),null!=h.def&&r(f,h.def),null!=h.attrs&&function(r,i){for(let o in i){let a=i[o];switch(o){case"style":t(r,a);break;case"on":n(r,a);break;case"data":e(r,a);break;default:null!=a?r.setAttribute(o,a):r.removeAttribute(o)}}}(f,h.attrs),null!=d&&d.appendChild(f)}if(null!=h.func){let t={_elem:f};h.func(i.bind(t))}else null!=h.text&&(f.textContent=h.text);return f}}();class h{}class d extends h{constructor(t){super(),this.token=t}addClickHandler(t,n,e){this.handler=e,this.type=t,this.idx=n}render(t,n){let e={"font-size":t/2+"px"};return n&&(e["writing-mode"]="tb"),f("text",this.token,{style:e})}}function p(t,n){let e=[];for(let r=0;r{this.handler(t,n,e)},this.srcTokens=t,this.dstTokens=n,this.attentions=p(t.length,n.length),this.srcTokenElems=[];for(let n=0;n{t=n("g",".grid",{transform:`translate(${this.leftLabelsMargin}, ${this.topLabelsMargin})`}),this.srcLabels=[],n("g",".src_labels",{transform:`translate(${this.leftLabelsMargin-this.labelCellGap}, ${this.topLabelsMargin+this.cellSize/2})`},(t=>{for(let n=0;n{for(let n=0;n{t.preventDefault(),t.stopPropagation(),this.handler(this.type,this.idx,t.shiftKey)},this.token=t,this.selected=!0,this.plotColors=n}render(){return this.elem=f("div",".token",this.token),this.elem.addEventListener("click",this.onClick),this.elem}addClickHandler(t,n,e){this.handler=e,this.type=t,this.idx=n}setAttn(n){this.selected?(this.elem.style.setProperty("background",this.plotColors.getInterpolatedColor(.8*n,"src"==this.type?t.SrcTokenHeatmap:t.DestTokenHeatmap)),this.elem.style.setProperty("border-left",`3px solid ${_(this.plotColors.getInterpolatedColor(1-.8*n,"src"==this.type?t.SrcTokenHeatmap:t.DestTokenHeatmap),.5)}`)):(this.elem.style.setProperty("background",this.plotColors.getInterpolatedSecondaryColor(.8*n)),this.elem.style.setProperty("border-left",`3px solid ${_(this.plotColors.getInterpolatedSecondaryColor(1-.8*n),.5)}`)),this.elem.style.setProperty("color",this.plotColors.getInterpolatedTextColor(n)),this.elem.title=n.toExponential()}setSelection(t){this.selected=t}}class M{constructor(t,n,e){this.tokens=t,this.title=n,this.plotColors=e,this.tokenViews=[];for(let t=0;t{t("div.title",this.title)}));for(let n=0;n{t.preventDefault(),t.stopPropagation(),this.handler(this.type,this.idx,t.shiftKey)},this.value=t,this.selected=!0,this.plotColors=n}render(){return this.elem=f("div",".value",this.value),this.elem.addEventListener("click",this.onClick),this.elem}addClickHandler(t,n,e){this.handler=e,this.type=t,this.idx=n}set background(t){this.elem.style.background=t}setAttn(n){this.selected?this.elem.style.setProperty("background",this.plotColors.getInterpolatedColor(.8*n,t.DimensionHeatmap)):this.elem.style.setProperty("background",this.plotColors.getInterpolatedSecondaryColor(.8*n)),this.elem.style.setProperty("color",this.plotColors.getInterpolatedTextColor(n)),this.elem.title=n.toExponential()}setSelection(t){this.selected=t}}class T{constructor(t,n,e){this.values=t,this.name=n,this.plotColors=e,this.valueViews={};for(let t of this.values){let n=new k(t,this.plotColors);this.valueViews[t]=n}}addClickHandler(t,n){for(let e=0;e{var n;t("div",".dimension-name.title",`${n=this.name,n.split(" ").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join(" ")}`)}));for(let n=0;n{this.handler(t,n,e)},this.onDimSelect=t=>{t.preventDefault(),t.stopPropagation(),this.selectedDimension=this.dimSelectElem.value,this.renderChart(),this.tokenDim=this.handler(this.selectedDimension),this.renderAttention()},this.tokens=t,this.dimensions=n,this.handler=e,this.plotColors=r,this.tokenElems=[];for(let n=0;n{t("div",".select-container",(t=>{t("div.title.inline","Dimension",{for:"token-dim-heatmap-select"}),this.dimSelectElem=t("select","#token-dim-heatmap-select",{on:{change:this.onDimSelect}},(t=>{for(let n in this.dimensions)t("option",n,{value:n})}))}))})),this.dimSelectElem.value=this.selectedDimension,this.renderChart(),this.elem}renderChart(){let t;null!=this.chartElem&&(this.chartElem.remove(),this.chartElem=null);let n=this.dimensions[this.selectedDimension],e={width:this.cellSize*n.values.length+this.leftLabelsMargin,height:this.cellSize*this.tokens.length,viewBox:`0 0 ${this.cellSize*n.values.length+this.leftLabelsMargin} ${this.cellSize*this.tokens.length} `};this.chartElem=f("svg",".matrix",e,(n=>{t=n("g",".grid",{transform:`translate(${this.leftLabelsMargin}, 0)`});let e=[];n("g",".token_labels",{transform:`translate(${this.leftLabelsMargin-this.labelCellGap}, ${this.cellSize/2})`},(t=>{for(let n=0;n{t.preventDefault(),t.stopPropagation(),console.log("click",this.dims);for(let t of this.dims)this.handler(t.d,t.v,!1)},this.height=e,this.width=r,this.nSrc=t,this.nDst=n}render(){this.elem=f("g",".lines",{on:{click:this.onClick}},(t=>{this.bgLines=t("g"),this.fgLines=t("g")})),this.lines=[];for(let t=0;t{t.preventDefault(),t.stopPropagation(),this.dim1=this.dimSelectElem1.value,this.renderChart(),this.attentions=this.dimChangeHandler(this.dim1,this.dim2),this.renderSelection(),this.renderAttention()},this.onDim2Select=t=>{t.preventDefault(),t.stopPropagation(),this.dim2=this.dimSelectElem2.value,this.renderChart(),this.attentions=this.dimChangeHandler(this.dim1,this.dim2),this.renderSelection(),this.renderAttention()},this.srcTokens=t,this.dstTokens=n,this.dimChangeHandler=r,this.dimensions=e,this.dim1="null",this.dim2="null",this.cellWidth=80,this.cellHeight=100,this.cellMargin=10}addClickHandler(t){this.selectHanlder=t}render(){return this.elem=f("div",".line-grid",(t=>{t("div.double-select",(t=>{t("div",".select-container",(t=>{t("label.title.inline","Y Dimension",{for:"line-grid-dim2-select"}),this.dimSelectElem1=t("select","#line-grid-dim2-select",{on:{change:this.onDim1Select}},(t=>{for(let n in this.dimensions)t("option",n,{value:n});t("option","None",{value:"null"})}))})),t("div",".select-container",(t=>{t("label.title.inline","X Dimension",{for:"line-grid-dim1-select"}),this.dimSelectElem2=t("select","#line-grid-dim1-select",{on:{change:this.onDim2Select}},(t=>{for(let n in this.dimensions)t("option",n,{value:n});t("option","None",{value:"null"})}))}))}))})),this.dimSelectElem1.value=this.dim1,this.dimSelectElem2.value=this.dim2,this.renderChart(),this.elem}renderChart(){null!=this.chartElem&&(this.chartElem.remove(),this.chartElem=null);let t=m(this.dim1,this.dimensions),n=m(this.dim2,this.dimensions),e={width:this.cellWidth*n.length+this.cellMargin*(n.length-1),height:this.cellHeight*t.length+this.cellMargin*(t.length-1),viewBox:`0 0 ${this.cellWidth*n.length+this.cellMargin*(n.length-1)} ${this.cellHeight*t.length+this.cellMargin*(t.length-1)}`};this.cellLayers=[],this.chartElem=f("svg",".matrix",e,(e=>{for(let r=0;r{for(let e=0;e{if(e)this.selected[t][n]=!0!==this.selected[t][n];else if(!0===this.selected[t][n])if(this.getSelectedCount(t)>1){for(let n in this.selected[t])this.selected[t][n]=!1;this.selected[t][n]=!0}else for(let n in this.selected[t])this.selected[t][n]=!0;else{for(let n in this.selected[t])this.selected[t][n]=!1;this.selected[t][n]=!0}this.renderAttention()},this.onLineGridDimChange=(t,n)=>this.calcGridAttentionAttention(t,n),this.onTokenHeatmapDimChange=t=>this.calcTokenDimsAttention(t),this.attentions=e,this.srcTokens=new D(r),this.dstTokens=new D(i),this.chartTypes=o,this.dimensions=n,this.dimensionsMap={};for(let t of this.dimensions)this.dimensionsMap[t.name]=t;this.attentionMatrixView=new x(this.srcTokens,this.dstTokens,a),this.srcTokenHeatmap=new M(this.srcTokens,"Query Tokens",a),this.dstTokenHeatmap=new M(this.dstTokens,"Key Tokens",a),this.srcTokenHeatmap.addClickHandler("src",this.onSelected),this.dstTokenHeatmap.addClickHandler("dst",this.onSelected),this.selected={};for(let t of n){let n={};for(let r of e)!0!==n[r.info[t.name]]&&(n[r.info[t.name]]=!0);this.selected[t.name]={},t.values=[];for(let e in n)this.selected[t.name][e]=!0,t.values.push(e)}this.selected.src={};for(let t=0;t=.3&&(n=.8),L.interpolateGreys(n)}getInterpolatedSecondaryColor(t){return L.interpolateGreys(t)}getInterpolatedColor(t,n){switch(this.colorSchemes[n].toLowerCase()){case"blues":default:return L.interpolateBlues(t);case"greens":return L.interpolateGreens(t);case"greys":return L.interpolateGreys(t);case"oranges":return L.interpolateOranges(t);case"purples":return L.interpolatePurples(t);case"reds":return L.interpolateReds(t);case"bugn":return L.interpolateBuGn(t);case"bupu":return L.interpolateBuPu(t);case"gnbu":return L.interpolateGnBu(t);case"orrd":return L.interpolateOrRd(t);case"pubugn":return L.interpolatePuBuGn(t);case"pubu":return L.interpolatePuBu(t);case"purd":return L.interpolatePuRd(t);case"rdpu":return L.interpolateRdPu(t);case"ylgnbu":return L.interpolateYlGnBu(t);case"ylgn":return L.interpolateYlGn(t);case"ylorbr":return L.interpolateYlOrBr(t);case"ylorrd":return L.interpolateYlOrRd(t);case"cividis":return L.interpolateCividis(t);case"viridis":return L.interpolateViridis(t);case"inferno":return L.interpolateInferno(t);case"magma":return L.interpolateMagma(t);case"plasma":return L.interpolatePlasma(t);case"warm":return L.interpolateWarm(t);case"cool":return L.interpolateCool(t);case"cubehelixdefault":return L.interpolateCubehelixDefault(t);case"turbo":return L.interpolateTurbo(t);case"brbg":return L.interpolateBrBG(t);case"prgn":return L.interpolatePRGn(t);case"piyg":return L.interpolatePiYG(t);case"puor":return L.interpolatePuOr(t);case"rdbu":return L.interpolateRdBu(t);case"rdgy":return L.interpolateRdGy(t);case"rdylbu":return L.interpolateRdYlBu(t);case"rdylgn":return L.interpolateRdYlGn(t);case"spectral":return L.interpolateSpectral(t)}}}class R{constructor(t,n,e){this.isNewLine=/^[\n\r\v]+$/.test(t),this.token=t,this.values=n.values,this.colors=e,this.info=n.info}updateMenuPosition(){const t=this.elem.getBoundingClientRect(),n=window.innerWidth/2;t.left>n&&this.menu.classList.add("right-align")}render(){return f("div",".hover-container",(t=>{this.elem=t("pre",".token"+(this.isNewLine?".new-line":""),this.token.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\v/g,"\\v")),this.menu=t("div",".menu",(t=>{for(let n=0;n{t("div",`${this.values[n].name}: ${this.values[n].value.toExponential()}`)}));t("hr"),null!=this.info&&t("pre",this.info)}))}))}setValue(n){let e=this.values.find((t=>t.name===n));if(null==e)return;let r=e.normalizedValue;this.elem.style.setProperty("background",window.matchMedia("(prefers-color-scheme: light)").matches?this.colors.getInterpolatedColor(1-(.6*r+.4),t.TokenLoss):this.colors.getInterpolatedColor(.6*r+.4,t.TokenLoss))}}class I{constructor(t,n,e,r=!0){this.onSelectChange=()=>{this.selectedMetric=this.selectElem.value;for(let t=0;t{t("div.title","Token Visualization"),t("div.title",(t=>{this.selectElem=t("select",(t=>{}))}))}));for(let n=0;n({name:o[e],value:n[t],normalizedValue:i[e][t],info:s[t]})));f[t]={values:n,info:s[t]}}let h=new I(e,f,l,a),d=document.createElement("div");d.className="attention-visualization",d.appendChild(h.render()),document.getElementById(n).appendChild(d),h.updateMenuPosition()}})()})(); \ No newline at end of file +(()=>{var t={470:function(t,n){!function(t){"use strict";function n(t,n){return null==t||null==n?NaN:tn?1:t>=n?0:NaN}function e(t){let e=t,r=t,i=t;function o(t,n,e=0,o=t.length){if(e>>1;i(t[r],n)<0?e=r+1:o=r}while(et(n)-e,r=n,i=(e,r)=>n(t(e),r)),{left:o,center:function(t,n,r=0,i=t.length){const a=o(t,n,r,i-1);return a>r&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,n,e=0,o=t.length){if(e>>1;i(t[r],n)<=0?e=r+1:o=r}while(e=n&&++e;else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(i=+i)>=i&&++e}return e}function l(t){return 0|t.length}function f(t){return!(t>0)}function h(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function d(t,n){let e,r=0,i=0,o=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(e=n-i,i+=e/++r,o+=e*(n-i));else{let a=-1;for(let u of t)null!=(u=n(u,++a,t))&&(u=+u)>=u&&(e=u-i,i+=e/++r,o+=e*(u-i))}if(r>1)return o/(r-1)}function p(t,n){const e=d(t,n);return e?Math.sqrt(e):e}function g(t,n){let e,r;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=r=n):(e>n&&(e=n),r=o&&(e=r=o):(e>o&&(e=o),r0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}class m extends Map{constructor(t,n=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const[n,e]of t)this.set(n,e)}get(t){return super.get(_(this,t))}has(t){return super.has(_(this,t))}set(t,n){return super.set(b(this,t),n)}delete(t){return super.delete(x(this,t))}}class v extends Set{constructor(t,n=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(_(this,t))}add(t){return super.add(b(this,t))}delete(t){return super.delete(x(this,t))}}function _({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function b({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function x({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function w(t){return null!==t&&"object"==typeof t?t.valueOf():t}function M(t){return t}function k(t,...n){return N(t,M,M,n)}function T(t,...n){return N(t,Array.from,M,n)}function A(t,n){for(let e=1,r=n.length;et.pop().map((([n,e])=>[...t,n,e]))));return t}function S(t,n,...e){return N(t,M,n,e)}function E(t,n,...e){return N(t,Array.from,n,e)}function C(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function N(t,n,e,r){return function t(i,o){if(o>=r.length)return e(i);const a=new m,u=r[o++];let s=-1;for(const t of i){const n=u(t,++s,i),e=a.get(n);e?e.push(t):a.set(n,[t])}for(const[n,e]of a)a.set(n,t(e,o));return n(a)}(t,0)}function P(t,n){return Array.from(n,(n=>t[n]))}function D(t,...n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[e]=n;if(e&&2!==e.length||n.length>1){const r=Uint32Array.from(t,((t,n)=>n));return n.length>1?(n=n.map((n=>t.map(n))),r.sort(((t,e)=>{for(const r of n){const n=L(r[t],r[e]);if(n)return n}}))):(e=t.map(e),r.sort(((t,n)=>L(e[t],e[n])))),P(t,r)}return t.sort(z(e))}function z(t=n){if(t===n)return L;if("function"!=typeof t)throw new TypeError("compare is not a function");return(n,e)=>{const r=t(n,e);return r||0===r?r:(0===t(e,e))-(0===t(n,n))}}function L(t,n){return(null==t||!(t>=t))-(null==n||!(n>=n))||(tn?1:0)}var H=Array.prototype.slice;function R(t){return()=>t}var B=Math.sqrt(50),I=Math.sqrt(10),q=Math.sqrt(2);function F(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n0){let e=Math.round(t/a),r=Math.round(n/a);for(e*an&&--r,o=new Array(i=r-e+1);++un&&--r,o=new Array(i=r-e+1);++u=0?(o>=B?10:o>=I?5:o>=q?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=B?10:o>=I?5:o>=q?2:1)}function U(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=B?i*=10:o>=I?i*=5:o>=q&&(i*=2),n0?(t=Math.floor(t/i)*i,n=Math.ceil(n/i)*i):i<0&&(t=Math.ceil(t*i)/i,n=Math.floor(n*i)/i),r=i}}function G(t){return Math.ceil(Math.log(c(t))/Math.LN2)+1}function V(){var t=M,n=g,e=G;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a=r.length,u=new Array(a);for(i=0;i=f)if(t>=f&&n===g){const t=O(l,f,e);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length;h[0]<=l;)h.shift(),--d;for(;h[d-1]>f;)h.pop(),--d;var p,y=new Array(d+1);for(i=0;i<=d;++i)(p=y[i]=[]).x0=i>0?h[i-1]:l,p.x1=i=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function $(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}function X(t,n,e=0,r=t.length-1,i){for(i=void 0===i?L:z(i);r>e;){if(r-e>600){const o=r-e+1,a=n-e+1,u=Math.log(o),s=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*s*(o-s)/o)*(a-o/2<0?-1:1);X(t,n,Math.max(e,Math.floor(n-a*s/o+c)),Math.min(r,Math.floor(n+(o-a)*s/o+c)),i)}const o=t[n];let a=e,u=r;for(W(t,e,n),i(t[r],o)>0&&W(t,e,r);a0;)--u}0===i(t[e],o)?W(t,e,u):(++u,W(t,u,r)),u<=n&&(e=u+1),n<=u&&(r=u-1)}return t}function W(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function Z(t,n,e){if(r=(t=Float64Array.from(function*(t,n){if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let e=-1;for(let r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}(t,e))).length){if((n=+n)<=0||r<2)return $(t);if(n>=1)return j(t);var r,i=(r-1)*n,o=Math.floor(i),a=j(X(t,o).subarray(0,o+1));return a+($(t.subarray(o+1))-a)*(i-o)}}function K(t,n,e=r){if(i=t.length){if((n=+n)<=0||i<2)return+e(t[0],0,t);if(n>=1)return+e(t[i-1],i-1,t);var i,o=(i-1)*n,a=Math.floor(o),u=+e(t[a],a,t);return u+(+e(t[a+1],a+1,t)-u)*(o-a)}}function Q(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e=o)&&(e=o,r=i);return r}function J(t){return Array.from(function*(t){for(const n of t)yield*n}(t))}function tt(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e>n||void 0===e&&n>=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e>o||void 0===e&&o>=o)&&(e=o,r=i);return r}function nt(t,n){return[t,n]}function et(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r+t(n)}function bt(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function xt(){return!this.__axis}function wt(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,s="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===ht||t===gt?-1:1,l=t===gt||t===dt?"x":"y",f=t===ht||t===pt?mt:vt;function h(h){var d=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,p=null==i?n.tickFormat?n.tickFormat.apply(n,e):ft:i,g=Math.max(o,0)+u,y=n.range(),m=+y[0]+s,v=+y[y.length-1]+s,_=(n.bandwidth?bt:_t)(n.copy(),s),b=h.selection?h.selection():h,x=b.selectAll(".domain").data([null]),w=b.selectAll(".tick").data(d,n).order(),M=w.exit(),k=w.enter().append("g").attr("class","tick"),T=w.select("line"),A=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(k),T=T.merge(k.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),A=A.merge(k.append("text").attr("fill","currentColor").attr(l,c*g).attr("dy",t===ht?"0em":t===pt?"0.71em":"0.32em")),h!==b&&(x=x.transition(h),w=w.transition(h),T=T.transition(h),A=A.transition(h),M=M.transition(h).attr("opacity",yt).attr("transform",(function(t){return isFinite(t=_(t))?f(t+s):this.getAttribute("transform")})),k.attr("opacity",yt).attr("transform",(function(t){var n=this.parentNode.__axis;return f((n&&isFinite(n=n(t))?n:_(t))+s)}))),M.remove(),x.attr("d",t===gt||t===dt?a?"M"+c*a+","+m+"H"+s+"V"+v+"H"+c*a:"M"+s+","+m+"V"+v:a?"M"+m+","+c*a+"V"+s+"H"+v+"V"+c*a:"M"+m+","+s+"H"+v),w.attr("opacity",1).attr("transform",(function(t){return f(_(t)+s)})),T.attr(l+"2",c*o),A.attr(l,c*g).text(p),b.filter(xt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===dt?"start":t===gt?"end":"middle"),b.each((function(){this.__axis=_}))}return h.scale=function(t){return arguments.length?(n=t,h):n},h.ticks=function(){return e=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(e=null==t?[]:Array.from(t),h):e.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(u=+t,h):u},h.offset=function(t){return arguments.length?(s=+t,h):s},h}var Mt={value:()=>{}};function kt(){for(var t,n=0,e=arguments.length,r={};n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Ct.hasOwnProperty(n)?{space:Ct[n],local:t}:t}function Pt(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Et&&n.documentElement.namespaceURI===Et?n.createElement(t):n.createElementNS(e,t)}}function Dt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function zt(t){var n=Nt(t);return(n.local?Dt:Pt)(n)}function Lt(){}function Ht(t){return null==t?Lt:function(){return this.querySelector(t)}}function Rt(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function Bt(){return[]}function It(t){return null==t?Bt:function(){return this.querySelectorAll(t)}}function qt(t){return function(){return this.matches(t)}}function Ft(t){return function(n){return n.matches(t)}}var Ot=Array.prototype.find;function Ut(){return this.firstElementChild}var Yt=Array.prototype.filter;function Gt(){return Array.from(this.children)}function Vt(t){return new Array(t.length)}function jt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function $t(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;un?1:t>=n?0:NaN}function Qt(t){return function(){this.removeAttribute(t)}}function Jt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tn(t,n){return function(){this.setAttribute(t,n)}}function nn(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function en(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function rn(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function on(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function an(t){return function(){this.style.removeProperty(t)}}function un(t,n,e){return function(){this.style.setProperty(t,n,e)}}function sn(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function cn(t,n){return t.style.getPropertyValue(n)||on(t).getComputedStyle(t,null).getPropertyValue(n)}function ln(t){return function(){delete this[t]}}function fn(t,n){return function(){this[t]=n}}function hn(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function dn(t){return t.trim().split(/^|\s+/)}function pn(t){return t.classList||new gn(t)}function gn(t){this._node=t,this._names=dn(t.getAttribute("class")||"")}function yn(t,n){for(var e=pn(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var In=[null];function qn(t,n){this._groups=t,this._parents=n}function Fn(){return new qn([[document.documentElement]],In)}function On(t){return"string"==typeof t?new qn([[document.querySelector(t)]],[document.documentElement]):new qn([[t]],In)}qn.prototype=Fn.prototype={constructor:qn,select:function(t){"function"!=typeof t&&(t=Ht(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=b&&(b=_+1);!(v=y[b])&&++b=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Kt);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?an:"function"==typeof n?sn:un)(t,n,null==e?"":e)):cn(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?ln:"function"==typeof n?hn:fn)(t,n)):this.node()[t]},classed:function(t,n){var e=dn(t+"");if(arguments.length<2){for(var r=pn(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Ln:zn,r=0;r()=>t;function te(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,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:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function ne(t){return!t.ctrlKey&&!t.button}function ee(){return this.parentNode}function re(t,n){return null==n?{x:t.x,y:t.y}:n}function ie(){return navigator.maxTouchPoints||"ontouchstart"in this}function oe(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function ae(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function ue(){}te.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var se=.7,ce=1/se,le="\\s*([+-]?\\d+)\\s*",fe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",he="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",de=/^#([0-9a-f]{3,8})$/,pe=new RegExp("^rgb\\("+[le,le,le]+"\\)$"),ge=new RegExp("^rgb\\("+[he,he,he]+"\\)$"),ye=new RegExp("^rgba\\("+[le,le,le,fe]+"\\)$"),me=new RegExp("^rgba\\("+[he,he,he,fe]+"\\)$"),ve=new RegExp("^hsl\\("+[fe,he,he]+"\\)$"),_e=new RegExp("^hsla\\("+[fe,he,he,fe]+"\\)$"),be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xe(){return this.rgb().formatHex()}function we(){return this.rgb().formatRgb()}function Me(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=de.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?ke(n):3===e?new Ee(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Te(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Te(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=pe.exec(t))?new Ee(n[1],n[2],n[3],1):(n=ge.exec(t))?new Ee(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ye.exec(t))?Te(n[1],n[2],n[3],n[4]):(n=me.exec(t))?Te(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=ve.exec(t))?De(n[1],n[2]/100,n[3]/100,1):(n=_e.exec(t))?De(n[1],n[2]/100,n[3]/100,n[4]):be.hasOwnProperty(t)?ke(be[t]):"transparent"===t?new Ee(NaN,NaN,NaN,0):null}function ke(t){return new Ee(t>>16&255,t>>8&255,255&t,1)}function Te(t,n,e,r){return r<=0&&(t=n=e=NaN),new Ee(t,n,e,r)}function Ae(t){return t instanceof ue||(t=Me(t)),t?new Ee((t=t.rgb()).r,t.g,t.b,t.opacity):new Ee}function Se(t,n,e,r){return 1===arguments.length?Ae(t):new Ee(t,n,e,null==r?1:r)}function Ee(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Ce(){return"#"+Pe(this.r)+Pe(this.g)+Pe(this.b)}function Ne(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Pe(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function De(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new He(t,n,e,r)}function ze(t){if(t instanceof He)return new He(t.h,t.s,t.l,t.opacity);if(t instanceof ue||(t=Me(t)),!t)return new He;if(t instanceof He)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&s<1?0:a,new He(a,u,s,t.opacity)}function Le(t,n,e,r){return 1===arguments.length?ze(t):new He(t,n,e,null==r?1:r)}function He(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Re(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}oe(ue,Me,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xe,formatHex:xe,formatHsl:function(){return ze(this).formatHsl()},formatRgb:we,toString:we}),oe(Ee,Se,ae(ue,{brighter:function(t){return t=null==t?ce:Math.pow(ce,t),new Ee(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?se:Math.pow(se,t),new Ee(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ce,formatHex:Ce,formatRgb:Ne,toString:Ne})),oe(He,Le,ae(ue,{brighter:function(t){return t=null==t?ce:Math.pow(ce,t),new He(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?se:Math.pow(se,t),new He(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Ee(Re(t>=240?t-240:t+120,i,r),Re(t,i,r),Re(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const Be=Math.PI/180,Ie=180/Math.PI,qe=.96422,Fe=1,Oe=.82521,Ue=4/29,Ye=6/29,Ge=3*Ye*Ye,Ve=Ye*Ye*Ye;function je(t){if(t instanceof Xe)return new Xe(t.l,t.a,t.b,t.opacity);if(t instanceof nr)return er(t);t instanceof Ee||(t=Ae(t));var n,e,r=Qe(t.r),i=Qe(t.g),o=Qe(t.b),a=We((.2225045*r+.7168786*i+.0606169*o)/Fe);return r===i&&i===o?n=e=a:(n=We((.4360747*r+.3850649*i+.1430804*o)/qe),e=We((.0139322*r+.0971045*i+.7141733*o)/Oe)),new Xe(116*a-16,500*(n-a),200*(a-e),t.opacity)}function $e(t,n,e,r){return 1===arguments.length?je(t):new Xe(t,n,e,null==r?1:r)}function Xe(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function We(t){return t>Ve?Math.pow(t,1/3):t/Ge+Ue}function Ze(t){return t>Ye?t*t*t:Ge*(t-Ue)}function Ke(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Je(t){if(t instanceof nr)return new nr(t.h,t.c,t.l,t.opacity);if(t instanceof Xe||(t=je(t)),0===t.a&&0===t.b)return new nr(NaN,0=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r()=>t;function mr(t,n){return function(e){return t+e*n}}function vr(t,n){var e=n-t;return e?mr(t,e>180||e<-180?e-360*Math.round(e/360):e):yr(isNaN(t)?n:t)}function _r(t){return 1==(t=+t)?br:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):yr(isNaN(n)?e:n)}}function br(t,n){var e=n-t;return e?mr(t,e):yr(isNaN(t)?n:t)}var xr=function t(n){var e=_r(n);function r(t,n){var r=e((t=Se(t)).r,(n=Se(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=br(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function wr(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:Cr(e,r)})),o=Dr.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Cr(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Cr(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,s),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Cr(t,e)},{i:u-2,x:Cr(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var n,e=-1,r=s.length;++e=0&&n._call.call(void 0,t),n=n._next;--ri}function mi(){si=(ui=li.now())+ci,ri=ii=0;try{yi()}finally{ri=0,function(){for(var t,n,e=ni,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:ni=n);ei=t,_i(r)}(),si=0}}function vi(){var t=li.now(),n=t-ui;n>ai&&(ci-=n,ui=t)}function _i(t){ri||(ii&&(ii=clearTimeout(ii)),t-si>24?(t<1/0&&(ii=setTimeout(mi,t-li.now()-ci)),oi&&(oi=clearInterval(oi))):(oi||(ui=li.now(),oi=setInterval(vi,ai)),ri=1,fi(mi)))}function bi(t,n,e){var r=new pi;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}pi.prototype=gi.prototype={constructor:pi,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?hi():+e)+(null==n?0:+n),this._next||ei===this||(ei?ei._next=this:ni=this,ei=this),this._call=t,this._time=e,_i()},stop:function(){this._call&&(this._call=null,this._time=1/0,_i())}};var xi=kt("start","end","cancel","interrupt"),wi=[],Mi=0,ki=1,Ti=2,Ai=3,Si=4,Ei=5,Ci=6;function Ni(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=ki,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var c,l,f,h;if(e.state!==ki)return s();for(c in i)if((h=i[c]).name===e.name){if(h.state===Ai)return bi(a);h.state===Si?(h.state=Ci,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+cMi)throw new Error("too late; already scheduled");return e}function Di(t,n){var e=zi(t,n);if(e.state>Ai)throw new Error("too late; already running");return e}function zi(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Li(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>Ti&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Pi:Di;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=Nt(t),r="transform"===e?Ur:Ii;return this.attrTween(t,"function"==typeof n?(e.local?Gi:Yi)(e,r,Bi(this,"attr."+t,n)):null==n?(e.local?Fi:qi)(e):(e.local?Ui:Oi)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Nt(t);return this.tween(e,(r.local?Vi:ji)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Or:Ii;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=cn(this,t),a=(this.style.removeProperty(t),cn(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,Qi(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=cn(this,t),u=e(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=cn(this,t)),a===s?null:a===r&&s===i?o:(i=s,o=n(r=a,u))}}(t,r,Bi(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var s=Di(this,t),c=s.on,l=null==s.value[a]?o||(o=Qi(n)):void 0;c===e&&i===l||(r=(e=c).copy()).on(u,i=l),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=cn(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Bi(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=zi(this.node(),e).tween,o=0,a=i.length;o()=>t;function qo(t,{sourceEvent:n,target:e,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Fo(t){t.preventDefault(),t.stopImmediatePropagation()}var Oo={name:"drag"},Uo={name:"space"},Yo={name:"handle"},Go={name:"center"};const{abs:Vo,max:jo,min:$o}=Math;function Xo(t){return[+t[0],+t[1]]}function Wo(t){return[Xo(t[0]),Xo(t[1])]}var Zo={name:"x",handles:["w","e"].map(ia),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Ko={name:"y",handles:["n","s"].map(ia),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Qo={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(ia),input:function(t){return null==t?null:Wo(t)},output:function(t){return t}},Jo={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"},ta={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},na={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ea={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ra={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ia(t){return{type:t}}function oa(t){return!t.ctrlKey&&!t.button}function aa(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function ua(){return navigator.maxTouchPoints||"ontouchstart"in this}function sa(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ca(t){var n,e=aa,r=oa,i=ua,o=!0,a=kt("start","brush","end"),u=6;function s(n){var e=n.property("__brush",g).selectAll(".overlay").data([ia("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Jo.overlay).merge(e).each((function(){var t=sa(this).extent;On(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([ia("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Jo.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Jo[t.type]})),n.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=On(this),n=sa(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,n,e){var r=t.__brush.emitter;return!r||e&&r.clean?new f(t,n,e):r}function f(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function h(e){if((!n||e.touches)&&r.apply(this,arguments)){var i,a,u,s,f,h,d,p,g,y,m,v=this,_=e.target.__data__.type,b="selection"===(o&&e.metaKey?_="overlay":_)?Oo:o&&e.altKey?Go:Yo,x=t===Ko?null:ea[_],w=t===Zo?null:ra[_],M=sa(v),k=M.extent,T=M.selection,A=k[0][0],S=k[0][1],E=k[1][0],C=k[1][1],N=0,P=0,D=x&&w&&o&&e.shiftKey,z=Array.from(e.touches||[e],(t=>{const n=t.identifier;return(t=jn(t,v)).point0=t.slice(),t.identifier=n,t}));Li(v);var L=l(v,arguments,!0).beforestart();if("overlay"===_){T&&(g=!0);const n=[z[0],z[1]||z[0]];M.selection=T=[[i=t===Ko?A:$o(n[0][0],n[1][0]),u=t===Zo?S:$o(n[0][1],n[1][1])],[f=t===Ko?E:jo(n[0][0],n[1][0]),d=t===Zo?C:jo(n[0][1],n[1][1])]],z.length>1&&q(e)}else i=T[0][0],u=T[0][1],f=T[1][0],d=T[1][1];a=i,s=u,h=f,p=d;var H=On(v).attr("pointer-events","none"),R=H.selectAll(".overlay").attr("cursor",Jo[_]);if(e.touches)L.moved=I,L.ended=F;else{var B=On(e.view).on("mousemove.brush",I,!0).on("mouseup.brush",F,!0);o&&B.on("keydown.brush",(function(t){switch(t.keyCode){case 16:D=x&&w;break;case 18:b===Yo&&(x&&(f=h-N*x,i=a+N*x),w&&(d=p-P*w,u=s+P*w),b=Go,q(t));break;case 32:b!==Yo&&b!==Go||(x<0?f=h-N:x>0&&(i=a-N),w<0?d=p-P:w>0&&(u=s-P),b=Uo,R.attr("cursor",Jo.selection),q(t));break;default:return}Fo(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:D&&(y=m=D=!1,q(t));break;case 18:b===Go&&(x<0?f=h:x>0&&(i=a),w<0?d=p:w>0&&(u=s),b=Yo,q(t));break;case 32:b===Uo&&(t.altKey?(x&&(f=h-N*x,i=a+N*x),w&&(d=p-P*w,u=s+P*w),b=Go):(x<0?f=h:x>0&&(i=a),w<0?d=p:w>0&&(u=s),b=Yo),R.attr("cursor",Jo[_]),q(t));break;default:return}Fo(t)}),!0),Kn(e.view)}c.call(v),L.start(e,b.name)}function I(t){for(const n of t.changedTouches||[t])for(const t of z)t.identifier===n.identifier&&(t.cur=jn(n,v));if(D&&!y&&!m&&1===z.length){const t=z[0];Vo(t.cur[0]-t[0])>Vo(t.cur[1]-t[1])?m=!0:y=!0}for(const t of z)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,Fo(t),q(t)}function q(t){const n=z[0],e=n.point0;var r;switch(N=n[0]-e[0],P=n[1]-e[1],b){case Uo:case Oo:x&&(N=jo(A-i,$o(E-f,N)),a=i+N,h=f+N),w&&(P=jo(S-u,$o(C-d,P)),s=u+P,p=d+P);break;case Yo:z[1]?(x&&(a=jo(A,$o(E,z[0][0])),h=jo(A,$o(E,z[1][0])),x=1),w&&(s=jo(S,$o(C,z[0][1])),p=jo(S,$o(C,z[1][1])),w=1)):(x<0?(N=jo(A-i,$o(E-i,N)),a=i+N,h=f):x>0&&(N=jo(A-f,$o(E-f,N)),a=i,h=f+N),w<0?(P=jo(S-u,$o(C-u,P)),s=u+P,p=d):w>0&&(P=jo(S-d,$o(C-d,P)),s=u,p=d+P));break;case Go:x&&(a=jo(A,$o(E,i-N*x)),h=jo(A,$o(E,f+N*x))),w&&(s=jo(S,$o(C,u-P*w)),p=jo(S,$o(C,d+P*w)))}ht+e))}function _a(t,n){var e=0,r=null,i=null,o=null;function a(a){var u,s=a.length,c=new Array(s),l=va(0,s),f=new Array(s*s),h=new Array(s),d=0;a=Float64Array.from({length:s*s},n?(t,n)=>a[n%s][n/s|0]:(t,n)=>a[n/s|0][n%s]);for(let n=0;nr(c[t],c[n])));for(const e of l){const r=n;if(t){const t=va(1+~s,s).filter((t=>t<0?a[~t*s+e]:a[e*s+t]));i&&t.sort(((t,n)=>i(t<0?-a[~t*s+e]:a[e*s+t],n<0?-a[~n*s+e]:a[e*s+n])));for(const r of t)r<0?(f[~r*s+e]||(f[~r*s+e]={source:null,target:null})).target={index:e,startAngle:n,endAngle:n+=a[~r*s+e]*d,value:a[~r*s+e]}:(f[e*s+r]||(f[e*s+r]={source:null,target:null})).source={index:e,startAngle:n,endAngle:n+=a[e*s+r]*d,value:a[e*s+r]};h[e]={index:e,startAngle:r,endAngle:n,value:c[e]}}else{const t=va(0,s).filter((t=>a[e*s+t]||a[t*s+e]));i&&t.sort(((t,n)=>i(a[e*s+t],a[e*s+n])));for(const r of t){let t;if(ewa)if(Math.abs(l*u-s*c)>wa&&i){var h=e-o,d=r-a,p=u*u+s*s,g=h*h+d*d,y=Math.sqrt(p),m=Math.sqrt(f),v=i*Math.tan((ba-Math.acos((p+f-g)/(2*y*m)))/2),_=v/m,b=v/y;Math.abs(_-1)>wa&&(this._+="L"+(t+_*c)+","+(n+_*l)),this._+="A"+i+","+i+",0,0,"+ +(l*h>c*d)+","+(this._x1=t+b*u)+","+(this._y1=n+b*s)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,r,i,o){t=+t,n=+n,o=!!o;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),s=t+a,c=n+u,l=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>wa||Math.abs(this._y1-c)>wa)&&(this._+="L"+s+","+c),e&&(f<0&&(f=f%xa+xa),f>Ma?this._+="A"+e+","+e+",0,1,"+l+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+l+","+(this._x1=s)+","+(this._y1=c):f>wa&&(this._+="A"+e+","+e+",0,"+ +(f>=ba)+","+l+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Aa=Array.prototype.slice;function Sa(t){return function(){return t}}function Ea(t){return t.source}function Ca(t){return t.target}function Na(t){return t.radius}function Pa(t){return t.startAngle}function Da(t){return t.endAngle}function za(){return 0}function La(){return 10}function Ha(t){var n=Ea,e=Ca,r=Na,i=Na,o=Pa,a=Da,u=za,s=null;function c(){var c,l=n.apply(this,arguments),f=e.apply(this,arguments),h=u.apply(this,arguments)/2,d=Aa.call(arguments),p=+r.apply(this,(d[0]=l,d)),g=o.apply(this,d)-pa,y=a.apply(this,d)-pa,m=+i.apply(this,(d[0]=f,d)),v=o.apply(this,d)-pa,_=a.apply(this,d)-pa;if(s||(s=c=Ta()),h>ma&&(la(y-g)>2*h+ma?y>g?(g+=h,y-=h):(g-=h,y+=h):g=y=(g+y)/2,la(_-v)>2*h+ma?_>v?(v+=h,_-=h):(v-=h,_+=h):v=_=(v+_)/2),s.moveTo(p*fa(g),p*ha(g)),s.arc(0,0,p,g,y),g!==v||y!==_)if(t){var b=m-+t.apply(this,arguments),x=(v+_)/2;s.quadraticCurveTo(0,0,b*fa(v),b*ha(v)),s.lineTo(m*fa(x),m*ha(x)),s.lineTo(b*fa(_),b*ha(_))}else s.quadraticCurveTo(0,0,m*fa(v),m*ha(v)),s.arc(0,0,m,v,_);if(s.quadraticCurveTo(0,0,p*fa(g),p*ha(g)),s.closePath(),c)return s=null,c+""||null}return t&&(c.headRadius=function(n){return arguments.length?(t="function"==typeof n?n:Sa(+n),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:Sa(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:Sa(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:Sa(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Sa(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Sa(+t),c):a},c.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:Sa(+t),c):u},c.source=function(t){return arguments.length?(n=t,c):n},c.target=function(t){return arguments.length?(e=t,c):e},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}var Ra=Array.prototype.slice;function Ba(t,n){return t-n}var Ia=t=>()=>t;function qa(t,n){for(var e,r=-1,i=n.length;++rr!=d>r&&e<(h-c)*(r-l)/(d-l)+c&&(i=-i)}return i}function Oa(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function Ua(){}var Ya=[[],[[[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 Ga(){var t=1,n=1,e=G,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(Ba);else{const e=g(t),r=U(e[0],e[1],n);n=F(Math.floor(e[0]/r)*r,Math.floor(e[1]/r-1)*r,n)}return n.map((n=>o(t,n)))}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,s,c,l,f,h=new Array,d=new Array;for(o=u=-1,c=e[0]>=r,Ya[c<<1].forEach(p);++o=r,Ya[s|c<<1].forEach(p);for(Ya[0|c].forEach(p);++u=r,l=e[u*t]>=r,Ya[c<<1|l<<2].forEach(p);++o=r,f=l,l=e[u*t+o+1]>=r,Ya[s|c<<1|l<<2|f<<3].forEach(p);Ya[c|l<<3].forEach(p)}for(o=-1,l=e[u*t]>=r,Ya[l<<2].forEach(p);++o=r,Ya[l<<2|f<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],s=[t[1][0]+o,t[1][1]+u],c=a(r),l=a(s);(n=d[c])?(e=h[l])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(s),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(s),d[n.end=l]=n):(n=h[l])?(e=d[c])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(s),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=c]=n):h[c]=d[l]={start:c,end:l,ring:[r,s]}}Ya[l<<3].forEach(p)}(e,i,(function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)})),u.forEach((function(t){for(var n,e=0,r=o.length;e0&&a0&&u=0&&o>=0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?Ia(Ra.call(t)):Ia(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:Ua,i):r===u},i}function Va(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(s-=t.data[u-o+a*r]),n.data[u-e+a*r]=s/Math.min(u+1,r-1+o-u,o))}function ja(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(s-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=s/Math.min(u+1,i-1+o-u,o))}function $a(t){return t[0]}function Xa(t){return t[1]}function Wa(){return 1}const Za=134217729,Ka=33306690738754706e-32;function Qa(t,n,e,r,i){let o,a,u,s,c=n[0],l=r[0],f=0,h=0;l>c==l>-c?(o=c,c=n[++f]):(o=l,l=r[++h]);let d=0;if(fc==l>-c?(a=c+o,u=o-(a-c),c=n[++f]):(a=l+o,u=o-(a-l),l=r[++h]),o=a,0!==u&&(i[d++]=u);fc==l>-c?(a=o+c,s=a-o,u=o-(a-s)+(c-s),c=n[++f]):(a=o+l,s=a-o,u=o-(a-s)+(l-s),l=r[++h]),o=a,0!==u&&(i[d++]=u);for(;f0!=u>0)return s;const c=Math.abs(a+u);return Math.abs(s)>=33306690738754716e-32*c?s:-function(t,n,e,r,i,o,a){let u,s,c,l,f,h,d,p,g,y,m,v,_,b,x,w,M,k;const T=t-i,A=e-i,S=n-o,E=r-o;b=T*E,h=Za*T,d=h-(h-T),p=T-d,h=Za*E,g=h-(h-E),y=E-g,x=p*y-(b-d*g-p*g-d*y),w=S*A,h=Za*S,d=h-(h-S),p=S-d,h=Za*A,g=h-(h-A),y=A-g,M=p*y-(w-d*g-p*g-d*y),m=x-M,f=x-m,eu[0]=x-(m+f)+(f-M),v=b+m,f=v-b,_=b-(v-f)+(m-f),m=_-w,f=_-m,eu[1]=_-(m+f)+(f-w),k=v+m,f=k-v,eu[2]=v-(k-f)+(m-f),eu[3]=k;let C=function(t,n){let e=n[0];for(let r=1;r=N||-C>=N)return C;if(f=t-T,u=t-(T+f)+(f-i),f=e-A,c=e-(A+f)+(f-i),f=n-S,s=n-(S+f)+(f-o),f=r-E,l=r-(E+f)+(f-o),0===u&&0===s&&0===c&&0===l)return C;if(N=nu*a+Ka*Math.abs(C),C+=T*l+E*u-(S*c+A*s),C>=N||-C>=N)return C;b=u*E,h=Za*u,d=h-(h-u),p=u-d,h=Za*E,g=h-(h-E),y=E-g,x=p*y-(b-d*g-p*g-d*y),w=s*A,h=Za*s,d=h-(h-s),p=s-d,h=Za*A,g=h-(h-A),y=A-g,M=p*y-(w-d*g-p*g-d*y),m=x-M,f=x-m,au[0]=x-(m+f)+(f-M),v=b+m,f=v-b,_=b-(v-f)+(m-f),m=_-w,f=_-m,au[1]=_-(m+f)+(f-w),k=v+m,f=k-v,au[2]=v-(k-f)+(m-f),au[3]=k;const P=Qa(4,eu,4,au,ru);b=T*l,h=Za*T,d=h-(h-T),p=T-d,h=Za*l,g=h-(h-l),y=l-g,x=p*y-(b-d*g-p*g-d*y),w=S*c,h=Za*S,d=h-(h-S),p=S-d,h=Za*c,g=h-(h-c),y=c-g,M=p*y-(w-d*g-p*g-d*y),m=x-M,f=x-m,au[0]=x-(m+f)+(f-M),v=b+m,f=v-b,_=b-(v-f)+(m-f),m=_-w,f=_-m,au[1]=_-(m+f)+(f-w),k=v+m,f=k-v,au[2]=v-(k-f)+(m-f),au[3]=k;const D=Qa(P,ru,4,au,iu);b=u*l,h=Za*u,d=h-(h-u),p=u-d,h=Za*l,g=h-(h-l),y=l-g,x=p*y-(b-d*g-p*g-d*y),w=s*c,h=Za*s,d=h-(h-s),p=s-d,h=Za*c,g=h-(h-c),y=c-g,M=p*y-(w-d*g-p*g-d*y),m=x-M,f=x-m,au[0]=x-(m+f)+(f-M),v=b+m,f=v-b,_=b-(v-f)+(m-f),m=_-w,f=_-m,au[1]=_-(m+f)+(f-w),k=v+m,f=k-v,au[2]=v-(k-f)+(m-f),au[3]=k;const z=Qa(D,iu,4,au,ou);return ou[z-1]}(t,n,e,r,i,o,c)}const su=Math.pow(2,-52),cu=new Uint32Array(512);class lu{static from(t,n=yu,e=mu){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const e=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*e),this._halfedges=new Int32Array(3*e),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).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:e,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,s=-1/0,c=-1/0;for(let n=0;ns&&(s=e),r>c&&(c=r),this._ids[n]=n}const l=(a+s)/2,f=(u+c)/2;let h,d,p,g=1/0;for(let n=0;n0&&(d=n,g=e)}let v=t[2*d],_=t[2*d+1],b=1/0;for(let n=0;nr&&(n[e++]=i,r=this._dists[i])}return this.hull=n.subarray(0,e),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(uu(y,m,v,_,x,w)<0){const t=d,n=v,e=_;d=p,v=x,_=w,p=t,x=n,w=e}const M=function(t,n,e,r,i,o){const a=e-t,u=r-n,s=i-t,c=o-n,l=a*a+u*u,f=s*s+c*c,h=.5/(a*c-u*s);return{x:t+(c*l-u*f)*h,y:n+(a*f-s*l)*h}}(y,m,v,_,x,w);this._cx=M.x,this._cy=M.y;for(let n=0;n0&&Math.abs(c-o)<=su&&Math.abs(l-a)<=su)continue;if(o=c,a=l,s===h||s===d||s===p)continue;let f=0;for(let t=0,n=this._hashKey(c,l);t=0;)if(y=g,y===f){y=-1;break}if(-1===y)continue;let m=this._addTriangle(y,s,e[y],-1,-1,r[y]);r[s]=this._legalize(m+2),r[y]=m,k++;let v=e[y];for(;g=e[v],uu(c,l,t[2*v],t[2*v+1],t[2*g],t[2*g+1])<0;)m=this._addTriangle(v,s,g,r[s],-1,r[v]),r[s]=this._legalize(m+2),e[v]=v,k--,v=g;if(y===f)for(;g=n[y],uu(c,l,t[2*g],t[2*g+1],t[2*y],t[2*y+1])<0;)m=this._addTriangle(g,s,y,-1,r[y],r[g]),this._legalize(m+2),r[g]=m,e[y]=y,k--,y=g;this._hullStart=n[s]=y,e[y]=n[v]=s,e[s]=v,i[this._hashKey(c,l)]=s,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(k);for(let t=0,n=this._hullStart;t0?3-e:1+e)/4}(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:e,coords:r}=this;let i=0,o=0;for(;;){const a=e[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=cu[--i];continue}const s=a-a%3,c=u+(t+1)%3,l=s+(a+2)%3,f=n[o],h=n[t],d=n[c],p=n[l];if(hu(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=f;const r=e[l];if(-1===r){let n=this._hullStart;do{if(this._hullTri[n]===l){this._hullTri[n]=t;break}n=this._hullPrev[n]}while(n!==this._hullStart)}this._link(t,r),this._link(a,e[o]),this._link(o,l);const u=s+(a+1)%3;i=e&&n[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=e+1,o=r;gu(t,e+r>>1,i),n[t[e]]>n[t[r]]&&gu(t,e,r),n[t[i]]>n[t[r]]&&gu(t,i,r),n[t[e]]>n[t[i]]&&gu(t,e,i);const a=t[i],u=n[a];for(;;){do{i++}while(n[t[i]]u);if(o=o-e?(pu(t,n,i,r),pu(t,n,e,o-1)):(pu(t,n,e,o-1),pu(t,n,i,r))}}function gu(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function yu(t){return t[0]}function mu(t){return t[1]}const vu=1e-6;class _u{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,e){const r=(t=+t)+(e=+e),i=n=+n;if(e<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>vu||Math.abs(this._y1-i)>vu)&&(this._+="L"+r+","+i),e&&(this._+=`A${e},${e},0,1,1,${t-e},${n}A${e},${e},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,n,e,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+e}v${+r}h${-e}Z`}value(){return this._||null}}class bu{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class xu{constructor(t,[n,e,r,i]=[0,0,960,500]){if(!((r=+r)>=(n=+n)&&(i=+i)>=(e=+e)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=n,this.ymax=i,this.ymin=e,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:e},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,e.length/3*2);for(let n,r,o=0,a=0,u=e.length;o1;)i-=2;for(let t=2;t4)for(let t=0;t0){if(n>=this.ymax)return null;(i=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/e)this.xmax?2:0)|(nthis.ymax?8:0)}}const wu=2*Math.PI,Mu=Math.pow;function ku(t){return t[0]}function Tu(t){return t[1]}function Au(t,n,e){return[t+Math.sin(t+n)*e,n+Math.cos(t-n)*e]}class Su{static from(t,n=ku,e=Tu,r){return new Su("length"in t?function(t,n,e,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a2&&function(t){const{triangles:n,coords:e}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:n.length/2},((t,n)=>n)).sort(((t,e)=>n[2*t]-n[2*e]||n[2*t+1]-n[2*e+1]));const t=this.collinear[0],e=this.collinear[this.collinear.length-1],r=[n[2*t],n[2*t+1],n[2*e],n[2*e+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,e=n.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new xu(this,t)}*neighbors(t){const{inedges:n,hull:e,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const n=a.indexOf(t);return n>0&&(yield a[n-1]),void(n=0&&i!==e&&i!==r;)e=i;return i}_step(t,n,e){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:s}=this;if(-1===r[t]||!s.length)return(t+1)%(s.length>>1);let c=t,l=Mu(n-s[2*t],2)+Mu(e-s[2*t+1],2);const f=r[t];let h=f;do{let r=u[h];const f=Mu(n-s[2*r],2)+Mu(e-s[2*r+1],2);if(f9999?"+"+Hu(t,6):Hu(t,4)}(t.getUTCFullYear())+"-"+Hu(t.getUTCMonth()+1,2)+"-"+Hu(t.getUTCDate(),2)+(i?"T"+Hu(n,2)+":"+Hu(e,2)+":"+Hu(r,2)+"."+Hu(i,3)+"Z":r?"T"+Hu(n,2)+":"+Hu(e,2)+":"+Hu(r,2)+"Z":e||n?"T"+Hu(n,2)+":"+Hu(e,2)+"Z":"")}function Bu(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,s=o<=0,c=!1;function l(){if(s)return Cu;if(c)return c=!1,Eu;var n,r,i=a;if(t.charCodeAt(i)===Nu){for(;a++=o?s=!0:(r=t.charCodeAt(a++))===Pu?c=!0:r===Du&&(c=!0,t.charCodeAt(a)===Pu&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;ais(n,e).then((n=>(new DOMParser).parseFromString(n,t)))}var ls=cs("application/xml"),fs=cs("text/html"),hs=cs("image/svg+xml");function ds(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,s,c,l,f,h,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=n>=(o=(g+m)/2))?g=o:m=o,(l=e>=(a=(y+v)/2))?y=a:v=a,i=d,!(d=d[f=l<<1|c]))return i[f]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),n===u&&e===s)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=n>=(o=(g+m)/2))?g=o:m=o,(l=e>=(a=(y+v)/2))?y=a:v=a}while((f=l<<1|c)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[f]=p,t}function ps(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function gs(t){return t[0]}function ys(t){return t[1]}function ms(t,n,e){var r=new vs(null==n?gs:n,null==e?ys:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function vs(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function _s(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var bs=ms.prototype=vs.prototype;function xs(t){return function(){return t}}function ws(t){return 1e-6*(t()-.5)}function Ms(t){return t.x+t.vx}function ks(t){return t.y+t.vy}function Ts(t){return t.index}function As(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}bs.copy=function(){var t,n,e=new vs(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=_s(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=_s(n));return e},bs.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return ds(this.cover(n,e),n,e,t)},bs.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,l=-1/0,f=-1/0;for(e=0;el&&(l=r),if&&(f=i));if(s>l||c>f)return this;for(this.cover(s,c).cover(l,f),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=s.y0)>d||(a=s.x1)=m)<<1|t>=y)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var v=t-+this._x.call(null,g.data),_=n-+this._y.call(null,g.data),b=v*v+_*_;if(b=(u=(p+y)/2))?p=u:y=u,(l=a>=(s=(g+m)/2))?g=s:m=s,n=d,!(d=d[f=l<<1|c]))return this;if(!d.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[f]=i:delete n[f],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},bs.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function Ls(t){return(t=zs(Math.abs(t)))?t[1]:NaN}var Hs,Rs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bs(t){if(!(n=Rs.exec(t)))throw new Error("invalid format: "+t);var n;return new Is({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function Is(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function qs(t,n){var e=zs(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Bs.prototype=Is.prototype,Is.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Fs={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>qs(100*t,n),r:qs,s:function(t,n){var e=zs(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Hs=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+zs(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Os(t){return t}var Us,Ys=Array.prototype.map,Gs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vs(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?Os:(n=Ys.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Os:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(Ys.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var n=(t=Bs(t)).fill,e=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,m=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Fs[v]||(void 0===y&&(y=12),m=!0,v="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===h?o:/[%p]/.test(v)?s:"",x=Fs[v],w=/[defgprs%]/.test(v);function M(t){var i,o,s,h=_,M=b;if("c"===v)M=x(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:x(Math.abs(t),y),m&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),k&&0==+t&&"+"!==f&&(k=!1),h=(k?"("===f?f:c:"-"===f||"("===f?"":f)+h,M=("s"===v?Gs[8+Hs/3]:"")+M+(k&&"("===f?")":""),w)for(i=-1,o=t.length;++i(s=t.charCodeAt(i))||s>57){M=(46===s?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var T=h.length+t.length+M.length,A=T>1)+h+t+M+A.slice(T);break;default:t=A+h+t+M}return u(t)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,n){var e=f(((t=Bs(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Ls(n)/3))),i=Math.pow(10,-r),o=Gs[8+r/3];return function(t){return e(i*t)+o}}}}function js(n){return Us=Vs(n),t.format=Us.format,t.formatPrefix=Us.formatPrefix,Us}function $s(t){return Math.max(0,-Ls(Math.abs(t)))}function Xs(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ls(n)/3)))-Ls(Math.abs(t)))}function Ws(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Ls(n)-Ls(t))+1}t.format=void 0,t.formatPrefix=void 0,js({thousands:",",grouping:[3],currency:["$",""]});var Zs=1e-6,Ks=1e-12,Qs=Math.PI,Js=Qs/2,tc=Qs/4,nc=2*Qs,ec=180/Qs,rc=Qs/180,ic=Math.abs,oc=Math.atan,ac=Math.atan2,uc=Math.cos,sc=Math.ceil,cc=Math.exp,lc=Math.hypot,fc=Math.log,hc=Math.pow,dc=Math.sin,pc=Math.sign||function(t){return t>0?1:t<0?-1:0},gc=Math.sqrt,yc=Math.tan;function mc(t){return t>1?0:t<-1?Qs:Math.acos(t)}function vc(t){return t>1?Js:t<-1?-Js:Math.asin(t)}function _c(t){return(t=dc(t/2))*t}function bc(){}function xc(t,n){t&&Mc.hasOwnProperty(t.type)&&Mc[t.type](t,n)}var wc={Feature:function(t,n){xc(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=uc(n=(n*=rc)/2+tc),a=dc(n),u=Pc*a,s=Nc*o+u*uc(i),c=u*r*dc(i);Yc.add(ac(c,s)),Cc=t,Nc=o,Pc=a}function Zc(t){return[ac(t[1],t[0]),vc(t[2])]}function Kc(t){var n=t[0],e=t[1],r=uc(e);return[r*uc(n),r*dc(n),dc(e)]}function Qc(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Jc(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function tl(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function nl(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function el(t){var n=gc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var rl,il,ol,al,ul,sl,cl,ll,fl,hl,dl,pl,gl,yl,ml,vl,_l={point:bl,lineStart:wl,lineEnd:Ml,polygonStart:function(){_l.point=kl,_l.lineStart=Tl,_l.lineEnd=Al,Fc=new y,Vc.polygonStart()},polygonEnd:function(){Vc.polygonEnd(),_l.point=bl,_l.lineStart=wl,_l.lineEnd=Ml,Yc<0?(Dc=-(Lc=180),zc=-(Hc=90)):Fc>Zs?Hc=90:Fc<-Zs&&(zc=-90),Uc[0]=Dc,Uc[1]=Lc},sphere:function(){Dc=-(Lc=180),zc=-(Hc=90)}};function bl(t,n){Oc.push(Uc=[Dc=t,Lc=t]),nHc&&(Hc=n)}function xl(t,n){var e=Kc([t*rc,n*rc]);if(qc){var r=Jc(qc,e),i=Jc([r[1],-r[0],0],r);el(i),i=Zc(i);var o,a=t-Rc,u=a>0?1:-1,s=i[0]*ec*u,c=ic(a)>180;c^(u*RcHc&&(Hc=o):c^(u*Rc<(s=(s+360)%360-180)&&sHc&&(Hc=n)),c?tSl(Dc,Lc)&&(Lc=t):Sl(t,Lc)>Sl(Dc,Lc)&&(Dc=t):Lc>=Dc?(tLc&&(Lc=t)):t>Rc?Sl(Dc,t)>Sl(Dc,Lc)&&(Lc=t):Sl(t,Lc)>Sl(Dc,Lc)&&(Dc=t)}else Oc.push(Uc=[Dc=t,Lc=t]);nHc&&(Hc=n),qc=e,Rc=t}function wl(){_l.point=xl}function Ml(){Uc[0]=Dc,Uc[1]=Lc,_l.point=bl,qc=null}function kl(t,n){if(qc){var e=t-Rc;Fc.add(ic(e)>180?e+(e>0?360:-360):e)}else Bc=t,Ic=n;Vc.point(t,n),xl(t,n)}function Tl(){Vc.lineStart()}function Al(){kl(Bc,Ic),Vc.lineEnd(),ic(Fc)>Zs&&(Dc=-(Lc=180)),Uc[0]=Dc,Uc[1]=Lc,qc=null}function Sl(t,n){return(n-=t)<0?n+360:n}function El(t,n){return t[0]-n[0]}function Cl(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nQs?t+Math.round(-t/nc)*nc:t,n]}function Gl(t,n,e){return(t%=nc)?n||e?Ul(jl(t),$l(n,e)):jl(t):n||e?$l(n,e):Yl}function Vl(t){return function(n,e){return[(n+=t)>Qs?n-nc:n<-Qs?n+nc:n,e]}}function jl(t){var n=Vl(t);return n.invert=Vl(-t),n}function $l(t,n){var e=uc(t),r=dc(t),i=uc(n),o=dc(n);function a(t,n){var a=uc(n),u=uc(t)*a,s=dc(t)*a,c=dc(n),l=c*e+u*r;return[ac(s*i-l*o,u*e-c*r),vc(l*i+s*o)]}return a.invert=function(t,n){var a=uc(n),u=uc(t)*a,s=dc(t)*a,c=dc(n),l=c*i-s*o;return[ac(s*i+c*o,u*e+l*r),vc(l*e-u*r)]},a}function Xl(t){function n(n){return(n=t(n[0]*rc,n[1]*rc))[0]*=ec,n[1]*=ec,n}return t=Gl(t[0]*rc,t[1]*rc,t.length>2?t[2]*rc:0),n.invert=function(n){return(n=t.invert(n[0]*rc,n[1]*rc))[0]*=ec,n[1]*=ec,n},n}function Wl(t,n,e,r,i,o){if(e){var a=uc(n),u=dc(n),s=r*e;null==i?(i=n+r*nc,o=n-s/2):(i=Zl(a,i),o=Zl(a,o),(r>0?io)&&(i+=r*nc));for(var c,l=i;r>0?l>o:l1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Ql(t,n){return ic(t[0]-n[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function nf(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,S=A*T,E=S>Qs,C=m*M;if(s.add(ac(C*A*dc(S),v*k+C*uc(S))),a+=E?T+A*nc:T,E^p>=e^x>=e){var N=Jc(Kc(d),Kc(b));el(N);var P=Jc(o,N);el(P);var D=(E^T>=0?-1:1)*vc(P[2]);(r>D||r===D&&(N[0]||N[1]))&&(u+=E^T>=0?1:-1)}}return(a<-Zs||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&s&&h.push(h.pop().concat(h.shift())),a.push(h.filter(af))}return h}}function af(t){return t.length>1}function uf(t,n){return((t=t.x)[0]<0?t[1]-Js-Zs:Js-t[1])-((n=n.x)[0]<0?n[1]-Js-Zs:Js-n[1])}Yl.invert=Yl;var sf=of((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?Qs:-Qs,s=ic(o-e);ic(s-Qs)0?Js:-Js),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&s>=Qs&&(ic(e-i)Zs?oc((dc(n)*(o=uc(r))*dc(e)-dc(r)*(i=uc(n))*dc(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*Js,r.point(-Qs,i),r.point(0,i),r.point(Qs,i),r.point(Qs,0),r.point(Qs,-i),r.point(0,-i),r.point(-Qs,-i),r.point(-Qs,0),r.point(-Qs,i);else if(ic(t[0]-n[0])>Zs){var o=t[0]0,i=ic(n)>Zs;function o(t,e){return uc(t)*uc(e)>n}function a(t,e,r){var i=[1,0,0],o=Jc(Kc(t),Kc(e)),a=Qc(o,o),u=o[0],s=a-u*u;if(!s)return!r&&t;var c=n*a/s,l=-n*u/s,f=Jc(i,o),h=nl(i,c);tl(h,nl(o,l));var d=f,p=Qc(h,d),g=Qc(d,d),y=p*p-g*(Qc(h,h)-1);if(!(y<0)){var m=gc(y),v=nl(d,(-p-m)/g);if(tl(v,h),v=Zc(v),!r)return v;var _,b=t[0],x=e[0],w=t[1],M=e[1];x0^v[1]<(ic(v[0]-b)Qs^(b<=v[0]&&v[0]<=x)){var A=nl(d,(-p+m)/g);return tl(A,h),[v,Zc(A)]}}}function u(n,e){var i=r?t:Qs-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return of(o,(function(t){var n,e,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(f,h){var d,p=[f,h],g=o(f,h),y=r?g?0:u(f,h):g?u(f+(f<0?Qs:-Qs),h):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(!(d=a(n,p))||Ql(n,d)||Ql(p,d))&&(p[2]=1),g!==s)l=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1],2),t.lineEnd()),n=d;else if(i&&n&&r^g){var m;y&e||!(m=a(p,n,!0))||(l=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||n&&Ql(n,p)||t.point(p[0],p[1]),n=p,s=g,e=y},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}),(function(n,r,i,o){Wl(o,t,e,i,n,r)}),r?[0,-t]:[-Qs,t-Qs])}var lf,ff,hf,df,pf=1e9,gf=-pf;function yf(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,c){var l=0,f=0;if(null==i||(l=a(i,u))!==(f=a(o,u))||s(i,o)<0^u>0)do{c.point(0===l||3===l?t:e,l>1?r:n)}while((l=(l+u+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return ic(r[0]-t)0?0:3:ic(r[0]-e)0?2:1:ic(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return s(t.x,n.x)}function s(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var s,c,l,f,h,d,p,g,y,m,v,_=a,b=Kl(),x={point:w,lineStart:function(){x.point=M,c&&c.push(l=[]),m=!0,y=!1,p=g=NaN},lineEnd:function(){s&&(M(f,h),d&&y&&b.rejoin(),s.push(b.result())),x.point=w,y&&_.lineEnd()},polygonStart:function(){_=b,s=[],c=[],v=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=c.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=v&&n,i=(s=J(s)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&tf(s,u,n,o,a),a.polygonEnd()),_=a,s=c=l=null}};function w(t,n){i(t,n)&&_.point(t,n)}function M(o,a){var u=i(o,a);if(c&&l.push([o,a]),m)f=o,h=a,d=u,m=!1,u&&(_.lineStart(),_.point(o,a));else if(u&&y)_.point(o,a);else{var s=[p=Math.max(gf,Math.min(pf,p)),g=Math.max(gf,Math.min(pf,g))],b=[o=Math.max(gf,Math.min(pf,o)),a=Math.max(gf,Math.min(pf,a))];!function(t,n,e,r,i,o){var a,u=t[0],s=t[1],c=0,l=1,f=n[0]-u,h=n[1]-s;if(a=e-u,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=i-u,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=o-s,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a0&&(t[0]=u+c*f,t[1]=s+c*h),l<1&&(n[0]=u+l*f,n[1]=s+l*h),!0}}}}}(s,b,t,n,e,r)?u&&(_.lineStart(),_.point(o,a),v=!1):(y||(_.lineStart(),_.point(s[0],s[1])),_.point(b[0],b[1]),u||_.lineEnd(),v=!1)}p=o,g=a,y=u}return x}}var mf={sphere:bc,point:bc,lineStart:function(){mf.point=_f,mf.lineEnd=vf},lineEnd:bc,polygonStart:bc,polygonEnd:bc};function vf(){mf.point=mf.lineEnd=bc}function _f(t,n){ff=t*=rc,hf=dc(n*=rc),df=uc(n),mf.point=bf}function bf(t,n){t*=rc;var e=dc(n*=rc),r=uc(n),i=ic(t-ff),o=uc(i),a=r*dc(i),u=df*e-hf*r*o,s=hf*e+df*r*o;lf.add(ac(gc(a*a+u*u),s)),ff=t,hf=e,df=r}function xf(t){return lf=new y,Ac(t,mf),+lf}var wf=[null,null],Mf={type:"LineString",coordinates:wf};function kf(t,n){return wf[0]=t,wf[1]=n,xf(Mf)}var Tf={Feature:function(t,n){return Sf(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r0&&(i=kf(t[o],t[o-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))Zs})).map(s)).concat(et(sc(o/d)*d,i,d).filter((function(t){return ic(t%g)>Zs})).map(c))}return m.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(e).reverse().slice(1),f(u).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),m.precision(y)):[[r,u],[e,a]]},m.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),m.precision(y)):[[n,o],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],m):[p,g]},m.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],m):[h,d]},m.precision=function(h){return arguments.length?(y=+h,s=zf(o,i,90),c=Lf(n,t,y),l=zf(u,a,90),f=Lf(r,e,y),m):y},m.extentMajor([[-180,-90+Zs],[180,90-Zs]]).extentMinor([[-180,-80-Zs],[180,80+Zs]])}var Rf,Bf,If,qf,Ff=t=>t,Of=new y,Uf=new y,Yf={point:bc,lineStart:bc,lineEnd:bc,polygonStart:function(){Yf.lineStart=Gf,Yf.lineEnd=$f},polygonEnd:function(){Yf.lineStart=Yf.lineEnd=Yf.point=bc,Of.add(ic(Uf)),Uf=new y},result:function(){var t=Of/2;return Of=new y,t}};function Gf(){Yf.point=Vf}function Vf(t,n){Yf.point=jf,Rf=If=t,Bf=qf=n}function jf(t,n){Uf.add(qf*t-If*n),If=t,qf=n}function $f(){jf(Rf,Bf)}var Xf=Yf,Wf=1/0,Zf=Wf,Kf=-Wf,Qf=Kf;var Jf,th,nh,eh,rh={point:function(t,n){tKf&&(Kf=t),nQf&&(Qf=n)},lineStart:bc,lineEnd:bc,polygonStart:bc,polygonEnd:bc,result:function(){var t=[[Wf,Zf],[Kf,Qf]];return Kf=Qf=-(Zf=Wf=1/0),t}},ih=0,oh=0,ah=0,uh=0,sh=0,ch=0,lh=0,fh=0,hh=0,dh={point:ph,lineStart:gh,lineEnd:vh,polygonStart:function(){dh.lineStart=_h,dh.lineEnd=bh},polygonEnd:function(){dh.point=ph,dh.lineStart=gh,dh.lineEnd=vh},result:function(){var t=hh?[lh/hh,fh/hh]:ch?[uh/ch,sh/ch]:ah?[ih/ah,oh/ah]:[NaN,NaN];return ih=oh=ah=uh=sh=ch=lh=fh=hh=0,t}};function ph(t,n){ih+=t,oh+=n,++ah}function gh(){dh.point=yh}function yh(t,n){dh.point=mh,ph(nh=t,eh=n)}function mh(t,n){var e=t-nh,r=n-eh,i=gc(e*e+r*r);uh+=i*(nh+t)/2,sh+=i*(eh+n)/2,ch+=i,ph(nh=t,eh=n)}function vh(){dh.point=ph}function _h(){dh.point=xh}function bh(){wh(Jf,th)}function xh(t,n){dh.point=wh,ph(Jf=nh=t,th=eh=n)}function wh(t,n){var e=t-nh,r=n-eh,i=gc(e*e+r*r);uh+=i*(nh+t)/2,sh+=i*(eh+n)/2,ch+=i,lh+=(i=eh*t-nh*n)*(nh+t),fh+=i*(eh+n),hh+=3*i,ph(nh=t,eh=n)}var Mh=dh;function kh(t){this._context=t}kh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,nc)}},result:bc};var Th,Ah,Sh,Eh,Ch,Nh=new y,Ph={point:bc,lineStart:function(){Ph.point=Dh},lineEnd:function(){Th&&zh(Ah,Sh),Ph.point=bc},polygonStart:function(){Th=!0},polygonEnd:function(){Th=null},result:function(){var t=+Nh;return Nh=new y,t}};function Dh(t,n){Ph.point=zh,Ah=Eh=t,Sh=Ch=n}function zh(t,n){Eh-=t,Ch-=n,Nh.add(gc(Eh*Eh+Ch*Ch)),Eh=t,Ch=n}var Lh=Ph;function Hh(){this._string=[]}function Rh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Bh(t){return function(n){var e=new Ih;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Ih(){}function qh(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Ac(e,t.stream(rh)),n(rh.result()),null!=r&&t.clipExtent(r),t}function Fh(t,n,e){return qh(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])}),e)}function Oh(t,n,e){return Fh(t,[[0,0],n],e)}function Uh(t,n,e){return qh(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])}),e)}function Yh(t,n,e){return qh(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])}),e)}Hh.prototype={_radius:4.5,_circle:Rh(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=Rh(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Ih.prototype={constructor:Ih,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Gh=16,Vh=uc(30*rc);function jh(t,n){return+n?function(t,n){function e(r,i,o,a,u,s,c,l,f,h,d,p,g,y){var m=c-r,v=l-i,_=m*m+v*v;if(_>4*n&&g--){var b=a+h,x=u+d,w=s+p,M=gc(b*b+x*x+w*w),k=vc(w/=M),T=ic(ic(w)-1)n||ic((m*C+v*N)/_-.5)>.3||a*h+u*d+s*p2?t[2]%360*rc:0,C()):[y*ec,m*ec,v*ec]},S.angle=function(t){return arguments.length?(_=t%360*rc,C()):_*ec},S.reflectX=function(t){return arguments.length?(b=t?-1:1,C()):b<0},S.reflectY=function(t){return arguments.length?(x=t?-1:1,C()):x<0},S.precision=function(t){return arguments.length?(a=jh(u,A=t*t),N()):gc(A)},S.fitExtent=function(t,n){return Fh(S,t,n)},S.fitSize=function(t,n){return Oh(S,t,n)},S.fitWidth=function(t,n){return Uh(S,t,n)},S.fitHeight=function(t,n){return Yh(S,t,n)},function(){return n=t.apply(this,arguments),S.invert=n.invert&&E,C()}}function Kh(t){var n=0,e=Qs/3,r=Zh(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*rc,e=t[1]*rc):[n*ec,e*ec]},i}function Qh(t,n){var e=dc(t),r=(e+dc(n))/2;if(ic(r)0?n<-Js+Zs&&(n=-Js+Zs):n>Js-Zs&&(n=Js-Zs);var e=i/hc(ud(n),r);return[e*dc(r*t),i-e*uc(r*t)]}return o.invert=function(t,n){var e=i-n,o=pc(r)*gc(t*t+e*e),a=ac(t,ic(e))*pc(e);return e*r<0&&(a-=Qs*pc(t)*pc(e)),[a/r,2*oc(hc(i/o,1/r))-Js]},o}function cd(t,n){return[t,n]}function ld(t,n){var e=uc(t),r=t===n?dc(t):(e-uc(n))/(n-t),i=e/r+t;if(ic(r)=0;)n+=e[r].value;else n=1;t.value=n}function Ad(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=Ed)):void 0===n&&(n=Sd);for(var e,r,i,o,a,u=new Pd(t),s=[u];e=s.pop();)if((i=n(e.data))&&(a=(i=Array.from(i)).length))for(e.children=i,o=a-1;o>=0;--o)s.push(r=i[o]=new Pd(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(Nd)}function Sd(t){return t.children}function Ed(t){return Array.isArray(t)?t[1]:null}function Cd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Nd(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Pd(t){this.data=t,this.depth=this.height=0,this.parent=null}function Dd(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(Array.from(t))).length,o=[];r0&&e*e>r*r+i*i}function Rd(t,n){for(var e=0;e(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),e.x=t.x-r*u-o*s,e.y=t.y-r*s+o*u):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),e.x=n.x+r*u-o*s,e.y=n.y+r*s+o*u)):(e.x=n.x+e.r,e.y=n.y)}function Od(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function Ud(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function Yd(t){this._=t,this.next=null,this.previous=null}function Gd(t){if(!(i=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,e,r,i,o,a,u,s,c,l,f;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Fd(e,n,r=t[2]),n=new Yd(n),e=new Yd(e),r=new Yd(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;uZs&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},_d.invert=ed(vc),bd.invert=ed((function(t){return 2*oc(t)})),xd.invert=function(t,n){return[-n,2*oc(cc(t))-Js]},Pd.prototype=Ad.prototype={constructor:Pd,count:function(){return this.eachAfter(Td)},each:function(t,n){let e=-1;for(const r of this)t.call(n,r,++e,this);return this},eachAfter:function(t,n){for(var e,r,i,o=this,a=[o],u=[],s=-1;o=a.pop();)if(u.push(o),e=o.children)for(r=0,i=e.length;r=0;--r)o.push(e[r]);return this},find:function(t,n){let e=-1;for(const r of this)if(t.call(n,r,++e,this))return r},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Ad(this).eachBefore(Cd)},[Symbol.iterator]:function*(){var t,n,e,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,n=i.children)for(e=0,r=n.length;e1&&!up(t,n););return t.slice(0,n)}function up(t,n){if("/"===t[n]){let e=0;for(;n>0&&"\\"===t[--n];)++e;if(!(1&e))return!0}return!1}function sp(t,n){return t.parent===n.parent?1:2}function cp(t){var n=t.children;return n?n[0]:t.t}function lp(t){var n=t.children;return n?n[n.length-1]:t.t}function fp(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function hp(t,n,e){return t.a.parent===n.parent?t.a:e}function dp(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function pp(t,n,e,r,i){for(var o,a=t.children,u=-1,s=a.length,c=t.value&&(i-e)/t.value;++uh&&(h=u),y=l*l*g,(d=Math.max(h/y,y/f))>p){l-=u;break}p=d}m.push(a={value:l,dice:s1?n:1)},e}(gp);var vp=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,s,c,l,f=-1,h=a.length,d=t.value;++f1?n:1)},e}(gp);function _p(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function bp(t,n){return t[0]-n[0]||t[1]-n[1]}function xp(t){const n=t.length,e=[0,1];let r,i=2;for(r=2;r1&&_p(t[e[i-2]],t[e[i-1]],t[r])<=0;)--i;e[i++]=r}return e.slice(0,i)}var wp=Math.random,Mp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(wp),kp=function t(n){function e(t,e){return arguments.length<2&&(e=t,t=0),t=Math.floor(t),e=Math.floor(e)-t,function(){return Math.floor(n()*e+t)}}return e.source=t,e}(wp),Tp=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(wp),Ap=function t(n){var e=Tp.source(n);function r(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(wp),Sp=function t(n){function e(t){return(t=+t)<=0?()=>0:function(){for(var e=0,r=t;r>1;--r)e+=n();return e+r*n()}}return e.source=t,e}(wp),Ep=function t(n){var e=Sp.source(n);function r(t){if(0==(t=+t))return n;var r=e(t);return function(){return r()/t}}return r.source=t,r}(wp),Cp=function t(n){function e(t){return function(){return-Math.log1p(-n())/t}}return e.source=t,e}(wp),Np=function t(n){function e(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-n(),t)}}return e.source=t,e}(wp),Pp=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(n()+t)}}return e.source=t,e}(wp),Dp=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-n())/t)})}return e.source=t,e}(wp),zp=function t(n){var e=Tp.source(n)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-n())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(n(),1/t):()=>1;return function(){do{do{var t=e(),u=1+o*t}while(u<=0);u*=u*u;var s=1-n()}while(s>=1-.0331*t*t*t*t&&Math.log(s)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(wp),Lp=function t(n){var e=zp.source(n);function r(t,n){var r=e(t),i=e(n);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(wp),Hp=function t(n){var e=Dp.source(n),r=Lp.source(n);function i(t,n){return t=+t,(n=+n)>=1?()=>t:n<=0?()=>0:function(){for(var i=0,o=t,a=n;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),s=r(u,o-u+1)();s<=a?(i+=u,o-=u,a=(a-s)/(1-s)):(o=u-1,a/=s)}for(var c=a<.5,l=e(c?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(c?h:o-h)}}return i.source=t,i}(wp),Rp=function t(n){function e(t,e,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=n=>Math.pow(n,t)),e=null==e?0:+e,r=null==r?1:+r,function(){return e+r*i(-Math.log1p(-n()))}}return e.source=t,e}(wp),Bp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){return t+e*Math.tan(Math.PI*n())}}return e.source=t,e}(wp),Ip=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){var r=n();return t+e*Math.log(r/(1-r))}}return e.source=t,e}(wp),qp=function t(n){var e=zp.source(n),r=Hp.source(n);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=e(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var s=-Math.log1p(-n()),c=0;s<=o;++c)s-=Math.log1p(-n());return i+c}}return i.source=t,i}(wp);const Fp=1/4294967296;function Op(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function Up(t,n){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof n?this.interpolator(n):this.range(n)}return this}const Yp=Symbol("implicit");function Gp(){var t=new m,n=[],e=[],r=Yp;function i(i){let o=t.get(i);if(void 0===o){if(r!==Yp)return r;t.set(i,o=n.push(i)-1)}return e[o%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new m;for(const r of e)t.has(r)||t.set(r,n.push(r)-1);return i},i.range=function(t){return arguments.length?(e=Array.from(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Gp(n,e).unknown(r)},Op.apply(i,arguments),i}function Vp(){var t,n,e=Gp().unknown(void 0),r=e.domain,i=e.range,o=0,a=1,u=!1,s=0,c=0,l=.5;function f(){var e=r().length,f=an&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(a[0],a[t-1])),r=t>2?Qp:Kp,i=o=null,f}function f(n){return null==n||isNaN(n=+n)?e:(i||(i=r(a.map(t),u,s)))(t(c(n)))}return f.invert=function(e){return c(n((o||(o=r(u,a.map(t),Cr)))(e)))},f.domain=function(t){return arguments.length?(a=Array.from(t,$p),l()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),l()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),s=Hr,l()},f.clamp=function(t){return arguments.length?(c=!!t||Wp,l()):c!==Wp},f.interpolate=function(t){return arguments.length?(s=t,l()):s},f.unknown=function(t){return arguments.length?(e=t,f):e},function(e,r){return t=e,n=r,l()}}function ng(){return tg()(Wp,Wp)}function eg(n,e,r,i){var o,a=U(n,e,r);switch((i=Bs(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=Xs(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=Ws(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=$s(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function rg(t){var n=t.domain;return t.ticks=function(t){var e=n();return F(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return eg(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,o=n(),a=0,u=o.length-1,s=o[a],c=o[u],l=10;for(c0;){if((i=O(s,c,e))===r)return o[a]=s,o[u]=c,n(o);if(i>0)s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function ig(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-n,e)}function fg(n){const e=n(og,ag),r=e.domain;let i,o,a=10;function u(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),n=>Math.log(n)/t)}(a),o=function(t){return 10===t?cg:t===Math.E?Math.exp:n=>Math.pow(t,n)}(a),r()[0]<0?(i=lg(i),o=lg(o),n(ug,sg)):n(og,ag),e}return e.base=function(t){return arguments.length?(a=+t,u()):a},e.domain=function(t){return arguments.length?(r(t),u()):r()},e.ticks=t=>{const n=r();let e=n[0],u=n[n.length-1];const s=u0){for(;f<=h;++f)for(c=1;cu)break;p.push(l)}}else for(;f<=h;++f)for(c=a-1;c>=1;--c)if(l=f>0?c/o(-f):c*o(f),!(lu)break;p.push(l)}2*p.length{if(null==n&&(n=10),null==r&&(r=10===a?"s":","),"function"!=typeof r&&(a%1||null!=(r=Bs(r)).precision||(r.trim=!0),r=t.format(r)),n===1/0)return r;const u=Math.max(1,a*n/e.ticks().length);return t=>{let n=t/o(Math.round(i(t)));return n*ar(ig(r(),{floor:t=>o(Math.floor(i(t))),ceil:t=>o(Math.ceil(i(t)))})),e}function hg(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function dg(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function pg(t){var n=1,e=t(hg(n),dg(n));return e.constant=function(e){return arguments.length?t(hg(n=+e),dg(n)):n},rg(e)}function gg(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function yg(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function mg(t){return t<0?-t*t:t*t}function vg(t){var n=t(Wp,Wp),e=1;return n.exponent=function(n){return arguments.length?1===(e=+n)?t(Wp,Wp):.5===e?t(yg,mg):t(gg(e),gg(1/e)):e},rg(n)}function _g(){var t=vg(tg());return t.copy=function(){return Jp(t,_g()).exponent(t.exponent())},Op.apply(t,arguments),t}function bg(t){return Math.sign(t)*t*t}var xg=new Date,wg=new Date;function Mg(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=function(n){return t(n=new Date(+n)),n},i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return xg.setTime(+n),wg.setTime(+r),t(xg),t(wg),Math.floor(e(xg,wg))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var kg=Mg((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));kg.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Mg((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):kg:null};var Tg=kg,Ag=kg.range;const Sg=1e3,Eg=6e4,Cg=36e5,Ng=864e5,Pg=6048e5,Dg=2592e6,zg=31536e6;var Lg=Mg((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+n*Sg)}),(function(t,n){return(n-t)/Sg}),(function(t){return t.getUTCSeconds()})),Hg=Lg,Rg=Lg.range,Bg=Mg((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Sg)}),(function(t,n){t.setTime(+t+n*Eg)}),(function(t,n){return(n-t)/Eg}),(function(t){return t.getMinutes()})),Ig=Bg,qg=Bg.range,Fg=Mg((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Sg-t.getMinutes()*Eg)}),(function(t,n){t.setTime(+t+n*Cg)}),(function(t,n){return(n-t)/Cg}),(function(t){return t.getHours()})),Og=Fg,Ug=Fg.range,Yg=Mg((t=>t.setHours(0,0,0,0)),((t,n)=>t.setDate(t.getDate()+n)),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Eg)/Ng),(t=>t.getDate()-1)),Gg=Yg,Vg=Yg.range;function jg(t){return Mg((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Eg)/Pg}))}var $g=jg(0),Xg=jg(1),Wg=jg(2),Zg=jg(3),Kg=jg(4),Qg=jg(5),Jg=jg(6),ty=$g.range,ny=Xg.range,ey=Wg.range,ry=Zg.range,iy=Kg.range,oy=Qg.range,ay=Jg.range,uy=Mg((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),sy=uy,cy=uy.range,ly=Mg((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));ly.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Mg((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var fy=ly,hy=ly.range,dy=Mg((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*Eg)}),(function(t,n){return(n-t)/Eg}),(function(t){return t.getUTCMinutes()})),py=dy,gy=dy.range,yy=Mg((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+n*Cg)}),(function(t,n){return(n-t)/Cg}),(function(t){return t.getUTCHours()})),my=yy,vy=yy.range,_y=Mg((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/Ng}),(function(t){return t.getUTCDate()-1})),by=_y,xy=_y.range;function wy(t){return Mg((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/Pg}))}var My=wy(0),ky=wy(1),Ty=wy(2),Ay=wy(3),Sy=wy(4),Ey=wy(5),Cy=wy(6),Ny=My.range,Py=ky.range,Dy=Ty.range,zy=Ay.range,Ly=Sy.range,Hy=Ey.range,Ry=Cy.range,By=Mg((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),Iy=By,qy=By.range,Fy=Mg((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Fy.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Mg((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Oy=Fy,Uy=Fy.range;function Yy(t,n,r,i,o,a){const u=[[Hg,1,Sg],[Hg,5,5e3],[Hg,15,15e3],[Hg,30,3e4],[a,1,Eg],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,Cg],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,Ng],[i,2,1728e5],[r,1,Pg],[n,1,Dg],[n,3,7776e6],[t,1,zg]];function s(n,r,i){const o=Math.abs(r-n)/i,a=e((([,,t])=>t)).right(u,o);if(a===u.length)return t.every(U(n/zg,r/zg,i));if(0===a)return Tg.every(Math.max(U(n,r,i),1));const[s,c]=u[o/u[a-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:pv,s:gv,S:Hm,u:Rm,U:Bm,V:qm,w:Fm,W:Om,x:null,X:null,y:Um,Y:Gm,Z:jm,"%":dv},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:$m,e:$m,f:Qm,g:cv,G:fv,H:Xm,I:Wm,j:Zm,L:Km,m:Jm,M:tv,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:pv,s:gv,S:nv,u:ev,U:rv,V:ov,w:av,W:uv,x:null,X:null,y:sv,Y:lv,Z:hv,"%":dv},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(t,n,e){var r=m.exec(n.slice(e));return r?(t.m=v.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=y.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:mm,e:mm,f:Mm,g:dm,G:hm,H:_m,I:_m,j:vm,L:wm,m:ym,M:bm,p:function(t,n,e){var r=c.exec(n.slice(e));return r?(t.p=l.get(r[0].toLowerCase()),e+r[0].length):-1},q:gm,Q:Tm,s:Am,S:xm,u:sm,U:cm,V:lm,w:um,W:fm,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:dm,Y:hm,Z:pm,"%":km};function w(t,n){return function(e){var r,i,o,a=[],u=-1,s=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Wy(Zy(o.y,0,1))).getUTCDay(),r=i>4||0===i?ky.ceil(r):ky(r),r=by.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Xy(Zy(o.y,0,1))).getDay(),r=i>4||0===i?Xg.ceil(r):Xg(r),r=Gg.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Wy(Zy(o.y,0,1)).getUTCDay():Xy(Zy(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Wy(o)):Xy(o)}}function k(t,n,e,r){for(var i,o,a=0,u=n.length,s=e.length;a=s)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in Jy?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return _.x=w(e,_),_.X=w(r,_),_.c=w(n,_),b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),{format:function(t){var n=w(t+="",_);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}var Qy,Jy={"-":"",_:" ",0:"0"},tm=/^\s*\d+/,nm=/^%/,em=/[\\^$*+?|[\]().{}]/g;function rm(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),n])))}function um(t,n,e){var r=tm.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function sm(t,n,e){var r=tm.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function cm(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function lm(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function fm(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function hm(t,n,e){var r=tm.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function dm(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function pm(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function gm(t,n,e){var r=tm.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function ym(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function mm(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function vm(t,n,e){var r=tm.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function _m(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function bm(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function xm(t,n,e){var r=tm.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function wm(t,n,e){var r=tm.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Mm(t,n,e){var r=tm.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function km(t,n,e){var r=nm.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Tm(t,n,e){var r=tm.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Am(t,n,e){var r=tm.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function Sm(t,n){return rm(t.getDate(),n,2)}function Em(t,n){return rm(t.getHours(),n,2)}function Cm(t,n){return rm(t.getHours()%12||12,n,2)}function Nm(t,n){return rm(1+Gg.count(fy(t),t),n,3)}function Pm(t,n){return rm(t.getMilliseconds(),n,3)}function Dm(t,n){return Pm(t,n)+"000"}function zm(t,n){return rm(t.getMonth()+1,n,2)}function Lm(t,n){return rm(t.getMinutes(),n,2)}function Hm(t,n){return rm(t.getSeconds(),n,2)}function Rm(t){var n=t.getDay();return 0===n?7:n}function Bm(t,n){return rm($g.count(fy(t)-1,t),n,2)}function Im(t){var n=t.getDay();return n>=4||0===n?Kg(t):Kg.ceil(t)}function qm(t,n){return t=Im(t),rm(Kg.count(fy(t),t)+(4===fy(t).getDay()),n,2)}function Fm(t){return t.getDay()}function Om(t,n){return rm(Xg.count(fy(t)-1,t),n,2)}function Um(t,n){return rm(t.getFullYear()%100,n,2)}function Ym(t,n){return rm((t=Im(t)).getFullYear()%100,n,2)}function Gm(t,n){return rm(t.getFullYear()%1e4,n,4)}function Vm(t,n){var e=t.getDay();return rm((t=e>=4||0===e?Kg(t):Kg.ceil(t)).getFullYear()%1e4,n,4)}function jm(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+rm(n/60|0,"0",2)+rm(n%60,"0",2)}function $m(t,n){return rm(t.getUTCDate(),n,2)}function Xm(t,n){return rm(t.getUTCHours(),n,2)}function Wm(t,n){return rm(t.getUTCHours()%12||12,n,2)}function Zm(t,n){return rm(1+by.count(Oy(t),t),n,3)}function Km(t,n){return rm(t.getUTCMilliseconds(),n,3)}function Qm(t,n){return Km(t,n)+"000"}function Jm(t,n){return rm(t.getUTCMonth()+1,n,2)}function tv(t,n){return rm(t.getUTCMinutes(),n,2)}function nv(t,n){return rm(t.getUTCSeconds(),n,2)}function ev(t){var n=t.getUTCDay();return 0===n?7:n}function rv(t,n){return rm(My.count(Oy(t)-1,t),n,2)}function iv(t){var n=t.getUTCDay();return n>=4||0===n?Sy(t):Sy.ceil(t)}function ov(t,n){return t=iv(t),rm(Sy.count(Oy(t),t)+(4===Oy(t).getUTCDay()),n,2)}function av(t){return t.getUTCDay()}function uv(t,n){return rm(ky.count(Oy(t)-1,t),n,2)}function sv(t,n){return rm(t.getUTCFullYear()%100,n,2)}function cv(t,n){return rm((t=iv(t)).getUTCFullYear()%100,n,2)}function lv(t,n){return rm(t.getUTCFullYear()%1e4,n,4)}function fv(t,n){var e=t.getUTCDay();return rm((t=e>=4||0===e?Sy(t):Sy.ceil(t)).getUTCFullYear()%1e4,n,4)}function hv(){return"+0000"}function dv(){return"%"}function pv(t){return+t}function gv(t){return Math.floor(+t/1e3)}function yv(n){return Qy=Ky(n),t.timeFormat=Qy.format,t.timeParse=Qy.parse,t.utcFormat=Qy.utcFormat,t.utcParse=Qy.utcParse,Qy}t.timeFormat=void 0,t.timeParse=void 0,t.utcFormat=void 0,t.utcParse=void 0,yv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var mv="%Y-%m-%dT%H:%M:%S.%LZ";var vv=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(mv),_v=vv;var bv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse(mv),xv=bv;function wv(t){return new Date(t)}function Mv(t){return t instanceof Date?+t:+new Date(+t)}function kv(t,n,e,r,i,o,a,u,s,c){var l=ng(),f=l.invert,h=l.domain,d=c(".%L"),p=c(":%S"),g=c("%I:%M"),y=c("%I %p"),m=c("%a %d"),v=c("%b %d"),_=c("%B"),b=c("%Y");function x(t){return(s(t)Mr(t[t.length-1]),Uv=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Nv),Yv=Ov(Uv),Gv=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Nv),Vv=Ov(Gv),jv=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Nv),$v=Ov(jv),Xv=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Nv),Wv=Ov(Xv),Zv=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Nv),Kv=Ov(Zv),Qv=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Nv),Jv=Ov(Qv),t_=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Nv),n_=Ov(t_),e_=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Nv),r_=Ov(e_),i_=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Nv),o_=Ov(i_),a_=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Nv),u_=Ov(a_),s_=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Nv),c_=Ov(s_),l_=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Nv),f_=Ov(l_),h_=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Nv),d_=Ov(h_),p_=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Nv),g_=Ov(p_),y_=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Nv),m_=Ov(y_),v_=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Nv),__=Ov(v_),b_=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Nv),x_=Ov(b_),w_=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Nv),M_=Ov(w_),k_=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Nv),T_=Ov(k_),A_=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Nv),S_=Ov(A_),E_=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Nv),C_=Ov(E_),N_=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Nv),P_=Ov(N_),D_=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Nv),z_=Ov(D_),L_=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Nv),H_=Ov(L_),R_=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Nv),B_=Ov(R_),I_=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Nv),q_=Ov(I_),F_=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Nv),O_=Ov(F_);var U_=Jr(fr(300,.5,0),fr(-240,.5,1)),Y_=Jr(fr(-100,.75,.35),fr(80,1.5,.8)),G_=Jr(fr(260,.75,.35),fr(80,1.5,.8)),V_=fr();var j_=Se(),$_=Math.PI/3,X_=2*Math.PI/3;function W_(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var Z_=W_(Nv("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),K_=W_(Nv("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Q_=W_(Nv("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),J_=W_(Nv("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function tb(t){return function(){return t}}var nb=Math.abs,eb=Math.atan2,rb=Math.cos,ib=Math.max,ob=Math.min,ab=Math.sin,ub=Math.sqrt,sb=1e-12,cb=Math.PI,lb=cb/2,fb=2*cb;function hb(t){return t>=1?lb:t<=-1?-lb:Math.asin(t)}function db(t){return t.innerRadius}function pb(t){return t.outerRadius}function gb(t){return t.startAngle}function yb(t){return t.endAngle}function mb(t){return t&&t.padAngle}function vb(t,n,e,r,i,o,a){var u=t-e,s=n-r,c=(a?o:-o)/ub(u*u+s*s),l=c*s,f=-c*u,h=t+l,d=n+f,p=e+l,g=r+f,y=(h+p)/2,m=(d+g)/2,v=p-h,_=g-d,b=v*v+_*_,x=i-o,w=h*g-p*d,M=(_<0?-1:1)*ub(ib(0,x*x*b-w*w)),k=(w*_-v*M)/b,T=(-w*v-_*M)/b,A=(w*_+v*M)/b,S=(-w*v+_*M)/b,E=k-y,C=T-m,N=A-y,P=S-m;return E*E+C*C>N*N+P*P&&(k=A,T=S),{cx:k,cy:T,x01:-l,y01:-f,x11:k*(i/x-1),y11:T*(i/x-1)}}var _b=Array.prototype.slice;function bb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function xb(t){this._context=t}function wb(t){return new xb(t)}function Mb(t){return t[0]}function kb(t){return t[1]}function Tb(t,n){var e=tb(!0),r=null,i=wb,o=null;function a(a){var u,s,c,l=(a=bb(a)).length,f=!1;for(null==r&&(o=i(c=Ta())),u=0;u<=l;++u)!(u=l;--f)u.point(y[f],m[f]);u.lineEnd(),u.areaEnd()}g&&(y[c]=+t(h,c,s),m[c]=+n(h,c,s),u.point(r?+r(h,c,s):y[c],e?+e(h,c,s):m[c]))}if(d)return u=null,d+""||null}function c(){return Tb().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Mb:tb(+t),n="function"==typeof n?n:tb(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?kb:tb(+e),s.x=function(n){return arguments.length?(t="function"==typeof n?n:tb(+n),r=null,s):t},s.x0=function(n){return arguments.length?(t="function"==typeof n?n:tb(+n),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:tb(+t),s):r},s.y=function(t){return arguments.length?(n="function"==typeof t?t:tb(+t),e=null,s):n},s.y0=function(t){return arguments.length?(n="function"==typeof t?t:tb(+t),s):n},s.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:tb(+t),s):e},s.lineX0=s.lineY0=function(){return c().x(t).y(n)},s.lineY1=function(){return c().x(t).y(e)},s.lineX1=function(){return c().x(r).y(n)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:tb(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),s):o},s}function Sb(t,n){return nt?1:n>=t?0:NaN}function Eb(t){return t}xb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var Cb=Pb(wb);function Nb(t){this._curve=t}function Pb(t){function n(n){return new Nb(t(n))}return n._curve=t,n}function Db(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(Pb(t)):n()._curve},t}function zb(){return Db(Tb().curve(Cb))}function Lb(){var t=Ab().curve(Cb),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Db(e())},delete t.lineX0,t.lineEndAngle=function(){return Db(r())},delete t.lineX1,t.lineInnerRadius=function(){return Db(i())},delete t.lineY0,t.lineOuterRadius=function(){return Db(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(Pb(t)):n()._curve},t}function Hb(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}function Rb(t){return t.source}function Bb(t){return t.target}function Ib(t){var n=Rb,e=Bb,r=Mb,i=kb,o=null;function a(){var a,u=_b.call(arguments),s=n.apply(this,u),c=e.apply(this,u);if(o||(o=a=Ta()),t(o,+r.apply(this,(u[0]=s,u)),+i.apply(this,u),+r.apply(this,(u[0]=c,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:tb(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:tb(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function qb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function Fb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function Ob(t,n,e,r,i){var o=Hb(n,e),a=Hb(n,e=(e+i)/2),u=Hb(r,e),s=Hb(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],s[0],s[1])}Nb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Ub={draw:function(t,n){var e=Math.sqrt(n/cb);t.moveTo(e,0),t.arc(0,0,e,0,fb)}},Yb={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Gb=Math.sqrt(1/3),Vb=2*Gb,jb={draw:function(t,n){var e=Math.sqrt(n/Vb),r=e*Gb;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},$b=Math.sin(cb/10)/Math.sin(7*cb/10),Xb=Math.sin(fb/10)*$b,Wb=-Math.cos(fb/10)*$b,Zb={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Xb*e,i=Wb*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=fb*o/5,u=Math.cos(a),s=Math.sin(a);t.lineTo(s*e,-u*e),t.lineTo(u*r-s*i,s*r+u*i)}t.closePath()}},Kb={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Qb=Math.sqrt(3),Jb={draw:function(t,n){var e=-Math.sqrt(n/(3*Qb));t.moveTo(0,2*e),t.lineTo(-Qb*e,-e),t.lineTo(Qb*e,-e),t.closePath()}},tx=-.5,nx=Math.sqrt(3)/2,ex=1/Math.sqrt(12),rx=3*(ex/2+1),ix={draw:function(t,n){var e=Math.sqrt(n/rx),r=e/2,i=e*ex,o=r,a=e*ex+e,u=-o,s=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,s),t.lineTo(tx*r-nx*i,nx*r+tx*i),t.lineTo(tx*o-nx*a,nx*o+tx*a),t.lineTo(tx*u-nx*s,nx*u+tx*s),t.lineTo(tx*r+nx*i,tx*i-nx*r),t.lineTo(tx*o+nx*a,tx*a-nx*o),t.lineTo(tx*u+nx*s,tx*s-nx*u),t.closePath()}},ox=[Ub,Yb,jb,Kb,Zb,Jb,ix];function ax(){}function ux(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function sx(t){this._context=t}function cx(t){this._context=t}function lx(t){this._context=t}sx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ux(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ux(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},cx.prototype={areaStart:ax,areaEnd:ax,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:ux(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},lx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:ux(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};class fx{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}function hx(t,n){this._basis=new sx(t),this._beta=n}hx.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,s=-1;++s<=e;)r=s/e,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*n[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var dx=function t(n){function e(t){return 1===n?new sx(t):new hx(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function px(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function gx(t,n){this._context=t,this._k=(1-n)/6}gx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:px(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:px(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var yx=function t(n){function e(t){return new gx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function mx(t,n){this._context=t,this._k=(1-n)/6}mx.prototype={areaStart:ax,areaEnd:ax,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:px(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var vx=function t(n){function e(t){return new mx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function _x(t,n){this._context=t,this._k=(1-n)/6}_x.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:px(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var bx=function t(n){function e(t){return new _x(t,n)}return e.tension=function(n){return t(+n)},e}(0);function xx(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>sb){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>sb){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-n*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-e*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function wx(t,n){this._context=t,this._alpha=n}wx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:xx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Mx=function t(n){function e(t){return n?new wx(t,n):new gx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function kx(t,n){this._context=t,this._alpha=n}kx.prototype={areaStart:ax,areaEnd:ax,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:xx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Tx=function t(n){function e(t){return n?new kx(t,n):new mx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Ax(t,n){this._context=t,this._alpha=n}Ax.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:xx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Sx=function t(n){function e(t){return n?new Ax(t,n):new _x(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Ex(t){this._context=t}function Cx(t){return t<0?-1:1}function Nx(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Cx(o)+Cx(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Px(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Dx(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function zx(t){this._context=t}function Lx(t){this._context=new Hx(t)}function Hx(t){this._context=t}function Rx(t){this._context=t}function Bx(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function Ox(t,n){return t[n]}function Ux(t){const n=[];return n.key=t,n}function Yx(t){var n=t.map(Gx);return Fx(t).sort((function(t,e){return n[t]-n[e]}))}function Gx(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function Vx(t){var n=t.map(jx);return Fx(t).sort((function(t,e){return n[t]-n[e]}))}function jx(t){for(var n,e=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var $x=t=>()=>t;function Xx(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Wx(t,n,e){this.k=t,this.x=n,this.y=e}Wx.prototype={constructor:Wx,scale:function(t){return 1===t?this:new Wx(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Wx(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Zx=new Wx(1,0,0);function Kx(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Zx;return t.__zoom}function Qx(t){t.stopImmediatePropagation()}function Jx(t){t.preventDefault(),t.stopImmediatePropagation()}function tw(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function nw(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function ew(){return this.__zoom||Zx}function rw(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function iw(){return navigator.maxTouchPoints||"ontouchstart"in this}function ow(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}Kx.prototype=Wx.prototype,t.Adder=y,t.Delaunay=Su,t.FormatSpecifier=Is,t.InternMap=m,t.InternSet=v,t.Node=Pd,t.Voronoi=xu,t.ZoomTransform=Wx,t.active=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>ki&&e.name===n)return new to([[t]],Bo,n,+r);return null},t.arc=function(){var t=db,n=pb,e=tb(0),r=null,i=gb,o=yb,a=mb,u=null;function s(){var s,c,l=+t.apply(this,arguments),f=+n.apply(this,arguments),h=i.apply(this,arguments)-lb,d=o.apply(this,arguments)-lb,p=nb(d-h),g=d>h;if(u||(u=s=Ta()),fsb)if(p>fb-sb)u.moveTo(f*rb(h),f*ab(h)),u.arc(0,0,f,h,d,!g),l>sb&&(u.moveTo(l*rb(d),l*ab(d)),u.arc(0,0,l,d,h,g));else{var y,m,v=h,_=d,b=h,x=d,w=p,M=p,k=a.apply(this,arguments)/2,T=k>sb&&(r?+r.apply(this,arguments):ub(l*l+f*f)),A=ob(nb(f-l)/2,+e.apply(this,arguments)),S=A,E=A;if(T>sb){var C=hb(T/l*ab(k)),N=hb(T/f*ab(k));(w-=2*C)>sb?(b+=C*=g?1:-1,x-=C):(w=0,b=x=(h+d)/2),(M-=2*N)>sb?(v+=N*=g?1:-1,_-=N):(M=0,v=_=(h+d)/2)}var P=f*rb(v),D=f*ab(v),z=l*rb(x),L=l*ab(x);if(A>sb){var H,R=f*rb(_),B=f*ab(_),I=l*rb(b),q=l*ab(b);if(p1?0:t<-1?cb:Math.acos(t)}((F*U+O*Y)/(ub(F*F+O*O)*ub(U*U+Y*Y)))/2),V=ub(H[0]*H[0]+H[1]*H[1]);S=ob(A,(l-V)/(G-1)),E=ob(A,(f-V)/(G+1))}}M>sb?E>sb?(y=vb(I,q,P,D,f,E,g),m=vb(R,B,z,L,f,E,g),u.moveTo(y.cx+y.x01,y.cy+y.y01),Esb&&w>sb?S>sb?(y=vb(z,L,R,B,l,-S,g),m=vb(P,D,I,q,l,-S,g),u.lineTo(y.cx+y.x01,y.cy+y.y01),S>a,c=i+2*u>>a,l=Ia(20);function f(r){var i=new Float32Array(s*c),f=new Float32Array(s*c),d=Math.pow(2,-a);r.forEach((function(r,o,a){var l=(t(r,o,a)+u)*d,f=(n(r,o,a)+u)*d,h=+e(r,o,a);if(l>=0&&l=0&&f>a),ja({width:s,height:c,data:f},{width:s,height:c,data:i},o>>a),Va({width:s,height:c,data:i},{width:s,height:c,data:f},o>>a),ja({width:s,height:c,data:f},{width:s,height:c,data:i},o>>a),Va({width:s,height:c,data:i},{width:s,height:c,data:f},o>>a),ja({width:s,height:c,data:f},{width:s,height:c,data:i},o>>a);var p=l(i);if(!Array.isArray(p)){var g=j(i);p=U(0,g,p),(p=et(0,Math.floor(g/p)*p,p)).shift()}return Ga().thresholds(p).size([s,c])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*a),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function y(){return s=r+2*(u=3*o)>>a,c=i+2*u>>a,f}return f.x=function(n){return arguments.length?(t="function"==typeof n?n:Ia(+n),f):t},f.y=function(t){return arguments.length?(n="function"==typeof t?t:Ia(+t),f):n},f.weight=function(t){return arguments.length?(e="function"==typeof t?t:Ia(+t),f):e},f.size=function(t){if(!arguments.length)return[r,i];var n=+t[0],e=+t[1];if(!(n>=0&&e>=0))throw new Error("invalid size");return r=n,i=e,y()},f.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),y()},f.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Ia(Ra.call(t)):Ia(t),f):l},f.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),y()},f},t.contours=Ga,t.count=c,t.create=function(t){return On(zt(t).call(document.documentElement))},t.creator=zt,t.cross=function(...t){const n="function"==typeof t[t.length-1]&&function(t){return n=>t(...n)}(t.pop()),e=(t=t.map(h)).map(l),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(f))return o;for(;;){o.push(i.map(((n,e)=>t[e][n])));let a=r;for(;++i[a]===e[a];){if(0===a)return n?o.map(n):o;i[a--]=0}}},t.csv=as,t.csvFormat=Ou,t.csvFormatBody=Uu,t.csvFormatRow=Gu,t.csvFormatRows=Yu,t.csvFormatValue=Vu,t.csvParse=qu,t.csvParseRows=Fu,t.cubehelix=fr,t.cumsum=function(t,n){var e=0,r=0;return Float64Array.from(t,void 0===n?t=>e+=+t||0:i=>e+=+n(i,r++,t)||0)},t.curveBasis=function(t){return new sx(t)},t.curveBasisClosed=function(t){return new cx(t)},t.curveBasisOpen=function(t){return new lx(t)},t.curveBumpX=function(t){return new fx(t,!0)},t.curveBumpY=function(t){return new fx(t,!1)},t.curveBundle=dx,t.curveCardinal=yx,t.curveCardinalClosed=vx,t.curveCardinalOpen=bx,t.curveCatmullRom=Mx,t.curveCatmullRomClosed=Tx,t.curveCatmullRomOpen=Sx,t.curveLinear=wb,t.curveLinearClosed=function(t){return new Ex(t)},t.curveMonotoneX=function(t){return new zx(t)},t.curveMonotoneY=function(t){return new Lx(t)},t.curveNatural=function(t){return new Rx(t)},t.curveStep=function(t){return new Ix(t,.5)},t.curveStepAfter=function(t){return new Ix(t,1)},t.curveStepBefore=function(t){return new Ix(t,0)},t.descending=function(t,n){return null==t||null==n?NaN:nt?1:n>=t?0:NaN},t.deviation=p,t.difference=function(t,...n){t=new v(t);for(const e of n)for(const n of e)t.delete(n);return t},t.disjoint=function(t,n){const e=n[Symbol.iterator](),r=new v;for(const n of t){if(r.has(n))return!1;let t,i;for(;({value:t,done:i}=e.next())&&!i;){if(Object.is(n,t))return!1;r.add(t)}}return!0},t.dispatch=kt,t.drag=function(){var t,n,e,r,i=ne,o=ee,a=re,u=ie,s={},c=kt("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",m,$n).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,u){if(!r&&i.call(this,a,u)){var s=_(this,o.call(this,a,u),a,u,"mouse");s&&(On(a.view).on("mousemove.drag",p,Xn).on("mouseup.drag",g,Xn),Kn(a.view),Wn(a),e=!1,t=a.clientX,n=a.clientY,s("start",a))}}function p(r){if(Zn(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>f}s.mouse("drag",r)}function g(t){On(t.view).on("mousemove.drag mouseup.drag",null),Qn(t.view,e),Zn(t),s.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,u=o.call(this,t,n),s=a.length;for(e=0;e+t,t.easePoly=so,t.easePolyIn=ao,t.easePolyInOut=so,t.easePolyOut=uo,t.easeQuad=io,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=io,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=fo,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*lo)},t.easeSinInOut=fo,t.easeSinOut=function(t){return Math.sin(t*lo)},t.every=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(!n(r,++e,t))return!1;return!0},t.extent=g,t.fcumsum=function(t,n){const e=new y;let r=-1;return Float64Array.from(t,void 0===n?t=>e.add(+t||0):i=>e.add(+n(i,++r,t)||0))},t.filter=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");const e=[];let r=-1;for(const i of t)n(i,++r,t)&&e.push(i);return e},t.flatGroup=function(t,...n){return A(T(t,...n),n)},t.flatRollup=function(t,n,...e){return A(E(t,n,...e),e)},t.forceCenter=function(t,n){var e,r=1;function i(){var i,o,a=e.length,u=0,s=0;for(i=0;ic+p||ol+p||as.index){var g=c-u.x-u.vx,y=l-u.y-u.vy,m=g*g+y*y;mt.r&&(t.r=t[n].r)}function s(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r[u(t,n,r),t])));for(a=0,i=new Array(c);a=u)){(t.data!==n||t.next)&&(0===f&&(p+=(f=ws(e))*f),0===h&&(p+=(h=ws(e))*h),p(t=(Ss*t+Es)%Cs)/Cs}();function f(){h(),c.call("tick",n),e1?(null==e?u.delete(t):u.set(t,p(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,s,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,e),n):c.on(t)}}},t.forceX=function(t){var n,e,r,i=xs(.1);function o(t){for(var i,o=0,a=n.length;o=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},l.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),s.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++eSl(r[0],r[1])&&(r[1]=i[1]),Sl(i[0],r[1])>Sl(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=Sl(r[1],i[0]))>a&&(a=u,Dc=i[0],Lc=r[1])}return Oc=Uc=null,Dc===1/0||zc===1/0?[[NaN,NaN],[NaN,NaN]]:[[Dc,zc],[Lc,Hc]]},t.geoCentroid=function(t){rl=il=ol=al=ul=sl=cl=ll=0,fl=new y,hl=new y,dl=new y,Ac(t,Nl);var n=+fl,e=+hl,r=+dl,i=lc(n,e,r);return i2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=xd,t.gray=function(t,n){return new Xe(t,0,0,null==n?1:n)},t.greatest=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)>0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)>0:0===e(n,n))&&(r=n,i=!0);return r},t.greatestIndex=function(t,e=n){if(1===e.length)return Q(t,e);let r,i=-1,o=-1;for(const n of t)++o,(i<0?0===e(n,n):e(n,r)>0)&&(r=n,i=o);return i},t.group=k,t.groupSort=function(t,e,r){return(2!==e.length?D(S(t,e,r),(([t,e],[r,i])=>n(e,i)||n(t,r))):D(k(t,r),(([t,r],[i,o])=>e(r,o)||n(t,i)))).map((([t])=>t))},t.groups=T,t.hcl=tr,t.hierarchy=Ad,t.histogram=V,t.hsl=Le,t.html=fs,t.image=function(t,n){return new Promise((function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t}))},t.index=function(t,...n){return N(t,M,C,n)},t.indexes=function(t,...n){return N(t,Array.from,C,n)},t.interpolate=Lr,t.interpolateArray=function(t,n){return(Ar(n)?Tr:Sr)(t,n)},t.interpolateBasis=pr,t.interpolateBasisClosed=gr,t.interpolateBlues=P_,t.interpolateBrBG=Yv,t.interpolateBuGn=u_,t.interpolateBuPu=c_,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=G_,t.interpolateCubehelix=Qr,t.interpolateCubehelixDefault=U_,t.interpolateCubehelixLong=Jr,t.interpolateDate=Er,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateGnBu=f_,t.interpolateGreens=z_,t.interpolateGreys=H_,t.interpolateHcl=Wr,t.interpolateHclLong=Zr,t.interpolateHsl=jr,t.interpolateHslLong=$r,t.interpolateHue=function(t,n){var e=vr(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateInferno=Q_,t.interpolateLab=function(t,n){var e=br((t=$e(t)).l,(n=$e(n)).l),r=br(t.a,n.a),i=br(t.b,n.b),o=br(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateMagma=K_,t.interpolateNumber=Cr,t.interpolateNumberArray=Tr,t.interpolateObject=Nr,t.interpolateOrRd=d_,t.interpolateOranges=O_,t.interpolatePRGn=Vv,t.interpolatePiYG=$v,t.interpolatePlasma=J_,t.interpolatePuBu=m_,t.interpolatePuBuGn=g_,t.interpolatePuOr=Wv,t.interpolatePuRd=__,t.interpolatePurples=B_,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return V_.h=360*t-100,V_.s=1.5-1.5*n,V_.l=.8-.9*n,V_+""},t.interpolateRdBu=Kv,t.interpolateRdGy=Jv,t.interpolateRdPu=x_,t.interpolateRdYlBu=n_,t.interpolateRdYlGn=r_,t.interpolateReds=q_,t.interpolateRgb=xr,t.interpolateRgbBasis=Mr,t.interpolateRgbBasisClosed=kr,t.interpolateRound=Hr,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,j_.r=255*(n=Math.sin(t))*n,j_.g=255*(n=Math.sin(t+$_))*n,j_.b=255*(n=Math.sin(t+X_))*n,j_+""},t.interpolateSpectral=o_,t.interpolateString=zr,t.interpolateTransformCss=Or,t.interpolateTransformSvg=Ur,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=Z_,t.interpolateWarm=Y_,t.interpolateYlGn=T_,t.interpolateYlGnBu=M_,t.interpolateYlOrBr=S_,t.interpolateYlOrRd=C_,t.interpolateZoom=Gr,t.interrupt=Li,t.intersection=function(t,...n){t=new v(t),n=n.map(st);t:for(const e of t)for(const r of n)if(!r.has(e)){t.delete(e);continue t}return t},t.interval=function(t,n,e){var r=new pi,i=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?hi():+e,r._restart((function o(a){a+=i,r._restart(o,i+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)},t.isoFormat=_v,t.isoParse=xv,t.json=function(t,n){return fetch(t,n).then(ss)},t.lab=$e,t.lch=function(t,n,e,r){return 1===arguments.length?Je(t):new nr(e,n,t,null==r?1:r)},t.least=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)<0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)<0:0===e(n,n))&&(r=n,i=!0);return r},t.leastIndex=rt,t.line=Tb,t.lineRadial=zb,t.linkHorizontal=function(){return Ib(qb)},t.linkRadial=function(){var t=Ib(Ob);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return Ib(Fb)},t.local=Yn,t.map=function(t,n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof n)throw new TypeError("mapper is not a function");return Array.from(t,((e,r)=>n(e,r,t)))},t.matcher=qt,t.max=j,t.maxIndex=Q,t.mean=function(t,n){let e=0,r=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(++e,r+=n);else{let i=-1;for(let o of t)null!=(o=n(o,++i,t))&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e},t.median=function(t,n){return Z(t,.5,n)},t.merge=J,t.min=$,t.minIndex=tt,t.mode=function(t,n){const e=new m;if(void 0===n)for(let n of t)null!=n&&n>=n&&e.set(n,(e.get(n)||0)+1);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&i>=i&&e.set(i,(e.get(i)||0)+1)}let r,i=0;for(const[t,n]of e)n>i&&(i=n,r=t);return r},t.namespace=Nt,t.namespaces=Ct,t.nice=Y,t.now=hi,t.pack=function(){var t=null,n=1,e=1,r=$d;function i(i){return i.x=n/2,i.y=e/2,t?i.eachBefore(Zd(t)).eachAfter(Kd(r,.5)).eachBefore(Qd(1)):i.eachBefore(Zd(Wd)).eachAfter(Kd($d,1)).eachAfter(Kd(r,i.r/Math.min(n,e))).eachBefore(Qd(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=Vd(n),i):t},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:Xd(+t),i):r},i},t.packEnclose=Dd,t.packSiblings=function(t){return Gd(t),t},t.pairs=function(t,n=nt){const e=[];let r,i=!1;for(const o of t)i&&e.push(n(r,o)),r=o,i=!0;return e},t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&tp(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a0&&(d+=f);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(a[t],a[n])})),u=0,c=d?(m-h*_)/d:0;u0?f*c:0)+_,g[s]={data:a[s],index:u,value:f,startAngle:y,endAngle:l,padAngle:v};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:tb(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:tb(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:tb(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:tb(+t),a):o},a},t.piecewise=ti,t.pointRadial=Hb,t.pointer=jn,t.pointers=function(t,n){return t.target&&(t=Vn(t),void 0===n&&(n=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>jn(t,n)))},t.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++eu!=c>u&&a<(s-e)*(u-r)/(c-r)+e&&(l=!l),s=e,c=r;return l},t.polygonHull=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)c.push(t[r[o[n]][2]]);for(n=+u;n(n=1664525*n+1013904223|0,Fp*(n>>>0))},t.randomLogNormal=Ap,t.randomLogistic=Ip,t.randomNormal=Tp,t.randomPareto=Np,t.randomPoisson=qp,t.randomUniform=Mp,t.randomWeibull=Rp,t.range=et,t.rank=function(t,e=n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let r=Array.from(t);const i=new Float64Array(r.length);2!==e.length&&(r=r.map(e),e=n);const o=(t,n)=>e(r[t],r[n]);let a,u;return Uint32Array.from(r,((t,n)=>n)).sort(e===n?(t,n)=>L(r[t],r[n]):z(o)).forEach(((t,n)=>{const e=o(t,void 0===a?t:a);e>=0?((void 0===a||e>0)&&(a=t,u=n),i[t]=u):i[t]=NaN})),i},t.reduce=function(t,n,e){if("function"!=typeof n)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:e}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)e=n(e,o,++a,t);return e},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rgb=Se,t.ribbon=function(){return Ha()},t.ribbonArrow=function(){return Ha(La)},t.rollup=S,t.rollups=E,t.scaleBand=Vp,t.scaleDiverging=function t(){var n=rg(Ev()(Wp));return n.copy=function(){return Av(n,t())},Up.apply(n,arguments)},t.scaleDivergingLog=function t(){var n=fg(Ev()).domain([.1,1,10]);return n.copy=function(){return Av(n,t()).base(n.base())},Up.apply(n,arguments)},t.scaleDivergingPow=Cv,t.scaleDivergingSqrt=function(){return Cv.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function t(){var n=pg(Ev());return n.copy=function(){return Av(n,t()).constant(n.constant())},Up.apply(n,arguments)},t.scaleIdentity=function t(n){var e;function r(t){return null==t||isNaN(t=+t)?e:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=Array.from(t,$p),r):n.slice()},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,$p):[0,1],rg(r)},t.scaleImplicit=Yp,t.scaleLinear=function t(){var n=ng();return n.copy=function(){return Jp(n,t())},Op.apply(n,arguments),rg(n)},t.scaleLog=function t(){const n=fg(tg()).domain([1,10]);return n.copy=()=>Jp(n,t()).base(n.base()),Op.apply(n,arguments),n},t.scaleOrdinal=Gp,t.scalePoint=function(){return jp(Vp.apply(null,arguments).paddingInner(1))},t.scalePow=_g,t.scaleQuantile=function t(){var e,r=[],i=[],o=[];function a(){var t=0,n=Math.max(1,i.length);for(o=new Array(n-1);++t0?o[n-1]:r[0],n=i?[o[i-1],r]:[o[n-1],o[n]]},u.unknown=function(t){return arguments.length?(n=t,u):u},u.thresholds=function(){return o.slice()},u.copy=function(){return t().domain([e,r]).range(a).unknown(n)},Op.apply(rg(u),arguments)},t.scaleRadial=function t(){var n,e=ng(),r=[0,1],i=!1;function o(t){var r=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(t));return isNaN(r)?n:i?Math.round(r):r}return o.invert=function(t){return e.invert(bg(t))},o.domain=function(t){return arguments.length?(e.domain(t),o):e.domain()},o.range=function(t){return arguments.length?(e.range((r=Array.from(t,$p)).map(bg)),o):r.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(i=!!t,o):i},o.clamp=function(t){return arguments.length?(e.clamp(t),o):e.clamp()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t(e.domain(),r).round(i).clamp(e.clamp()).unknown(n)},Op.apply(o,arguments),rg(o)},t.scaleSequential=function t(){var n=rg(Tv()(Wp));return n.copy=function(){return Av(n,t())},Up.apply(n,arguments)},t.scaleSequentialLog=function t(){var n=fg(Tv()).domain([1,10]);return n.copy=function(){return Av(n,t()).base(n.base())},Up.apply(n,arguments)},t.scaleSequentialPow=Sv,t.scaleSequentialQuantile=function t(){var e=[],r=Wp;function i(t){if(null!=t&&!isNaN(t=+t))return r((s(e,t,1)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(n),i},i.interpolator=function(t){return arguments.length?(r=t,i):r},i.range=function(){return e.map(((t,n)=>r(n/(e.length-1))))},i.quantiles=function(t){return Array.from({length:t+1},((n,r)=>Z(e,r/t)))},i.copy=function(){return t(r).domain(e)},Up.apply(i,arguments)},t.scaleSequentialSqrt=function(){return Sv.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var n=pg(Tv());return n.copy=function(){return Av(n,t()).constant(n.constant())},Up.apply(n,arguments)},t.scaleSqrt=function(){return _g.apply(null,arguments).exponent(.5)},t.scaleSymlog=function t(){var n=pg(tg());return n.copy=function(){return Jp(n,t()).constant(n.constant())},Op.apply(n,arguments)},t.scaleThreshold=function t(){var n,e=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[s(e,t,0,i)]:n}return o.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,r.length-1),o):e.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(e.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var n=r.indexOf(t);return[e[n-1],e[n]]},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t().domain(e).range(r).unknown(n)},Op.apply(o,arguments)},t.scaleTime=function(){return Op.apply(kv(jy,$y,fy,sy,$g,Gg,Og,Ig,Hg,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return Op.apply(kv(Gy,Vy,Oy,Iy,My,by,my,py,Hg,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,n){const e=rt(t,n);return e<0?void 0:e},t.schemeAccent=Dv,t.schemeBlues=N_,t.schemeBrBG=Uv,t.schemeBuGn=a_,t.schemeBuPu=s_,t.schemeCategory10=Pv,t.schemeDark2=zv,t.schemeGnBu=l_,t.schemeGreens=D_,t.schemeGreys=L_,t.schemeOrRd=h_,t.schemeOranges=F_,t.schemePRGn=Gv,t.schemePaired=Lv,t.schemePastel1=Hv,t.schemePastel2=Rv,t.schemePiYG=jv,t.schemePuBu=y_,t.schemePuBuGn=p_,t.schemePuOr=Xv,t.schemePuRd=v_,t.schemePurples=R_,t.schemeRdBu=Zv,t.schemeRdGy=Qv,t.schemeRdPu=b_,t.schemeRdYlBu=t_,t.schemeRdYlGn=e_,t.schemeReds=I_,t.schemeSet1=Bv,t.schemeSet2=Iv,t.schemeSet3=qv,t.schemeSpectral=i_,t.schemeTableau10=Fv,t.schemeYlGn=k_,t.schemeYlGnBu=w_,t.schemeYlOrBr=A_,t.schemeYlOrRd=E_,t.select=On,t.selectAll=function(t){return"string"==typeof t?new qn([document.querySelectorAll(t)],[document.documentElement]):new qn([Rt(t)],In)},t.selection=Fn,t.selector=Ht,t.selectorAll=It,t.shuffle=it,t.shuffler=ot,t.some=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(n(r,++e,t))return!0;return!1},t.sort=D,t.stack=function(){var t=tb([]),n=Fx,e=qx,r=Ox;function i(i){var o,a,u=Array.from(t.apply(this,arguments),Ux),s=u.length,c=-1;for(const t of i)for(o=0,++c;o0)for(var e,r,i,o,a,u,s=0,c=t[n[0]].length;s0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},t.stackOffsetExpand=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,a=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;afunction(t){let n=(t=`${t}`).length;return up(t,n-1)&&!up(t,n-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(n,e,r)))),e=n.map(ap),i=new Set(n).add("");for(const t of e)i.has(t)||(i.add(t),n.push(t),e.push(ap(t)),h.push(rp));d=(t,e)=>n[e],p=(t,n)=>e[n]}for(a=0,i=h.length;a=0&&(c=h[t]).data===rp;--t)c.data=null}if(u.parent=np,u.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Nd),u.parent=null,i>0)throw new Error("cycle");return u}return r.id=function(t){return arguments.length?(n=Vd(t),r):n},r.parentId=function(t){return arguments.length?(e=Vd(t),r):e},r.path=function(n){return arguments.length?(t=Vd(n),r):t},r},t.style=cn,t.subset=function(t,n){return ct(n,t)},t.sum=function(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e},t.superset=ct,t.svg=hs,t.symbol=function(t,n){var e=null;function r(){var r;if(e||(e=r=Ta()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return t="function"==typeof t?t:tb(t||Ub),n="function"==typeof n?n:tb(void 0===n?64:+n),r.type=function(n){return arguments.length?(t="function"==typeof n?n:tb(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:tb(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},t.symbolCircle=Ub,t.symbolCross=Yb,t.symbolDiamond=jb,t.symbolSquare=Kb,t.symbolStar=Zb,t.symbolTriangle=Jb,t.symbolWye=ix,t.symbols=ox,t.text=is,t.thresholdFreedmanDiaconis=function(t,n,e){return Math.ceil((e-n)/(2*(Z(t,.75)-Z(t,.25))*Math.pow(c(t),-1/3)))},t.thresholdScott=function(t,n,e){return Math.ceil((e-n)/(3.5*p(t)*Math.pow(c(t),-1/3)))},t.thresholdSturges=G,t.tickFormat=eg,t.tickIncrement=O,t.tickStep=U,t.ticks=F,t.timeDay=Gg,t.timeDays=Vg,t.timeFormatDefaultLocale=yv,t.timeFormatLocale=Ky,t.timeFriday=Qg,t.timeFridays=oy,t.timeHour=Og,t.timeHours=Ug,t.timeInterval=Mg,t.timeMillisecond=Tg,t.timeMilliseconds=Ag,t.timeMinute=Ig,t.timeMinutes=qg,t.timeMonday=Xg,t.timeMondays=ny,t.timeMonth=sy,t.timeMonths=cy,t.timeSaturday=Jg,t.timeSaturdays=ay,t.timeSecond=Hg,t.timeSeconds=Rg,t.timeSunday=$g,t.timeSundays=ty,t.timeThursday=Kg,t.timeThursdays=iy,t.timeTickInterval=$y,t.timeTicks=jy,t.timeTuesday=Wg,t.timeTuesdays=ey,t.timeWednesday=Zg,t.timeWednesdays=ry,t.timeWeek=$g,t.timeWeeks=ty,t.timeYear=fy,t.timeYears=hy,t.timeout=bi,t.timer=gi,t.timerFlush=yi,t.transition=no,t.transpose=at,t.tree=function(){var t=sp,n=1,e=1,r=null;function i(i){var s=function(t){for(var n,e,r,i,o,a=new dp(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new dp(r[i],i)),e.parent=n;return(a.parent=new dp(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(u);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,d=h-c.x,p=n/(l.x+h+d),g=e/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,s=o.parent.children[0],c=o.m,l=a.m,f=u.m,h=s.m;u=lp(u),o=cp(o),u&&o;)s=cp(s),(a=lp(a)).a=n,(i=u.z+f-o.z-c+t(u._,o._))>0&&(fp(hp(u,n,r),n,i),c+=i,l+=i),f+=u.m,c+=o.m,h+=s.m,l+=a.m;u&&!lp(a)&&(a.t=u,a.m+=f-l),o&&!cp(s)&&(s.t=o,s.m+=c-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=mp,n=!1,e=1,r=1,i=[0],o=$d,a=$d,u=$d,s=$d,c=$d;function l(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(f),i=[0],n&&t.eachBefore(Jd),t}function f(n){var e=i[n.depth],r=n.x0+e,l=n.y0+e,f=n.x1-e,h=n.y1-e;f=e-1){var l=u[n];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=s)}for(var f=c[n],h=r/2+f,d=n+1,p=e-1;d>>1;c[g]s-o){var v=r?(i*m+a*y)/r:a;t(n,d,y,i,o,v,s),t(d,e,m,v,o,a,s)}else{var _=r?(o*m+s*y)/r:s;t(n,d,y,i,o,a,_),t(d,e,m,i,_,a,s)}}(0,s,t.value,n,e,r,i)},t.treemapDice=tp,t.treemapResquarify=vp,t.treemapSlice=pp,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?pp:tp)(t,n,e,r,i)},t.treemapSquarify=mp,t.tsv=us,t.tsvFormat=Wu,t.tsvFormatBody=Zu,t.tsvFormatRow=Qu,t.tsvFormatRows=Ku,t.tsvFormatValue=Ju,t.tsvParse=$u,t.tsvParseRows=Xu,t.union=function(...t){const n=new v;for(const e of t)for(const t of e)n.add(t);return n},t.utcDay=by,t.utcDays=xy,t.utcFriday=Ey,t.utcFridays=Hy,t.utcHour=my,t.utcHours=vy,t.utcMillisecond=Tg,t.utcMilliseconds=Ag,t.utcMinute=py,t.utcMinutes=gy,t.utcMonday=ky,t.utcMondays=Py,t.utcMonth=Iy,t.utcMonths=qy,t.utcSaturday=Cy,t.utcSaturdays=Ry,t.utcSecond=Hg,t.utcSeconds=Rg,t.utcSunday=My,t.utcSundays=Ny,t.utcThursday=Sy,t.utcThursdays=Ly,t.utcTickInterval=Vy,t.utcTicks=Gy,t.utcTuesday=Ty,t.utcTuesdays=Dy,t.utcWednesday=Ay,t.utcWednesdays=zy,t.utcWeek=My,t.utcWeeks=Ny,t.utcYear=Oy,t.utcYears=Uy,t.variance=d,t.version="7.2.1",t.window=on,t.xml=ls,t.zip=function(){return at(arguments)},t.zoom=function(){var t,n,e,r=tw,i=nw,o=ow,a=rw,u=iw,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Gr,h=kt("start","zoom","end"),d=500,p=150,g=0,y=10;function m(t){t.property("__zoom",ew).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",A).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,n){return(n=Math.max(s[0],Math.min(s[1],n)))===t.k?t:new Wx(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Wx(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=w(t,o).event(r),u=i.apply(t,o),s=null==e?b(u):"function"==typeof e?e.apply(t,o):e,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),l=t.__zoom,h="function"==typeof n?n.apply(t,o):n,d=f(l.invert(s).concat(c/l.k),h.invert(s).concat(c/h.k));return function(t){if(1===t)t=h;else{var n=d(t),e=c/n[2];t=new Wx(e,s[0]-n[0]*e,s[1]-n[1]*e)}a.zoom(null,t)}}))}function w(t,n,e){return!e&&t.__zooming||new M(t,n)}function M(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function k(t,...n){if(r.apply(this,arguments)){var e=w(this,n).event(t),i=this.__zoom,u=Math.max(s[0],Math.min(s[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=jn(t);if(e.wheel)e.mouse[0][0]===l[0]&&e.mouse[0][1]===l[1]||(e.mouse[1]=i.invert(e.mouse[0]=l)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[l,i.invert(l)],Li(this),e.start()}Jx(t),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),p),e.zoom("mouse",o(_(v(i,u),e.mouse[0],e.mouse[1]),e.extent,c))}}function T(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=w(this,n,!0).event(t),u=On(t.view).on("mousemove.zoom",(function(t){if(Jx(t),!a.moved){var n=t.clientX-l,e=t.clientY-f;a.moved=n*n+e*e>g}a.event(t).zoom("mouse",o(_(a.that.__zoom,a.mouse[0]=jn(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),Qn(t.view,a.moved),Jx(t),a.event(t).end()}),!0),s=jn(t,i),l=t.clientX,f=t.clientY;Kn(t.view),Qx(t),a.mouse=[s,this.__zoom.invert(s)],Li(this),a.start()}}function A(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=jn(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),s=e.k*(t.shiftKey?.5:2),f=o(_(v(e,s),a,u),i.apply(this,n),c);Jx(t),l>0?On(this).transition().duration(l).call(x,f,a,t):On(this).call(m.transform,f,a,t)}}function S(e,...i){if(r.apply(this,arguments)){var o,a,u,s,c=e.touches,l=c.length,f=w(this,i,e.changedTouches.length===l).event(e);for(Qx(e),a=0;a{"use strict";var t;!function(t){t.AttentionMatrix="attention_matrix",t.SrcTokenHeatmap="query_token_heatmap",t.DestTokenHeatmap="key_token_heatmap",t.DimensionHeatmap="dimension_heatmap",t.TokenDimHeatmap="token_dim_heatmap",t.LineGrid="line_grid",t.TokenLoss="token_loss"}(t||(t={}));class n{constructor(t){this.chart_types=t.chart_types,this.src_tokens=t.src_tokens,this.tgt_tokens=t.tgt_tokens,this.dimensions=[];for(let n in t.dimensions)this.dimensions.push({name:t.dimensions[n].name});this.attention=[];for(let n in t.attention){let e=i(t.attention[n].values,t.attention[n].shape);this.attention.push({values:e,info:t.attention[n].info})}}}function r(t,n){if(1===n.length)return t;let e=[],i=n[0];n=n.slice(1);let o=t.length/i;for(let a=0;a2)throw Error("Invalid Definition: "+t);return e.length>1&&(n.classes=e.slice(1)),n}const l={h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0};let f=function(){function t(t,n){for(let e in n){let r=n[e];null!=r?t.style.setProperty(e,r):t.style.removeProperty(e)}}function n(t,n){for(let e in n){let r=e.split("|");for(let i of r)t.addEventListener(i,n[e],!1)}}function e(t,n){for(let e in n)t[e]=n[e]}let r;function i(t,n){null!=n.id&&(t.id=n.id);for(let e of n.classes)t.classList.add(e)}function a(t,n){if(null!=n.id&&(t.id=n.id),n.classes.length>0){let e=n.classes.join(" ");t.setAttribute("class",e)}}return function(){let t=o.document.createElementNS("http://www.w3.org/2000/svg","g");r=t.classList?i:a}(),function i(...a){let f,h=function(t){let n={def:null,text:null,attrs:null,func:null,parent:null};if(0==t.length)n.def=c("div");else if("string"==typeof t[0]){let e=t[0];if(function(t){if(null!=l[t])return!0;for(let n of t)if(n.toLowerCase()!==n||n.toUpperCase()===n)return!1;return!0}(e)&&t.length>1&&"string"==typeof t[1]){const n=t[1];n.length>1&&("."===n[0]||"#"===n[0])&&(e+=n,t=t.slice(1))}n.def=c(e),t=t.slice(1)}for(let e of t)switch(typeof e){case"function":n.func=e;break;case"object":e instanceof HTMLElement||e instanceof SVGElement?n.parent=e:n.attrs=e;break;case"string":n.text=e}return n}(a),d=h.parent;if(null!=this&&null!=this._elem){if(null!=d)throw Error("Cannot set a parent within a context");d=this._elem}if(null==h.def)f=d;else{let i=h.def.tag,a=s[u[i]];f=null!=a?o.document.createElementNS(a,i):o.document.createElement(i),null!=h.def&&r(f,h.def),null!=h.attrs&&function(r,i){for(let o in i){let a=i[o];switch(o){case"style":t(r,a);break;case"on":n(r,a);break;case"data":e(r,a);break;default:null!=a?r.setAttribute(o,a):r.removeAttribute(o)}}}(f,h.attrs),null!=d&&d.appendChild(f)}if(null!=h.func){let t={_elem:f};h.func(i.bind(t))}else null!=h.text&&(f.textContent=h.text);return f}}();class h{}class d extends h{constructor(t){super(),this.token=t}addClickHandler(t,n,e){this.handler=e,this.type=t,this.idx=n}render(t,n){let e={"font-size":t/2+"px"};return n&&(e["writing-mode"]="tb"),f("text",this.token,{style:e})}}function p(t,n){let e=[];for(let r=0;r{this.handler(t,n,e)},this.srcTokens=t,this.dstTokens=n,this.attentions=p(t.length,n.length),this.srcTokenElems=[];for(let n=0;n{t=n("g",".grid",{transform:`translate(${this.leftLabelsMargin}, ${this.topLabelsMargin})`}),this.srcLabels=[],n("g",".src_labels",{transform:`translate(${this.leftLabelsMargin-this.labelCellGap}, ${this.topLabelsMargin+this.cellSize/2})`},(t=>{for(let n=0;n{for(let n=0;n{t.preventDefault(),t.stopPropagation(),this.handler(this.type,this.idx,t.shiftKey)},this.token=t,this.selected=!0,this.plotColors=n}render(){return this.elem=f("div",".token",this.token),this.elem.addEventListener("click",this.onClick),this.elem}addClickHandler(t,n,e){this.handler=e,this.type=t,this.idx=n}setAttn(n){this.selected?(this.elem.style.setProperty("background",this.plotColors.getInterpolatedColor(.8*n,"src"==this.type?t.SrcTokenHeatmap:t.DestTokenHeatmap)),this.elem.style.setProperty("border-left",`3px solid ${_(this.plotColors.getInterpolatedColor(1-.8*n,"src"==this.type?t.SrcTokenHeatmap:t.DestTokenHeatmap),.5)}`)):(this.elem.style.setProperty("background",this.plotColors.getInterpolatedSecondaryColor(.8*n)),this.elem.style.setProperty("border-left",`3px solid ${_(this.plotColors.getInterpolatedSecondaryColor(1-.8*n),.5)}`)),this.elem.style.setProperty("color",this.plotColors.getFilledTextColor()),this.elem.title=n.toExponential()}setSelection(t){this.selected=t}}class M{constructor(t,n,e){this.tokens=t,this.title=n,this.plotColors=e,this.tokenViews=[];for(let t=0;t{t("div.title",this.title)}));for(let n=0;n{t.preventDefault(),t.stopPropagation(),this.handler(this.type,this.idx,t.shiftKey)},this.value=t,this.selected=!0,this.plotColors=n}render(){return this.elem=f("div",".value",this.value),this.elem.addEventListener("click",this.onClick),this.elem}addClickHandler(t,n,e){this.handler=e,this.type=t,this.idx=n}set background(t){this.elem.style.background=t}setAttn(n){this.selected?this.elem.style.setProperty("background",this.plotColors.getInterpolatedColor(.8*n,t.DimensionHeatmap)):this.elem.style.setProperty("background",this.plotColors.getInterpolatedSecondaryColor(.8*n)),this.elem.style.setProperty("color",this.plotColors.getFilledTextColor()),this.elem.title=n.toExponential()}setSelection(t){this.selected=t}}class T{constructor(t,n,e){this.values=t,this.name=n,this.plotColors=e,this.valueViews={};for(let t of this.values){let n=new k(t,this.plotColors);this.valueViews[t]=n}}addClickHandler(t,n){for(let e=0;e{var n;t("div",".dimension-name.title",`${n=this.name,n.split(" ").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join(" ")}`)}));for(let n=0;n{this.handler(t,n,e)},this.onDimSelect=t=>{t.preventDefault(),t.stopPropagation(),this.selectedDimension=this.dimSelectElem.value,this.renderChart(),this.tokenDim=this.handler(this.selectedDimension),this.renderAttention()},this.tokens=t,this.dimensions=n,this.handler=e,this.plotColors=r,this.tokenElems=[];for(let n=0;n{t("div",".select-container",(t=>{t("div.title.inline","Dimension",{for:"token-dim-heatmap-select"}),this.dimSelectElem=t("select","#token-dim-heatmap-select",{on:{change:this.onDimSelect}},(t=>{for(let n in this.dimensions)t("option",n,{value:n})}))}))})),this.dimSelectElem.value=this.selectedDimension,this.renderChart(),this.elem}renderChart(){let t;null!=this.chartElem&&(this.chartElem.remove(),this.chartElem=null);let n=this.dimensions[this.selectedDimension],e={width:this.cellSize*n.values.length+this.leftLabelsMargin,height:this.cellSize*this.tokens.length,viewBox:`0 0 ${this.cellSize*n.values.length+this.leftLabelsMargin} ${this.cellSize*this.tokens.length} `};this.chartElem=f("svg",".matrix",e,(n=>{t=n("g",".grid",{transform:`translate(${this.leftLabelsMargin}, 0)`});let e=[];n("g",".token_labels",{transform:`translate(${this.leftLabelsMargin-this.labelCellGap}, ${this.cellSize/2})`},(t=>{for(let n=0;n{t.preventDefault(),t.stopPropagation(),console.log("click",this.dims);for(let t of this.dims)this.handler(t.d,t.v,!1)},this.height=e,this.width=r,this.nSrc=t,this.nDst=n}render(){this.elem=f("g",".lines",{on:{click:this.onClick}},(t=>{this.bgLines=t("g"),this.fgLines=t("g")})),this.lines=[];for(let t=0;t{t.preventDefault(),t.stopPropagation(),this.dim1=this.dimSelectElem1.value,this.renderChart(),this.attentions=this.dimChangeHandler(this.dim1,this.dim2),this.renderSelection(),this.renderAttention()},this.onDim2Select=t=>{t.preventDefault(),t.stopPropagation(),this.dim2=this.dimSelectElem2.value,this.renderChart(),this.attentions=this.dimChangeHandler(this.dim1,this.dim2),this.renderSelection(),this.renderAttention()},this.srcTokens=t,this.dstTokens=n,this.dimChangeHandler=r,this.dimensions=e,this.dim1="null",this.dim2="null",this.cellWidth=80,this.cellHeight=100,this.cellMargin=10}addClickHandler(t){this.selectHanlder=t}render(){return this.elem=f("div",".line-grid",(t=>{t("div.double-select",(t=>{t("div",".select-container",(t=>{t("label.title.inline","Y Dimension",{for:"line-grid-dim2-select"}),this.dimSelectElem1=t("select","#line-grid-dim2-select",{on:{change:this.onDim1Select}},(t=>{for(let n in this.dimensions)t("option",n,{value:n});t("option","None",{value:"null"})}))})),t("div",".select-container",(t=>{t("label.title.inline","X Dimension",{for:"line-grid-dim1-select"}),this.dimSelectElem2=t("select","#line-grid-dim1-select",{on:{change:this.onDim2Select}},(t=>{for(let n in this.dimensions)t("option",n,{value:n});t("option","None",{value:"null"})}))}))}))})),this.dimSelectElem1.value=this.dim1,this.dimSelectElem2.value=this.dim2,this.renderChart(),this.elem}renderChart(){null!=this.chartElem&&(this.chartElem.remove(),this.chartElem=null);let t=v(this.dim1,this.dimensions),n=v(this.dim2,this.dimensions),e={width:this.cellWidth*n.length+this.cellMargin*(n.length-1),height:this.cellHeight*t.length+this.cellMargin*(t.length-1),viewBox:`0 0 ${this.cellWidth*n.length+this.cellMargin*(n.length-1)} ${this.cellHeight*t.length+this.cellMargin*(t.length-1)}`};this.cellLayers=[],this.chartElem=f("svg",".matrix",e,(e=>{for(let r=0;r{for(let e=0;e{if(e)this.selected[t][n]=!0!==this.selected[t][n];else if(!0===this.selected[t][n])if(this.getSelectedCount(t)>1){for(let n in this.selected[t])this.selected[t][n]=!1;this.selected[t][n]=!0}else for(let n in this.selected[t])this.selected[t][n]=!0;else{for(let n in this.selected[t])this.selected[t][n]=!1;this.selected[t][n]=!0}this.renderAttention()},this.onLineGridDimChange=(t,n)=>this.calcGridAttentionAttention(t,n),this.onTokenHeatmapDimChange=t=>this.calcTokenDimsAttention(t),this.attentions=e,this.srcTokens=new D(r),this.dstTokens=new D(i),this.chartTypes=o,this.dimensions=n,this.dimensionsMap={};for(let t of this.dimensions)this.dimensionsMap[t.name]=t;this.attentionMatrixView=new x(this.srcTokens,this.dstTokens,a),this.srcTokenHeatmap=new M(this.srcTokens,"Query Tokens",a),this.dstTokenHeatmap=new M(this.dstTokens,"Key Tokens",a),this.srcTokenHeatmap.addClickHandler("src",this.onSelected),this.dstTokenHeatmap.addClickHandler("dst",this.onSelected),this.selected={};for(let t of n){let n={};for(let r of e)!0!==n[r.info[t.name]]&&(n[r.info[t.name]]=!0);this.selected[t.name]={},t.values=[];for(let e in n)this.selected[t.name][e]=!0,t.values.push(e)}this.selected.src={};for(let t=0;tn&&this.menu.classList.add("right-align")}render(){return f("div",".hover-container",(t=>{this.elem=t("pre",".token"+(this.isNewLine?".new-line":""),this.token.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\v/g,"\\v")),this.elem.style.setProperty("color",this.colors.getFilledTextColor()),this.menu=t("div",".menu",(t=>{for(let n=0;n{t("div",`${this.values[n].name}: ${this.values[n].value.toExponential()}`)}));t("hr"),null!=this.info&&t("pre",this.info)}))}))}setValue(n){let e=this.values.find((t=>t.name===n));if(null==e)return;let r=e.normalizedValue;this.elem.style.setProperty("background",this.colors.getInterpolatedColor(r,t.TokenLoss))}}class B{constructor(t,n,e,r=!0){this.onSelectChange=()=>{this.selectedMetric=this.selectElem.value;for(let t=0;t{t("div.title","Token Visualization"),t("div.title",(t=>{this.selectElem=t("select",(t=>{}))}))}));for(let n=0;n({name:o[e],value:n[t],normalizedValue:i[e][t],info:s[t]})));h[t]={values:n,info:s[t]}}let d=new B(e,h,f,a),p=document.createElement("div");p.className="attention-visualization"+("light"===c?"":" dark-theme"),p.appendChild(d.render()),document.getElementById(n).appendChild(p),d.updateMenuPosition()}})()})(); \ No newline at end of file