react-d3-calendar-heatmap
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -0,1 +1,4 @@ | ||
## 0.0.11 | ||
- Solve issue with date format | ||
## 0.0.10 | ||
@@ -2,0 +5,0 @@ - Expose `tooltipOffsetX` as distance between tooltip and cursor |
export declare const pathMonth: (t: Date, weekday: any, cellSize: any, timeWeek: any, countDay: any) => string; | ||
export declare const sameDay: (first: Date, second: Date) => boolean; | ||
export declare const convertDateToUTCDate: (date: Date) => Date; |
/*! For license information please see react.d3.calendar.heatmap.js.LICENSE.txt */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactD3CalendarHeatmap=t(require("react")):e.ReactD3CalendarHeatmap=t(e.React)}(self,(function(e){return(()=>{var t={184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"===a)for(var u in n)r.call(n,u)&&n[u]&&e.push(u)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},383:t=>{"use strict";t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>$n});var e=r(383),t=r(184),n=r.n(t),a=new Date,i=new Date;function u(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,r,a){var i,u=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return u;do{u.push(i=new Date(+n)),t(n,a),e(n)}while(i<n&&n<r);return u},o.filter=function(n){return u((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(o.count=function(t,r){return a.setTime(+t),i.setTime(+r),e(a),e(i),Math.floor(n(a,i))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?function(t){return r(t)%e==0}:function(t){return o.count(0,t)%e==0}):o:null}),o}var l=u((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));l.every=function(e){return isFinite(e=Math.floor(e))&&e>0?u((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};const c=l;l.range;const f=864e5,s=6048e5;var h=u((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/f),(e=>e.getDate()-1));const g=h;function d(e){return u((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/s}))}h.range;var p=d(0),m=d(1),v=d(2),y=d(3),b=d(4),M=d(5),w=d(6),x=(p.range,m.range,v.range,y.range,b.range,M.range,w.range,u((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})));const C=x;var T=x.range;function D(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function U(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function k(){}var N=.7,S=1/N,F="\\s*([+-]?\\d+)\\s*",E="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Y="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H=/^#([0-9a-f]{3,8})$/,A=new RegExp("^rgb\\("+[F,F,F]+"\\)$"),O=new RegExp("^rgb\\("+[Y,Y,Y]+"\\)$"),j=new RegExp("^rgba\\("+[F,F,F,E]+"\\)$"),L=new RegExp("^rgba\\("+[Y,Y,Y,E]+"\\)$"),P=new RegExp("^hsl\\("+[E,Y,Y]+"\\)$"),R=new RegExp("^hsla\\("+[E,Y,Y,E]+"\\)$"),z={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 q(){return this.rgb().formatHex()}function W(){return this.rgb().formatRgb()}function _(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=H.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?X(t):3===n?new I(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?$(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?$(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=A.exec(e))?new I(t[1],t[2],t[3],1):(t=O.exec(e))?new I(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=j.exec(e))?$(t[1],t[2],t[3],t[4]):(t=L.exec(e))?$(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=P.exec(e))?G(t[1],t[2]/100,t[3]/100,1):(t=R.exec(e))?G(t[1],t[2]/100,t[3]/100,t[4]):z.hasOwnProperty(e)?X(z[e]):"transparent"===e?new I(NaN,NaN,NaN,0):null}function X(e){return new I(e>>16&255,e>>8&255,255&e,1)}function $(e,t,n,r){return r<=0&&(e=t=n=NaN),new I(e,t,n,r)}function V(e){return e instanceof k||(e=_(e)),e?new I((e=e.rgb()).r,e.g,e.b,e.opacity):new I}function Z(e,t,n,r){return 1===arguments.length?V(e):new I(e,t,n,null==r?1:r)}function I(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function B(){return"#"+Q(this.r)+Q(this.g)+Q(this.b)}function J(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function Q(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function G(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ee(e,t,n,r)}function K(e){if(e instanceof ee)return new ee(e.h,e.s,e.l,e.opacity);if(e instanceof k||(e=_(e)),!e)return new ee;if(e instanceof ee)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,u=a-o,l=(a+o)/2;return u?(i=t===a?(n-r)/u+6*(n<r):n===a?(r-t)/u+2:(t-n)/u+4,u/=l<.5?a+o:2-a-o,i*=60):u=l>0&&l<1?0:i,new ee(i,u,l,e.opacity)}function ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function te(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function ne(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}D(k,_,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:q,formatHex:q,formatHsl:function(){return K(this).formatHsl()},formatRgb:W,toString:W}),D(I,Z,U(k,{brighter:function(e){return e=null==e?S:Math.pow(S,e),new I(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?N:Math.pow(N,e),new I(this.r*e,this.g*e,this.b*e,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:B,formatHex:B,formatRgb:J,toString:J})),D(ee,(function(e,t,n,r){return 1===arguments.length?K(e):new ee(e,t,n,null==r?1:r)}),U(k,{brighter:function(e){return e=null==e?S:Math.pow(S,e),new ee(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?N:Math.pow(N,e),new ee(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new I(te(e>=240?e-240:e+120,o,r),te(e,o,r),te(e<120?e+240:e-120,o,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 e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));const re=e=>()=>e;function oe(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):re(isNaN(e)?t:e)}const ae=function e(t){var n=function(e){return 1==(e=+e)?oe:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):re(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Z(e)).r,(t=Z(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=oe(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function ie(e){return function(t){var n,r,o=t.length,a=new Array(o),i=new Array(o),u=new Array(o);for(n=0;n<o;++n)r=Z(t[n]),a[n]=r.r||0,i[n]=r.g||0,u[n]=r.b||0;return a=e(a),i=e(i),u=e(u),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=u(e),r+""}}}var ue=ie((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,u=r<t-1?e[r+2]:2*a-o;return ne((n-r/t)*t,i,o,a,u)}}));function le(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=new Array(o),i=new Array(r);for(n=0;n<o;++n)a[n]=me(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}function ce(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function fe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function se(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=me(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}ie((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],u=e[(r+2)%t];return ne((n-r/t)*t,o,a,i,u)}}));var he=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ge=new RegExp(he.source,"g");function de(e,t){var n,r,o,a=he.lastIndex=ge.lastIndex=0,i=-1,u=[],l=[];for(e+="",t+="";(n=he.exec(e))&&(r=ge.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),u[i]?u[i]+=o:u[++i]=o),(n=n[0])===(r=r[0])?u[i]?u[i]+=r:u[++i]=r:(u[++i]=null,l.push({i,x:fe(n,r)})),a=ge.lastIndex;return a<t.length&&(o=t.slice(a),u[i]?u[i]+=o:u[++i]=o),u.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)u[(n=l[r]).i]=n.x(e);return u.join("")})}function pe(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}}function me(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?re(t):("number"===o?fe:"string"===o?(n=_(t))?(t=n,ae):de:t instanceof _?ae:t instanceof Date?ce:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?le:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?se:fe:pe))(e,t)}function ve(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ye(e){return e}function be(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}var Me=Math.sqrt(50),we=Math.sqrt(10),xe=Math.sqrt(2);function Ce(e,t,n){var r=(t-e)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,o);return o>=0?(a>=Me?10:a>=we?5:a>=xe?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(a>=Me?10:a>=we?5:a>=xe?2:1)}var Te,De=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ue(e){if(!(t=De.exec(e)))throw new Error("invalid format: "+e);var t;return new ke({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ke(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ne(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Se(e){return(e=Ne(Math.abs(e)))?e[1]:NaN}function Fe(e,t){var n=Ne(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Ue.prototype=ke.prototype,ke.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};const Ee={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Fe(100*e,t),r:Fe,s:function(e,t){var n=Ne(e,t);if(!n)return e+"";var r=n[0],o=n[1],a=o-(Te=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,i=r.length;return a===i?r:a>i?r+new Array(a-i+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ne(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ye(e){return e}var He,Ae,Oe,je=Array.prototype.map,Le=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Pe(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,o,a,i,u=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(o=e,e=t,t=o),0===(i=Ce(e,t,n))||!isFinite(i))return[];if(i>0){let n=Math.round(e/i),r=Math.round(t/i);for(n*i<e&&++n,r*i>t&&--r,a=new Array(o=r-n+1);++u<o;)a[u]=(n+u)*i}else{i=-i;let n=Math.round(e*i),r=Math.round(t*i);for(n/i<e&&++n,r/i>t&&--r,a=new Array(o=r-n+1);++u<o;)a[u]=(n+u)/i}return r&&a.reverse(),a}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return function(e,t,n,r){var o,a=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/o;return a>=Me?o*=10:a>=we?o*=5:a>=xe&&(o*=2),t<e?-o:o}(e,t,n);switch((r=Ue(null==r?",f":r)).type){case"s":var i=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Se(t)/3)))-Se(Math.abs(e)))}(a,i))||(r.precision=o),Oe(r,i);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Se(t)-Se(e))+1}(a,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=function(e){return Math.max(0,-Se(Math.abs(e)))}(a))||(r.precision=o-2*("%"===r.type))}return Ae(r)}(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,a=t(),i=0,u=a.length-1,l=a[i],c=a[u],f=10;for(c<l&&(o=l,l=c,c=o,o=i,i=u,u=o);f-- >0;){if((o=Ce(l,c,n))===r)return a[i]=l,a[u]=c,t(a);if(o>0)l=Math.floor(l/o)*o,c=Math.ceil(c/o)*o;else{if(!(o<0))break;l=Math.ceil(l*o)/o,c=Math.floor(c*o)/o}r=o}return e},e}function Re(){var e,t,n,r,o,a=0,i=1,u=ye,l=!1;function c(t){return isNaN(t=+t)?o:u(0===n?.5:(t=(r(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function f(e){return function(t){var n,r;return arguments.length?([n,r]=t,u=e(n,r),c):[u(0),u(1)]}}return c.domain=function(o){return arguments.length?([a,i]=o,e=r(a=+a),t=r(i=+i),n=e===t?0:1/(t-e),c):[a,i]},c.clamp=function(e){return arguments.length?(l=!!e,c):l},c.interpolator=function(e){return arguments.length?(u=e,c):u},c.range=f(me),c.rangeRound=f(ve),c.unknown=function(e){return arguments.length?(o=e,c):o},function(o){return r=o,e=o(a),t=o(i),n=e===t?0:1/(t-e),c}}function ze(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function qe(){var e=Pe(Re()(ye));return e.copy=function(){return ze(e,qe())},be.apply(e,arguments)}He=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Ye:(t=je.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,u=t[0],l=0;o>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(e.substring(o-=u,o+u)),!((l+=u+1)>r));)u=t[i=(i+1)%t.length];return a.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",u=void 0===e.numerals?Ye:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(je.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",f=void 0===e.nan?"NaN":e.nan+"";function s(e){var t=(e=Ue(e)).fill,n=e.align,s=e.sign,h=e.symbol,g=e.zero,d=e.width,p=e.comma,m=e.precision,v=e.trim,y=e.type;"n"===y?(p=!0,y="g"):Ee[y]||(void 0===m&&(m=12),v=!0,y="g"),(g||"0"===t&&"="===n)&&(g=!0,t="0",n="=");var b="$"===h?o:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",M="$"===h?a:/[%p]/.test(y)?l:"",w=Ee[y],x=/[defgprs%]/.test(y);function C(e){var o,a,l,h=b,C=M;if("c"===y)C=w(e)+C,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?f:w(Math.abs(e),m),v&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),T&&0==+e&&"+"!==s&&(T=!1),h=(T?"("===s?s:c:"-"===s||"("===s?"":s)+h,C=("s"===y?Le[8+Te/3]:"")+C+(T&&"("===s?")":""),x)for(o=-1,a=e.length;++o<a;)if(48>(l=e.charCodeAt(o))||l>57){C=(46===l?i+e.slice(o+1):e.slice(o))+C,e=e.slice(0,o);break}}p&&!g&&(e=r(e,1/0));var D=h.length+e.length+C.length,U=D<d?new Array(d-D+1).join(t):"";switch(p&&g&&(e=r(U+e,U.length?d-C.length:1/0),U=""),n){case"<":e=h+e+C+U;break;case"=":e=h+U+e+C;break;case"^":e=U.slice(0,D=U.length>>1)+h+e+C+U.slice(D);break;default:e=U+h+e+C}return u(e)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),C.toString=function(){return e+""},C}return{format:s,formatPrefix:function(e,t){var n=s(((e=Ue(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Se(t)/3))),o=Math.pow(10,-r),a=Le[8+r/3];return function(e){return n(o*e)+a}}}}({thousands:",",grouping:[3],currency:["$",""]}),Ae=He.format,Oe=He.formatPrefix;const We=(_e=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map((function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(6*r,6*++r);return n})),ue(_e[_e.length-1]));var _e;function Xe(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function $e(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function Ve(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ze(e,t,n=0,r=e.length-1,o=Ve){for(;r>n;){if(r-n>600){const a=r-n+1,i=t-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(i-a/2<0?-1:1);Ze(e,t,Math.max(n,Math.floor(t-i*l/a+c)),Math.min(r,Math.floor(t+(a-i)*l/a+c)),o)}const a=e[t];let i=n,u=r;for(Ie(e,n,t),o(e[r],a)>0&&Ie(e,n,r);i<u;){for(Ie(e,i,u),++i,--u;o(e[i],a)<0;)++i;for(;o(e[u],a)>0;)--u}0===o(e[n],a)?Ie(e,n,u):(++u,Ie(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Ie(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Be(e,t,n){if(r=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n))).length){if((t=+t)<=0||r<2)return $e(e);if(t>=1)return Xe(e);var r,o=(r-1)*t,a=Math.floor(o),i=Xe(Ze(e,a).subarray(0,a+1));return i+($e(e.subarray(a+1))-i)*(o-a)}}function Je(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),a=new Array(o);++r<o;)a[r]=e+r*n;return a}var Qe=u((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/f}),(function(e){return e.getUTCDate()-1}));const Ge=Qe;function Ke(e){return u((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/s}))}Qe.range;var et=Ke(0),tt=Ke(1),nt=Ke(2),rt=Ke(3),ot=Ke(4),at=Ke(5),it=Ke(6),ut=(et.range,tt.range,nt.range,rt.range,ot.range,at.range,it.range,u((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()})));ut.every=function(e){return isFinite(e=Math.floor(e))&&e>0?u((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};const lt=ut;function ct(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ft(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function st(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}ut.range;var ht,gt,dt={"-":"",_:" ",0:"0"},pt=/^\s*\d+/,mt=/^%/,vt=/[\\^$*+?|[\]().{}]/g;function yt(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?new Array(n-a+1).join(t)+o:o)}function bt(e){return e.replace(vt,"\\$&")}function Mt(e){return new RegExp("^(?:"+e.map(bt).join("|")+")","i")}function wt(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function xt(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ct(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Tt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Dt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ut(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function kt(e,t,n){var r=pt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Nt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function St(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ft(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Et(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Yt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ht(e,t,n){var r=pt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function At(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ot(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Lt(e,t,n){var r=pt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Pt(e,t,n){var r=pt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Rt(e,t,n){var r=mt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zt(e,t,n){var r=pt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qt(e,t,n){var r=pt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Wt(e,t){return yt(e.getDate(),t,2)}function _t(e,t){return yt(e.getHours(),t,2)}function Xt(e,t){return yt(e.getHours()%12||12,t,2)}function $t(e,t){return yt(1+g.count(lt(e),e),t,3)}function Vt(e,t){return yt(e.getMilliseconds(),t,3)}function Zt(e,t){return Vt(e,t)+"000"}function It(e,t){return yt(e.getMonth()+1,t,2)}function Bt(e,t){return yt(e.getMinutes(),t,2)}function Jt(e,t){return yt(e.getSeconds(),t,2)}function Qt(e){var t=e.getDay();return 0===t?7:t}function Gt(e,t){return yt(et.count(lt(e)-1,e),t,2)}function Kt(e){var t=e.getDay();return t>=4||0===t?ot(e):ot.ceil(e)}function en(e,t){return e=Kt(e),yt(ot.count(lt(e),e)+(4===lt(e).getDay()),t,2)}function tn(e){return e.getDay()}function nn(e,t){return yt(tt.count(lt(e)-1,e),t,2)}function rn(e,t){return yt(e.getFullYear()%100,t,2)}function on(e,t){return yt((e=Kt(e)).getFullYear()%100,t,2)}function an(e,t){return yt(e.getFullYear()%1e4,t,4)}function un(e,t){var n=e.getDay();return yt((e=n>=4||0===n?ot(e):ot.ceil(e)).getFullYear()%1e4,t,4)}function ln(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yt(t/60|0,"0",2)+yt(t%60,"0",2)}function cn(e,t){return yt(e.getUTCDate(),t,2)}function fn(e,t){return yt(e.getUTCHours(),t,2)}function sn(e,t){return yt(e.getUTCHours()%12||12,t,2)}function hn(e,t){return yt(1+Ge.count(c(e),e),t,3)}function gn(e,t){return yt(e.getUTCMilliseconds(),t,3)}function dn(e,t){return gn(e,t)+"000"}function pn(e,t){return yt(e.getUTCMonth()+1,t,2)}function mn(e,t){return yt(e.getUTCMinutes(),t,2)}function vn(e,t){return yt(e.getUTCSeconds(),t,2)}function yn(e){var t=e.getUTCDay();return 0===t?7:t}function bn(e,t){return yt(p.count(c(e)-1,e),t,2)}function Mn(e){var t=e.getUTCDay();return t>=4||0===t?b(e):b.ceil(e)}function wn(e,t){return e=Mn(e),yt(b.count(c(e),e)+(4===c(e).getUTCDay()),t,2)}function xn(e){return e.getUTCDay()}function Cn(e,t){return yt(m.count(c(e)-1,e),t,2)}function Tn(e,t){return yt(e.getUTCFullYear()%100,t,2)}function Dn(e,t){return yt((e=Mn(e)).getUTCFullYear()%100,t,2)}function Un(e,t){return yt(e.getUTCFullYear()%1e4,t,4)}function kn(e,t){var n=e.getUTCDay();return yt((e=n>=4||0===n?b(e):b.ceil(e)).getUTCFullYear()%1e4,t,4)}function Nn(){return"+0000"}function Sn(){return"%"}function Fn(e){return+e}function En(e){return Math.floor(+e/1e3)}(ht=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,u=e.months,l=e.shortMonths,c=Mt(o),f=wt(o),s=Mt(a),h=wt(a),d=Mt(i),p=wt(i),v=Mt(u),y=wt(u),b=Mt(l),M=wt(l),w={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return u[e.getMonth()]},c:null,d:Wt,e:Wt,f:Zt,g:on,G:un,H:_t,I:Xt,j:$t,L:Vt,m:It,M:Bt,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Fn,s:En,S:Jt,u:Qt,U:Gt,V:en,w:tn,W:nn,x:null,X:null,y:rn,Y:an,Z:ln,"%":Sn},x={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return u[e.getUTCMonth()]},c:null,d:cn,e:cn,f:dn,g:Dn,G:kn,H:fn,I:sn,j:hn,L:gn,m:pn,M:mn,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Fn,s:En,S:vn,u:yn,U:bn,V:wn,w:xn,W:Cn,x:null,X:null,y:Tn,Y:Un,Z:Nn,"%":Sn},C={a:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=s.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=b.exec(t.slice(n));return r?(e.m=M.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return U(e,t,n,r)},d:Yt,e:Yt,f:Pt,g:Nt,G:kt,H:At,I:At,j:Ht,L:Lt,m:Et,M:Ot,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=f.get(r[0].toLowerCase()),n+r[0].length):-1},q:Ft,Q:zt,s:qt,S:jt,u:Ct,U:Tt,V:Dt,w:xt,W:Ut,x:function(e,t,r){return U(e,n,t,r)},X:function(e,t,n){return U(e,r,t,n)},y:Nt,Y:kt,Z:St,"%":Rt};function T(e,t){return function(n){var r,o,a,i=[],u=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++u<c;)37===e.charCodeAt(u)&&(i.push(e.slice(l,u)),null!=(o=dt[r=e.charAt(++u)])?r=e.charAt(++u):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),l=u+1);return i.push(e.slice(l,u)),i.join("")}}function D(e,t){return function(n){var r,o,a=st(1900,void 0,1);if(U(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(t&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(o=(r=ft(st(a.y,0,1))).getUTCDay(),r=o>4||0===o?m.ceil(r):m(r),r=Ge.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(o=(r=ct(st(a.y,0,1))).getDay(),r=o>4||0===o?tt.ceil(r):tt(r),r=g.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?ft(st(a.y,0,1)).getUTCDay():ct(st(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,ft(a)):ct(a)}}function U(e,t,n,r){for(var o,a,i=0,u=t.length,l=n.length;i<u;){if(r>=l)return-1;if(37===(o=t.charCodeAt(i++))){if(o=t.charAt(i++),!(a=C[o in dt?t.charAt(i++):o])||(r=a(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return w.x=T(n,w),w.X=T(r,w),w.c=T(t,w),x.x=T(n,x),x.X=T(r,x),x.c=T(t,x),{format:function(e){var t=T(e+="",w);return t.toString=function(){return e},t},parse:function(e){var t=D(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=T(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=D(e+="",!0);return t.toString=function(){return e},t}}}({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"]})).format,ht.parse,gt=ht.utcFormat,ht.utcParse;var Yn=function(){},Hn="undefined"!=typeof window;const An=Hn?e.useLayoutEffect:e.useEffect;var On={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const jn=Hn&&void 0!==window.ResizeObserver?function(){var t=(0,e.useState)(null),n=t[0],r=t[1],o=(0,e.useState)(On),a=o[0],i=o[1],u=(0,e.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,o=t.width,a=t.height,u=t.top,l=t.left,c=t.bottom,f=t.right;i({x:n,y:r,width:o,height:a,top:u,left:l,bottom:c,right:f})}}))}),[]);return An((function(){if(n)return u.observe(n),function(){u.disconnect()}}),[n]),[r,a]}:function(){return[Yn,On]},Ln=e.memo((function(t){var n=t.position,r=t.placement,o=t.offsetX,a=void 0===o?0:o,i=t.offsetY,u=void 0===i?0:i,l=t.children,c=jn(),f=c[0],s=c[1],h=s.width,g=s.height,d=n[0],p=n[1],m=Math.round(d),v=Math.round(p);if(h>0&&g>0)switch(r){case"bottom":m-=h/2;break;case"bottomLeft":m-=h,v+=g/2;break;case"bottomRight":m+=25,v+=20;break;case"left":m-=h+a,v-=g/2+u;break;case"right":m+=20+a,v-=g/2+u;break;case"top":m-=h/2,v-=g;break;case"topLeft":m-=h,v-=g;break;case"topRight":m+=20,v-=g}var y={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0,maxWidth:"calc(50% - 15px)",transform:"translate("+m+"px, "+v+"px)"};return e.createElement("div",{ref:f,style:y},l)}));var Pn={showTooltip:function(){throw new Error("TooltipContext not initalized")},hideTooltip:function(){throw new Error("TooltipContext not initalized")},disableTooltip:!1,valueFn:function(e){return""+e}};const Rn=e.createContext(Pn),zn=function(t){var n=t.tooltipPlacement,r=t.tooltipClassName,o=t.tooltipOffsetX,a=t.tooltipOffsetY,i=t.disableTooltip,u=t.valueFn,l=t.children,c=e.useRef(null),f=e.useState(!1),s=f[0],h=f[1],g=e.useState([null,null]),d=g[0],p=g[1],m=e.useState(null),v=m[0],y=m[1],b=e.useState(n),M=b[0],w=b[1],x=e.useCallback((function(e,t){var n=t.clientX,r=t.clientY,o=c.current.getBoundingClientRect(),a=o.width,i=n-o.left,u=r-o.top;M||w(i<a/2?"right":"left"),h(!0),p([i,u]),y(e)}),[c,y,h,p]),C=e.useCallback((function(){h(!1)}),[h,p]),T=e.useMemo((function(){return{showTooltip:x,hideTooltip:C,tooltipClassName:r,valueFn:u,disableTooltip:i}}),[x,C,r,u]);return e.createElement(Rn.Provider,{value:T},e.createElement("div",{ref:c},l,s&&e.createElement(Ln,{position:d,placement:M,offsetX:o,offsetY:a},v)))},qn=function(){return e.useContext(Rn)};var Wn=e.memo((function(t){var n=t.label,r=t.value,o=t.projects,a=qn(),i=a.tooltipClassName,u=a.valueFn;return e.createElement("div",{className:i},e.createElement("div",{className:"CalendarHeatMap__tooltip"},void 0!==r?e.createElement(e.Fragment,null,e.createElement("span",{className:"CalendarHeatMap__tooltipLabel"},n,": "),e.createElement("span",{className:"CalendarHeatMap__tooltipValue"},""+u(r))):n,o&&e.createElement("div",{className:"CalendarHeatMap__tooltipProjects"},Object.keys(o).map((function(t,n){return e.createElement("div",{key:n},e.createElement("span",{className:"CalendarHeatMap__tooltipLabel"},t,":"," "),e.createElement("span",{className:"CalendarHeatMap__tooltipValue"},""+u(o[t])))})))))})),_n=function(){return(_n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};const Xn=function(t){var n=t.color,r=t.cellSize,o=t.cellPadding,a=t.c,i=t.countDay,u=t.timeWeek,l=t.formatDate,c=t.timeRange,f=t.cellShape,s=t.defaultColor,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["color","cellSize","cellPadding","c","countDay","timeWeek","formatDate","timeRange","cellShape","defaultColor"]),g=qn(),d=g.hideTooltip,p=g.showTooltip,m=g.disableTooltip,v=e.useCallback((function(t){p(e.createElement(Wn,{label:""+l(new Date(a.day)),value:a.value,projects:"projects"in a?a.projects:void 0}),t)}),[p]),y=e.useCallback((function(){d()}),[d]),b=new Date(a.day),M=u.count(c.from,b)*r+o/2,w=i(b.getUTCDay())*r+o/2;return e.createElement("rect",_n({onMouseEnter:m?void 0:v,onMouseLeave:m?void 0:y,onMouseMove:m?void 0:v,rx:"circle"===f?9999:1,width:r-o,height:r-o,x:M,y:w,fill:a.value?n(a.value):s},h))},$n=function(t){var r=t.className,o=t.data,a=t.weekday,i=void 0===a?"weekday":a,u=t.disableTooltip,l=void 0!==u&&u,f=t.tooltipOffsetX,s=void 0===f?0:f,h=t.tooltipOffsetY,d=void 0===h?0:h,p=t.tooltipPlacement,v=t.tooltipClassName,y=t.timeRange,b=t.customD3ColorScale,M=void 0===b?qe(We):b,w=t.width,x=void 0===w?900:w,D=t.cellSize,U=void 0===D?17:D,k=t.cellShape,N=void 0===k?"circle":k,S=t.formatDate,F=void 0===S?gt("%Y-%m-%d"):S,E=t.valueFn,Y=void 0===E?Ae(".2f"):E,H=t.defaultColor,A=void 0===H?"#eeeeee":H,O=t.marginTop,j=void 0===O?0:O,L=t.marginBottom,P=void 0===L?0:L,R=t.marginLeft,z=void 0===R?0:R,q=t.paddingUnderMonthHeader,W=void 0===q?8:q,_=t.paddingAfterDayOfWeekHeader,X=void 0===_?8:_,$=t.cellPadding,V=void 0===$?2:$,Z=t.formatDay,I=void 0===Z?function(e){return"SMTWTFS"[e]}:Z,B=o,J=B[0],Q=B[o.length-1],G=y||{from:c(new Date(J?J.day:"")),to:new Date(Q?Q.day:"")},K=G.from,ee=G.to,te=g.range(K,ee).map((function(e){return o.filter((function(t){return n=new Date(t.day),r=e,n.getUTCFullYear()===r.getUTCFullYear()&&n.getUTCMonth()===r.getUTCMonth()&&n.getUTCDate()===r.getUTCDate();var n,r})).pop()||{day:e.toISOString(),value:0}})),ne=gt("%b"),re=Be(te,.9975,(function(e){return Math.abs(e.value)})),oe=M.domain([-re,+re]),ae=m,ie="weekend"===i?function(e){return(e-1+7)%7}:function(e){return(e+6)%7},ue="weekday"===i?Je(1,6):Je(0,7),le=T(C(K),ee),ce="weekday"===i?te.filter((function(e){return![0,6].includes(new Date(e.day).getUTCDay())})):te,fe=x,se=U*("weekday"===i?6:8)+j+P+W,he=K.getUTCFullYear()===ee.getUTCFullYear(),ge=K.getUTCFullYear()+(he?"":"/"+ee.getUTCFullYear().toString().slice(-2)),de=he?X:X+15;return e.createElement(zn,{tooltipPlacement:p,tooltipClassName:v,disableTooltip:l,tooltipOffsetX:s,tooltipOffsetY:d,valueFn:Y},e.createElement("div",{className:n()("CalendarHeatMap",r)},e.createElement("svg",{fontSize:"10px",viewBox:"0 0 "+fe+" "+se},e.createElement("g",{transform:"translate("+(28+z+de)+", "+(10+j+W)+")"},e.createElement("text",{x:-X,y:-W,fontWeight:"bold",textAnchor:"end"},ge),e.createElement("g",{textAnchor:"end"},ue.map((function(t,n){return e.createElement("text",{key:n,x:-X,y:(ie(t)+.5)*U,dy:"0.31em"},I(t))}))),e.createElement("g",null,ce.map((function(t,n){return e.createElement(Xn,{key:n,c:t,color:oe,cellSize:U,countDay:ie,timeWeek:ae,formatDate:F,timeRange:G,cellShape:N,defaultColor:A,cellPadding:V})}))),e.createElement("g",null,le.map((function(t,n){var r=ae.count(K,ae.ceil(t))*U+2;return r<=-30?null:e.createElement("g",{key:n},e.createElement("text",{x:Math.max(r,0),y:-W},ne(t)))})))))))}})(),o})()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactD3CalendarHeatmap=t(require("react")):e.ReactD3CalendarHeatmap=t(e.React)}(self,(function(e){return(()=>{var t={184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"===a)for(var u in n)r.call(n,u)&&n[u]&&e.push(u)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},383:t=>{"use strict";t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>$n});var e=r(383),t=r(184),n=r.n(t),a=new Date,i=new Date;function u(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,r,a){var i,u=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return u;do{u.push(i=new Date(+n)),t(n,a),e(n)}while(i<n&&n<r);return u},o.filter=function(n){return u((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(o.count=function(t,r){return a.setTime(+t),i.setTime(+r),e(a),e(i),Math.floor(n(a,i))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?function(t){return r(t)%e==0}:function(t){return o.count(0,t)%e==0}):o:null}),o}var l=u((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));l.every=function(e){return isFinite(e=Math.floor(e))&&e>0?u((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};const c=l;l.range;const f=864e5,s=6048e5;var h=u((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/f),(e=>e.getDate()-1));const g=h;function d(e){return u((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/s}))}h.range;var p=d(0),m=d(1),v=d(2),y=d(3),b=d(4),M=d(5),w=d(6),x=(p.range,m.range,v.range,y.range,b.range,M.range,w.range,u((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})));const C=x;var T=x.range;function D(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function U(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function k(){}var N=.7,S=1/N,F="\\s*([+-]?\\d+)\\s*",E="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Y="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H=/^#([0-9a-f]{3,8})$/,A=new RegExp("^rgb\\("+[F,F,F]+"\\)$"),O=new RegExp("^rgb\\("+[Y,Y,Y]+"\\)$"),j=new RegExp("^rgba\\("+[F,F,F,E]+"\\)$"),L=new RegExp("^rgba\\("+[Y,Y,Y,E]+"\\)$"),P=new RegExp("^hsl\\("+[E,Y,Y]+"\\)$"),R=new RegExp("^hsla\\("+[E,Y,Y,E]+"\\)$"),z={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 q(){return this.rgb().formatHex()}function W(){return this.rgb().formatRgb()}function _(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=H.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?X(t):3===n?new I(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?$(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?$(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=A.exec(e))?new I(t[1],t[2],t[3],1):(t=O.exec(e))?new I(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=j.exec(e))?$(t[1],t[2],t[3],t[4]):(t=L.exec(e))?$(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=P.exec(e))?G(t[1],t[2]/100,t[3]/100,1):(t=R.exec(e))?G(t[1],t[2]/100,t[3]/100,t[4]):z.hasOwnProperty(e)?X(z[e]):"transparent"===e?new I(NaN,NaN,NaN,0):null}function X(e){return new I(e>>16&255,e>>8&255,255&e,1)}function $(e,t,n,r){return r<=0&&(e=t=n=NaN),new I(e,t,n,r)}function V(e){return e instanceof k||(e=_(e)),e?new I((e=e.rgb()).r,e.g,e.b,e.opacity):new I}function Z(e,t,n,r){return 1===arguments.length?V(e):new I(e,t,n,null==r?1:r)}function I(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function B(){return"#"+Q(this.r)+Q(this.g)+Q(this.b)}function J(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function Q(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function G(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ee(e,t,n,r)}function K(e){if(e instanceof ee)return new ee(e.h,e.s,e.l,e.opacity);if(e instanceof k||(e=_(e)),!e)return new ee;if(e instanceof ee)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,u=a-o,l=(a+o)/2;return u?(i=t===a?(n-r)/u+6*(n<r):n===a?(r-t)/u+2:(t-n)/u+4,u/=l<.5?a+o:2-a-o,i*=60):u=l>0&&l<1?0:i,new ee(i,u,l,e.opacity)}function ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function te(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function ne(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}D(k,_,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:q,formatHex:q,formatHsl:function(){return K(this).formatHsl()},formatRgb:W,toString:W}),D(I,Z,U(k,{brighter:function(e){return e=null==e?S:Math.pow(S,e),new I(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?N:Math.pow(N,e),new I(this.r*e,this.g*e,this.b*e,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:B,formatHex:B,formatRgb:J,toString:J})),D(ee,(function(e,t,n,r){return 1===arguments.length?K(e):new ee(e,t,n,null==r?1:r)}),U(k,{brighter:function(e){return e=null==e?S:Math.pow(S,e),new ee(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?N:Math.pow(N,e),new ee(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new I(te(e>=240?e-240:e+120,o,r),te(e,o,r),te(e<120?e+240:e-120,o,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 e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));const re=e=>()=>e;function oe(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):re(isNaN(e)?t:e)}const ae=function e(t){var n=function(e){return 1==(e=+e)?oe:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):re(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Z(e)).r,(t=Z(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=oe(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function ie(e){return function(t){var n,r,o=t.length,a=new Array(o),i=new Array(o),u=new Array(o);for(n=0;n<o;++n)r=Z(t[n]),a[n]=r.r||0,i[n]=r.g||0,u[n]=r.b||0;return a=e(a),i=e(i),u=e(u),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=u(e),r+""}}}var ue=ie((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,u=r<t-1?e[r+2]:2*a-o;return ne((n-r/t)*t,i,o,a,u)}}));function le(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=new Array(o),i=new Array(r);for(n=0;n<o;++n)a[n]=me(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}function ce(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function fe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function se(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=me(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}ie((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],u=e[(r+2)%t];return ne((n-r/t)*t,o,a,i,u)}}));var he=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ge=new RegExp(he.source,"g");function de(e,t){var n,r,o,a=he.lastIndex=ge.lastIndex=0,i=-1,u=[],l=[];for(e+="",t+="";(n=he.exec(e))&&(r=ge.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),u[i]?u[i]+=o:u[++i]=o),(n=n[0])===(r=r[0])?u[i]?u[i]+=r:u[++i]=r:(u[++i]=null,l.push({i,x:fe(n,r)})),a=ge.lastIndex;return a<t.length&&(o=t.slice(a),u[i]?u[i]+=o:u[++i]=o),u.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)u[(n=l[r]).i]=n.x(e);return u.join("")})}function pe(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}}function me(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?re(t):("number"===o?fe:"string"===o?(n=_(t))?(t=n,ae):de:t instanceof _?ae:t instanceof Date?ce:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?le:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?se:fe:pe))(e,t)}function ve(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ye(e){return e}function be(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}var Me=Math.sqrt(50),we=Math.sqrt(10),xe=Math.sqrt(2);function Ce(e,t,n){var r=(t-e)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,o);return o>=0?(a>=Me?10:a>=we?5:a>=xe?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(a>=Me?10:a>=we?5:a>=xe?2:1)}var Te,De=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ue(e){if(!(t=De.exec(e)))throw new Error("invalid format: "+e);var t;return new ke({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ke(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ne(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Se(e){return(e=Ne(Math.abs(e)))?e[1]:NaN}function Fe(e,t){var n=Ne(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Ue.prototype=ke.prototype,ke.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};const Ee={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Fe(100*e,t),r:Fe,s:function(e,t){var n=Ne(e,t);if(!n)return e+"";var r=n[0],o=n[1],a=o-(Te=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,i=r.length;return a===i?r:a>i?r+new Array(a-i+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ne(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ye(e){return e}var He,Ae,Oe,je=Array.prototype.map,Le=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Pe(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,o,a,i,u=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(o=e,e=t,t=o),0===(i=Ce(e,t,n))||!isFinite(i))return[];if(i>0){let n=Math.round(e/i),r=Math.round(t/i);for(n*i<e&&++n,r*i>t&&--r,a=new Array(o=r-n+1);++u<o;)a[u]=(n+u)*i}else{i=-i;let n=Math.round(e*i),r=Math.round(t*i);for(n/i<e&&++n,r/i>t&&--r,a=new Array(o=r-n+1);++u<o;)a[u]=(n+u)/i}return r&&a.reverse(),a}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return function(e,t,n,r){var o,a=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/o;return a>=Me?o*=10:a>=we?o*=5:a>=xe&&(o*=2),t<e?-o:o}(e,t,n);switch((r=Ue(null==r?",f":r)).type){case"s":var i=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Se(t)/3)))-Se(Math.abs(e)))}(a,i))||(r.precision=o),Oe(r,i);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Se(t)-Se(e))+1}(a,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=function(e){return Math.max(0,-Se(Math.abs(e)))}(a))||(r.precision=o-2*("%"===r.type))}return Ae(r)}(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,a=t(),i=0,u=a.length-1,l=a[i],c=a[u],f=10;for(c<l&&(o=l,l=c,c=o,o=i,i=u,u=o);f-- >0;){if((o=Ce(l,c,n))===r)return a[i]=l,a[u]=c,t(a);if(o>0)l=Math.floor(l/o)*o,c=Math.ceil(c/o)*o;else{if(!(o<0))break;l=Math.ceil(l*o)/o,c=Math.floor(c*o)/o}r=o}return e},e}function Re(){var e,t,n,r,o,a=0,i=1,u=ye,l=!1;function c(t){return isNaN(t=+t)?o:u(0===n?.5:(t=(r(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function f(e){return function(t){var n,r;return arguments.length?([n,r]=t,u=e(n,r),c):[u(0),u(1)]}}return c.domain=function(o){return arguments.length?([a,i]=o,e=r(a=+a),t=r(i=+i),n=e===t?0:1/(t-e),c):[a,i]},c.clamp=function(e){return arguments.length?(l=!!e,c):l},c.interpolator=function(e){return arguments.length?(u=e,c):u},c.range=f(me),c.rangeRound=f(ve),c.unknown=function(e){return arguments.length?(o=e,c):o},function(o){return r=o,e=o(a),t=o(i),n=e===t?0:1/(t-e),c}}function ze(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function qe(){var e=Pe(Re()(ye));return e.copy=function(){return ze(e,qe())},be.apply(e,arguments)}He=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Ye:(t=je.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,u=t[0],l=0;o>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(e.substring(o-=u,o+u)),!((l+=u+1)>r));)u=t[i=(i+1)%t.length];return a.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",u=void 0===e.numerals?Ye:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(je.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",f=void 0===e.nan?"NaN":e.nan+"";function s(e){var t=(e=Ue(e)).fill,n=e.align,s=e.sign,h=e.symbol,g=e.zero,d=e.width,p=e.comma,m=e.precision,v=e.trim,y=e.type;"n"===y?(p=!0,y="g"):Ee[y]||(void 0===m&&(m=12),v=!0,y="g"),(g||"0"===t&&"="===n)&&(g=!0,t="0",n="=");var b="$"===h?o:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",M="$"===h?a:/[%p]/.test(y)?l:"",w=Ee[y],x=/[defgprs%]/.test(y);function C(e){var o,a,l,h=b,C=M;if("c"===y)C=w(e)+C,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?f:w(Math.abs(e),m),v&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),T&&0==+e&&"+"!==s&&(T=!1),h=(T?"("===s?s:c:"-"===s||"("===s?"":s)+h,C=("s"===y?Le[8+Te/3]:"")+C+(T&&"("===s?")":""),x)for(o=-1,a=e.length;++o<a;)if(48>(l=e.charCodeAt(o))||l>57){C=(46===l?i+e.slice(o+1):e.slice(o))+C,e=e.slice(0,o);break}}p&&!g&&(e=r(e,1/0));var D=h.length+e.length+C.length,U=D<d?new Array(d-D+1).join(t):"";switch(p&&g&&(e=r(U+e,U.length?d-C.length:1/0),U=""),n){case"<":e=h+e+C+U;break;case"=":e=h+U+e+C;break;case"^":e=U.slice(0,D=U.length>>1)+h+e+C+U.slice(D);break;default:e=U+h+e+C}return u(e)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),C.toString=function(){return e+""},C}return{format:s,formatPrefix:function(e,t){var n=s(((e=Ue(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Se(t)/3))),o=Math.pow(10,-r),a=Le[8+r/3];return function(e){return n(o*e)+a}}}}({thousands:",",grouping:[3],currency:["$",""]}),Ae=He.format,Oe=He.formatPrefix;const We=(_e=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map((function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(6*r,6*++r);return n})),ue(_e[_e.length-1]));var _e;function Xe(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function $e(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function Ve(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ze(e,t,n=0,r=e.length-1,o=Ve){for(;r>n;){if(r-n>600){const a=r-n+1,i=t-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(i-a/2<0?-1:1);Ze(e,t,Math.max(n,Math.floor(t-i*l/a+c)),Math.min(r,Math.floor(t+(a-i)*l/a+c)),o)}const a=e[t];let i=n,u=r;for(Ie(e,n,t),o(e[r],a)>0&&Ie(e,n,r);i<u;){for(Ie(e,i,u),++i,--u;o(e[i],a)<0;)++i;for(;o(e[u],a)>0;)--u}0===o(e[n],a)?Ie(e,n,u):(++u,Ie(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Ie(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Be(e,t,n){if(r=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n))).length){if((t=+t)<=0||r<2)return $e(e);if(t>=1)return Xe(e);var r,o=(r-1)*t,a=Math.floor(o),i=Xe(Ze(e,a).subarray(0,a+1));return i+($e(e.subarray(a+1))-i)*(o-a)}}function Je(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),a=new Array(o);++r<o;)a[r]=e+r*n;return a}var Qe=u((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/f}),(function(e){return e.getUTCDate()-1}));const Ge=Qe;function Ke(e){return u((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/s}))}Qe.range;var et=Ke(0),tt=Ke(1),nt=Ke(2),rt=Ke(3),ot=Ke(4),at=Ke(5),it=Ke(6),ut=(et.range,tt.range,nt.range,rt.range,ot.range,at.range,it.range,u((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()})));ut.every=function(e){return isFinite(e=Math.floor(e))&&e>0?u((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};const lt=ut;function ct(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ft(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function st(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}ut.range;var ht,gt,dt={"-":"",_:" ",0:"0"},pt=/^\s*\d+/,mt=/^%/,vt=/[\\^$*+?|[\]().{}]/g;function yt(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?new Array(n-a+1).join(t)+o:o)}function bt(e){return e.replace(vt,"\\$&")}function Mt(e){return new RegExp("^(?:"+e.map(bt).join("|")+")","i")}function wt(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function xt(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ct(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Tt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Dt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ut(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function kt(e,t,n){var r=pt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Nt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function St(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ft(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Et(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Yt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ht(e,t,n){var r=pt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function At(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ot(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jt(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Lt(e,t,n){var r=pt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Pt(e,t,n){var r=pt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Rt(e,t,n){var r=mt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zt(e,t,n){var r=pt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qt(e,t,n){var r=pt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Wt(e,t){return yt(e.getDate(),t,2)}function _t(e,t){return yt(e.getHours(),t,2)}function Xt(e,t){return yt(e.getHours()%12||12,t,2)}function $t(e,t){return yt(1+g.count(lt(e),e),t,3)}function Vt(e,t){return yt(e.getMilliseconds(),t,3)}function Zt(e,t){return Vt(e,t)+"000"}function It(e,t){return yt(e.getMonth()+1,t,2)}function Bt(e,t){return yt(e.getMinutes(),t,2)}function Jt(e,t){return yt(e.getSeconds(),t,2)}function Qt(e){var t=e.getDay();return 0===t?7:t}function Gt(e,t){return yt(et.count(lt(e)-1,e),t,2)}function Kt(e){var t=e.getDay();return t>=4||0===t?ot(e):ot.ceil(e)}function en(e,t){return e=Kt(e),yt(ot.count(lt(e),e)+(4===lt(e).getDay()),t,2)}function tn(e){return e.getDay()}function nn(e,t){return yt(tt.count(lt(e)-1,e),t,2)}function rn(e,t){return yt(e.getFullYear()%100,t,2)}function on(e,t){return yt((e=Kt(e)).getFullYear()%100,t,2)}function an(e,t){return yt(e.getFullYear()%1e4,t,4)}function un(e,t){var n=e.getDay();return yt((e=n>=4||0===n?ot(e):ot.ceil(e)).getFullYear()%1e4,t,4)}function ln(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yt(t/60|0,"0",2)+yt(t%60,"0",2)}function cn(e,t){return yt(e.getUTCDate(),t,2)}function fn(e,t){return yt(e.getUTCHours(),t,2)}function sn(e,t){return yt(e.getUTCHours()%12||12,t,2)}function hn(e,t){return yt(1+Ge.count(c(e),e),t,3)}function gn(e,t){return yt(e.getUTCMilliseconds(),t,3)}function dn(e,t){return gn(e,t)+"000"}function pn(e,t){return yt(e.getUTCMonth()+1,t,2)}function mn(e,t){return yt(e.getUTCMinutes(),t,2)}function vn(e,t){return yt(e.getUTCSeconds(),t,2)}function yn(e){var t=e.getUTCDay();return 0===t?7:t}function bn(e,t){return yt(p.count(c(e)-1,e),t,2)}function Mn(e){var t=e.getUTCDay();return t>=4||0===t?b(e):b.ceil(e)}function wn(e,t){return e=Mn(e),yt(b.count(c(e),e)+(4===c(e).getUTCDay()),t,2)}function xn(e){return e.getUTCDay()}function Cn(e,t){return yt(m.count(c(e)-1,e),t,2)}function Tn(e,t){return yt(e.getUTCFullYear()%100,t,2)}function Dn(e,t){return yt((e=Mn(e)).getUTCFullYear()%100,t,2)}function Un(e,t){return yt(e.getUTCFullYear()%1e4,t,4)}function kn(e,t){var n=e.getUTCDay();return yt((e=n>=4||0===n?b(e):b.ceil(e)).getUTCFullYear()%1e4,t,4)}function Nn(){return"+0000"}function Sn(){return"%"}function Fn(e){return+e}function En(e){return Math.floor(+e/1e3)}(ht=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,u=e.months,l=e.shortMonths,c=Mt(o),f=wt(o),s=Mt(a),h=wt(a),d=Mt(i),p=wt(i),v=Mt(u),y=wt(u),b=Mt(l),M=wt(l),w={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return u[e.getMonth()]},c:null,d:Wt,e:Wt,f:Zt,g:on,G:un,H:_t,I:Xt,j:$t,L:Vt,m:It,M:Bt,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Fn,s:En,S:Jt,u:Qt,U:Gt,V:en,w:tn,W:nn,x:null,X:null,y:rn,Y:an,Z:ln,"%":Sn},x={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return u[e.getUTCMonth()]},c:null,d:cn,e:cn,f:dn,g:Dn,G:kn,H:fn,I:sn,j:hn,L:gn,m:pn,M:mn,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Fn,s:En,S:vn,u:yn,U:bn,V:wn,w:xn,W:Cn,x:null,X:null,y:Tn,Y:Un,Z:Nn,"%":Sn},C={a:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=s.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=b.exec(t.slice(n));return r?(e.m=M.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return U(e,t,n,r)},d:Yt,e:Yt,f:Pt,g:Nt,G:kt,H:At,I:At,j:Ht,L:Lt,m:Et,M:Ot,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=f.get(r[0].toLowerCase()),n+r[0].length):-1},q:Ft,Q:zt,s:qt,S:jt,u:Ct,U:Tt,V:Dt,w:xt,W:Ut,x:function(e,t,r){return U(e,n,t,r)},X:function(e,t,n){return U(e,r,t,n)},y:Nt,Y:kt,Z:St,"%":Rt};function T(e,t){return function(n){var r,o,a,i=[],u=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++u<c;)37===e.charCodeAt(u)&&(i.push(e.slice(l,u)),null!=(o=dt[r=e.charAt(++u)])?r=e.charAt(++u):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),l=u+1);return i.push(e.slice(l,u)),i.join("")}}function D(e,t){return function(n){var r,o,a=st(1900,void 0,1);if(U(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(t&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(o=(r=ft(st(a.y,0,1))).getUTCDay(),r=o>4||0===o?m.ceil(r):m(r),r=Ge.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(o=(r=ct(st(a.y,0,1))).getDay(),r=o>4||0===o?tt.ceil(r):tt(r),r=g.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?ft(st(a.y,0,1)).getUTCDay():ct(st(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,ft(a)):ct(a)}}function U(e,t,n,r){for(var o,a,i=0,u=t.length,l=n.length;i<u;){if(r>=l)return-1;if(37===(o=t.charCodeAt(i++))){if(o=t.charAt(i++),!(a=C[o in dt?t.charAt(i++):o])||(r=a(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return w.x=T(n,w),w.X=T(r,w),w.c=T(t,w),x.x=T(n,x),x.X=T(r,x),x.c=T(t,x),{format:function(e){var t=T(e+="",w);return t.toString=function(){return e},t},parse:function(e){var t=D(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=T(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=D(e+="",!0);return t.toString=function(){return e},t}}}({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"]})).format,ht.parse,gt=ht.utcFormat,ht.utcParse;var Yn=function(){},Hn="undefined"!=typeof window;const An=Hn?e.useLayoutEffect:e.useEffect;var On={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const jn=Hn&&void 0!==window.ResizeObserver?function(){var t=(0,e.useState)(null),n=t[0],r=t[1],o=(0,e.useState)(On),a=o[0],i=o[1],u=(0,e.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,o=t.width,a=t.height,u=t.top,l=t.left,c=t.bottom,f=t.right;i({x:n,y:r,width:o,height:a,top:u,left:l,bottom:c,right:f})}}))}),[]);return An((function(){if(n)return u.observe(n),function(){u.disconnect()}}),[n]),[r,a]}:function(){return[Yn,On]},Ln=e.memo((function(t){var n=t.position,r=t.placement,o=t.offsetX,a=void 0===o?0:o,i=t.offsetY,u=void 0===i?0:i,l=t.children,c=jn(),f=c[0],s=c[1],h=s.width,g=s.height,d=n[0],p=n[1],m=Math.round(d),v=Math.round(p);if(h>0&&g>0)switch(r){case"bottom":m-=h/2;break;case"bottomLeft":m-=h,v+=g/2;break;case"bottomRight":m+=25,v+=20;break;case"left":m-=h+a,v-=g/2+u;break;case"right":m+=20+a,v-=g/2+u;break;case"top":m-=h/2,v-=g;break;case"topLeft":m-=h,v-=g;break;case"topRight":m+=20,v-=g}var y={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0,maxWidth:"calc(50% - 15px)",transform:"translate("+m+"px, "+v+"px)"};return e.createElement("div",{ref:f,style:y},l)}));var Pn={showTooltip:function(){throw new Error("TooltipContext not initalized")},hideTooltip:function(){throw new Error("TooltipContext not initalized")},disableTooltip:!1,valueFn:function(e){return""+e}};const Rn=e.createContext(Pn),zn=function(t){var n=t.tooltipPlacement,r=t.tooltipClassName,o=t.tooltipOffsetX,a=t.tooltipOffsetY,i=t.disableTooltip,u=t.valueFn,l=t.children,c=e.useRef(null),f=e.useState(!1),s=f[0],h=f[1],g=e.useState([null,null]),d=g[0],p=g[1],m=e.useState(null),v=m[0],y=m[1],b=e.useState(n),M=b[0],w=b[1],x=e.useCallback((function(e,t){var n=t.clientX,r=t.clientY,o=c.current.getBoundingClientRect(),a=o.width,i=n-o.left,u=r-o.top;M||w(i<a/2?"right":"left"),h(!0),p([i,u]),y(e)}),[c,y,h,p]),C=e.useCallback((function(){h(!1)}),[h,p]),T=e.useMemo((function(){return{showTooltip:x,hideTooltip:C,tooltipClassName:r,valueFn:u,disableTooltip:i}}),[x,C,r,u]);return e.createElement(Rn.Provider,{value:T},e.createElement("div",{ref:c},l,s&&e.createElement(Ln,{position:d,placement:M,offsetX:o,offsetY:a},v)))},qn=function(){return e.useContext(Rn)};var Wn=e.memo((function(t){var n=t.label,r=t.value,o=t.projects,a=qn(),i=a.tooltipClassName,u=a.valueFn;return e.createElement("div",{className:i},e.createElement("div",{className:"CalendarHeatMap__tooltip"},void 0!==r?e.createElement(e.Fragment,null,e.createElement("span",{className:"CalendarHeatMap__tooltipLabel"},n,": "),e.createElement("span",{className:"CalendarHeatMap__tooltipValue"},""+u(r))):n,o&&e.createElement("div",{className:"CalendarHeatMap__tooltipProjects"},Object.keys(o).map((function(t,n){return e.createElement("div",{key:n},e.createElement("span",{className:"CalendarHeatMap__tooltipLabel"},t,":"," "),e.createElement("span",{className:"CalendarHeatMap__tooltipValue"},""+u(o[t])))})))))})),_n=function(){return(_n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};const Xn=function(t){var n=t.color,r=t.cellSize,o=t.cellPadding,a=t.c,i=t.countDay,u=t.timeWeek,l=t.formatDate,c=t.timeRange,f=t.cellShape,s=t.defaultColor,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["color","cellSize","cellPadding","c","countDay","timeWeek","formatDate","timeRange","cellShape","defaultColor"]),g=qn(),d=g.hideTooltip,p=g.showTooltip,m=g.disableTooltip,v=e.useCallback((function(t){p(e.createElement(Wn,{label:""+l(new Date(a.day)),value:a.value,projects:"projects"in a?a.projects:void 0}),t)}),[p]),y=e.useCallback((function(){d()}),[d]),b=new Date(a.day),M=u.count(c.from,b)*r+o/2,w=i(b.getUTCDay())*r+o/2;return e.createElement("rect",_n({onMouseEnter:m?void 0:v,onMouseLeave:m?void 0:y,onMouseMove:m?void 0:v,rx:"circle"===f?9999:1,width:r-o,height:r-o,x:M,y:w,fill:a.value?n(a.value):s},h))},$n=function(t){var r=t.className,o=t.data,a=t.weekday,i=void 0===a?"weekday":a,u=t.disableTooltip,l=void 0!==u&&u,f=t.tooltipOffsetX,s=void 0===f?0:f,h=t.tooltipOffsetY,d=void 0===h?0:h,p=t.tooltipPlacement,v=t.tooltipClassName,y=t.timeRange,b=t.customD3ColorScale,M=void 0===b?qe(We):b,w=t.width,x=void 0===w?900:w,D=t.cellSize,U=void 0===D?17:D,k=t.cellShape,N=void 0===k?"circle":k,S=t.formatDate,F=void 0===S?gt("%Y-%m-%d"):S,E=t.valueFn,Y=void 0===E?Ae(".2f"):E,H=t.defaultColor,A=void 0===H?"#eeeeee":H,O=t.marginTop,j=void 0===O?0:O,L=t.marginBottom,P=void 0===L?0:L,R=t.marginLeft,z=void 0===R?0:R,q=t.paddingUnderMonthHeader,W=void 0===q?8:q,_=t.paddingAfterDayOfWeekHeader,X=void 0===_?8:_,$=t.cellPadding,V=void 0===$?2:$,Z=t.formatDay,I=void 0===Z?function(e){return"SMTWTFS"[e]}:Z,B=o,J=B[0],Q=B[o.length-1],G=y||{from:c(new Date(J?J.day:"")),to:new Date(Q?Q.day:"")},K=G.from,ee=G.to,te=g.range(K,ee).map((function(e){return o.filter((function(t){return n=new Date(t.day),r=e,n.getUTCFullYear()===r.getUTCFullYear()&&n.getUTCMonth()===r.getUTCMonth()&&n.getUTCDate()===r.getUTCDate();var n,r})).pop()||{day:e.toISOString().slice(0,10),value:0}})),ne=gt("%b"),re=Be(te,.9975,(function(e){return Math.abs(e.value)})),oe=M.domain([-re,+re]),ae=m,ie="weekend"===i?function(e){return(e-1+7)%7}:function(e){return(e+6)%7},ue="weekday"===i?Je(1,6):Je(0,7),le=T(C(K),ee),ce="weekday"===i?te.filter((function(e){return![0,6].includes(new Date(e.day).getUTCDay())})):te,fe=x,se=U*("weekday"===i?6:8)+j+P+W,he=K.getUTCFullYear()===ee.getUTCFullYear(),ge=K.getUTCFullYear()+(he?"":"/"+ee.getUTCFullYear().toString().slice(-2)),de=he?X:X+15;return e.createElement(zn,{tooltipPlacement:p,tooltipClassName:v,disableTooltip:l,tooltipOffsetX:s,tooltipOffsetY:d,valueFn:Y},e.createElement("div",{className:n()("CalendarHeatMap",r)},e.createElement("svg",{fontSize:"10px",viewBox:"0 0 "+fe+" "+se},e.createElement("g",{transform:"translate("+(28+z+de)+", "+(10+j+W)+")"},e.createElement("text",{x:-X,y:-W,fontWeight:"bold",textAnchor:"end"},ge),e.createElement("g",{textAnchor:"end"},ue.map((function(t,n){return e.createElement("text",{key:n,x:-X,y:(ie(t)+.5)*U,dy:"0.31em"},I(t))}))),e.createElement("g",null,ce.map((function(t,n){return e.createElement(Xn,{key:n,c:t,color:oe,cellSize:U,countDay:ie,timeWeek:ae,formatDate:F,timeRange:G,cellShape:N,defaultColor:A,cellPadding:V})}))),e.createElement("g",null,le.map((function(t,n){var r=ae.count(K,ae.ceil(t))*U+2;return r<=-10?null:e.createElement("g",{key:n},e.createElement("text",{x:Math.max(r,0),y:-W},ne(t)))})))))))}})(),o})()})); | ||
//# sourceMappingURL=react.d3.calendar.heatmap.js.map |
{ | ||
"name": "react-d3-calendar-heatmap", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Calendar Heatmap in D3", | ||
@@ -5,0 +5,0 @@ "main": "dist/react.d3.calendar.heatmap.js", |
@@ -26,1 +26,14 @@ import { utcYear } from "d3-time"; | ||
first.getUTCDate() === second.getUTCDate(); | ||
export const convertDateToUTCDate = (date: Date): Date => { | ||
const dateUTC = Date.UTC( | ||
date.getUTCFullYear(), | ||
date.getUTCMonth(), | ||
date.getUTCDate(), | ||
date.getUTCHours(), | ||
date.getUTCMinutes(), | ||
date.getUTCSeconds() | ||
); | ||
return new Date(dateUTC); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
322725
1276