ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
3,126 lines • 102 kB
JavaScript
import { n as Bt, t as se } from "./rolldown-runtime-9ZSF5uba.js";
import { n as g } from "./chunk-Y2CYZVJY-0JxdZxki.js";
import { a as Qt, c as er, d as rr, f as nr, g as $r, i as Or, m as bt, p as jt, s as ir, u as Hr } from "./src-DtRLxcYO.js";
import { H as Nr, K as Vr, U as Pr, a as zr, c as Rr, s as Br, v as Zr, w as qr, x as Yt, y as Xr } from "./chunk-WYO6CB5R-DDHkKowO.js";
import { a as jr, i as He, n as Gr, r as Qr, t as Jr } from "./linear-B2AM4ZBe.js";
import { t as Kr } from "./init-1VpIn1S3.js";
import { t as tn } from "./dist-C0Fwsvsq.js";
import { g as en } from "./chunk-ICXQ74PX-DR8rL-xF.js";
function rn(t, e) {
let r;
if (e === void 0)
for (const n of t) n != null && (r < n || r === void 0 && n >= n) && (r = n);
else {
let n = -1;
for (let i of t) (i = e(i, ++n, t)) != null && (r < i || r === void 0 && i >= i) && (r = i);
}
return r;
}
function nn(t, e) {
let r;
if (e === void 0)
for (const n of t) n != null && (r > n || r === void 0 && n >= n) && (r = n);
else {
let n = -1;
for (let i of t) (i = e(i, ++n, t)) != null && (r > i || r === void 0 && i >= i) && (r = i);
}
return r;
}
function an(t) {
return t;
}
var Jt = 1, ce = 2, pe = 3, Gt = 4, Ne = 1e-6;
function sn(t) {
return "translate(" + t + ",0)";
}
function on(t) {
return "translate(0," + t + ")";
}
function cn(t) {
return (e) => +t(e);
}
function un(t, e) {
return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (r) => +t(r) + e;
}
function ln() {
return !this.__axis;
}
function ar(t, e) {
var r = [], n = null, i = null, a = 6, o = 6, x = 3, Y = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, M = t === Jt || t === Gt ? -1 : 1, _ = t === Gt || t === ce ? "x" : "y", O = t === Jt || t === pe ? sn : on;
function C(S) {
var X = n ?? (e.ticks ? e.ticks.apply(e, r) : e.domain()), q = i ?? (e.tickFormat ? e.tickFormat.apply(e, r) : an), v = Math.max(a, 0) + x, E = e.range(), V = +E[0] + Y, L = +E[E.length - 1] + Y, B = (e.bandwidth ? un : cn)(e.copy(), Y), j = S.selection ? S.selection() : S, p = j.selectAll(".domain").data([null]), y = j.selectAll(".tick").data(X, e).order(), k = y.exit(), W = y.enter().append("g").attr("class", "tick"), T = y.select("line"), w = y.select("text");
p = p.merge(p.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), y = y.merge(W), T = T.merge(W.append("line").attr("stroke", "currentColor").attr(_ + "2", M * a)), w = w.merge(W.append("text").attr("fill", "currentColor").attr(_, M * v).attr("dy", t === Jt ? "0em" : t === pe ? "0.71em" : "0.32em")), S !== j && (p = p.transition(S), y = y.transition(S), T = T.transition(S), w = w.transition(S), k = k.transition(S).attr("opacity", Ne).attr("transform", function(s) {
return isFinite(s = B(s)) ? O(s + Y) : this.getAttribute("transform");
}), W.attr("opacity", Ne).attr("transform", function(s) {
var u = this.parentNode.__axis;
return O((u && isFinite(u = u(s)) ? u : B(s)) + Y);
})), k.remove(), p.attr("d", t === Gt || t === ce ? o ? "M" + M * o + "," + V + "H" + Y + "V" + L + "H" + M * o : "M" + Y + "," + V + "V" + L : o ? "M" + V + "," + M * o + "V" + Y + "H" + L + "V" + M * o : "M" + V + "," + Y + "H" + L), y.attr("opacity", 1).attr("transform", function(s) {
return O(B(s) + Y);
}), T.attr(_ + "2", M * a), w.attr(_, M * v).text(q), j.filter(ln).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === ce ? "start" : t === Gt ? "end" : "middle"), j.each(function() {
this.__axis = B;
});
}
return C.scale = function(S) {
return arguments.length ? (e = S, C) : e;
}, C.ticks = function() {
return r = Array.from(arguments), C;
}, C.tickArguments = function(S) {
return arguments.length ? (r = S == null ? [] : Array.from(S), C) : r.slice();
}, C.tickValues = function(S) {
return arguments.length ? (n = S == null ? null : Array.from(S), C) : n && n.slice();
}, C.tickFormat = function(S) {
return arguments.length ? (i = S, C) : i;
}, C.tickSize = function(S) {
return arguments.length ? (a = o = +S, C) : a;
}, C.tickSizeInner = function(S) {
return arguments.length ? (a = +S, C) : a;
}, C.tickSizeOuter = function(S) {
return arguments.length ? (o = +S, C) : o;
}, C.tickPadding = function(S) {
return arguments.length ? (x = +S, C) : x;
}, C.offset = function(S) {
return arguments.length ? (Y = +S, C) : Y;
}, C;
}
function fn(t) {
return ar(Jt, t);
}
function dn(t) {
return ar(pe, t);
}
var hn = Math.PI / 180, mn = 180 / Math.PI, ee = 18, sr = 0.96422, or = 1, cr = 0.82521, ur = 4 / 29, Ft = 6 / 29, lr = 3 * Ft * Ft, gn = Ft * Ft * Ft;
function fr(t) {
if (t instanceof ft) return new ft(t.l, t.a, t.b, t.opacity);
if (t instanceof mt) return dr(t);
t instanceof er || (t = Hr(t));
var e = de(t.r), r = de(t.g), n = de(t.b), i = ue((0.2225045 * e + 0.7168786 * r + 0.0606169 * n) / or), a, o;
return e === r && r === n ? a = o = i : (a = ue((0.4360747 * e + 0.3850649 * r + 0.1430804 * n) / sr), o = ue((0.0139322 * e + 0.0971045 * r + 0.7141733 * n) / cr)), new ft(116 * i - 16, 500 * (a - i), 200 * (i - o), t.opacity);
}
function yn(t, e, r, n) {
return arguments.length === 1 ? fr(t) : new ft(t, e, r, n ?? 1);
}
function ft(t, e, r, n) {
this.l = +t, this.a = +e, this.b = +r, this.opacity = +n;
}
rr(ft, yn, nr(ir, {
brighter(t) {
return new ft(this.l + ee * (t ?? 1), this.a, this.b, this.opacity);
},
darker(t) {
return new ft(this.l - ee * (t ?? 1), this.a, this.b, this.opacity);
},
rgb() {
var t = (this.l + 16) / 116, e = isNaN(this.a) ? t : t + this.a / 500, r = isNaN(this.b) ? t : t - this.b / 200;
return e = sr * le(e), t = or * le(t), r = cr * le(r), new er(fe(3.1338561 * e - 1.6168667 * t - 0.4906146 * r), fe(-0.9787684 * e + 1.9161415 * t + 0.033454 * r), fe(0.0719453 * e - 0.2289914 * t + 1.4052427 * r), this.opacity);
}
}));
function ue(t) {
return t > gn ? Math.pow(t, 1 / 3) : t / lr + ur;
}
function le(t) {
return t > Ft ? t * t * t : lr * (t - ur);
}
function fe(t) {
return 255 * (t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055);
}
function de(t) {
return (t /= 255) <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
}
function kn(t) {
if (t instanceof mt) return new mt(t.h, t.c, t.l, t.opacity);
if (t instanceof ft || (t = fr(t)), t.a === 0 && t.b === 0) return new mt(NaN, 0 < t.l && t.l < 100 ? 0 : NaN, t.l, t.opacity);
var e = Math.atan2(t.b, t.a) * mn;
return new mt(e < 0 ? e + 360 : e, Math.sqrt(t.a * t.a + t.b * t.b), t.l, t.opacity);
}
function Te(t, e, r, n) {
return arguments.length === 1 ? kn(t) : new mt(t, e, r, n ?? 1);
}
function mt(t, e, r, n) {
this.h = +t, this.c = +e, this.l = +r, this.opacity = +n;
}
function dr(t) {
if (isNaN(t.h)) return new ft(t.l, 0, 0, t.opacity);
var e = t.h * hn;
return new ft(t.l, Math.cos(e) * t.c, Math.sin(e) * t.c, t.opacity);
}
rr(mt, Te, nr(ir, {
brighter(t) {
return new mt(this.h, this.c, this.l + ee * (t ?? 1), this.opacity);
},
darker(t) {
return new mt(this.h, this.c, this.l - ee * (t ?? 1), this.opacity);
},
rgb() {
return dr(this).rgb();
}
}));
function hr(t) {
return function(e, r) {
var n = t((e = Te(e)).h, (r = Te(r)).h), i = Qt(e.c, r.c), a = Qt(e.l, r.l), o = Qt(e.opacity, r.opacity);
return function(x) {
return e.h = n(x), e.c = i(x), e.l = a(x), e.opacity = o(x), e + "";
};
};
}
var vn = hr(Or), Ia = hr(Qt);
function pn(t, e) {
t = t.slice();
var r = 0, n = t.length - 1, i = t[r], a = t[n], o;
return a < i && (o = r, r = n, n = o, o = i, i = a, a = o), t[r] = e.floor(i), t[n] = e.ceil(a), t;
}
var he = /* @__PURE__ */ new Date(), me = /* @__PURE__ */ new Date();
function rt(t, e, r, n) {
function i(a) {
return t(a = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+a)), a;
}
return i.floor = (a) => (t(a = /* @__PURE__ */ new Date(+a)), a), i.ceil = (a) => (t(a = /* @__PURE__ */ new Date(a - 1)), e(a, 1), t(a), a), i.round = (a) => {
const o = i(a), x = i.ceil(a);
return a - o < x - a ? o : x;
}, i.offset = (a, o) => (e(a = /* @__PURE__ */ new Date(+a), o == null ? 1 : Math.floor(o)), a), i.range = (a, o, x) => {
const Y = [];
if (a = i.ceil(a), x = x == null ? 1 : Math.floor(x), !(a < o) || !(x > 0)) return Y;
let M;
do
Y.push(M = /* @__PURE__ */ new Date(+a)), e(a, x), t(a);
while (M < a && a < o);
return Y;
}, i.filter = (a) => rt((o) => {
if (o >= o) for (; t(o), !a(o); ) o.setTime(o - 1);
}, (o, x) => {
if (o >= o) if (x < 0) for (; ++x <= 0; ) for (; e(o, -1), !a(o); ) ;
else for (; --x >= 0; ) for (; e(o, 1), !a(o); ) ;
}), r && (i.count = (a, o) => (he.setTime(+a), me.setTime(+o), t(he), t(me), Math.floor(r(he, me))), i.every = (a) => (a = Math.floor(a), !isFinite(a) || !(a > 0) ? null : a > 1 ? i.filter(n ? (o) => n(o) % a === 0 : (o) => i.count(0, o) % a === 0) : i)), i;
}
var Et = rt(() => {
}, (t, e) => {
t.setTime(+t + e);
}, (t, e) => e - t);
Et.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? rt((e) => {
e.setTime(Math.floor(e / t) * t);
}, (e, r) => {
e.setTime(+e + r * t);
}, (e, r) => (r - e) / t) : Et);
var Wa = Et.range, gt = 1e3, ot = gt * 60, yt = ot * 60, kt = yt * 24, De = kt * 7, Ve = kt * 30, ge = kt * 365, pt = rt((t) => {
t.setTime(t - t.getMilliseconds());
}, (t, e) => {
t.setTime(+t + e * gt);
}, (t, e) => (e - t) / gt, (t) => t.getUTCSeconds()), Aa = pt.range, Vt = rt((t) => {
t.setTime(t - t.getMilliseconds() - t.getSeconds() * gt);
}, (t, e) => {
t.setTime(+t + e * ot);
}, (t, e) => (e - t) / ot, (t) => t.getMinutes()), $a = Vt.range, mr = rt((t) => {
t.setUTCSeconds(0, 0);
}, (t, e) => {
t.setTime(+t + e * ot);
}, (t, e) => (e - t) / ot, (t) => t.getUTCMinutes()), Oa = mr.range, Pt = rt((t) => {
t.setTime(t - t.getMilliseconds() - t.getSeconds() * gt - t.getMinutes() * ot);
}, (t, e) => {
t.setTime(+t + e * yt);
}, (t, e) => (e - t) / yt, (t) => t.getHours()), Ha = Pt.range, gr = rt((t) => {
t.setUTCMinutes(0, 0, 0);
}, (t, e) => {
t.setTime(+t + e * yt);
}, (t, e) => (e - t) / yt, (t) => t.getUTCHours()), Na = gr.range, xt = rt((t) => t.setHours(0, 0, 0, 0), (t, e) => t.setDate(t.getDate() + e), (t, e) => (e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * ot) / kt, (t) => t.getDate() - 1), Va = xt.range, Ce = rt((t) => {
t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
t.setUTCDate(t.getUTCDate() + e);
}, (t, e) => (e - t) / kt, (t) => t.getUTCDate() - 1), Pa = Ce.range, yr = rt((t) => {
t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
t.setUTCDate(t.getUTCDate() + e);
}, (t, e) => (e - t) / kt, (t) => Math.floor(t / kt)), za = yr.range;
function Mt(t) {
return rt((e) => {
e.setDate(e.getDate() - (e.getDay() + 7 - t) % 7), e.setHours(0, 0, 0, 0);
}, (e, r) => {
e.setDate(e.getDate() + r * 7);
}, (e, r) => (r - e - (r.getTimezoneOffset() - e.getTimezoneOffset()) * ot) / De);
}
var Zt = Mt(0), zt = Mt(1), kr = Mt(2), vr = Mt(3), wt = Mt(4), pr = Mt(5), Tr = Mt(6), Ra = Zt.range, Ba = zt.range, Za = kr.range, qa = vr.range, Xa = wt.range, ja = pr.range, Ga = Tr.range;
function Dt(t) {
return rt((e) => {
e.setUTCDate(e.getUTCDate() - (e.getUTCDay() + 7 - t) % 7), e.setUTCHours(0, 0, 0, 0);
}, (e, r) => {
e.setUTCDate(e.getUTCDate() + r * 7);
}, (e, r) => (r - e) / De);
}
var _e = Dt(0), re = Dt(1), Tn = Dt(2), bn = Dt(3), Lt = Dt(4), xn = Dt(5), wn = Dt(6), Qa = _e.range, Ja = re.range, Ka = Tn.range, ts = bn.range, es = Lt.range, rs = xn.range, ns = wn.range, Rt = rt((t) => {
t.setDate(1), t.setHours(0, 0, 0, 0);
}, (t, e) => {
t.setMonth(t.getMonth() + e);
}, (t, e) => e.getMonth() - t.getMonth() + (e.getFullYear() - t.getFullYear()) * 12, (t) => t.getMonth()), is = Rt.range, br = rt((t) => {
t.setUTCDate(1), t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
t.setUTCMonth(t.getUTCMonth() + e);
}, (t, e) => e.getUTCMonth() - t.getUTCMonth() + (e.getUTCFullYear() - t.getUTCFullYear()) * 12, (t) => t.getUTCMonth()), as = br.range, vt = rt((t) => {
t.setMonth(0, 1), t.setHours(0, 0, 0, 0);
}, (t, e) => {
t.setFullYear(t.getFullYear() + e);
}, (t, e) => e.getFullYear() - t.getFullYear(), (t) => t.getFullYear());
vt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : rt((e) => {
e.setFullYear(Math.floor(e.getFullYear() / t) * t), e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
}, (e, r) => {
e.setFullYear(e.getFullYear() + r * t);
});
var ss = vt.range, Tt = rt((t) => {
t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0);
}, (t, e) => {
t.setUTCFullYear(t.getUTCFullYear() + e);
}, (t, e) => e.getUTCFullYear() - t.getUTCFullYear(), (t) => t.getUTCFullYear());
Tt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : rt((e) => {
e.setUTCFullYear(Math.floor(e.getUTCFullYear() / t) * t), e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
}, (e, r) => {
e.setUTCFullYear(e.getUTCFullYear() + r * t);
});
var os = Tt.range;
function xr(t, e, r, n, i, a) {
const o = [
[
pt,
1,
gt
],
[
pt,
5,
5 * gt
],
[
pt,
15,
15 * gt
],
[
pt,
30,
30 * gt
],
[
a,
1,
ot
],
[
a,
5,
5 * ot
],
[
a,
15,
15 * ot
],
[
a,
30,
30 * ot
],
[
i,
1,
yt
],
[
i,
3,
3 * yt
],
[
i,
6,
6 * yt
],
[
i,
12,
12 * yt
],
[
n,
1,
kt
],
[
n,
2,
2 * kt
],
[
r,
1,
De
],
[
e,
1,
Ve
],
[
e,
3,
3 * Ve
],
[
t,
1,
ge
]
];
function x(M, _, O) {
const C = _ < M;
C && ([M, _] = [_, M]);
const S = O && typeof O.range == "function" ? O : Y(M, _, O), X = S ? S.range(M, +_ + 1) : [];
return C ? X.reverse() : X;
}
function Y(M, _, O) {
const C = Math.abs(_ - M) / O, S = jr(([, , v]) => v).right(o, C);
if (S === o.length) return t.every(He(M / ge, _ / ge, O));
if (S === 0) return Et.every(Math.max(He(M, _, O), 1));
const [X, q] = o[C / o[S - 1][2] < o[S][2] / C ? S - 1 : S];
return X.every(q);
}
return [x, Y];
}
var [cs, us] = xr(Tt, br, _e, yr, gr, mr), [Mn, Dn] = xr(vt, Rt, Zt, xt, Pt, Vt);
function ye(t) {
if (0 <= t.y && t.y < 100) {
var e = new Date(-1, t.m, t.d, t.H, t.M, t.S, t.L);
return e.setFullYear(t.y), e;
}
return new Date(t.y, t.m, t.d, t.H, t.M, t.S, t.L);
}
function ke(t) {
if (0 <= t.y && t.y < 100) {
var e = new Date(Date.UTC(-1, t.m, t.d, t.H, t.M, t.S, t.L));
return e.setUTCFullYear(t.y), e;
}
return new Date(Date.UTC(t.y, t.m, t.d, t.H, t.M, t.S, t.L));
}
function Ot(t, e, r) {
return {
y: t,
m: e,
d: r,
H: 0,
M: 0,
S: 0,
L: 0
};
}
function Cn(t) {
var e = t.dateTime, r = t.date, n = t.time, i = t.periods, a = t.days, o = t.shortDays, x = t.months, Y = t.shortMonths, M = Ht(i), _ = Nt(i), O = Ht(a), C = Nt(a), S = Ht(o), X = Nt(o), q = Ht(x), v = Nt(x), E = Ht(Y), V = Nt(Y), L = {
a: F,
A: c,
b: I,
B: f,
c: null,
d: qe,
e: qe,
f: jn,
g: ai,
G: oi,
H: Zn,
I: qn,
j: Xn,
L: wr,
m: Gn,
M: Qn,
p: l,
q: U,
Q: Ge,
s: Qe,
S: Jn,
u: Kn,
U: ti,
V: ei,
w: ri,
W: ni,
x: null,
X: null,
y: ii,
Y: si,
Z: ci,
"%": je
}, B = {
a: H,
A: R,
b: P,
B: tt,
c: null,
d: Xe,
e: Xe,
f: di,
g: xi,
G: Mi,
H: ui,
I: li,
j: fi,
L: Dr,
m: hi,
M: mi,
p: $,
q: at,
Q: Ge,
s: Qe,
S: gi,
u: yi,
U: ki,
V: vi,
w: pi,
W: Ti,
x: null,
X: null,
y: bi,
Y: wi,
Z: Di,
"%": je
}, j = {
a: T,
A: w,
b: s,
B: u,
c: h,
d: Be,
e: Be,
f: Pn,
g: Re,
G: ze,
H: Ze,
I: Ze,
j: On,
L: Vn,
m: $n,
M: Hn,
p: W,
q: An,
Q: Rn,
s: Bn,
S: Nn,
u: Un,
U: En,
V: Ln,
w: Fn,
W: In,
x: b,
X: m,
y: Re,
Y: ze,
Z: Wn,
"%": zn
};
L.x = p(r, L), L.X = p(n, L), L.c = p(e, L), B.x = p(r, B), B.X = p(n, B), B.c = p(e, B);
function p(D, N) {
return function(z) {
var d = [], K = -1, A = 0, J = D.length, G, Q, ct;
for (z instanceof Date || (z = /* @__PURE__ */ new Date(+z)); ++K < J; ) D.charCodeAt(K) === 37 && (d.push(D.slice(A, K)), (Q = Pe[G = D.charAt(++K)]) != null ? G = D.charAt(++K) : Q = G === "e" ? " " : "0", (ct = N[G]) && (G = ct(z, Q)), d.push(G), A = K + 1);
return d.push(D.slice(A, K)), d.join("");
};
}
function y(D, N) {
return function(z) {
var d = Ot(1900, void 0, 1), K = k(d, D, z += "", 0), A, J;
if (K != z.length) return null;
if ("Q" in d) return new Date(d.Q);
if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
if (N && !("Z" in d) && (d.Z = 0), "p" in d && (d.H = d.H % 12 + d.p * 12), d.m === void 0 && (d.m = "q" in d ? d.q : 0), "V" in d) {
if (d.V < 1 || d.V > 53) return null;
"w" in d || (d.w = 1), "Z" in d ? (A = ke(Ot(d.y, 0, 1)), J = A.getUTCDay(), A = J > 4 || J === 0 ? re.ceil(A) : re(A), A = Ce.offset(A, (d.V - 1) * 7), d.y = A.getUTCFullYear(), d.m = A.getUTCMonth(), d.d = A.getUTCDate() + (d.w + 6) % 7) : (A = ye(Ot(d.y, 0, 1)), J = A.getDay(), A = J > 4 || J === 0 ? zt.ceil(A) : zt(A), A = xt.offset(A, (d.V - 1) * 7), d.y = A.getFullYear(), d.m = A.getMonth(), d.d = A.getDate() + (d.w + 6) % 7);
} else ("W" in d || "U" in d) && ("w" in d || (d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0), J = "Z" in d ? ke(Ot(d.y, 0, 1)).getUTCDay() : ye(Ot(d.y, 0, 1)).getDay(), d.m = 0, d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (J + 5) % 7 : d.w + d.U * 7 - (J + 6) % 7);
return "Z" in d ? (d.H += d.Z / 100 | 0, d.M += d.Z % 100, ke(d)) : ye(d);
};
}
function k(D, N, z, d) {
for (var K = 0, A = N.length, J = z.length, G, Q; K < A; ) {
if (d >= J) return -1;
if (G = N.charCodeAt(K++), G === 37) {
if (G = N.charAt(K++), Q = j[G in Pe ? N.charAt(K++) : G], !Q || (d = Q(D, z, d)) < 0) return -1;
} else if (G != z.charCodeAt(d++)) return -1;
}
return d;
}
function W(D, N, z) {
var d = M.exec(N.slice(z));
return d ? (D.p = _.get(d[0].toLowerCase()), z + d[0].length) : -1;
}
function T(D, N, z) {
var d = S.exec(N.slice(z));
return d ? (D.w = X.get(d[0].toLowerCase()), z + d[0].length) : -1;
}
function w(D, N, z) {
var d = O.exec(N.slice(z));
return d ? (D.w = C.get(d[0].toLowerCase()), z + d[0].length) : -1;
}
function s(D, N, z) {
var d = E.exec(N.slice(z));
return d ? (D.m = V.get(d[0].toLowerCase()), z + d[0].length) : -1;
}
function u(D, N, z) {
var d = q.exec(N.slice(z));
return d ? (D.m = v.get(d[0].toLowerCase()), z + d[0].length) : -1;
}
function h(D, N, z) {
return k(D, e, N, z);
}
function b(D, N, z) {
return k(D, r, N, z);
}
function m(D, N, z) {
return k(D, n, N, z);
}
function F(D) {
return o[D.getDay()];
}
function c(D) {
return a[D.getDay()];
}
function I(D) {
return Y[D.getMonth()];
}
function f(D) {
return x[D.getMonth()];
}
function l(D) {
return i[+(D.getHours() >= 12)];
}
function U(D) {
return 1 + ~~(D.getMonth() / 3);
}
function H(D) {
return o[D.getUTCDay()];
}
function R(D) {
return a[D.getUTCDay()];
}
function P(D) {
return Y[D.getUTCMonth()];
}
function tt(D) {
return x[D.getUTCMonth()];
}
function $(D) {
return i[+(D.getUTCHours() >= 12)];
}
function at(D) {
return 1 + ~~(D.getUTCMonth() / 3);
}
return {
format: function(D) {
var N = p(D += "", L);
return N.toString = function() {
return D;
}, N;
},
parse: function(D) {
var N = y(D += "", !1);
return N.toString = function() {
return D;
}, N;
},
utcFormat: function(D) {
var N = p(D += "", B);
return N.toString = function() {
return D;
}, N;
},
utcParse: function(D) {
var N = y(D += "", !0);
return N.toString = function() {
return D;
}, N;
}
};
}
var Pe = {
"-": "",
_: " ",
0: "0"
}, nt = /^\s*\d+/, _n = /^%/, Sn = /[\\^$*+?|[\]().{}]/g;
function Z(t, e, r) {
var n = t < 0 ? "-" : "", i = (n ? -t : t) + "", a = i.length;
return n + (a < r ? new Array(r - a + 1).join(e) + i : i);
}
function Yn(t) {
return t.replace(Sn, "\\$&");
}
function Ht(t) {
return new RegExp("^(?:" + t.map(Yn).join("|") + ")", "i");
}
function Nt(t) {
return new Map(t.map((e, r) => [e.toLowerCase(), r]));
}
function Fn(t, e, r) {
var n = nt.exec(e.slice(r, r + 1));
return n ? (t.w = +n[0], r + n[0].length) : -1;
}
function Un(t, e, r) {
var n = nt.exec(e.slice(r, r + 1));
return n ? (t.u = +n[0], r + n[0].length) : -1;
}
function En(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.U = +n[0], r + n[0].length) : -1;
}
function Ln(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.V = +n[0], r + n[0].length) : -1;
}
function In(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.W = +n[0], r + n[0].length) : -1;
}
function ze(t, e, r) {
var n = nt.exec(e.slice(r, r + 4));
return n ? (t.y = +n[0], r + n[0].length) : -1;
}
function Re(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), r + n[0].length) : -1;
}
function Wn(t, e, r) {
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r, r + 6));
return n ? (t.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), r + n[0].length) : -1;
}
function An(t, e, r) {
var n = nt.exec(e.slice(r, r + 1));
return n ? (t.q = n[0] * 3 - 3, r + n[0].length) : -1;
}
function $n(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.m = n[0] - 1, r + n[0].length) : -1;
}
function Be(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.d = +n[0], r + n[0].length) : -1;
}
function On(t, e, r) {
var n = nt.exec(e.slice(r, r + 3));
return n ? (t.m = 0, t.d = +n[0], r + n[0].length) : -1;
}
function Ze(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.H = +n[0], r + n[0].length) : -1;
}
function Hn(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.M = +n[0], r + n[0].length) : -1;
}
function Nn(t, e, r) {
var n = nt.exec(e.slice(r, r + 2));
return n ? (t.S = +n[0], r + n[0].length) : -1;
}
function Vn(t, e, r) {
var n = nt.exec(e.slice(r, r + 3));
return n ? (t.L = +n[0], r + n[0].length) : -1;
}
function Pn(t, e, r) {
var n = nt.exec(e.slice(r, r + 6));
return n ? (t.L = Math.floor(n[0] / 1e3), r + n[0].length) : -1;
}
function zn(t, e, r) {
var n = _n.exec(e.slice(r, r + 1));
return n ? r + n[0].length : -1;
}
function Rn(t, e, r) {
var n = nt.exec(e.slice(r));
return n ? (t.Q = +n[0], r + n[0].length) : -1;
}
function Bn(t, e, r) {
var n = nt.exec(e.slice(r));
return n ? (t.s = +n[0], r + n[0].length) : -1;
}
function qe(t, e) {
return Z(t.getDate(), e, 2);
}
function Zn(t, e) {
return Z(t.getHours(), e, 2);
}
function qn(t, e) {
return Z(t.getHours() % 12 || 12, e, 2);
}
function Xn(t, e) {
return Z(1 + xt.count(vt(t), t), e, 3);
}
function wr(t, e) {
return Z(t.getMilliseconds(), e, 3);
}
function jn(t, e) {
return wr(t, e) + "000";
}
function Gn(t, e) {
return Z(t.getMonth() + 1, e, 2);
}
function Qn(t, e) {
return Z(t.getMinutes(), e, 2);
}
function Jn(t, e) {
return Z(t.getSeconds(), e, 2);
}
function Kn(t) {
var e = t.getDay();
return e === 0 ? 7 : e;
}
function ti(t, e) {
return Z(Zt.count(vt(t) - 1, t), e, 2);
}
function Mr(t) {
var e = t.getDay();
return e >= 4 || e === 0 ? wt(t) : wt.ceil(t);
}
function ei(t, e) {
return t = Mr(t), Z(wt.count(vt(t), t) + (vt(t).getDay() === 4), e, 2);
}
function ri(t) {
return t.getDay();
}
function ni(t, e) {
return Z(zt.count(vt(t) - 1, t), e, 2);
}
function ii(t, e) {
return Z(t.getFullYear() % 100, e, 2);
}
function ai(t, e) {
return t = Mr(t), Z(t.getFullYear() % 100, e, 2);
}
function si(t, e) {
return Z(t.getFullYear() % 1e4, e, 4);
}
function oi(t, e) {
var r = t.getDay();
return t = r >= 4 || r === 0 ? wt(t) : wt.ceil(t), Z(t.getFullYear() % 1e4, e, 4);
}
function ci(t) {
var e = t.getTimezoneOffset();
return (e > 0 ? "-" : (e *= -1, "+")) + Z(e / 60 | 0, "0", 2) + Z(e % 60, "0", 2);
}
function Xe(t, e) {
return Z(t.getUTCDate(), e, 2);
}
function ui(t, e) {
return Z(t.getUTCHours(), e, 2);
}
function li(t, e) {
return Z(t.getUTCHours() % 12 || 12, e, 2);
}
function fi(t, e) {
return Z(1 + Ce.count(Tt(t), t), e, 3);
}
function Dr(t, e) {
return Z(t.getUTCMilliseconds(), e, 3);
}
function di(t, e) {
return Dr(t, e) + "000";
}
function hi(t, e) {
return Z(t.getUTCMonth() + 1, e, 2);
}
function mi(t, e) {
return Z(t.getUTCMinutes(), e, 2);
}
function gi(t, e) {
return Z(t.getUTCSeconds(), e, 2);
}
function yi(t) {
var e = t.getUTCDay();
return e === 0 ? 7 : e;
}
function ki(t, e) {
return Z(_e.count(Tt(t) - 1, t), e, 2);
}
function Cr(t) {
var e = t.getUTCDay();
return e >= 4 || e === 0 ? Lt(t) : Lt.ceil(t);
}
function vi(t, e) {
return t = Cr(t), Z(Lt.count(Tt(t), t) + (Tt(t).getUTCDay() === 4), e, 2);
}
function pi(t) {
return t.getUTCDay();
}
function Ti(t, e) {
return Z(re.count(Tt(t) - 1, t), e, 2);
}
function bi(t, e) {
return Z(t.getUTCFullYear() % 100, e, 2);
}
function xi(t, e) {
return t = Cr(t), Z(t.getUTCFullYear() % 100, e, 2);
}
function wi(t, e) {
return Z(t.getUTCFullYear() % 1e4, e, 4);
}
function Mi(t, e) {
var r = t.getUTCDay();
return t = r >= 4 || r === 0 ? Lt(t) : Lt.ceil(t), Z(t.getUTCFullYear() % 1e4, e, 4);
}
function Di() {
return "+0000";
}
function je() {
return "%";
}
function Ge(t) {
return +t;
}
function Qe(t) {
return Math.floor(+t / 1e3);
}
var _t, ne, Ci, _i, Si;
Yi({
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"
]
});
function Yi(t) {
return _t = Cn(t), ne = _t.format, Ci = _t.parse, _i = _t.utcFormat, Si = _t.utcParse, _t;
}
function Fi(t) {
return new Date(t);
}
function Ui(t) {
return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);
}
function _r(t, e, r, n, i, a, o, x, Y, M) {
var _ = Gr(), O = _.invert, C = _.domain, S = M(".%L"), X = M(":%S"), q = M("%I:%M"), v = M("%I %p"), E = M("%a %d"), V = M("%b %d"), L = M("%B"), B = M("%Y");
function j(p) {
return (Y(p) < p ? S : x(p) < p ? X : o(p) < p ? q : a(p) < p ? v : n(p) < p ? i(p) < p ? E : V : r(p) < p ? L : B)(p);
}
return _.invert = function(p) {
return new Date(O(p));
}, _.domain = function(p) {
return arguments.length ? C(Array.from(p, Ui)) : C().map(Fi);
}, _.ticks = function(p) {
var y = C();
return t(y[0], y[y.length - 1], p ?? 10);
}, _.tickFormat = function(p, y) {
return y == null ? j : M(y);
}, _.nice = function(p) {
var y = C();
return (!p || typeof p.range != "function") && (p = e(y[0], y[y.length - 1], p ?? 10)), p ? C(pn(y, p)) : _;
}, _.copy = function() {
return Qr(_, _r(t, e, r, n, i, a, o, x, Y, M));
}, _;
}
function Ei() {
return Kr.apply(_r(Mn, Dn, vt, Rt, Zt, xt, Pt, Vt, pt, ne).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
}
var Li = /* @__PURE__ */ se(((t, e) => {
(function(r, n) {
typeof t == "object" && typeof e < "u" ? e.exports = n() : typeof define == "function" && define.amd ? define(n) : (r = typeof globalThis < "u" ? globalThis : r || self).dayjs_plugin_isoWeek = n();
})(t, (function() {
"use strict";
var r = "day";
return function(n, i, a) {
var o = function(M) {
return M.add(4 - M.isoWeekday(), r);
}, x = i.prototype;
x.isoWeekYear = function() {
return o(this).year();
}, x.isoWeek = function(M) {
if (!this.$utils().u(M)) return this.add(7 * (M - this.isoWeek()), r);
var _, O, C, S, X = o(this), q = (_ = this.isoWeekYear(), O = this.$u, C = (O ? a.utc : a)().year(_).startOf("year"), S = 4 - C.isoWeekday(), C.isoWeekday() > 4 && (S += 7), C.add(S, r));
return X.diff(q, "week") + 1;
}, x.isoWeekday = function(M) {
return this.$utils().u(M) ? this.day() || 7 : this.day(this.day() % 7 ? M : M - 7);
};
var Y = x.startOf;
x.startOf = function(M, _) {
var O = this.$utils(), C = !!O.u(_) || _;
return O.p(M) === "isoweek" ? C ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : Y.bind(this)(M, _);
};
};
}));
})), Ii = /* @__PURE__ */ se(((t, e) => {
(function(r, n) {
typeof t == "object" && typeof e < "u" ? e.exports = n() : typeof define == "function" && define.amd ? define(n) : (r = typeof globalThis < "u" ? globalThis : r || self).dayjs_plugin_customParseFormat = n();
})(t, (function() {
"use strict";
var r = {
LTS: "h:mm:ss A",
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D, YYYY",
LLL: "MMMM D, YYYY h:mm A",
LLLL: "dddd, MMMM D, YYYY h:mm A"
}, n = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, i = /\d/, a = /\d\d/, o = /\d\d?/, x = /\d*[^-_:/,()\s\d]+/, Y = {}, M = function(v) {
return (v = +v) + (v > 68 ? 1900 : 2e3);
}, _ = function(v) {
return function(E) {
this[v] = +E;
};
}, O = [/[+-]\d\d:?(\d\d)?|Z/, function(v) {
(this.zone || (this.zone = {})).offset = (function(E) {
if (!E || E === "Z") return 0;
var V = E.match(/([+-]|\d\d)/g), L = 60 * V[1] + (+V[2] || 0);
return L === 0 ? 0 : V[0] === "+" ? -L : L;
})(v);
}], C = function(v) {
var E = Y[v];
return E && (E.indexOf ? E : E.s.concat(E.f));
}, S = function(v, E) {
var V, L = Y.meridiem;
if (L) {
for (var B = 1; B <= 24; B += 1) if (v.indexOf(L(B, 0, E)) > -1) {
V = B > 12;
break;
}
} else V = v === (E ? "pm" : "PM");
return V;
}, X = {
A: [x, function(v) {
this.afternoon = S(v, !1);
}],
a: [x, function(v) {
this.afternoon = S(v, !0);
}],
Q: [i, function(v) {
this.month = 3 * (v - 1) + 1;
}],
S: [i, function(v) {
this.milliseconds = 100 * +v;
}],
SS: [a, function(v) {
this.milliseconds = 10 * +v;
}],
SSS: [/\d{3}/, function(v) {
this.milliseconds = +v;
}],
s: [o, _("seconds")],
ss: [o, _("seconds")],
m: [o, _("minutes")],
mm: [o, _("minutes")],
H: [o, _("hours")],
h: [o, _("hours")],
HH: [o, _("hours")],
hh: [o, _("hours")],
D: [o, _("day")],
DD: [a, _("day")],
Do: [x, function(v) {
var E = Y.ordinal, V = v.match(/\d+/);
if (this.day = V[0], E) for (var L = 1; L <= 31; L += 1) E(L).replace(/\[|\]/g, "") === v && (this.day = L);
}],
w: [o, _("week")],
ww: [a, _("week")],
M: [o, _("month")],
MM: [a, _("month")],
MMM: [x, function(v) {
var E = C("months"), V = (C("monthsShort") || E.map((function(L) {
return L.slice(0, 3);
}))).indexOf(v) + 1;
if (V < 1) throw new Error();
this.month = V % 12 || V;
}],
MMMM: [x, function(v) {
var E = C("months").indexOf(v) + 1;
if (E < 1) throw new Error();
this.month = E % 12 || E;
}],
Y: [/[+-]?\d+/, _("year")],
YY: [a, function(v) {
this.year = M(v);
}],
YYYY: [/\d{4}/, _("year")],
Z: O,
ZZ: O
};
function q(v) {
for (var E = v, V = Y && Y.formats, L = (v = E.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(T, w, s) {
var u = s && s.toUpperCase();
return w || V[s] || r[s] || V[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(h, b, m) {
return b || m.slice(1);
}));
}))).match(n), B = L.length, j = 0; j < B; j += 1) {
var p = L[j], y = X[p], k = y && y[0], W = y && y[1];
L[j] = W ? {
regex: k,
parser: W
} : p.replace(/^\[|\]$/g, "");
}
return function(T) {
for (var w = {}, s = 0, u = 0; s < B; s += 1) {
var h = L[s];
if (typeof h == "string") u += h.length;
else {
var b = h.regex, m = h.parser, F = T.slice(u), c = b.exec(F)[0];
m.call(w, c), T = T.replace(c, "");
}
}
return (function(I) {
var f = I.afternoon;
if (f !== void 0) {
var l = I.hours;
f ? l < 12 && (I.hours += 12) : l === 12 && (I.hours = 0), delete I.afternoon;
}
})(w), w;
};
}
return function(v, E, V) {
V.p.customParseFormat = !0, v && v.parseTwoDigitYear && (M = v.parseTwoDigitYear);
var L = E.prototype, B = L.parse;
L.parse = function(j) {
var p = j.date, y = j.utc, k = j.args;
this.$u = y;
var W = k[1];
if (typeof W == "string") {
var T = k[2] === !0, w = k[3] === !0, s = T || w, u = k[2];
w && (u = k[2]), Y = this.$locale(), !T && u && (Y = V.Ls[u]), this.$d = (function(F, c, I, f) {
try {
if (["x", "X"].indexOf(c) > -1) return /* @__PURE__ */ new Date((c === "X" ? 1e3 : 1) * F);
var l = q(c)(F), U = l.year, H = l.month, R = l.day, P = l.hours, tt = l.minutes, $ = l.seconds, at = l.milliseconds, D = l.zone, N = l.week, z = /* @__PURE__ */ new Date(), d = R || (U || H ? 1 : z.getDate()), K = U || z.getFullYear(), A = 0;
U && !H || (A = H > 0 ? H - 1 : z.getMonth());
var J, G = P || 0, Q = tt || 0, ct = $ || 0, ut = at || 0;
return D ? new Date(Date.UTC(K, A, d, G, Q, ct, ut + 60 * D.offset * 1e3)) : I ? new Date(Date.UTC(K, A, d, G, Q, ct, ut)) : (J = new Date(K, A, d, G, Q, ct, ut), N && (J = f(J).week(N).toDate()), J);
} catch {
return /* @__PURE__ */ new Date("");
}
})(p, W, y, V), this.init(), u && u !== !0 && (this.$L = this.locale(u).$L), s && p != this.format(W) && (this.$d = /* @__PURE__ */ new Date("")), Y = {};
} else if (W instanceof Array) for (var h = W.length, b = 1; b <= h; b += 1) {
k[1] = W[b - 1];
var m = V.apply(this, k);
if (m.isValid()) {
this.$d = m.$d, this.$L = m.$L, this.init();
break;
}
b === h && (this.$d = /* @__PURE__ */ new Date(""));
}
else B.call(this, j);
};
};
}));
})), Wi = /* @__PURE__ */ se(((t, e) => {
(function(r, n) {
typeof t == "object" && typeof e < "u" ? e.exports = n() : typeof define == "function" && define.amd ? define(n) : (r = typeof globalThis < "u" ? globalThis : r || self).dayjs_plugin_advancedFormat = n();
})(t, (function() {
"use strict";
return function(r, n) {
var i = n.prototype, a = i.format;
i.format = function(o) {
var x = this, Y = this.$locale();
if (!this.isValid()) return a.bind(this)(o);
var M = this.$utils(), _ = (o || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(O) {
switch (O) {
case "Q":
return Math.ceil((x.$M + 1) / 3);
case "Do":
return Y.ordinal(x.$D);
case "gggg":
return x.weekYear();
case "GGGG":
return x.isoWeekYear();
case "wo":
return Y.ordinal(x.week(), "W");
case "w":
case "ww":
return M.s(x.week(), O === "w" ? 1 : 2, "0");
case "W":
case "WW":
return M.s(x.isoWeek(), O === "W" ? 1 : 2, "0");
case "k":
case "kk":
return M.s(String(x.$H === 0 ? 24 : x.$H), O === "k" ? 1 : 2, "0");
case "X":
return Math.floor(x.$d.getTime() / 1e3);
case "x":
return x.$d.getTime();
case "z":
return "[" + x.offsetName() + "]";
case "zzz":
return "[" + x.offsetName("long") + "]";
default:
return O;
}
}));
return a.bind(this)(_);
};
};
}));
})), Ai = /* @__PURE__ */ se(((t, e) => {
(function(r, n) {
typeof t == "object" && typeof e < "u" ? e.exports = n() : typeof define == "function" && define.amd ? define(n) : (r = typeof globalThis < "u" ? globalThis : r || self).dayjs_plugin_duration = n();
})(t, (function() {
"use strict";
var r, n, i = 1e3, a = 6e4, o = 36e5, x = 864e5, Y = 31536e6, M = 2628e6, _ = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, O = /\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g, C = {
years: Y,
months: M,
days: x,
hours: o,
minutes: a,
seconds: i,
milliseconds: 1,
weeks: 6048e5
}, S = function(p) {
return p instanceof B;
}, X = function(p, y, k) {
return new B(p, k, y.$l);
}, q = function(p) {
return n.p(p) + "s";
}, v = function(p) {
return p < 0;
}, E = function(p) {
return v(p) ? Math.ceil(p) : Math.floor(p);
}, V = function(p) {
return Math.abs(p);
}, L = function(p, y) {
return p ? v(p) ? {
negative: !0,
format: "" + V(p) + y
} : {
negative: !1,
format: "" + p + y
} : {
negative: !1,
format: ""
};
}, B = (function() {
function p(k, W, T) {
var w = this;
if (this.$d = {}, this.$l = T, k === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), W) return X(k * C[q(W)], this);
if (typeof k == "number") return this.$ms = k, this.parseFromMilliseconds(), this;
if (typeof k == "object") return Object.keys(k).forEach((function(h) {
w.$d[q(h)] = k[h];
})), this.calMilliseconds(), this;
if (typeof k == "string") {
var s = k.match(_);
if (s) {
var u = s.slice(2).map((function(h) {
return h != null ? Number(h) : 0;
}));
return this.$d.years = u[0], this.$d.months = u[1], this.$d.weeks = u[2], this.$d.days = u[3], this.$d.hours = u[4], this.$d.minutes = u[5], this.$d.seconds = u[6], this.calMilliseconds(), this;
}
}
return this;
}
var y = p.prototype;
return y.calMilliseconds = function() {
var k = this;
this.$ms = Object.keys(this.$d).reduce((function(W, T) {
return W + (k.$d[T] || 0) * C[T];
}), 0);
}, y.parseFromMilliseconds = function() {
var k = this.$ms;
this.$d.years = E(k / Y), k %= Y, this.$d.months = E(k / M), k %= M, this.$d.days = E(k / x), k %= x, this.$d.hours = E(k / o), k %= o, this.$d.minutes = E(k / a), k %= a, this.$d.seconds = E(k / i), k %= i, this.$d.milliseconds = k;
}, y.toISOString = function() {
var k = L(this.$d.years, "Y"), W = L(this.$d.months, "M"), T = +this.$d.days || 0;
this.$d.weeks && (T += 7 * this.$d.weeks);
var w = L(T, "D"), s = L(this.$d.hours, "H"), u = L(this.$d.minutes, "M"), h = this.$d.seconds || 0;
this.$d.milliseconds && (h += this.$d.milliseconds / 1e3, h = Math.round(1e3 * h) / 1e3);
var b = L(h, "S"), m = k.negative || W.negative || w.negative || s.negative || u.negative || b.negative, F = s.format || u.format || b.format ? "T" : "", c = (m ? "-" : "") + "P" + k.format + W.format + w.format + F + s.format + u.format + b.format;
return c === "P" || c === "-P" ? "P0D" : c;
}, y.toJSON = function() {
return this.toISOString();
}, y.format = function(k) {
var W = k || "YYYY-MM-DDTHH:mm:ss", T = {
Y: this.$d.years,
YY: n.s(this.$d.years, 2, "0"),
YYYY: n.s(this.$d.years, 4, "0"),
M: this.$d.months,
MM: n.s(this.$d.months, 2, "0"),
D: this.$d.days,
DD: n.s(this.$d.days, 2, "0"),
H: this.$d.hours,
HH: n.s(this.$d.hours, 2, "0"),
m: this.$d.minutes,
mm: n.s(this.$d.minutes, 2, "0"),
s: this.$d.seconds,
ss: n.s(this.$d.seconds, 2, "0"),
SSS: n.s(this.$d.milliseconds, 3, "0")
};
return W.replace(O, (function(w, s) {
return s || String(T[w]);
}));
}, y.as = function(k) {
return this.$ms / C[q(k)];
}, y.get = function(k) {
var W = this.$ms, T = q(k);
return T === "milliseconds" ? W %= 1e3 : W = T === "weeks" ? E(W / C[T]) : this.$d[T], W || 0;
}, y.add = function(k, W, T) {
var w;
return w = W ? k * C[q(W)] : S(k) ? k.$ms : X(k, this).$ms, X(this.$ms + w * (T ? -1 : 1), this);
}, y.subtract = function(k, W) {
return this.add(k, W, !0);
}, y.locale = function(k) {
var W = this.clone();
return W.$l = k, W;
}, y.clone = function() {
return X(this.$ms, this);
}, y.humanize = function(k) {
return r().add(this.$ms, "ms").locale(this.$l).fromNow(!k);
}, y.valueOf = function() {
return this.asMilliseconds();
}, y.milliseconds = function() {
return this.get("milliseconds");
}, y.asMilliseconds = function() {
return this.as("milliseconds");
}, y.seconds = function() {
return this.get("seconds");
}, y.asSeconds = function() {
return this.as("seconds");
}, y.minutes = function() {
return this.get("minutes");
}, y.asMinutes = function() {
return this.as("minutes");
}, y.hours = function() {
return this.get("hours");
}, y.asHours = function() {
return this.as("hours");
}, y.days = function() {
return this.get("days");
}, y.asDays = function() {
return this.as("days");
}, y.weeks = function() {
return this.get("weeks");
}, y.asWeeks = function() {
return this.as("weeks");
}, y.months = function() {
return this.get("months");
}, y.asMonths = function() {
return this.as("months");
}, y.years = function() {
return this.get("years");
}, y.asYears = function() {
return this.as("years");
}, p;
})(), j = function(p, y, k) {
return p.add(y.years() * k, "y").add(y.months() * k, "M").add(y.days() * k, "d").add(y.hours() * k, "h").add(y.minutes() * k, "m").add(y.seconds() * k, "s").add(y.milliseconds() * k, "ms");
};
return function(p, y, k) {
r = k, n = k().$utils(), k.duration = function(w, s) {
return X(w, { $l: k.locale() }, s);
}, k.isDuration = S;
var W = y.prototype.add, T = y.prototype.subtract;
y.prototype.add = function(w, s) {
return S(w) ? j(this, w, 1) : W.bind(this)(w, s);
}, y.prototype.subtract = function(w, s) {
return S(w) ? j(this, w, -1) : T.bind(this)(w, s);
};
};
}));
})), $i = tn(), it = /* @__PURE__ */ Bt($r(), 1), Oi = /* @__PURE__ */ Bt(Li(), 1), Hi = /* @__PURE__ */ Bt(Ii(), 1), Ni = /* @__PURE__ */ Bt(Wi(), 1), Vi = /* @__PURE__ */ Bt(Ai(), 1), be = (function() {
var t = /* @__PURE__ */ g(function(s, u, h, b) {
for (h = h || {}, b = s.length; b--; h[s[b]] = u) ;
return h;
}, "o"), e = [
6,
8,
10,
12,
13,
14,
15,
16,
17,
18,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
33,
35,
36,
38,
40
], r = [1, 26], n = [1, 27], i = [1, 28], a = [1, 29], o = [1, 30], x = [1, 31], Y = [1, 32], M = [1, 33], _ = [1, 34], O = [1, 9], C = [1, 10], S = [1, 11], X = [1, 12], q = [1, 13], v = [1, 14], E = [1, 15], V = [1, 16], L = [1, 19], B = [1, 20], j = [1, 21], p = [1, 22], y = [1, 23], k = [1, 25], W = [1, 35], T = {
trace: /* @__PURE__ */ g(function() {
}, "trace"),
yy: {},
symbols_: {
error: 2,
start: 3,
gantt: 4,
document: 5,
EOF: 6,
line: 7,
SPACE: 8,
statement: 9,
NL: 10,
weekday: 11,
weekday_monday: 12,
weekday_tuesday: 13,
weekday_wednesday: 14,
weekday_thursday: 15,
weekday_friday: 16,
weekday_saturday: 17,
weekday_sunday: 18,
weekend: 19,
weekend_friday: 20,
weekend_saturday: 21,
dateFormat: 22,
inclusiveEndDates: 23,
topAxis: 24,
axisFormat: 25,
tickInterval: 26,
excludes: 27,
includes: 28,
todayMarker: 29,
title: 30,
acc_title: 31,
acc_title_value: 32,
acc_descr: 33,
acc_descr_value: 34,
acc_descr_multiline_value: 35,
section: 36,
clickStatement: 37,
taskTxt: 38,
taskData: 39,
click: 40,
callbackname: 41,
callbackargs: 42,
href: 43,
clickStatementDebug: 44,
$accept: 0,
$end: 1
},
terminals_: {
2: "error",
4: "gantt",
6: "EOF",
8: "SPACE",
10: "NL",
12: "weekday_monday",
13: "weekday_tuesday",
14: "weekday_wednesday",
15: "weekday_thursday",
16: "weekday_friday",
17: "weekday_saturday",
18: "weekday_sunday",
20: "weekend_friday",
21: "weekend_saturday",
22: "dateFormat",
23: "inclusiveEndDates",
24: "topAxis",
25: "axisFormat",
26: "tickInterval",
27: "excludes",
28: "includes",
29: "todayMarker",
30: "title",
31: "acc_title",
32: "acc_title_value",
33: "acc_descr",
34: "acc_descr_value",
35: "acc_descr_multiline_value",
36: "section",
38: "taskTxt",
39: "taskData",
40: "click",
41: "callbackname",
42: "callbackargs",
43: "href"
},
productions_: [
0,
[3, 3],
[5, 0],
[5, 2],
[7, 2],
[7, 1],
[7, 1],
[7, 1],
[11, 1],
[11, 1],
[11, 1],
[11, 1],
[11, 1],
[11, 1],
[11, 1],
[19, 1],
[19, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 1],
[9, 2],
[9, 2],
[9, 1],
[9, 1],
[9, 1],
[9, 2],
[37, 2],
[37, 3],
[37, 3],
[37, 4],
[37, 3],
[37, 4],
[37, 2],
[44, 2],
[44, 3],
[44, 3],
[44, 4],
[44, 3],
[44, 4],
[44, 2]
],
performAction: /* @__PURE__ */ g(function(u, h, b, m, F, c, I) {
var f = c.length - 1;
switch (F) {
case 1:
return c[f - 1];
case 2:
this.$ = [];
break;
case 3:
c[f - 1].push(c[f]), this.$ = c[f - 1];
break;
case 4:
case 5:
this.$ = c[f];
break;
case 6:
case 7:
this.$ = [];
break;
case 8:
m.setWeekday("monday");
break;
case 9:
m.setWeekday("tuesday");
break;
case 10:
m.setWeekday("wednesday");
break;
case 11:
m.setWeekday("thursday");
break;
case 12:
m.setWeekday("friday");
break;
case 13:
m.setWeekday("saturday");
break;
case 14:
m.setWeekday("sunday");
break;
case 15:
m.setWeekend("friday");
break;
case 16:
m.setWeekend("saturday");
break;
case 17:
m.setDateFormat(c[f].substr(11)), this.$ = c[f].substr(11);
break;
case 18:
m.enableInclusiveEndDates(), this.$ = c[f].substr(18);
break;
case 19:
m.TopAxis(), this.$ = c[f].substr(8);
break;
case 20:
m.setAxisFormat(c[f].substr(11)), this.$ = c[f].substr(11);
break;
case 21:
m.setTickInterval(c[f].substr(13)), this.$ = c[f].substr(13);
break;
case 22:
m.setExcludes(c[f].substr(9)), this.$ = c[f].substr(9);
break;
case 23:
m.setIncludes(c[f].substr(9)), this.$ = c[f].substr(9);
break;
case 24:
m.setTodayMarker(c[f].substr(12)), this.$ = c[f].substr(12);
break;
case 27:
m.setDiagramTitle(c[f].substr(6)), this.$ = c[f].substr(6);
break;
case 28:
this.$ = c[f].trim(), m.setAccTitle(this.$);
break;
case 29:
case 30:
this.$ = c[f].trim(), m.setAccDescription(this.$);
break;
case 31:
m.addSection(c[f].substr(8)), this.$ = c[f].substr(8);
break;
case 33:
m.addTask(c[f - 1], c[f]), this.$ = "task";
break;
case 34:
this.$ = c[f - 1], m.setClickEvent(c[f - 1], c[f], null);
break;
case 35:
this.$ = c[f - 2], m.setClickEvent(c[f - 2], c[f - 1], c[f]);
break;
case 36:
this.$ = c[f - 2], m.setClickEvent(c[f - 2], c[f - 1], null), m.setLink(c[f - 2], c[f]);
break;
case 37:
this.$ = c[f - 3], m.setClickEvent(c[f - 3], c[f - 2], c[f - 1]), m.setLink(c[f - 3], c[f]);
break;
case 38:
this.$ = c[f - 2], m.setClickEvent(c[f - 2], c[f], null), m.setLink(c[f - 2], c[f - 1]);
break;
case 39:
this.$ = c[f - 3], m.setClickEvent(c[f - 3], c[f - 1], c[f]), m.setLink(c[f - 3], c[f - 2]);
break;
case 40:
this.$ = c[f - 1], m.setLink(c[f - 1], c[f]);
break;
case 41:
case 47:
this.$ = c[f - 1] + " " + c[f];
break;
case 42:
case 43:
case 45:
this.$ = c[f - 2] + " " + c[f - 1] + " " + c[f];
break;
case 44:
case 46:
this.$ = c[f - 3] + " " + c[f - 2] + " " + c[f - 1] + " " + c[f];
break;
}
}, "anonymous"),
table: [
{
3: 1,
4: [1, 2]
},
{ 1: [3] },
t(e, [2, 2], { 5: 3 }),
{
6: [1, 4],
7: 5,
8: [1, 6],
9: 7,
10: [1, 8],
11: 17,
12: r,
13: n,
14: i,
15: a,
16: o,
17: x,
18: Y,
19: 18,
20: M,
21: _,
22: O,
23: C,
24: S,
25: X,
26: q,
27: v,
28: E,
29: V,
30: L,
31: B,
33: j,
35: p,
36: y,
37: 24,
38: k,
40: W
},
t(e, [2, 7], { 1: [2, 1] }),
t(e, [2, 3]),
{
9: 36,
11: 17,
12: r,
13: n,
14: i,
15: a,
16: o,
17: x,
18: Y,
19: 18,
20: M,
21: _,
22: O,
23: C,
24: S,
25: X,
26: q,
27: v,
28: E,
29: V,
30: L,
31: B,
33: j,
35: p,
36: y,
37: 24,
38: k,
40: W
},
t(e, [2, 5]),
t(e, [2, 6]),
t(e, [2, 17]),
t(e, [2, 18]),
t(e, [2, 19]),
t(e, [2, 20]),
t(e, [2, 21]),
t(e, [2, 22]),
t(e, [2, 23]),
t(e, [2, 24]),
t(e, [2, 25]),
t(e, [2, 26]),
t(e, [2, 27]),
{ 32: [1, 37] },
{ 34: [1, 38] },
t(e, [2, 30]),
t(e, [2, 31]),
t(e, [2, 32]),
{ 39: [1, 39] },
t(e, [2, 8]),
t(e, [2, 9]),
t(e, [2, 10]),
t(e, [2, 11]),
t(e, [2, 12]),
t(e, [2, 13]),
t(e, [2, 14]),
t(e, [2, 15]),
t(e, [2, 16]),
{
41: [1, 40],
43: [1, 41]
},
t(e, [2, 4]),
t(e, [2, 28]),
t(e, [2, 29]),
t(e, [2, 33]),
t(e, [2, 34], {
42: [1, 42],
43: [1, 43]
}),
t(e, [2, 40], { 41: [1, 44] }),
t(e, [2, 35], { 43: [1, 45] }),
t(e, [2, 36]),
t(e, [2, 38], { 42: [1, 46] }),
t(e, [2, 37]),
t(e, [2, 39])
],
defaultActions: {},
parseError: /* @__PURE__ */ g(function(u, h) {
if (h.recoverable) this.trace(u);
else {
var b = new Error(u);
throw b.hash = h, b;
}
}, "parseError"),
parse: /* @__PURE__ */ g(function(u) {
var h = this, b = [0], m = [], F = [null], c = [], I = this.table, f = "", l = 0, U = 0, H = 0, R = 2, P = 1, tt = c.slice.call(arguments, 1), $ = Object.create(this.lexer), at = { yy: {} };
for (var D in this.yy) Object.prototype.hasOwnProperty.call(this.yy, D) && (at.yy[D] = this.yy[D]);
$.setInput(u, at.yy), at.yy.lexer = $, at.yy.parser = this, typeof $.yylloc > "u" && ($.yylloc = {});
var N = $.yylloc;
c.push(N);
var z = $.options && $.options.ranges;
typeof at.yy.parseError == "function" ? this.parseError = at.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
function d(st) {
b.length = b.length - 2 * st, F.length = F.length - st, c.length = c.length - st;
}
g(d, "popStack");
function K() {
var st = m.pop() || $.lex() || P;
return typeof st != "number" && (st instanceof Array && (m = st, st = m.pop()), st = h.symbols_[st] || st), st;
}
g(K, "lex");
for (var A, J, G, Q, ct, ut = {}, $t, dt, Oe, Xt; ; ) {
if (G = b[b.length - 1], this.defaultActions[G] ? Q = this.defaultActions[G] : ((A === null || typeof A > "u") && (A = K()), Q = I[G] && I[G][A]), typeof Q > "u" || !Q.length || !Q[0]) {
var oe = "";
Xt = [];
for ($t in I[G]) this.terminals_[$t] && $t > R && Xt.push("'" + this.terminals_[$t] + "'");
$.showPosition ? oe = "Parse error on line " + (l + 1) + `:
` + $.showPosition() + `
Expecting ` + Xt.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : oe = "Parse error on line " + (l + 1) + ": Unexpected " + (A == P ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(oe, {
text: $.match,
token: this.terminals_[A] || A,
line: $.yylineno,
loc: N,
expected: Xt
});
}
if (Q[0] instanceof Array && Q.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + G + ", token: " + A);
switch (Q[0]) {
case 1:
b.push(A), F.push($.yytext), c.push($.yylloc), b.push(Q[1]), A = null, J ? (A = J, J = null) : (U = $.yyleng, f = $.yytext, l = $.yylineno, N = $.yylloc, H > 0 && H--);
break;
case 2:
if (dt = this.productions_[Q[1]][1], ut.$ = F[F.length - dt], ut._$ = {
first_line: c[c.length - (dt || 1)].first_line,
last_line: c[c.length - 1].last_line,
first_column: c[c.length - (dt || 1)].first_column,
last_column: c[c.length - 1].last_column
}, z && (ut._$.range = [c[c.length - (dt || 1)].range[0], c[c.length - 1].range[1]]), ct = this.performAction.apply(ut, [
f,
U,
l,
at.yy,
Q[1],
F,
c
].concat(tt)), typeof ct < "u") return ct;
dt && (b = b.slice(0, -1 * dt * 2), F = F.slice(0, -1 * dt), c = c.slice(0, -1 * dt)), b.push(this.productions_[Q[1]][0]), F.push(ut.$), c.push(ut._$), Oe = I[b[b.length - 2]][b[b.length - 1]], b.push(Oe);
break;
case 3:
return !0;
}
}
return !0;
}, "parse")
};
T.lexer = /* @__PURE__ */ (function() {
return {
EOF: 1,
parseError: /* @__PURE__ */ g(function(u, h) {
if (this.yy.parser) this.yy.parser.parseError(u, h);
else throw new Error(u);
}, "parseError"),
setInput: /* @__PURE__ */ g(function(s, u) {
return this.yy = u || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
first_line: 1,
first_column: 0,
last_line: 1,
last_column: 0
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
}, "setInput"),
input: /* @__PURE__ */ g(function() {
var s = this._input[0];
return this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s, s.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
}, "input"),
unput: /* @__PURE__ */ g(function(s) {
var u = s.length, h = s.split(/(?:\r\n?|\n)/g);
this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - u), this.offset -= u;
var b = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), h.length - 1 && (this.yylineno -= h.length - 1);
var m = this.yylloc.range;
return this.yylloc = {
first_line: this.yylloc.first_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.first_column,
last_column: h ? (h.length === b.length ? this.yylloc.first_column : 0) + b[b.length - h.length].length - h[0].length : this.yylloc.first_column - u
}, this.options.ranges && (this.yylloc.range = [m[0], m[0] + this.yyleng - u]), this.yyleng = this.yytext.length, this;
}, "unput"),
more: /* @__PURE__ */ g(function() {
return this._more = !0, this;
}, "more"),
reject: /* @__PURE__ */ g(function() {
if (this.options.backtrack_lexer) this._backtrack = !0;
else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
` + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
return this;
}, "reject"),
less: /* @__PURE__ */ g(function(s) {
this.unput(this.match.slice(s));
}, "less"),
pastInput: /* @__PURE__ */ g(function() {
var s = this.matched.substr(0, this.matched.length - this.match.length);
return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
}, "pastInput"),
upcomingInput: /* @__PURE__ */ g(function() {
var s = this.match;
return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
}, "upcomingInput"),
showPosition: /* @__PURE__ */ g(function() {
var s = this.pastInput(), u = new Array(s.length + 1).join("-");
return s + this.upcomingInput() + `
` + u + "^";
}, "showPosition"),
test_match: /* @__PURE__ */ g(function(s, u) {
var h, b, m;
if (this.options.backtrack_lexer && (m = {
yylineno: this.yylineno,
yylloc: {
first_line: this.yylloc.first_line,
last_line: this.last_line,
first_column: this.yylloc.first_column,
last_column: this.yylloc.last_column
},
yytext: this.yytext,
match: this.match,
matches: this.matches,
matched: this.matched,
yyleng: this.yyleng,
offset: this.offset,
_more: this._more,
_input: this._input,
yy: this.yy,
conditionStack: this.conditionStack.slice(0),
done: this.done
}, this.options.ranges && (m.yylloc.range = this.yylloc.range.slice(0))), b = s[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
}, this.yytext += s[0], this.match += s[0], this.matches = s, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(s[0].length), this.matched += s[0], h = this.performAction.call(this, this.yy, this, u, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), h) return h;
if (this._backtrack) {
for (var F in m) this[F] = m[F];
return !1;
}
return !1;
}, "test_match"),
next: /* @__PURE__ */ g(function() {
if (this.done) return this.EOF;
this._input || (this.done = !0);
var s, u, h, b;
this._more || (this.yytext = "", this.match = "");
for (var m = this._currentRules(), F = 0; F < m.length; F++)
if (h = this._input.match(this.rules[m[F]]), h && (!u || h[0].length > u[0].length)) {
if (u = h, b = F, this.options.backtrack_lexer) {
if (s = this.test_match(h, m[F]), s !== !1) return s;
if (this._backtrack) {
u = !1;
continue;
} else return !1;
} else if (!this.options.flex) break;
}
return u ? (s = this.test_match(u, m[b]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
}, "next"),
lex: /* @__PURE__ */ g(function() {
var u = this.next();
return u || this.lex();
}, "lex"),
begin: /* @__PURE__ */ g(function(u) {
this.conditionStack.push(u);
}, "begin"),
popState: /* @__PURE__ */ g(function() {
return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
}, "popState"),
_currentRules: /* @__PURE__ */ g(function() {
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
}, "_currentRules"),
topState: /* @__PURE__ */ g(function(u) {
return u = this.conditionStack.length - 1 - Math.abs(u || 0), u >= 0 ? this.conditionStack[u] : "INITIAL";
}, "topState"),
pushState: /* @__PURE__ */ g(function(u) {
this.begin(u);
}, "pushState"),
stateStackSize: /* @__PURE__ */ g(function() {
return this.conditionStack.length;
}, "stateStackSize"),
options: { "case-insensitive": !0 },
performAction: /* @__PURE__ */ g(function(u, h, b, m) {
switch (b) {
case 0:
return this.begin("open_directive"), "open_directive";
case 1:
return this.begin("acc_title"), 31;
case 2:
return this.popState(), "acc_title_value";
case 3:
return this.begin("acc_descr"), 33;
case 4:
return this.popState(), "acc_descr_value";
case 5:
this.begin("acc_descr_multiline");
break;
case 6:
this.popState();
break;
case 7:
return "acc_descr_multiline_value";
case 8:
break;
case 9:
break;
case 10:
break;
case 11:
return 10;
case 12:
break;
case 13:
break;
case 14:
this.begin("href");
break;
case 15:
this.popState();
break;
case 16:
return 43;
case 17:
this.begin("callbackname");
break;
case 18:
this.popState();
break;
case 19:
this.popState(), this.begin("callbackargs");
break;
case 20:
return 41;
case 21:
this.popState();
break;
case 22:
return 42;
case 23:
this.begin("click");
break;
case 24:
this.popState();
break;
case 25:
return 40;
case 26:
return 4;
case 27:
return 22;
case 28:
return 23;
case 29:
return 24;
case 30:
return 25;
case 31:
return 26;
case 32:
return 28;
case 33:
return 27;
case 34:
return 29;
case 35:
return 12;
case 36:
return 13;
case 37:
return 14;
case 38:
return 15;
case 39:
return 16;
case 40:
return 17;
case 41:
return 18;
case 42:
return 20;
case 43:
return 21;
case 44:
return "date";
case 45:
return 30;
case 46:
return "accDescription";
case 47:
return 36;
case 48:
return 38;
case 49:
return 39;
case 50:
return ":";
case 51:
return 6;
case 52:
return "INVALID";
}
}, "anonymous"),
rules: [
/^(?:%%\{)/i,
/^(?:accTitle\s*:\s*)/i,
/^(?:(?!\n||)*[^\n]*)/i,
/^(?:accDescr\s*:\s*)/i,
/^(?:(?!\n||)*[^\n]*)/i,
/^(?:accDescr\s*\{\s*)/i,
/^(?:[\}])/i,
/^(?:[^\}]*)/i,
/^(?:%%(?!\{)*[^\n]*)/i,
/^(?:[^\}]%%*[^\n]*)/i,
/^(?:%%*[^\n]*[\n]*)/i,
/^(?:[\n]+)/i,
/^(?:\s+)/i,
/^(?:%[^\n]*)/i,
/^(?:href[\s]+["])/i,
/^(?:["])/i,
/^(?:[^"]*)/i,
/^(?:call[\s]+)/i,
/^(?:\([\s]*\))/i,
/^(?:\()/i,
/^(?:[^(]*)/i,
/^(?:\))/i,
/^(?:[^)]*)/i,
/^(?:click[\s]+)/i,
/^(?:[\s\n])/i,
/^(?:[^\s\n]*)/i,
/^(?:gantt\b)/i,
/^(?:dateFormat\s[^#\n;]+)/i,
/^(?:inclusiveEndDates\b)/i,
/^(?:topAxis\b)/i,
/^(?:axisFormat\s[^#\n;]+)/i,
/^(?:tickInterval\s[^#\n;]+)/i,
/^(?:includes\s[^#\n;]+)/i,
/^(?:excludes\s[^#\n;]+)/i,
/^(?:todayMarker\s[^\n;]+)/i,
/^(?:weekday\s+monday\b)/i,
/^(?:weekday\s+tuesday\b)/i,
/^(?:weekday\s+wednesday\b)/i,
/^(?:weekday\s+thursday\b)/i,
/^(?:weekday\s+friday\b)/i,
/^(?:weekday\s+saturday\b)/i,
/^(?:weekday\s+sunday\b)/i,
/^(?:weekend\s+friday\b)/i,
/^(?:weekend\s+saturday\b)/i,
/^(?:\d\d\d\d-\d\d-\d\d\b)/i,
/^(?:title\s[^\n]+)/i,
/^(?:accDescription\s[^#\n;]+)/i,
/^(?:section\s[^\n]+)/i,
/^(?:[^:\n]+)/i,
/^(?::[^#\n;]+)/i,
/^(?::)/i,
/^(?:$)/i,
/^(?:.)/i
],
conditions: {
acc_descr_multiline: {
rules: [6, 7],
inclusive: !1
},
acc_descr: {
rules: [4],
inclusive: !1
},
acc_title: {
rules: [2],
inclusive: !1
},
callbackargs: {
rules: [21, 22],
inclusive: !1
},
callbackname: {
rules: [
18,
19,
20
],
inclusive: !1
},
href: {
rules: [15, 16],
inclusive: !1
},
click: {
rules: [24, 25],
inclusive: !1
},
INITIAL: {
rules: [
0,
1,
3,
5,
8,
9,
10,
11,
12,
13,
14,
17,
23,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52
],
inclusive: !0
}
}
};
})();
function w() {
this.yy = {};
}
return g(w, "Parser"), w.prototype = T, T.Parser = w, new w();
})();
be.parser = be;
var Pi = be;
it.default.extend(Oi.default);
it.default.extend(Hi.default);
it.default.extend(Ni.default);
var Je = {
friday: 5,
saturday: 6
}, lt = "", Se = "", Ye = void 0, Fe = "", It = [], Wt = [], Ue = /* @__PURE__ */ new Map(), Ee = [], ie = [], At = "", Le = "", Sr = [
"active",
"done",
"crit",
"milestone",
"vert"
], Ie = [], St = "", qt = !1, We = !1, Ae = "sunday", ae = "saturday", xe = 0, zi = /* @__PURE__ */ g(function() {
Ee = [], ie = [], At = "", Ie = [], Kt = 0, Me = void 0, te = void 0, et = [], lt = "", Se = "", Le = "", Ye = void 0, Fe = "", It = [], Wt = [], qt = !1, We = !1, xe = 0, Ue = /* @__PURE__ */ new Map(), St = "", zr(), Ae = "sunday", ae = "saturday";
}, "clear"), Ri = /* @__PURE__ */ g(function(t) {
St = t;
}, "setDiagramId"), Bi = /* @__PURE__ */ g(function(t) {
Se = t;
}, "setAxisFormat"), Zi = /* @__PURE__ */ g(function() {
return Se;
}, "getAxisFormat"), qi = /* @__PURE__ */ g(function(t) {
Ye = t;
}, "setTickInterval"), Xi = /* @__PURE__ */ g(function() {
return Ye;
}, "getTickInterval"), ji = /* @__PURE__ */ g(function(t) {
Fe = t;
}, "setTodayMarker"), Gi = /* @__PURE__ */ g(function() {
return Fe;
}, "getTodayMarker"), Qi = /* @__PURE__ */ g(function(t) {
lt = t;
}, "setDateFormat"), Ji = /* @__PURE__ */ g(function() {
qt = !0;
}, "enableInclusiveEndDates"), Ki = /* @__PURE__ */ g(function() {
return qt;
}, "endDatesAreInclusive"), ta = /* @__PURE__ */ g(function() {
We = !0;
}, "enableTopAxis"), ea = /* @__PURE__ */ g(function() {
return We;
}, "topAxisEnabled"), ra = /* @__PURE__ */ g(function(t) {
Le = t;
}, "setDisplayMode"), na = /* @__PURE__ */ g(function() {
return Le;
}, "getDisplayMode"), ia = /* @__PURE__ */ g(function() {
return lt;
}, "getDateFormat"), Yr = /* @__PURE__ */ g((t, e) => {
const r = e.toLowerCase().split(/[\s,]+/).filter((n) => n !== "");
return [.../* @__PURE__ */ new Set([...t, ...r])];
}, "mergeTokens"), aa = /* @__PURE__ */ g(function(t) {
It = Yr(It, t);
}, "setIncludes"), sa = /* @__PURE__ */ g(function() {
return It;
}, "getIncludes"), oa = /* @__PURE__ */ g(function(t) {
Wt = Yr(Wt, t);
}, "setExcludes"), ca = /* @__PURE__ */ g(function() {
return Wt;
}, "getExcludes"), ua = /* @__PURE__ */ g(function() {
return Ue;
}, "getLinks"), la = /* @__PURE__ */ g(function(t) {
At = t, Ee.push(t);
}, "addSection"), fa = /* @__PURE__ */ g(function() {
return Ee;
}, "getSections"), da = /* @__PURE__ */ g(function() {
let t = Ke();
const e = 10;
let r = 0;
for (; !t && r < e; )
t = Ke(), r++;
return ie = et, ie;
}, "getTasks"), Fr = /* @__PURE__ */ g(function(t, e, r, n) {
const i = t.format(e.trim()), a = t.format("YYYY-MM-DD");
return n.includes(i) || n.includes(a) ? !1 : r.includes("weekends") && (t.isoWeekday() === Je[ae] || t.isoWeekday() === Je[ae] + 1) || r.includes(t.format("dddd").toLowerCase()) ? !0 : r.includes(i) || r.includes(a);
}, "isInvalidDate"), ha = /* @__PURE__ */ g(function(t) {
Ae = t;
}, "setWeekday"), ma = /* @__PURE__ */ g(function() {
return Ae;
}, "getWeekday"), ga = /* @__PURE__ */ g(function(t) {
ae = t;
}, "setWeekend"), Ur = /* @__PURE__ */ g(function(t, e, r, n) {
if (!r.length || t.manualEndTime) return;
let i;
t.startTime instanceof Date ? i = (0, it.default)(t.startTime) : i = (0, it.default)(t.startTime, e, !0), i = i.add(1, "d");
let a;
t.endTime instanceof Date ? a = (0, it.default)(t.endTime) : a = (0, it.default)(t.endTime, e, !0);
const [o, x] = ya(i, a, e, r, n);
t.endTime = o.toDate(), t.renderEndTime = x;
}, "checkTaskDates"), ya = /* @__PURE__ */ g(function(t, e, r, n, i) {
let a = !1, o = null;
const x = e.add(1e4, "d");
for (; t <= e; ) {
if (a || (o = e.toDate()), a = Fr(t, r, n, i), a && (e = e.add(1, "d"), e > x))
throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");
t = t.add(1, "d");
}
return [e, o];
}, "fixTaskDates"), we = /* @__PURE__ */ g(function(t, e, r) {
if (r = r.trim(), (/* @__PURE__ */ g((a) => {
const o = a.trim();
return o === "x" || o === "X";
}, "isTimestampFormat"))(e) && /^\d+$/.test(r)) return new Date(Number(r));
const n = /^after\s+(?<ids>[\d\w- ]+)/.exec(r);
if (n !== null) {
let a = null;
for (const x of n.groups.ids.split(" ")) {
let Y = Ct(x);
Y !== void 0 && (!a || Y.endTime > a.endTime) && (a = Y);
}
if (a) return a.endTime;
const o = /* @__PURE__ */ new Date();
return o.setHours(0, 0, 0, 0), o;
}
let i = (0, it.default)(r, e.trim(), !0);
if (i.isValid()) return i.toDate();
{
bt.debug("Invalid date:" + r), bt.debug("With date format:" + e.trim());
const a = new Date(r);
if (a === void 0 || isNaN(a.getTime()) || a.getFullYear() < -1e4 || a.getFullYear() > 1e4) throw new Error("Invalid date:" + r);
return a;
}
}, "getStartDate"), Er = /* @__PURE__ */ g(function(t) {
const e = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());
return e !== null ? [Number.parseFloat(e[1]), e[2]] : [NaN, "ms"];
}, "parseDuration"), Lr = /* @__PURE__ */ g(function(t, e, r, n = !1) {
r = r.trim();
const i = /^until\s+(?<ids>[\d\w- ]+)/.exec(r);
if (i !== null) {
let M = null;
for (const O of i.groups.ids.split(" ")) {
let C = Ct(O);
C !== void 0 && (!M || C.startTime < M.startTime) && (M = C);
}
if (M) return M.startTime;
const _ = /* @__PURE__ */ new Date();
return _.setHours(0, 0, 0, 0), _;
}
let a = (0, it.default)(r, e.trim(), !0);
if (a.isValid())
return n && (a = a.add(1, "d")), a.toDate();
let o = (0, it.default)(t);
const [x, Y] = Er(r);
if (!Number.isNaN(x)) {
const M = o.add(x, Y);
M.isValid() && (o = M);
}
return o.toDate();
}, "getEndDate"), Kt = 0, Ut = /* @__PURE__ */ g(function(t) {
return t === void 0 ? (Kt = Kt + 1, "task" + Kt) : t;
}, "parseId"), ka = /* @__PURE__ */ g(function(t, e) {
let r;
e.substr(0, 1) === ":" ? r = e.substr(1, e.length) : r = e;
const n = r.split(","), i = {};
$e(n, i, Sr);
for (let o = 0; o < n.length; o++) n[o] = n[o].trim();
let a = "";
switch (n.length) {
case 1:
i.id = Ut(), i.startTime = t.endTime, a = n[0];
break;
case 2:
i.id = Ut(), i.startTime = we(void 0, lt, n[0]), a = n[1];
break;
case 3:
i.id = Ut(n[0]), i.startTime = we(void 0, lt, n[1]), a = n[2];
break;
default:
}
return a && (i.endTime = Lr(i.startTime, lt, a, qt), i.manualEndTime = (0, it.default)(a, "YYYY-MM-DD", !0).isValid(), Ur(i, lt, Wt, It)), i;
}, "compileData"), va = /* @__PURE__ */ g(function(t, e) {
let r;
e.substr(0, 1) === ":" ? r = e.substr(1, e.length) : r = e;
const n = r.split(","), i = {};
$e(n, i, Sr);
for (let a = 0; a < n.length; a++) n[a] = n[a].trim();
switch (n.length) {
case 1:
i.id = Ut(), i.startTime = {
type: "prevTaskEnd",
id: t
}, i.endTime = { data: n[0] };
break;
case 2:
i.id = Ut(), i.startTime = {
type: "getStartDate",
startData: n[0]
}, i.endTime = { data: n[1] };
break;
case 3:
i.id = Ut(n[0]), i.startTime = {
type: "getStartDate",
startData: n[1]
}, i.endTime = { data: n[2] };
break;
default:
}
return i;
}, "parseData"), Me, te, et = [], Ir = {}, pa = /* @__PURE__ */ g(function(t, e) {
const r = {
section: At,
type: At,
processed: !1,
manualEndTime: !1,
renderEndTime: null,
raw: { data: e },
task: t,
classes: []
}, n = va(te, e);
r.raw.startTime = n.startTime, r.raw.endTime = n.endTime, r.id = n.id, r.prevTaskId = te, r.active = n.active, r.done = n.done, r.crit = n.crit, r.milestone = n.milestone, r.vert = n.vert, r.vert ? r.order = -1 : (r.order = xe, xe++);
const i = et.push(r);
te = r.id, Ir[r.id] = i - 1;
}, "addTask"), Ct = /* @__PURE__ */ g(function(t) {
const e = Ir[t];
return et[e];
}, "findTaskById"), Ta = /* @__PURE__ */ g(function(t, e) {
const r = {
section: At,
type: At,
description: t,
task: t,
classes: []
}, n = ka(Me, e);
r.startTime = n.startTime, r.endTime = n.endTime, r.id = n.id, r.active = n.active, r.done = n.done, r.crit = n.crit, r.milestone = n.milestone, r.vert = n.vert, Me = r, ie.push(r);
}, "addTaskOrg"), Ke = /* @__PURE__ */ g(function() {
const t = /* @__PURE__ */ g(function(r) {
const n = et[r];
let i = "";
switch (et[r].raw.startTime.type) {
case "prevTaskEnd":
n.startTime = Ct(n.prevTaskId).endTime;
break;
case "getStartDate":
i = we(void 0, lt, et[r].raw.startTime.startData), i && (et[r].startTime = i);
break;
}
return et[r].startTime && (et[r].endTime = Lr(et[r].startTime, lt, et[r].raw.endTime.data, qt), et[r].endTime && (et[r].processed = !0, et[r].manualEndTime = (0, it.default)(et[r].raw.endTime.data, "YYYY-MM-DD", !0).isValid(), Ur(et[r], lt, Wt, It))), et[r].processed;
}, "compileTask");
let e = !0;
for (const [r, n] of et.entries())
t(r), e = e && n.processed;
return e;
}, "compileTasks"), ba = /* @__PURE__ */ g(function(t, e) {
let r = e;
Yt().securityLevel !== "loose" && (r = (0, $i.sanitizeUrl)(e)), t.split(",").forEach(function(n) {
Ct(n) !== void 0 && (Ar(n, () => {
window.open(r, "_self");
}), Ue.set(n, r));
}), Wr(t, "clickable");
}, "setLink"), Wr = /* @__PURE__ */ g(function(t, e) {
t.split(",").forEach(function(r) {
let n = Ct(r);
n !== void 0 && n.classes.push(e);
});
}, "setClass"), xa = /* @__PURE__ */ g(function(t, e, r) {
if (Yt().securityLevel !== "loose" || e === void 0) return;
let n = [];
if (typeof r == "string") {
n = r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
for (let i = 0; i < n.length; i++) {
let a = n[i].trim();
a.startsWith('"') && a.endsWith('"') && (a = a.substr(1, a.length - 2)), n[i] = a;
}
}
n.length === 0 && n.push(t), Ct(t) !== void 0 && Ar(t, () => {
en.runFunc(e, ...n);
});
}, "setClickFun"), Ar = /* @__PURE__ */ g(function(t, e) {
Ie.push(function() {
const r = St ? `${St}-${t}` : t, n = document.querySelector(`[id="${r}"]`);
n !== null && n.addEventListener("click", function() {
e();
});
}, function() {
const r = St ? `${St}-${t}` : t, n = document.querySelector(`[id="${r}-text"]`);
n !== null && n.addEventListener("click", function() {
e();
});
});
}, "pushFun"), wa = {
getConfig: /* @__PURE__ */ g(() => Yt().gantt, "getConfig"),
clear: zi,
setDateFormat: Qi,
getDateFormat: ia,
enableInclusiveEndDates: Ji,
endDatesAreInclusive: Ki,
enableTopAxis: ta,
topAxisEnabled: ea,
setAxisFormat: Bi,
getAxisFormat: Zi,
setTickInterval: qi,
getTickInterval: Xi,
setTodayMarker: ji,
getTodayMarker: Gi,
setAccTitle: Pr,
getAccTitle: Xr,
setDiagramTitle: Vr,
getDiagramTitle: qr,
setDiagramId: Ri,
setDisplayMode: ra,
getDisplayMode: na,
setAccDescription: Nr,
getAccDescription: Zr,
addSection: la,
getSections: fa,
getTasks: da,
addTask: pa,
findTaskById: Ct,
addTaskOrg: Ta,
setIncludes: aa,
getIncludes: sa,
setExcludes: oa,
getExcludes: ca,
setClickEvent: /* @__PURE__ */ g(function(t, e, r) {
t.split(",").forEach(function(n) {
xa(n, e, r);
}), Wr(t, "clickable");
}, "setClickEvent"),
setLink: ba,
getLinks: ua,
bindFunctions: /* @__PURE__ */ g(function(t) {
Ie.forEach(function(e) {
e(t);
});
}, "bindFunctions"),
parseDuration: Er,
isInvalidDate: Fr,
setWeekday: ha,
getWeekday: ma,
setWeekend: ga
};
function $e(t, e, r) {
let n = !0;
for (; n; )
n = !1, r.forEach(function(i) {
const a = "^\\s*" + i + "\\s*$", o = new RegExp(a);
t[0].match(o) && (e[i] = !0, t.shift(1), n = !0);
});
}
g($e, "getTaskTags");
it.default.extend(Vi.default);
var Ma = /* @__PURE__ */ g(function() {
bt.debug("Something is calling, setConf, remove the call");
}, "setConf"), tr = {
monday: zt,
tuesday: kr,
wednesday: vr,
thursday: wt,
friday: pr,
saturday: Tr,
sunday: Zt
}, Da = /* @__PURE__ */ g((t, e) => {
let r = [...t].map(() => -1 / 0), n = [...t].sort((a, o) => a.startTime - o.startTime || a.order - o.order), i = 0;
for (const a of n) for (let o = 0; o < r.length; o++) if (a.startTime >= r[o]) {
r[o] = a.endTime, a.order = o + e, o > i && (i = o);
break;
}
return i;
}, "getMaxIntersections"), ht, ve = 1e4, ls = {
parser: Pi,
db: wa,
renderer: {
setConf: Ma,
draw: /* @__PURE__ */ g(function(t, e, r, n) {
const i = Yt().gantt;
n.db.setDiagramId(e);
const a = Yt().securityLevel;
let o;
a === "sandbox" && (o = jt("#i" + e));
const x = a === "sandbox" ? jt(o.nodes()[0].contentDocument.body) : jt("body"), Y = a === "sandbox" ? o.nodes()[0].contentDocument : document, M = Y.getElementById(e);
ht = M.parentElement.offsetWidth, ht === void 0 && (ht = 1200), i.useWidth !== void 0 && (ht = i.useWidth);
const _ = n.db.getTasks(), O = _.filter((T) => !T.vert);
let C = [];
for (const T of O) C.push(T.type);
C = W(C);
const S = {};
let X = 2 * i.topPadding;
if (n.db.getDisplayMode() === "compact" || i.displayMode === "compact") {
const T = {};
for (const s of O) T[s.section] === void 0 ? T[s.section] = [s] : T[s.section].push(s);
let w = 0;
for (const s of Object.keys(T)) {
const u = Da(T[s], w) + 1;
w += u, X += u * (i.barHeight + i.barGap), S[s] = u;
}
} else {
X += O.length * (i.barHeight + i.barGap);
for (const T of C) S[T] = O.filter((w) => w.type === T).length;
}
M.setAttribute("viewBox", "0 0 " + ht + " " + X);
const q = x.select(`[id="${e}"]`), v = Ei().domain([nn(_, function(T) {
return T.startTime;
}), rn(_, function(T) {
return T.endTime;
})]).rangeRound([0, ht - i.leftPadding - i.rightPadding]);
function E(T, w) {
const s = T.startTime, u = w.startTime;
let h = 0;
return s > u ? h = 1 : s < u && (h = -1), h;
}
g(E, "taskCompare"), _.sort(E), V(_, ht, X), Rr(q, X, ht, i.useMaxWidth), q.append("text").text(n.db.getDiagramTitle()).attr("x", ht / 2).attr("y", i.titleTopMargin).attr("class", "titleText");
function V(T, w, s) {
const u = i.barHeight, h = u + i.barGap, b = i.topPadding, m = i.leftPadding, F = Jr().domain([0, C.length]).range(["#00B9FA", "#F95002"]).interpolate(vn);
B(h, b, m, w, s, T, n.db.getExcludes(), n.db.getIncludes()), p(m, b, w, s), L(T, h, b, m, u, F, w, s), y(h, b, m, u, F), k(m, b, w, s);
}
g(V, "makeGantt");
function L(T, w, s, u, h, b, m) {
T.sort((l, U) => l.vert === U.vert ? 0 : l.vert ? 1 : -1);
const F = T.filter((l) => !l.vert), c = [...new Set(F.map((l) => l.order))].map((l) => F.find((U) => U.order === l));
q.append("g").selectAll("rect").data(c).enter().append("rect").attr("x", 0).attr("y", function(l, U) {
return U = l.order, U * w + s - 2;
}).attr("width", function() {
return m - i.rightPadding / 2;
}).attr("height", w).attr("class", function(l) {
for (const [U, H] of C.entries()) if (l.type === H) return "section section" + U % i.numberSectionStyles;
return "section section0";
}).enter();
const I = q.append("g").selectAll("rect").data(T).enter(), f = n.db.getLinks();
if (I.append("rect").attr("id", function(l) {
return e + "-" + l.id;
}).attr("rx", 3).attr("ry", 3).attr("x", function(l) {
return l.milestone ? v(l.startTime) + u + 0.5 * (v(l.endTime) - v(l.startTime)) - 0.5 * h : v(l.startTime) + u;
}).attr("y", function(l, U) {
return U = l.order, l.vert ? i.gridLineStartPadding : U * w + s;
}).attr("width", function(l) {
return l.milestone ? h : l.vert ? 0.08 * h : v(l.renderEndTime || l.endTime) - v(l.startTime);
}).attr("height", function(l) {
return l.vert ? F.length * (i.barHeight + i.barGap) + i.barHeight * 2 : h;
}).attr("transform-origin", function(l, U) {
return U = l.order, (v(l.startTime) + u + 0.5 * (v(l.endTime) - v(l.startTime))).toString() + "px " + (U * w + s + 0.5 * h).toString() + "px";
}).attr("class", function(l) {
const U = "task";
let H = "";
l.classes.length > 0 && (H = l.classes.join(" "));
let R = 0;
for (const [tt, $] of C.entries()) l.type === $ && (R = tt % i.numberSectionStyles);
let P = "";
return l.active ? l.crit ? P += " activeCrit" : P = " active" : l.done ? l.crit ? P = " doneCrit" : P = " done" : l.crit && (P += " crit"), P.length === 0 && (P = " task"), l.milestone && (P = " milestone " + P), l.vert && (P = " vert " + P), P += R, P += " " + H, U + P;
}), I.append("text").attr("id", function(l) {
return e + "-" + l.id + "-text";
}).text(function(l) {
return l.task;
}).attr("font-size", i.fontSize).attr("x", function(l) {
let U = v(l.startTime), H = v(l.renderEndTime || l.endTime);
if (l.milestone && (U += 0.5 * (v(l.endTime) - v(l.startTime)) - 0.5 * h, H = U + h), l.vert) return v(l.startTime) + u;
const R = this.getBBox().width;
return R > H - U ? H + R + 1.5 * i.leftPadding > m ? U + u - 5 : H + u + 5 : (H - U) / 2 + U + u;
}).attr("y", function(l, U) {
return l.vert ? i.gridLineStartPadding + F.length * (i.barHeight + i.barGap) + 60 : (U = l.order, U * w + i.barHeight / 2 + (i.fontSize / 2 - 2) + s);
}).attr("text-height", h).attr("class", function(l) {
const U = v(l.startTime);
let H = v(l.endTime);
l.milestone && (H = U + h);
const R = this.getBBox().width;
let P = "";
l.classes.length > 0 && (P = l.classes.join(" "));
let tt = 0;
for (const [at, D] of C.entries()) l.type === D && (tt = at % i.numberSectionStyles);
let $ = "";
return l.active && (l.crit ? $ = "activeCritText" + tt : $ = "activeText" + tt), l.done ? l.crit ? $ = $ + " doneCritText" + tt : $ = $ + " doneText" + tt : l.crit && ($ = $ + " critText" + tt), l.milestone && ($ += " milestoneText"), l.vert && ($ += " vertText"), R > H - U ? H + R + 1.5 * i.leftPadding > m ? P + " taskTextOutsideLeft taskTextOutside" + tt + " " + $ : P + " taskTextOutsideRight taskTextOutside" + tt + " " + $ + " width-" + R : P + " taskText taskText" + tt + " " + $ + " width-" + R;
}), Yt().securityLevel === "sandbox") {
let l;
l = jt("#i" + e);
const U = l.nodes()[0].contentDocument;
I.filter(function(H) {
return f.has(H.id);
}).each(function(H) {
var R = U.querySelector("#" + CSS.escape(e + "-" + H.id)), P = U.querySelector("#" + CSS.escape(e + "-" + H.id + "-text"));
const tt = R.parentNode;
var $ = U.createElement("a");
$.setAttribute("xlink:href", f.get(H.id)), $.setAttribute("target", "_top"), tt.appendChild($), $.appendChild(R), $.appendChild(P);
});
}
}
g(L, "drawRects");
function B(T, w, s, u, h, b, m, F) {
if (m.length === 0 && F.length === 0) return;
let c, I;
for (const { startTime: R, endTime: P } of b)
(c === void 0 || R < c) && (c = R), (I === void 0 || P > I) && (I = P);
if (!c || !I) return;
if ((0, it.default)(I).diff((0, it.default)(c), "year") > 5) {
bt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");
return;
}
const f = n.db.getDateFormat(), l = [];
let U = null, H = (0, it.default)(c);
for (; H.valueOf() <= I; )
n.db.isInvalidDate(H, f, m, F) ? U ? U.end = H : U = {
start: H,
end: H
} : U && (l.push(U), U = null), H = H.add(1, "d");
q.append("g").selectAll("rect").data(l).enter().append("rect").attr("id", (R) => e + "-exclude-" + R.start.format("YYYY-MM-DD")).attr("x", (R) => v(R.start.startOf("day")) + s).attr("y", i.gridLineStartPadding).attr("width", (R) => v(R.end.endOf("day")) - v(R.start.startOf("day"))).attr("height", h - w - i.gridLineStartPadding).attr("transform-origin", function(R, P) {
return (v(R.start) + s + 0.5 * (v(R.end) - v(R.start))).toString() + "px " + (P * T + 0.5 * h).toString() + "px";
}).attr("class", "exclude-range");
}
g(B, "drawExcludeDays");
function j(T, w, s, u) {
if (s <= 0 || T > w) return 1 / 0;
const h = w - T, b = it.default.duration({ [u ?? "day"]: s }).asMilliseconds();
return b <= 0 ? 1 / 0 : Math.ceil(h / b);
}
g(j, "getEstimatedTickCount");
function p(T, w, s, u) {
const h = n.db.getDateFormat(), b = n.db.getAxisFormat();
let m;
b ? m = b : h === "D" ? m = "%d" : m = i.axisFormat ?? "%Y-%m-%d";
let F = dn(v).tickSize(-u + w + i.gridLineStartPadding).tickFormat(ne(m));
const c = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval() || i.tickInterval);
if (c !== null) {
const I = parseInt(c[1], 10);
if (isNaN(I) || I <= 0) bt.warn(`Invalid tick interval value: "${c[1]}". Skipping custom tick interval.`);
else {
const f = c[2], l = n.db.getWeekday() || i.weekday, U = v.domain(), H = U[0], R = U[1], P = j(H, R, I, f);
if (P > ve) bt.warn(`The tick interval "${I}${f}" would generate ${P} ticks, which exceeds the maximum allowed (${ve}). This may indicate an invalid date or time range. Skipping custom tick interval.`);
else switch (f) {
case "millisecond":
F.ticks(Et.every(I));
break;
case "second":
F.ticks(pt.every(I));
break;
case "minute":
F.ticks(Vt.every(I));
break;
case "hour":
F.ticks(Pt.every(I));
break;
case "day":
F.ticks(xt.every(I));
break;
case "week":
F.ticks(tr[l].every(I));
break;
case "month":
F.ticks(Rt.every(I));
break;
}
}
}
if (q.append("g").attr("class", "grid").attr("transform", "translate(" + T + ", " + (u - 50) + ")").call(F).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"), n.db.topAxisEnabled() || i.topAxis) {
let I = fn(v).tickSize(-u + w + i.gridLineStartPadding).tickFormat(ne(m));
if (c !== null) {
const f = parseInt(c[1], 10);
if (isNaN(f) || f <= 0) bt.warn(`Invalid tick interval value: "${c[1]}". Skipping custom tick interval.`);
else {
const l = c[2], U = n.db.getWeekday() || i.weekday, H = v.domain(), R = H[0], P = H[1];
if (j(R, P, f, l) <= ve) switch (l) {
case "millisecond":
I.ticks(Et.every(f));
break;
case "second":
I.ticks(pt.every(f));
break;
case "minute":
I.ticks(Vt.every(f));
break;
case "hour":
I.ticks(Pt.every(f));
break;
case "day":
I.ticks(xt.every(f));
break;
case "week":
I.ticks(tr[U].every(f));
break;
case "month":
I.ticks(Rt.every(f));
break;
}
}
}
q.append("g").attr("class", "grid").attr("transform", "translate(" + T + ", " + w + ")").call(I).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
}
}
g(p, "makeGrid");
function y(T, w) {
let s = 0;
const u = Object.keys(S).map((h) => [h, S[h]]);
q.append("g").selectAll("text").data(u).enter().append(function(h) {
const b = h[0].split(Br.lineBreakRegex), m = -(b.length - 1) / 2, F = Y.createElementNS("http://www.w3.org/2000/svg", "text");
F.setAttribute("dy", m + "em");
for (const [c, I] of b.entries()) {
const f = Y.createElementNS("http://www.w3.org/2000/svg", "tspan");
f.setAttribute("alignment-baseline", "central"), f.setAttribute("x", "10"), c > 0 && f.setAttribute("dy", "1em"), f.textContent = I, F.appendChild(f);
}
return F;
}).attr("x", 10).attr("y", function(h, b) {
if (b > 0) for (let m = 0; m < b; m++)
return s += u[b - 1][1], h[1] * T / 2 + s * T + w;
else return h[1] * T / 2 + w;
}).attr("font-size", i.sectionFontSize).attr("class", function(h) {
for (const [b, m] of C.entries()) if (h[0] === m) return "sectionTitle sectionTitle" + b % i.numberSectionStyles;
return "sectionTitle";
});
}
g(y, "vertLabels");
function k(T, w, s, u) {
const h = n.db.getTodayMarker();
if (h === "off") return;
const b = q.append("g").attr("class", "today"), m = /* @__PURE__ */ new Date(), F = b.append("line");
F.attr("x1", v(m) + T).attr("x2", v(m) + T).attr("y1", i.titleTopMargin).attr("y2", u - i.titleTopMargin).attr("class", "today"), h !== "" && F.attr("style", h.replace(/,/g, ";"));
}
g(k, "drawToday");
function W(T) {
const w = {}, s = [];
for (let u = 0, h = T.length; u < h; ++u) Object.prototype.hasOwnProperty.call(w, T[u]) || (w[T[u]] = !0, s.push(T[u]));
return s;
}
g(W, "checkUnique");
}, "draw")
},
styles: /* @__PURE__ */ g((t) => `
.mermaid-main-font {
font-family: ${t.fontFamily};
}
.exclude-range {
fill: ${t.excludeBkgColor};
}
.section {
stroke: none;
opacity: 0.2;
}
.section0 {
fill: ${t.sectionBkgColor};
}
.section2 {
fill: ${t.sectionBkgColor2};
}
.section1,
.section3 {
fill: ${t.altSectionBkgColor};
opacity: 0.2;
}
.sectionTitle0 {
fill: ${t.titleColor};
}
.sectionTitle1 {
fill: ${t.titleColor};
}
.sectionTitle2 {
fill: ${t.titleColor};
}
.sectionTitle3 {
fill: ${t.titleColor};
}
.sectionTitle {
text-anchor: start;
font-family: ${t.fontFamily};
}
/* Grid and axis */
.grid .tick {
stroke: ${t.gridColor};
opacity: 0.8;
shape-rendering: crispEdges;
}
.grid .tick text {
font-family: ${t.fontFamily};
fill: ${t.textColor};
}
.grid path {
stroke-width: 0;
}
/* Today line */
.today {
fill: none;
stroke: ${t.todayLineColor};
stroke-width: 2px;
}
/* Task styling */
/* Default task */
.task {
stroke-width: 2;
}
.taskText {
text-anchor: middle;
font-family: ${t.fontFamily};
}
.taskTextOutsideRight {
fill: ${t.taskTextDarkColor};
text-anchor: start;
font-family: ${t.fontFamily};
}
.taskTextOutsideLeft {
fill: ${t.taskTextDarkColor};
text-anchor: end;
}
/* Special case clickable */
.task.clickable {
cursor: pointer;
}
.taskText.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideLeft.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideRight.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
/* Specific task settings for the sections*/
.taskText0,
.taskText1,
.taskText2,
.taskText3 {
fill: ${t.taskTextColor};
}
.task0,
.task1,
.task2,
.task3 {
fill: ${t.taskBkgColor};
stroke: ${t.taskBorderColor};
}
.taskTextOutside0,
.taskTextOutside2
{
fill: ${t.taskTextOutsideColor};
}
.taskTextOutside1,
.taskTextOutside3 {
fill: ${t.taskTextOutsideColor};
}
/* Active task */
.active0,
.active1,
.active2,
.active3 {
fill: ${t.activeTaskBkgColor};
stroke: ${t.activeTaskBorderColor};
}
.activeText0,
.activeText1,
.activeText2,
.activeText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Completed task */
.done0,
.done1,
.done2,
.done3 {
stroke: ${t.doneTaskBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
}
.doneText0,
.doneText1,
.doneText2,
.doneText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Done task text displayed outside the bar sits against the diagram background,
not against the done-task bar, so it must use the outside/contrast color. */
.doneText0.taskTextOutsideLeft,
.doneText0.taskTextOutsideRight,
.doneText1.taskTextOutsideLeft,
.doneText1.taskTextOutsideRight,
.doneText2.taskTextOutsideLeft,
.doneText2.taskTextOutsideRight,
.doneText3.taskTextOutsideLeft,
.doneText3.taskTextOutsideRight {
fill: ${t.taskTextOutsideColor} !important;
}
/* Tasks on the critical line */
.crit0,
.crit1,
.crit2,
.crit3 {
stroke: ${t.critBorderColor};
fill: ${t.critBkgColor};
stroke-width: 2;
}
.activeCrit0,
.activeCrit1,
.activeCrit2,
.activeCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.activeTaskBkgColor};
stroke-width: 2;
}
.doneCrit0,
.doneCrit1,
.doneCrit2,
.doneCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
cursor: pointer;
shape-rendering: crispEdges;
}
.milestone {
transform: rotate(45deg) scale(0.8,0.8);
}
.milestoneText {
font-style: italic;
}
.doneCritText0,
.doneCritText1,
.doneCritText2,
.doneCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Done-crit task text outside the bar — same reasoning as doneText above. */
.doneCritText0.taskTextOutsideLeft,
.doneCritText0.taskTextOutsideRight,
.doneCritText1.taskTextOutsideLeft,
.doneCritText1.taskTextOutsideRight,
.doneCritText2.taskTextOutsideLeft,
.doneCritText2.taskTextOutsideRight,
.doneCritText3.taskTextOutsideLeft,
.doneCritText3.taskTextOutsideRight {
fill: ${t.taskTextOutsideColor} !important;
}
.vert {
stroke: ${t.vertLineColor};
}
.vertText {
font-size: 15px;
text-anchor: middle;
fill: ${t.vertLineColor} !important;
}
.activeCritText0,
.activeCritText1,
.activeCritText2,
.activeCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
.titleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.titleColor || t.textColor};
font-family: ${t.fontFamily};
}
`, "getStyles")
};
export {
ls as diagram
};