import{R as t,r as n,d as a,e as r,C as i,n as e,h as s}from"./timer-CK-RIWfW.js";import{c as o,a as u}from"./linear-spCykGIY.js";import{i as c}from"./init-DLRA0X12.js";import{aw as l,ax as f,ay as h,az as p,aA as y,aB as w,aC as v,aD as b,aE as g,aF as m,aG as d,aH as M,aI as N,aJ as D,aK as I,aL as j,aM as k,aN as x,aO as P,aP as A,aQ as B,aR as C,aS as F,aT as L}from"./index-FKnJJang.js";function R(t,n){let a;if(void 0===n)for(const r of t)null!=r&&(a<r||void 0===a&&r>=r)&&(a=r);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(a<i||void 0===a&&i>=i)&&(a=i)}return a}function S(t,n){let a;if(void 0===n)for(const r of t)null!=r&&(a>r||void 0===a&&r>=r)&&(a=r);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(a>i||void 0===a&&i>=i)&&(a=i)}return a}function q(t,n,a,r,i,e){const s=[[v,1,b],[v,5,5*b],[v,15,15*b],[v,30,30*b],[e,1,g],[e,5,5*g],[e,15,15*g],[e,30,30*g],[i,1,m],[i,3,3*m],[i,6,6*m],[i,12,12*m],[r,1,d],[r,2,2*d],[a,1,M],[n,1,N],[n,3,3*N],[t,1,h]];function o(n,a,r){const i=Math.abs(a-n)/r,e=l((([,,t])=>t)).right(s,i);if(e===s.length)return t.every(f(n/h,a/h,r));if(0===e)return p.every(Math.max(f(n,a,r),1));const[o,u]=s[i/s[e-1][2]<s[e][2]/i?e-1:e];return o.every(u)}return[function(t,n,a){const r=n<t;r&&([t,n]=[n,t]);const i=a&&"function"==typeof a.range?a:o(t,n,a),e=i?i.range(t,+n+1):[];return r?e.reverse():e},o]}const[z,E]=q(y,x,k,j,I,D),[G,H]=q(w,F,C,B,A,P),J=Math.PI/180,K=180/Math.PI,O=.96422,Q=.82521,T=4/29,Y=6/29,U=3*Y*Y,V=Y*Y*Y;function W(a){if(a instanceof Z)return new Z(a.l,a.a,a.b,a.opacity);if(a instanceof rt)return it(a);a instanceof t||(a=n(a));var r,i,e=nt(a.r),s=nt(a.g),o=nt(a.b),u=$((.2225045*e+.7168786*s+.0606169*o)/1);return e===s&&s===o?r=i=u:(r=$((.4360747*e+.3850649*s+.1430804*o)/O),i=$((.0139322*e+.0971045*s+.7141733*o)/Q)),new Z(116*u-16,500*(r-u),200*(u-i),a.opacity)}function X(t,n,a,r){return 1===arguments.length?W(t):new Z(t,n,a,null==r?1:r)}function Z(t,n,a,r){this.l=+t,this.a=+n,this.b=+a,this.opacity=+r}function $(t){return t>V?Math.pow(t,1/3):t/U+T}function _(t){return t>Y?t*t*t:U*(t-T)}function tt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function nt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function at(t,n,a,r){return 1===arguments.length?function(t){if(t instanceof rt)return new rt(t.h,t.c,t.l,t.opacity);if(t instanceof Z||(t=W(t)),0===t.a&&0===t.b)return new rt(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*K;return new rt(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new rt(t,n,a,null==r?1:r)}function rt(t,n,a,r){this.h=+t,this.c=+n,this.l=+a,this.opacity=+r}function it(t){if(isNaN(t.h))return new Z(t.l,0,0,t.opacity);var n=t.h*J;return new Z(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}function et(t){return function(n,a){var r=t((n=at(n)).h,(a=at(a)).h),i=e(n.c,a.c),s=e(n.l,a.l),o=e(n.opacity,a.opacity);return function(t){return n.h=r(t),n.c=i(t),n.l=s(t),n.opacity=o(t),n+""}}}a(Z,X,r(i,{brighter(t){return new Z(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Z(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,a=isNaN(this.a)?n:n+this.a/500,r=isNaN(this.b)?n:n-this.b/200;return a=O*_(a),n=1*_(n),r=Q*_(r),new t(tt(3.1338561*a-1.6168667*n-.4906146*r),tt(-.9787684*a+1.9161415*n+.033454*r),tt(.0719453*a-.2289914*n+1.4052427*r),this.opacity)}})),a(rt,at,r(i,{brighter(t){return new rt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new rt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return it(this).rgb()}}));const st=et(s);var ot=et(e);function ut(t,n){var a,r=0,i=(t=t.slice()).length-1,e=t[r],s=t[i];return s<e&&(a=r,r=i,i=a,a=e,e=s,s=a),t[r]=n.floor(e),t[i]=n.ceil(s),t}function ct(t){return new Date(t)}function lt(t){return t instanceof Date?+t:+new Date(+t)}function ft(t,n,a,r,i,e,s,c,l,f){var h=o(),p=h.invert,y=h.domain,w=f(".%L"),v=f(":%S"),b=f("%I:%M"),g=f("%I %p"),m=f("%a %d"),d=f("%b %d"),M=f("%B"),N=f("%Y");function D(t){return(l(t)<t?w:c(t)<t?v:s(t)<t?b:e(t)<t?g:r(t)<t?i(t)<t?m:d:a(t)<t?M:N)(t)}return h.invert=function(t){return new Date(p(t))},h.domain=function(t){return arguments.length?y(Array.from(t,lt)):y().map(ct)},h.ticks=function(n){var a=y();return t(a[0],a[a.length-1],null==n?10:n)},h.tickFormat=function(t,n){return null==n?D:f(n)},h.nice=function(t){var a=y();return t&&"function"==typeof t.range||(t=n(a[0],a[a.length-1],null==t?10:t)),t?y(ut(a,t)):h},h.copy=function(){return u(h,ft(t,n,a,r,i,e,s,c,l,f))},h}function ht(){return c.apply(ft(G,H,w,F,C,B,A,P,v,L).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{R as a,z as b,ft as c,K as d,at as e,ot as h,st as i,X as l,S as m,ut as n,J as r,ht as t,E as u};
