import { timeDay as e, utcDay as t } from "../../d3-time/src/day.js";
import { timeMonday as n, timeSunday as r, timeThursday as i, utcMonday as a, utcSunday as o, utcThursday as s } from "../../d3-time/src/week.js";
import { timeYear as c, utcYear as l } from "../../d3-time/src/year.js";
//#region ../../node_modules/d3-time-format/src/locale.js
function u(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 d(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 f(e, t, n) {
	return {
		y: e,
		m: t,
		d: n,
		H: 0,
		M: 0,
		S: 0,
		L: 0
	};
}
function p(r) {
	var i = r.dateTime, o = r.date, s = r.time, c = r.periods, l = r.days, p = r.shortDays, h = r.months, g = r.shortMonths, _ = b(c), v = x(c), y = b(l), B = x(l), W = b(p), Le = x(p), Re = b(h), ze = x(h), Be = b(g), Ve = x(g), J = {
		a: Xe,
		A: Ze,
		b: Qe,
		B: $e,
		c: null,
		d: k,
		e: k,
		f: P,
		g: ge,
		G: ve,
		H: A,
		I: j,
		j: M,
		L: N,
		m: F,
		M: I,
		p: et,
		q: tt,
		Q: K,
		s: q,
		S: L,
		u: R,
		U: z,
		V,
		w: pe,
		W: me,
		x: null,
		X: null,
		y: he,
		Y: _e,
		Z: ye,
		"%": G
	}, Y = {
		a: nt,
		A: rt,
		b: it,
		B: at,
		c: null,
		d: H,
		e: H,
		f: Ce,
		g: Ne,
		G: Fe,
		H: be,
		I: xe,
		j: Se,
		L: U,
		m: we,
		M: Te,
		p: ot,
		q: st,
		Q: K,
		s: q,
		S: Ee,
		u: De,
		U: Oe,
		V: ke,
		w: Ae,
		W: je,
		x: null,
		X: null,
		y: Me,
		Y: Pe,
		Z: Ie,
		"%": G
	}, He = {
		a: We,
		A: Ge,
		b: Ke,
		B: qe,
		c: Je,
		d: D,
		e: D,
		f: le,
		g: E,
		G: T,
		H: O,
		I: O,
		j: ae,
		L: ce,
		m: ie,
		M: oe,
		p: Ue,
		q: re,
		Q: de,
		s: fe,
		S: se,
		u: C,
		U: ee,
		V: te,
		w: S,
		W: w,
		x: $,
		X: Ye,
		y: E,
		Y: T,
		Z: ne,
		"%": ue
	};
	J.x = X(o, J), J.X = X(s, J), J.c = X(i, J), Y.x = X(o, Y), Y.X = X(s, Y), Y.c = X(i, Y);
	function X(e, t) {
		return function(n) {
			var r = [], i = -1, a = 0, o = e.length, s, c, l;
			for (n instanceof Date || (n = /* @__PURE__ */ new Date(+n)); ++i < o;) e.charCodeAt(i) === 37 && (r.push(e.slice(a, i)), (c = m[s = e.charAt(++i)]) == null ? c = s === "e" ? " " : "0" : s = e.charAt(++i), (l = t[s]) && (s = l(n, c)), r.push(s), a = i + 1);
			return r.push(e.slice(a, i)), r.join("");
		};
	}
	function Z(r, i) {
		return function(o) {
			var s = f(1900, void 0, 1), c = Q(s, r, o += "", 0), l, p;
			if (c != o.length) return null;
			if ("Q" in s) return new Date(s.Q);
			if ("s" in s) return new Date(s.s * 1e3 + ("L" in s ? s.L : 0));
			if (i && !("Z" in s) && (s.Z = 0), "p" in s && (s.H = s.H % 12 + s.p * 12), s.m === void 0 && (s.m = "q" in s ? s.q : 0), "V" in s) {
				if (s.V < 1 || s.V > 53) return null;
				"w" in s || (s.w = 1), "Z" in s ? (l = d(f(s.y, 0, 1)), p = l.getUTCDay(), l = p > 4 || p === 0 ? a.ceil(l) : a(l), l = t.offset(l, (s.V - 1) * 7), s.y = l.getUTCFullYear(), s.m = l.getUTCMonth(), s.d = l.getUTCDate() + (s.w + 6) % 7) : (l = u(f(s.y, 0, 1)), p = l.getDay(), l = p > 4 || p === 0 ? n.ceil(l) : n(l), l = e.offset(l, (s.V - 1) * 7), s.y = l.getFullYear(), s.m = l.getMonth(), s.d = l.getDate() + (s.w + 6) % 7);
			} else ("W" in s || "U" in s) && ("w" in s || (s.w = "u" in s ? s.u % 7 : +("W" in s)), p = "Z" in s ? d(f(s.y, 0, 1)).getUTCDay() : u(f(s.y, 0, 1)).getDay(), s.m = 0, s.d = "W" in s ? (s.w + 6) % 7 + s.W * 7 - (p + 5) % 7 : s.w + s.U * 7 - (p + 6) % 7);
			return "Z" in s ? (s.H += s.Z / 100 | 0, s.M += s.Z % 100, d(s)) : u(s);
		};
	}
	function Q(e, t, n, r) {
		for (var i = 0, a = t.length, o = n.length, s, c; i < a;) {
			if (r >= o) return -1;
			if (s = t.charCodeAt(i++), s === 37) {
				if (s = t.charAt(i++), c = He[s in m ? t.charAt(i++) : s], !c || (r = c(e, n, r)) < 0) return -1;
			} else if (s != n.charCodeAt(r++)) return -1;
		}
		return r;
	}
	function Ue(e, t, n) {
		var r = _.exec(t.slice(n));
		return r ? (e.p = v.get(r[0].toLowerCase()), n + r[0].length) : -1;
	}
	function We(e, t, n) {
		var r = W.exec(t.slice(n));
		return r ? (e.w = Le.get(r[0].toLowerCase()), n + r[0].length) : -1;
	}
	function Ge(e, t, n) {
		var r = y.exec(t.slice(n));
		return r ? (e.w = B.get(r[0].toLowerCase()), n + r[0].length) : -1;
	}
	function Ke(e, t, n) {
		var r = Be.exec(t.slice(n));
		return r ? (e.m = Ve.get(r[0].toLowerCase()), n + r[0].length) : -1;
	}
	function qe(e, t, n) {
		var r = Re.exec(t.slice(n));
		return r ? (e.m = ze.get(r[0].toLowerCase()), n + r[0].length) : -1;
	}
	function Je(e, t, n) {
		return Q(e, i, t, n);
	}
	function $(e, t, n) {
		return Q(e, o, t, n);
	}
	function Ye(e, t, n) {
		return Q(e, s, t, n);
	}
	function Xe(e) {
		return p[e.getDay()];
	}
	function Ze(e) {
		return l[e.getDay()];
	}
	function Qe(e) {
		return g[e.getMonth()];
	}
	function $e(e) {
		return h[e.getMonth()];
	}
	function et(e) {
		return c[+(e.getHours() >= 12)];
	}
	function tt(e) {
		return 1 + ~~(e.getMonth() / 3);
	}
	function nt(e) {
		return p[e.getUTCDay()];
	}
	function rt(e) {
		return l[e.getUTCDay()];
	}
	function it(e) {
		return g[e.getUTCMonth()];
	}
	function at(e) {
		return h[e.getUTCMonth()];
	}
	function ot(e) {
		return c[+(e.getUTCHours() >= 12)];
	}
	function st(e) {
		return 1 + ~~(e.getUTCMonth() / 3);
	}
	return {
		format: function(e) {
			var t = X(e += "", J);
			return t.toString = function() {
				return e;
			}, t;
		},
		parse: function(e) {
			var t = Z(e += "", !1);
			return t.toString = function() {
				return e;
			}, t;
		},
		utcFormat: function(e) {
			var t = X(e += "", Y);
			return t.toString = function() {
				return e;
			}, t;
		},
		utcParse: function(e) {
			var t = Z(e += "", !0);
			return t.toString = function() {
				return e;
			}, t;
		}
	};
}
var m = {
	"-": "",
	_: " ",
	0: "0"
}, h = /^\s*\d+/, g = /^%/, _ = /[\\^$*+?|[\]().{}]/g;
function v(e, t, n) {
	var r = e < 0 ? "-" : "", i = (r ? -e : e) + "", a = i.length;
	return r + (a < n ? Array(n - a + 1).join(t) + i : i);
}
function y(e) {
	return e.replace(_, "\\$&");
}
function b(e) {
	return RegExp("^(?:" + e.map(y).join("|") + ")", "i");
}
function x(e) {
	return new Map(e.map((e, t) => [e.toLowerCase(), t]));
}
function S(e, t, n) {
	var r = h.exec(t.slice(n, n + 1));
	return r ? (e.w = +r[0], n + r[0].length) : -1;
}
function C(e, t, n) {
	var r = h.exec(t.slice(n, n + 1));
	return r ? (e.u = +r[0], n + r[0].length) : -1;
}
function ee(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.U = +r[0], n + r[0].length) : -1;
}
function te(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.V = +r[0], n + r[0].length) : -1;
}
function w(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.W = +r[0], n + r[0].length) : -1;
}
function T(e, t, n) {
	var r = h.exec(t.slice(n, n + 4));
	return r ? (e.y = +r[0], n + r[0].length) : -1;
}
function E(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3), n + r[0].length) : -1;
}
function ne(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 re(e, t, n) {
	var r = h.exec(t.slice(n, n + 1));
	return r ? (e.q = r[0] * 3 - 3, n + r[0].length) : -1;
}
function ie(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.m = r[0] - 1, n + r[0].length) : -1;
}
function D(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.d = +r[0], n + r[0].length) : -1;
}
function ae(e, t, n) {
	var r = h.exec(t.slice(n, n + 3));
	return r ? (e.m = 0, e.d = +r[0], n + r[0].length) : -1;
}
function O(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.H = +r[0], n + r[0].length) : -1;
}
function oe(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.M = +r[0], n + r[0].length) : -1;
}
function se(e, t, n) {
	var r = h.exec(t.slice(n, n + 2));
	return r ? (e.S = +r[0], n + r[0].length) : -1;
}
function ce(e, t, n) {
	var r = h.exec(t.slice(n, n + 3));
	return r ? (e.L = +r[0], n + r[0].length) : -1;
}
function le(e, t, n) {
	var r = h.exec(t.slice(n, n + 6));
	return r ? (e.L = Math.floor(r[0] / 1e3), n + r[0].length) : -1;
}
function ue(e, t, n) {
	var r = g.exec(t.slice(n, n + 1));
	return r ? n + r[0].length : -1;
}
function de(e, t, n) {
	var r = h.exec(t.slice(n));
	return r ? (e.Q = +r[0], n + r[0].length) : -1;
}
function fe(e, t, n) {
	var r = h.exec(t.slice(n));
	return r ? (e.s = +r[0], n + r[0].length) : -1;
}
function k(e, t) {
	return v(e.getDate(), t, 2);
}
function A(e, t) {
	return v(e.getHours(), t, 2);
}
function j(e, t) {
	return v(e.getHours() % 12 || 12, t, 2);
}
function M(t, n) {
	return v(1 + e.count(c(t), t), n, 3);
}
function N(e, t) {
	return v(e.getMilliseconds(), t, 3);
}
function P(e, t) {
	return N(e, t) + "000";
}
function F(e, t) {
	return v(e.getMonth() + 1, t, 2);
}
function I(e, t) {
	return v(e.getMinutes(), t, 2);
}
function L(e, t) {
	return v(e.getSeconds(), t, 2);
}
function R(e) {
	var t = e.getDay();
	return t === 0 ? 7 : t;
}
function z(e, t) {
	return v(r.count(c(e) - 1, e), t, 2);
}
function B(e) {
	var t = e.getDay();
	return t >= 4 || t === 0 ? i(e) : i.ceil(e);
}
function V(e, t) {
	return e = B(e), v(i.count(c(e), e) + (c(e).getDay() === 4), t, 2);
}
function pe(e) {
	return e.getDay();
}
function me(e, t) {
	return v(n.count(c(e) - 1, e), t, 2);
}
function he(e, t) {
	return v(e.getFullYear() % 100, t, 2);
}
function ge(e, t) {
	return e = B(e), v(e.getFullYear() % 100, t, 2);
}
function _e(e, t) {
	return v(e.getFullYear() % 1e4, t, 4);
}
function ve(e, t) {
	var n = e.getDay();
	return e = n >= 4 || n === 0 ? i(e) : i.ceil(e), v(e.getFullYear() % 1e4, t, 4);
}
function ye(e) {
	var t = e.getTimezoneOffset();
	return (t > 0 ? "-" : (t *= -1, "+")) + v(t / 60 | 0, "0", 2) + v(t % 60, "0", 2);
}
function H(e, t) {
	return v(e.getUTCDate(), t, 2);
}
function be(e, t) {
	return v(e.getUTCHours(), t, 2);
}
function xe(e, t) {
	return v(e.getUTCHours() % 12 || 12, t, 2);
}
function Se(e, n) {
	return v(1 + t.count(l(e), e), n, 3);
}
function U(e, t) {
	return v(e.getUTCMilliseconds(), t, 3);
}
function Ce(e, t) {
	return U(e, t) + "000";
}
function we(e, t) {
	return v(e.getUTCMonth() + 1, t, 2);
}
function Te(e, t) {
	return v(e.getUTCMinutes(), t, 2);
}
function Ee(e, t) {
	return v(e.getUTCSeconds(), t, 2);
}
function De(e) {
	var t = e.getUTCDay();
	return t === 0 ? 7 : t;
}
function Oe(e, t) {
	return v(o.count(l(e) - 1, e), t, 2);
}
function W(e) {
	var t = e.getUTCDay();
	return t >= 4 || t === 0 ? s(e) : s.ceil(e);
}
function ke(e, t) {
	return e = W(e), v(s.count(l(e), e) + (l(e).getUTCDay() === 4), t, 2);
}
function Ae(e) {
	return e.getUTCDay();
}
function je(e, t) {
	return v(a.count(l(e) - 1, e), t, 2);
}
function Me(e, t) {
	return v(e.getUTCFullYear() % 100, t, 2);
}
function Ne(e, t) {
	return e = W(e), v(e.getUTCFullYear() % 100, t, 2);
}
function Pe(e, t) {
	return v(e.getUTCFullYear() % 1e4, t, 4);
}
function Fe(e, t) {
	var n = e.getUTCDay();
	return e = n >= 4 || n === 0 ? s(e) : s.ceil(e), v(e.getUTCFullYear() % 1e4, t, 4);
}
function Ie() {
	return "+0000";
}
function G() {
	return "%";
}
function K(e) {
	return +e;
}
function q(e) {
	return Math.floor(e / 1e3);
}
//#endregion
export { p as default };
