import{a as _,s as q}from"./precisionRound-BIK1W-Pu.js";import{a as z,i as G}from"./linear-BdKgxuJR.js";import{A as D,C as d,D as w,E as A,M as k,N as H,O as x,S as J,T as y,_ as K,c as C,j as Q,k as I,l as U,o as j,p as E,s as V,t as W,v as F,w as X,x as L,y as Z}from"./defaultLocale-Ca1Ci3kv.js";import{n as $}from"./init-PHOs_KoL.js";function nn(r,u){let o;if(u===void 0)for(let t of r)t!=null&&(o<t||o===void 0&&t>=t)&&(o=t);else{let t=-1;for(let a of r)(a=u(a,++t,r))!=null&&(o<a||o===void 0&&a>=a)&&(o=a)}return o}function rn(r,u){let o;if(u===void 0)for(let t of r)t!=null&&(o>t||o===void 0&&t>=t)&&(o=t);else{let t=-1;for(let a of r)(a=u(a,++t,r))!=null&&(o>a||o===void 0&&a>=a)&&(o=a)}return o}function N(r,u,o,t,a,f){let e=[[y,1,D],[y,5,5*D],[y,15,15*D],[y,30,30*D],[f,1,x],[f,5,5*x],[f,15,15*x],[f,30,30*x],[a,1,w],[a,3,3*w],[a,6,6*w],[a,12,12*w],[t,1,A],[t,2,2*A],[o,1,Q],[u,1,I],[u,3,3*I],[r,1,k]];function h(s,i,m){let l=i<s;l&&([s,i]=[i,s]);let c=m&&typeof m.range=="function"?m:p(s,i,m),g=c?c.range(s,+i+1):[];return l?g.reverse():g}function p(s,i,m){let l=Math.abs(i-s)/m,c=q(([,,b])=>b).right(e,l);if(c===e.length)return r.every(_(s/k,i/k,m));if(c===0)return H.every(Math.max(_(s,i,m),1));let[g,M]=e[l/e[c-1][2]<e[c][2]/l?c-1:c];return g.every(M)}return[h,p]}var[tn,an]=N(V,U,K,Z,J,X),[on,sn]=N(j,C,E,F,L,d);function O(r,u){r=r.slice();var o=0,t=r.length-1,a=r[o],f=r[t],e;return f<a&&(e=o,o=t,t=e,e=a,a=f,f=e),r[o]=u.floor(a),r[t]=u.ceil(f),r}function un(r){return new Date(r)}function en(r){return r instanceof Date?+r:+new Date(+r)}function S(r,u,o,t,a,f,e,h,p,s){var i=G(),m=i.invert,l=i.domain,c=s(".%L"),g=s(":%S"),M=s("%I:%M"),b=s("%I %p"),T=s("%a %d"),B=s("%b %d"),P=s("%B"),R=s("%Y");function Y(n){return(p(n)<n?c:h(n)<n?g:e(n)<n?M:f(n)<n?b:t(n)<n?a(n)<n?T:B:o(n)<n?P:R)(n)}return i.invert=function(n){return new Date(m(n))},i.domain=function(n){return arguments.length?l(Array.from(n,en)):l().map(un)},i.ticks=function(n){var v=l();return r(v[0],v[v.length-1],n??10)},i.tickFormat=function(n,v){return v==null?Y:s(v)},i.nice=function(n){var v=l();return(!n||typeof n.range!="function")&&(n=u(v[0],v[v.length-1],n??10)),n?l(O(v,n)):i},i.copy=function(){return z(i,S(r,u,o,t,a,f,e,h,p,s))},i}function fn(){return $.apply(S(on,sn,j,C,E,F,L,d,y,W).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{tn as a,an as i,fn as n,rn as o,O as r,nn as s,S as t};
