@umriss-ui/schedule 0.51.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schedule.js CHANGED
@@ -1,234 +1,234 @@
1
1
  "use client";
2
2
  import "./schedule.css";
3
- import { localOffset as qe, toWorkingTimeClamped as V, calendarFrom as Tt, toWallClock as qt, MINUTE as Z, DAY as J, timeStep as As, workingTimeTicks as Ds, inDoubledHour as _s, HOUR as jt, LinearScale as Os, resolveColours as Fs, removedIntervals as $s, subscribeTheme as Es } from "@umriss-ui/charts";
4
- import { useContext as Zt, useEffect as Y, createContext as je, useRef as W, useId as Ze, useState as ht, useLayoutEffect as yt, useImperativeHandle as Bs, useSyncExternalStore as Jt, useMemo as U, createElement as xs } from "react";
5
- import { jsxs as E, Fragment as ot, jsx as p } from "react/jsx-runtime";
6
- import { zoneFields as Je, zoneInstant as Kt, useWording as mt, useFormats as St, useTimeZoneLabel as Ns, Skeleton as Ps, AngleGlyph as Rs, VisuallyHidden as Le, warnOnce as Gs, createLongPress as Hs, zoneDayStart as Ks } from "@umriss-ui/core";
7
- function Q(s) {
8
- return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
3
+ import { localOffset as Ze, toWorkingTimeClamped as z, calendarFrom as St, toWallClock as Zt, MINUTE as Z, DAY as Q, timeStep as Os, workingTimeTicks as $s, inDoubledHour as Fs, HOUR as Jt, LinearScale as Es, resolveColours as Bs, removedIntervals as xs, subscribeTheme as Ns } from "@umriss-ui/charts";
4
+ import { useContext as Qt, useEffect as Y, createContext as Je, useRef as U, useId as Qe, useState as ct, useLayoutEffect as bt, useImperativeHandle as Ps, useSyncExternalStore as te, useMemo as X, createElement as Rs } from "react";
5
+ import { jsxs as E, Fragment as ot, jsx as m } from "react/jsx-runtime";
6
+ import { zoneFields as ts, zoneInstant as Yt, useWording as rt, useFormats as pt, useTimeZoneLabel as Gs, Skeleton as Hs, AngleGlyph as Ks, VisuallyHidden as Ce, warnOnce as Ys, createLongPress as Vs, zoneDayStart as zs } from "@umriss-ui/core";
7
+ function tt(n) {
8
+ return { from: n.from - (n.leadIn ?? 0), to: n.to + (n.leadOut ?? 0) };
9
9
  }
10
- function Qt(s, t) {
11
- return (s.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
10
+ function ee(n, t) {
11
+ return (n.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
12
12
  }
13
- function te(s, t) {
14
- return (s.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
13
+ function se(n, t) {
14
+ return (n.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
15
15
  }
16
- function Ce(s, t) {
17
- if (t.kind === "place" || t.subtask !== s.id) return s;
16
+ function De(n, t) {
17
+ if (t.kind === "place" || t.subtask !== n.id) return n;
18
18
  switch (t.kind) {
19
19
  case "move":
20
20
  case "stretch":
21
- return { ...s, from: t.from, to: t.to };
21
+ return { ...n, from: t.from, to: t.to };
22
22
  case "leadIn":
23
- return { ...s, leadIn: t.leadIn };
23
+ return { ...n, leadIn: t.leadIn };
24
24
  case "leadOut":
25
- return { ...s, leadOut: t.leadOut };
25
+ return { ...n, leadOut: t.leadOut };
26
26
  case "lane":
27
- return { ...s, lane: t.lane };
27
+ return { ...n, lane: t.lane };
28
28
  }
29
29
  }
30
- function Ji(s, t) {
30
+ function eo(n, t) {
31
31
  return {
32
32
  id: t,
33
- task: s.task,
34
- lane: s.lane,
35
- from: s.from,
36
- to: s.to,
37
- ...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
38
- ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
33
+ task: n.task,
34
+ lane: n.lane,
35
+ from: n.from,
36
+ to: n.to,
37
+ ...n.leadIn === void 0 ? {} : { leadIn: n.leadIn },
38
+ ...n.leadOut === void 0 ? {} : { leadOut: n.leadOut }
39
39
  };
40
40
  }
41
- function ee(s) {
41
+ function ne(n) {
42
42
  const t = [], e = /* @__PURE__ */ new Map();
43
- s.forEach((n, i) => {
44
- const { from: o, to: a } = Q(n);
43
+ n.forEach((s, i) => {
44
+ const { from: o, to: a } = tt(s);
45
45
  if (!(o < a)) return;
46
- const r = e.get(n.lane) ?? [];
47
- r.push({ subtask: n, index: i, from: o, to: a }), e.set(n.lane, r);
46
+ const r = e.get(s.lane) ?? [];
47
+ r.push({ subtask: s, index: i, from: o, to: a }), e.set(s.lane, r);
48
48
  });
49
- for (const [n, i] of e) {
49
+ for (const [s, i] of e) {
50
50
  i.sort((o, a) => o.from - a.from || o.index - a.index);
51
51
  for (let o = 0; o < i.length; o++) {
52
52
  const a = i[o];
53
53
  for (let r = o + 1; r < i.length; r++) {
54
54
  const l = i[r];
55
55
  if (l.from >= a.to) break;
56
- t.push({ lane: n, first: a.subtask.id, second: l.subtask.id, from: l.from, to: Math.min(a.to, l.to) });
56
+ t.push({ lane: s, first: a.subtask.id, second: l.subtask.id, from: l.from, to: Math.min(a.to, l.to) });
57
57
  }
58
58
  }
59
59
  }
60
60
  return t;
61
61
  }
62
- function Ys(s) {
62
+ function Ws(n) {
63
63
  const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
64
- for (const n of s) {
65
- const i = Q(n), o = e.get(n.lane) ?? [];
64
+ for (const s of n) {
65
+ const i = tt(s), o = e.get(s.lane) ?? [];
66
66
  let a = 0;
67
67
  if (i.from < i.to) {
68
68
  for (const r of o) i.from < r.to && r.from < i.to && a++;
69
69
  o.push(i);
70
70
  }
71
- e.set(n.lane, o), t.set(n.id, a);
71
+ e.set(s.lane, o), t.set(s.id, a);
72
72
  }
73
73
  return t;
74
74
  }
75
- function se(s, t) {
76
- const e = new Map(s.map((i) => [i.id, i])), n = [];
75
+ function ie(n, t) {
76
+ const e = new Map(n.map((i) => [i.id, i])), s = [];
77
77
  for (const i of t) {
78
78
  const o = e.get(i.from), a = e.get(i.to);
79
79
  if (o === void 0 || a === void 0) continue;
80
- const r = Qt(i, o), l = te(i, a), d = r + i.lag - l;
81
- d > 0 && n.push({ dependency: i.id, departure: r, arrival: l, shortBy: d });
80
+ const r = ee(i, o), l = se(i, a), d = r + i.lag - l;
81
+ d > 0 && s.push({ dependency: i.id, departure: r, arrival: l, shortBy: d });
82
82
  }
83
- return n;
83
+ return s;
84
84
  }
85
- function Qe(s, t) {
85
+ function es(n, t) {
86
86
  const e = [];
87
- for (const n of s) {
88
- const i = Q(n);
87
+ for (const s of n) {
88
+ const i = tt(s);
89
89
  for (const o of t)
90
- o.lane !== n.lane || !(i.from < o.to && o.from < i.to) || e.push({ subtask: n.id, blocked: o.id, lane: o.lane, from: Math.max(i.from, o.from), to: Math.min(i.to, o.to) });
90
+ o.lane !== s.lane || !(i.from < o.to && o.from < i.to) || e.push({ subtask: s.id, blocked: o.id, lane: o.lane, from: Math.max(i.from, o.from), to: Math.min(i.to, o.to) });
91
91
  }
92
92
  return e;
93
93
  }
94
- function Qi(s, t, e = []) {
94
+ function so(n, t, e = []) {
95
95
  return {
96
- overlaps: ee(s),
97
- violatedDependencies: se(s, t),
98
- inBlockedTime: Qe(s, e)
96
+ overlaps: ne(n),
97
+ violatedDependencies: ie(n, t),
98
+ inBlockedTime: es(n, e)
99
99
  };
100
100
  }
101
- function to(s, t, e) {
101
+ function no(n, t, e) {
102
102
  if (e.kind === "place") return [];
103
- const n = new Map(s.map((l) => [l.id, Ce(l, e)])), i = /* @__PURE__ */ new Map();
103
+ const s = new Map(n.map((l) => [l.id, De(l, e)])), i = /* @__PURE__ */ new Map();
104
104
  for (const l of t) {
105
105
  const d = i.get(l.from) ?? [];
106
106
  d.push(l), i.set(l.from, d);
107
107
  }
108
108
  const o = /* @__PURE__ */ new Map(), a = [e.subtask];
109
- let r = (s.length + 1) * (t.length + 1);
109
+ let r = (n.length + 1) * (t.length + 1);
110
110
  for (; a.length > 0 && r-- > 0; ) {
111
- const l = a.shift(), d = n.get(l);
111
+ const l = a.shift(), d = s.get(l);
112
112
  if (d !== void 0)
113
- for (const h of i.get(l) ?? []) {
114
- if (h.to === e.subtask) continue;
115
- const c = n.get(h.to);
116
- if (c === void 0) continue;
117
- const m = Qt(h, d) + h.lag - te(h, c);
118
- if (!(m > 0)) continue;
119
- const k = { kind: "move", subtask: c.id, from: c.from + m, to: c.to + m };
120
- n.set(c.id, Ce(c, k)), o.set(c.id, k), a.push(c.id);
113
+ for (const c of i.get(l) ?? []) {
114
+ if (c.to === e.subtask) continue;
115
+ const h = s.get(c.to);
116
+ if (h === void 0) continue;
117
+ const p = ee(c, d) + c.lag - se(c, h);
118
+ if (!(p > 0)) continue;
119
+ const g = { kind: "move", subtask: h.id, from: h.from + p, to: h.to + p };
120
+ s.set(h.id, De(h, g)), o.set(h.id, g), a.push(h.id);
121
121
  }
122
122
  }
123
123
  return [...o.values()];
124
124
  }
125
- function Vs(s, t, e) {
126
- const { step: n, offset: i } = typeof t == "number" ? { step: t, offset: 0 } : t;
127
- if (!(n > 0) || !Number.isFinite(s)) return s;
128
- const o = qe(s, e) + i;
129
- return o + Math.round((s - o) / n) * n;
125
+ function Us(n, t, e) {
126
+ const { step: s, offset: i } = typeof t == "number" ? { step: t, offset: 0 } : t;
127
+ if (!(s > 0) || !Number.isFinite(n)) return n;
128
+ const o = Ze(n, e) + i;
129
+ return o + Math.round((n - o) / s) * s;
130
130
  }
131
- function eo(s, t, e) {
132
- return e === 0 || !Number.isFinite(e) ? [] : s.filter((n) => n.task === t).map((n) => ({ kind: "move", subtask: n.id, from: n.from + e, to: n.to + e }));
131
+ function io(n, t, e) {
132
+ return e === 0 || !Number.isFinite(e) ? [] : n.filter((s) => s.task === t).map((s) => ({ kind: "move", subtask: s.id, from: s.from + e, to: s.to + e }));
133
133
  }
134
- function It(s) {
135
- let t = !1, e = !1, n = !1, i = !1;
136
- for (const o of s ?? [])
137
- o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? n = !0 : o === "open" && (i = !0);
138
- return { dashed: t, hatched: e, muted: n, open: i };
134
+ function It(n) {
135
+ let t = !1, e = !1, s = !1, i = !1;
136
+ for (const o of n ?? [])
137
+ o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? s = !0 : o === "open" && (i = !0);
138
+ return { dashed: t, hatched: e, muted: s, open: i };
139
139
  }
140
- const ne = /* @__PURE__ */ je(null), ts = /* @__PURE__ */ je(null);
141
- function es() {
142
- return Zt(ts);
140
+ const oe = /* @__PURE__ */ Je(null), ss = /* @__PURE__ */ Je(null);
141
+ function ns() {
142
+ return Qt(ss);
143
143
  }
144
- function zs(s) {
145
- const t = Zt(ne);
144
+ function Xs(n) {
145
+ const t = Qt(oe);
146
146
  if (t === null)
147
- throw new Error(`@umriss-ui/schedule: <${s}> must be used inside a <Schedule>.`);
147
+ throw new Error(`@umriss-ui/schedule: <${n}> must be used inside a <Schedule>.`);
148
148
  return t;
149
149
  }
150
- function ie(s, t, e, n, i) {
151
- const o = zs(s), a = W(null);
150
+ function ae(n, t, e, s, i) {
151
+ const o = Xs(n), a = U(null);
152
152
  Y(() => (a.current = e(o, t), () => {
153
153
  a.current !== null && i(o, a.current), a.current = null;
154
154
  }), [o]), Y(() => {
155
- a.current !== null && n(o, a.current, t);
155
+ a.current !== null && s(o, a.current, t);
156
156
  });
157
157
  }
158
- function Ws(s) {
159
- ie("Lane", s, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
158
+ function qs(n) {
159
+ ae("Lane", n, (t, e) => t.registerLane(e), (t, e, s) => t.updateLane(e, s), (t, e) => t.unregisterLane(e));
160
160
  }
161
- function Us(s) {
162
- ie("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
161
+ function js(n) {
162
+ ae("LaneGroup", n, (t, e) => t.registerGroup(e), (t, e, s) => t.updateGroup(e, s), (t, e) => t.unregisterGroup(e));
163
163
  }
164
- function Xs(s) {
165
- const t = Zt(ne);
164
+ function Zs(n) {
165
+ const t = Qt(oe);
166
166
  return Y(() => {
167
167
  if (t !== null)
168
- return t.registerDataTable(s), () => t.unregisterDataTable();
169
- }, [t, s]), t;
168
+ return t.registerDataTable(n), () => t.unregisterDataTable();
169
+ }, [t, n]), t;
170
170
  }
171
- function Lt(s, t) {
172
- ie(s, t, (e, n) => e.registerLayer(n), (e, n, i) => e.updateLayer(n, i), (e, n) => e.unregisterLayer(n));
171
+ function Lt(n, t) {
172
+ ae(n, t, (e, s) => e.registerLayer(s), (e, s, i) => e.updateLayer(s, i), (e, s) => e.unregisterLayer(s));
173
173
  }
174
- const ss = 24, qs = 4, js = 3, Pt = 4;
175
- function Ae(s) {
176
- const { lanes: t, groups: e, collapsed: n, laneHeight: i, headHeight: o = ss } = s, a = new Map(e.map((b) => [b.id, b])), r = (b) => b !== void 0 && a.has(b) ? b : void 0, l = /* @__PURE__ */ new Map(), d = (b) => {
174
+ const is = 24, Js = 4, Qs = 3, Pt = 4;
175
+ function _e(n) {
176
+ const { lanes: t, groups: e, collapsed: s, laneHeight: i, headHeight: o = is } = n, a = new Map(e.map((b) => [b.id, b])), r = (b) => b !== void 0 && a.has(b) ? b : void 0, l = /* @__PURE__ */ new Map(), d = (b) => {
177
177
  const S = [];
178
178
  let I = r(b.parent);
179
- const F = /* @__PURE__ */ new Set();
180
- for (; I !== void 0 && !F.has(I); )
181
- F.add(I), S.unshift(I), I = r(a.get(I).parent);
179
+ const $ = /* @__PURE__ */ new Set();
180
+ for (; I !== void 0 && !$.has(I); )
181
+ $.add(I), S.unshift(I), I = r(a.get(I).parent);
182
182
  return S;
183
- }, h = /* @__PURE__ */ new Map();
183
+ }, c = /* @__PURE__ */ new Map();
184
184
  for (const b of t) {
185
185
  const S = d(b);
186
- h.set(b.id, S);
186
+ c.set(b.id, S);
187
187
  for (const I of S) {
188
- const F = l.get(I) ?? [];
189
- F.push(b.id), l.set(I, F);
188
+ const $ = l.get(I) ?? [];
189
+ $.push(b.id), l.set(I, $);
190
190
  }
191
191
  }
192
- const c = [], m = /* @__PURE__ */ new Map();
193
- let k = [], f = null, v = 0;
194
- const C = (b) => (c.push({ ...b, top: v }), v += b.height, c.length - 1), A = (b) => b.find((S) => n.has(S)), M = () => {
192
+ const h = [], p = /* @__PURE__ */ new Map();
193
+ let g = [], f = null, y = 0;
194
+ const A = (b) => (h.push({ ...b, top: y }), y += b.height, h.length - 1), C = (b) => b.find((S) => s.has(S)), M = () => {
195
195
  if (f === null) return;
196
- const { row: b, lanes: S } = f, I = c[b], F = Math.max(I.height, S.length * qs + 2 * Pt);
197
- c[b] = { ...I, height: F }, v += F - I.height;
198
- const O = F - 2 * Pt, R = Math.max(js, Math.floor(O / S.length));
199
- S.forEach((q, gt) => {
200
- const kt = h.get(q) ?? [];
201
- m.set(q, {
202
- top: I.top + Pt + gt * R,
196
+ const { row: b, lanes: S } = f, I = h[b], $ = Math.max(I.height, S.length * Js + 2 * Pt);
197
+ h[b] = { ...I, height: $ }, y += $ - I.height;
198
+ const O = $ - 2 * Pt, R = Math.max(Qs, Math.floor(O / S.length));
199
+ S.forEach((J, kt) => {
200
+ const vt = c.get(J) ?? [];
201
+ p.set(J, {
202
+ top: I.top + Pt + kt * R,
203
203
  height: R,
204
204
  miniature: !0,
205
- group: kt[kt.length - 1]
205
+ group: vt[vt.length - 1]
206
206
  });
207
207
  }), f = null;
208
208
  };
209
209
  for (const b of t) {
210
- const S = (h.get(b.id) ?? []).filter((O) => (l.get(O) ?? []).length > 0), I = A(S);
210
+ const S = (c.get(b.id) ?? []).filter((O) => (l.get(O) ?? []).length > 0), I = C(S);
211
211
  if (f !== null && I === f.group) {
212
212
  f.lanes.push(b.id);
213
213
  continue;
214
214
  }
215
215
  M();
216
- const F = S.filter((O, R) => k[R] === O).length;
217
- k = k.slice(0, F);
218
- for (const O of S.slice(F)) {
219
- if (k.push(O), O === I) break;
220
- C({
216
+ const $ = S.filter((O, R) => g[R] === O).length;
217
+ g = g.slice(0, $);
218
+ for (const O of S.slice($)) {
219
+ if (g.push(O), O === I) break;
220
+ A({
221
221
  kind: "groupHead",
222
222
  lane: void 0,
223
223
  group: O,
224
- depth: k.length - 1,
225
- within: [...k],
224
+ depth: g.length - 1,
225
+ within: [...g],
226
226
  lanes: (l.get(O) ?? []).length,
227
227
  height: o
228
228
  });
229
229
  }
230
230
  if (I !== void 0) {
231
- const O = S.indexOf(I), R = C({
231
+ const O = S.indexOf(I), R = A({
232
232
  kind: "miniature",
233
233
  lane: void 0,
234
234
  group: I,
@@ -240,193 +240,193 @@ function Ae(s) {
240
240
  f = { group: I, row: R, lanes: [b.id] };
241
241
  continue;
242
242
  }
243
- C({ kind: "lane", lane: b.id, group: S[S.length - 1], depth: S.length, within: S, lanes: 1, height: i }), m.set(b.id, {
244
- top: c[c.length - 1].top,
243
+ A({ kind: "lane", lane: b.id, group: S[S.length - 1], depth: S.length, within: S, lanes: 1, height: i }), p.set(b.id, {
244
+ top: h[h.length - 1].top,
245
245
  height: i,
246
246
  miniature: !1,
247
247
  group: S[S.length - 1]
248
248
  });
249
249
  }
250
- return M(), { rows: c, slots: m, height: v };
250
+ return M(), { rows: h, slots: p, height: y };
251
251
  }
252
- function Zs(s, t) {
253
- if (t.size === 0) return s;
252
+ function tn(n, t) {
253
+ if (t.size === 0) return n;
254
254
  const e = /* @__PURE__ */ new Set();
255
- for (const n of s) t.has(n) || e.add(n);
255
+ for (const s of n) t.has(s) || e.add(s);
256
256
  return e;
257
257
  }
258
- function at(s, t) {
259
- if (t < 0 || t >= s.height) return null;
260
- let e = 0, n = s.rows.length - 1;
261
- for (; e <= n; ) {
262
- const i = e + n >> 1, o = s.rows[i];
263
- if (t < o.top) n = i - 1;
258
+ function at(n, t) {
259
+ if (t < 0 || t >= n.height) return null;
260
+ let e = 0, s = n.rows.length - 1;
261
+ for (; e <= s; ) {
262
+ const i = e + s >> 1, o = n.rows[i];
263
+ if (t < o.top) s = i - 1;
264
264
  else if (t >= o.top + o.height) e = i + 1;
265
265
  else return o;
266
266
  }
267
267
  return null;
268
268
  }
269
- function oe(s, t) {
270
- return s.slots.get(t) ?? null;
269
+ function re(n, t) {
270
+ return n.slots.get(t) ?? null;
271
271
  }
272
- function Js(s, t) {
273
- const e = at(s, t);
272
+ function en(n, t) {
273
+ const e = at(n, t);
274
274
  if (e === null) return null;
275
275
  if (e.kind === "lane") return e.lane ?? null;
276
276
  if (e.kind === "groupHead") return null;
277
- for (const [n, i] of s.slots)
278
- if (i.miniature && t >= i.top && t < i.top + i.height) return n;
277
+ for (const [s, i] of n.slots)
278
+ if (i.miniature && t >= i.top && t < i.top + i.height) return s;
279
279
  return null;
280
280
  }
281
- const Qs = 6, ns = 3, dt = 2, De = 3, _e = 3;
282
- function x(s, t) {
283
- return Math.round(s.scale.toPx(V(t, s.calendar)));
281
+ const sn = 6, os = 3, ht = 2, Oe = 3, $e = 3;
282
+ function x(n, t) {
283
+ return Math.round(n.scale.toPx(z(t, n.calendar)));
284
284
  }
285
- function tt(s, t) {
286
- const e = oe(s.rows, t);
287
- return e === null ? null : { ...e, top: e.top - s.scrollY };
285
+ function et(n, t) {
286
+ const e = re(n.rows, t);
287
+ return e === null ? null : { ...e, top: e.top - n.scrollY };
288
288
  }
289
- function ae(s, t) {
290
- const e = tt(s, t.lane);
291
- return e === null ? null : { x: x(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
289
+ function le(n, t) {
290
+ const e = et(n, t.lane);
291
+ return e === null ? null : { x: x(n, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
292
292
  }
293
- function Oe(s, t) {
294
- return Js(s.rows, t + s.scrollY);
293
+ function Fe(n, t) {
294
+ return en(n.rows, t + n.scrollY);
295
295
  }
296
- function is(s, t, e, n) {
297
- const i = e.miniature ? 0 : Qs, o = e.miniature ? 0 : _e * De, a = Math.max(e.miniature ? 1 : 4, e.height - 2 * i - o), r = e.top - s.scrollY + Math.floor((e.height - a) / 2), l = Q(t);
296
+ function as(n, t, e, s) {
297
+ const i = e.miniature ? 0 : sn, o = e.miniature ? 0 : $e * Oe, a = Math.max(e.miniature ? 1 : 4, e.height - 2 * i - o), r = e.top - n.scrollY + Math.floor((e.height - a) / 2), l = tt(t);
298
298
  return {
299
299
  subtask: t,
300
300
  miniature: e.miniature,
301
- depth: n,
302
- y: r + (e.miniature ? 0 : Math.min(n, _e) * De),
301
+ depth: s,
302
+ y: r + (e.miniature ? 0 : Math.min(s, $e) * Oe),
303
303
  height: a,
304
- outerFrom: x(s, l.from),
305
- mainFrom: x(s, t.from),
306
- mainTo: x(s, t.to),
307
- outerTo: x(s, l.to)
304
+ outerFrom: x(n, l.from),
305
+ mainFrom: x(n, t.from),
306
+ mainTo: x(n, t.to),
307
+ outerTo: x(n, l.to)
308
308
  };
309
309
  }
310
- function os(s, t, e) {
311
- if (e < s.y || e > s.y + s.height) return null;
312
- const n = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
313
- return t < s.outerFrom - n || t > s.outerTo + n ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
310
+ function rs(n, t, e) {
311
+ if (e < n.y || e > n.y + n.height) return null;
312
+ const s = Math.max(0, (6 - (n.outerTo - n.outerFrom)) / 2);
313
+ return t < n.outerFrom - s || t > n.outerTo + s ? null : t < n.mainFrom ? "leadIn" : t > n.mainTo ? "leadOut" : "main";
314
314
  }
315
- function tn(s, t, e, n = 5) {
316
- if (e < s.y || e > s.y + s.height) return null;
317
- const i = Math.abs(t - s.mainFrom), o = Math.abs(t - s.mainTo);
318
- return Math.min(i, o) > n ? null : i <= o ? "from" : "to";
315
+ function nn(n, t, e, s = 5) {
316
+ if (e < n.y || e > n.y + n.height) return null;
317
+ const i = Math.abs(t - n.mainFrom), o = Math.abs(t - n.mainTo);
318
+ return Math.min(i, o) > s ? null : i <= o ? "from" : "to";
319
319
  }
320
- function Yt(s, t, e) {
321
- return s.outerTo >= 0 && s.outerFrom <= t && s.y + s.height >= 0 && s.y <= e;
320
+ function Vt(n, t, e) {
321
+ return n.outerTo >= 0 && n.outerFrom <= t && n.y + n.height >= 0 && n.y <= e;
322
322
  }
323
- function en(s, t, e) {
324
- let i = Math.min(s.x1, s.x2, s.c1x, s.c2x), o = Math.max(s.x1, s.x2, s.c1x, s.c2x), a = Math.min(s.y1, s.y2), r = Math.max(s.y1, s.y2);
325
- for (let l = 0; l + 1 < s.points.length; l += 2)
326
- i = Math.min(i, s.points[l]), o = Math.max(o, s.points[l]), a = Math.min(a, s.points[l + 1]), r = Math.max(r, s.points[l + 1]);
323
+ function on(n, t, e) {
324
+ let i = Math.min(n.x1, n.x2, n.c1x, n.c2x), o = Math.max(n.x1, n.x2, n.c1x, n.c2x), a = Math.min(n.y1, n.y2), r = Math.max(n.y1, n.y2);
325
+ for (let l = 0; l + 1 < n.points.length; l += 2)
326
+ i = Math.min(i, n.points[l]), o = Math.max(o, n.points[l]), a = Math.min(a, n.points[l + 1]), r = Math.max(r, n.points[l + 1]);
327
327
  return o >= -8 && i <= t + 8 && r >= -8 && a <= e + 8;
328
328
  }
329
- const sn = 64;
330
- function nn(s, t) {
331
- if (s.miniature) return null;
332
- const e = It(s.subtask.appearance).hatched ? dt + ns + 1 : 0, n = Math.max(s.mainFrom + e, 0), i = Math.min(s.mainTo - e, t) - n;
333
- return i < sn ? null : { x: n, width: i, y: s.y, height: s.height };
329
+ const an = 64;
330
+ function rn(n, t) {
331
+ if (n.miniature) return null;
332
+ const e = It(n.subtask.appearance).hatched ? ht + os + 1 : 0, s = Math.max(n.mainFrom + e, 0), i = Math.min(n.mainTo - e, t) - s;
333
+ return i < an ? null : { x: s, width: i, y: n.y, height: n.height };
334
334
  }
335
- const on = 10;
336
- function Fe(s, t, e) {
337
- const n = Math.round(t.y + t.height / 2);
338
- return s === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
335
+ const ln = 10;
336
+ function Ee(n, t, e) {
337
+ const s = Math.round(t.y + t.height / 2);
338
+ return n === "centre" || e.y === t.y ? s : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
339
339
  }
340
- function Vt(s, t, e, n, i) {
341
- const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l = x(s, Qt(t, e.subtask)), d = x(s, te(t, n.subtask)), h = Fe(a, e, n), c = Fe(a, n, e);
340
+ function zt(n, t, e, s, i) {
341
+ const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l = x(n, ee(t, e.subtask)), d = x(n, se(t, s.subtask)), c = Ee(a, e, s), h = Ee(a, s, e);
342
342
  if (o === "straight")
343
- return { dependency: t, kind: o, ends: r, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: [l, h, d, c] };
343
+ return { dependency: t, kind: o, ends: r, x1: l, y1: c, x2: d, y2: h, c1x: l, c2x: d, points: [l, c, d, h] };
344
344
  if (o === "orthogonal") {
345
- const C = l + on, A = h === c ? C : Math.round((C + d) / 2);
346
- return { dependency: t, kind: o, ends: r, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: h === c ? [l, h, d, c] : [l, h, A, h, A, c, d, c] };
347
- }
348
- const m = Math.max(14, Math.abs(d - l) / 2), k = l + m, f = d - m, v = [];
349
- for (let C = 0; C <= 16; C++) {
350
- const A = C / 16, M = 1 - A;
351
- v.push(
352
- M * M * M * l + 3 * M * M * A * k + 3 * M * A * A * f + A * A * A * d,
353
- M * M * M * h + 3 * M * M * A * h + 3 * M * A * A * c + A * A * A * c
345
+ const A = l + ln, C = c === h ? A : Math.round((A + d) / 2);
346
+ return { dependency: t, kind: o, ends: r, x1: l, y1: c, x2: d, y2: h, c1x: l, c2x: d, points: c === h ? [l, c, d, h] : [l, c, C, c, C, h, d, h] };
347
+ }
348
+ const p = Math.max(14, Math.abs(d - l) / 2), g = l + p, f = d - p, y = [];
349
+ for (let A = 0; A <= 16; A++) {
350
+ const C = A / 16, M = 1 - C;
351
+ y.push(
352
+ M * M * M * l + 3 * M * M * C * g + 3 * M * C * C * f + C * C * C * d,
353
+ M * M * M * c + 3 * M * M * C * c + 3 * M * C * C * h + C * C * C * h
354
354
  );
355
355
  }
356
- return { dependency: t, kind: "curve", ends: r, x1: l, y1: h, x2: d, y2: c, c1x: k, c2x: f, points: v };
356
+ return { dependency: t, kind: "curve", ends: r, x1: l, y1: c, x2: d, y2: h, c1x: g, c2x: f, points: y };
357
357
  }
358
- function an(s, t, e) {
359
- let n = 1 / 0;
360
- const i = s.points;
358
+ function dn(n, t, e) {
359
+ let s = 1 / 0;
360
+ const i = n.points;
361
361
  for (let o = 0; o + 3 < i.length; o += 2) {
362
- const a = i[o], r = i[o + 1], l = i[o + 2], d = i[o + 3], h = l - a, c = d - r, m = h * h + c * c, k = m === 0 ? 0 : Math.max(0, Math.min(1, ((t - a) * h + (e - r) * c) / m));
363
- n = Math.min(n, Math.hypot(t - (a + k * h), e - (r + k * c)));
362
+ const a = i[o], r = i[o + 1], l = i[o + 2], d = i[o + 3], c = l - a, h = d - r, p = c * c + h * h, g = p === 0 ? 0 : Math.max(0, Math.min(1, ((t - a) * c + (e - r) * h) / p));
363
+ s = Math.min(s, Math.hypot(t - (a + g * c), e - (r + g * h)));
364
364
  }
365
- return n;
365
+ return s;
366
366
  }
367
- const as = [], rs = 56;
368
- function rn(s) {
369
- return s > 16 ? s / 16 : 1;
367
+ const ls = [], ds = 56;
368
+ function hn(n) {
369
+ return n > 16 ? n / 16 : 1;
370
370
  }
371
- function ln(s, t = rs) {
372
- return s > 0 ? Math.min(J, Math.max(15 * Z, As(s * t, 1))) : 15 * Z;
371
+ function cn(n, t = ds) {
372
+ return n > 0 ? Math.min(Q, Math.max(15 * Z, Os(n * t, 1))) : 15 * Z;
373
373
  }
374
- const dn = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
375
- function hn(s, t, e = as, n) {
376
- const [i, o] = ls(s, e);
377
- return Ds(e, i, o, t, 0, n ?? dn()).filter(
378
- (a) => a.workingTime >= s[0] && a.workingTime <= s[1]
374
+ const un = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
375
+ function fn(n, t, e = ls, s) {
376
+ const [i, o] = hs(n, e);
377
+ return $s(e, i, o, t, 0, s ?? un()).filter(
378
+ (a) => a.workingTime >= n[0] && a.workingTime <= n[1]
379
379
  );
380
380
  }
381
- function cn(s, t = as, e) {
382
- const [n, i] = ls(s, t), o = [], { year: a, month: r, day: l } = Je(n, e);
383
- let d = l, h = Kt({ year: a, month: r, day: d }, e).getTime();
384
- for (; h < i && o.length < 400; ) {
385
- const c = h;
386
- h = Kt({ year: a, month: r, day: ++d }, e).getTime(), o.push({
387
- start: c,
388
- from: V(c, t),
389
- to: V(h, t)
381
+ function mn(n, t = ls, e) {
382
+ const [s, i] = hs(n, t), o = [], { year: a, month: r, day: l } = ts(s, e);
383
+ let d = l, c = Yt({ year: a, month: r, day: d }, e).getTime();
384
+ for (; c < i && o.length < 400; ) {
385
+ const h = c;
386
+ c = Yt({ year: a, month: r, day: ++d }, e).getTime(), o.push({
387
+ start: h,
388
+ from: z(h, t),
389
+ to: z(c, t)
390
390
  });
391
391
  }
392
392
  return o;
393
393
  }
394
394
  const Rt = [1, 2, 7, 14, 28];
395
- function un(s, t) {
396
- return Rt.find((e) => e * s >= t) ?? Rt[Rt.length - 1];
395
+ function pn(n, t) {
396
+ return Rt.find((e) => e * n >= t) ?? Rt[Rt.length - 1];
397
397
  }
398
- function Gt(s, t, e, n = 1) {
399
- return ((Math.round((s - qe(s, e)) / J) - 3 - n) % t + t) % t === 0;
398
+ function Gt(n, t, e, s = 1) {
399
+ return ((Math.round((n - Ze(n, e)) / Q) - 3 - s) % t + t) % t === 0;
400
400
  }
401
- function j(s, t) {
402
- const e = s.time(new Date(t), !1);
403
- return _s(t, s.timeZone) ? `${e} ${s.offset(new Date(t))}` : e;
401
+ function V(n, t) {
402
+ const e = n.time(new Date(t), !1);
403
+ return Fs(t, n.timeZone) ? `${e} ${n.offset(new Date(t))}` : e;
404
404
  }
405
- function fn(s, t, e, n) {
406
- const i = s[1] - s[0];
407
- if (!(i > 0)) return [s[0], s[1]];
408
- const o = Math.min(n.max, Math.max(n.min, i * e)), a = (t - s[0]) / i, r = t - a * o;
405
+ function gn(n, t, e, s) {
406
+ const i = n[1] - n[0];
407
+ if (!(i > 0)) return [n[0], n[1]];
408
+ const o = Math.min(s.max, Math.max(s.min, i * e)), a = (t - n[0]) / i, r = t - a * o;
409
409
  return [r, r + o];
410
410
  }
411
- function mn(s, t) {
412
- return [s[0] + t, s[1] + t];
411
+ function kn(n, t) {
412
+ return [n[0] + t, n[1] + t];
413
413
  }
414
- function ut(s, t) {
415
- const e = Tt(t);
416
- return e.intervals.length === 0 ? s : qt(Math.max(0, Math.min(e.total, s)), e);
414
+ function ft(n, t) {
415
+ const e = St(t);
416
+ return e.intervals.length === 0 ? n : Zt(Math.max(0, Math.min(e.total, n)), e);
417
417
  }
418
- function ls(s, t) {
419
- return [ut(s[0], t), ut(s[1], t)];
418
+ function hs(n, t) {
419
+ return [ft(n[0], t), ft(n[1], t)];
420
420
  }
421
- const zt = 44;
422
- class pn {
421
+ const Wt = 44;
422
+ class vn {
423
423
  constructor(t) {
424
424
  this.data = t;
425
425
  }
426
426
  options = {
427
- laneHeight: zt,
427
+ laneHeight: Wt,
428
428
  calendar: [],
429
- zoomLimits: { min: jt, max: 28 * J },
429
+ zoomLimits: { min: Jt, max: 28 * Q },
430
430
  snap: "ticks",
431
431
  intents: [],
432
432
  now: null,
@@ -436,14 +436,14 @@ class pn {
436
436
  };
437
437
  /** The root font size over 16 px, 1 at the default size and below (`fontScaleOf`). */
438
438
  fontScale = 1;
439
- domain = [0, J];
439
+ domain = [0, Q];
440
440
  scrollY = 0;
441
441
  width = 0;
442
442
  height = 0;
443
443
  /* What is laid out from top to bottom (`rows.ts`). It is derived here and
444
444
  not in the data, because a row's height comes from a view option; every y
445
445
  in the package reads it. */
446
- rows = Ae({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: zt });
446
+ rows = _e({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Wt });
447
447
  /** The folded groups, as the scene holds them. */
448
448
  collapsed = /* @__PURE__ */ new Set();
449
449
  /** The groups a gesture in flight holds open. Dropped when it ends; the
@@ -477,22 +477,22 @@ class pn {
477
477
  }
478
478
  /** Takes new options; a new calendar keeps the wall-clock span in view. */
479
479
  setOptions(t) {
480
- const e = t.calendar !== this.options.calendar, n = this.options.calendar;
480
+ const e = t.calendar !== this.options.calendar, s = this.options.calendar;
481
481
  if (this.options = t, e) {
482
- const i = Tt(n), o = (a) => {
482
+ const i = St(s), o = (a) => {
483
483
  const r = i.intervals.length === 0 ? a : Math.max(0, Math.min(i.total, a));
484
- return V(qt(r, i), t.calendar) + (a - r);
484
+ return z(Zt(r, i), t.calendar) + (a - r);
485
485
  };
486
486
  this.domain = [o(this.domain[0]), o(this.domain[1])];
487
487
  }
488
488
  }
489
489
  /** Puts a span of two wall-clock instants in view. */
490
490
  showWall(t) {
491
- this.domain = [V(t[0], this.options.calendar), V(t[1], this.options.calendar)];
491
+ this.domain = [z(t[0], this.options.calendar), z(t[1], this.options.calendar)];
492
492
  }
493
493
  viewport() {
494
494
  return {
495
- scale: new Os(this.domain, [0, this.width]),
495
+ scale: new Es(this.domain, [0, this.width]),
496
496
  calendar: this.options.calendar,
497
497
  scrollY: this.scrollY,
498
498
  rows: this.rows
@@ -508,42 +508,42 @@ class pn {
508
508
  /** The fine band's step at the current zoom. */
509
509
  step() {
510
510
  const t = this.domain[1] - this.domain[0];
511
- return ln(this.width > 0 ? t / this.width : t, rs * this.fontScale);
511
+ return cn(this.width > 0 ? t / this.width : t, ds * this.fontScale);
512
512
  }
513
513
  /** Lays the rows out, clamps the scroll, and lays the data out anew. */
514
514
  layout() {
515
- this.moved = !1, this.rows = Ae({
515
+ this.moved = !1, this.rows = _e({
516
516
  lanes: this.data.lanes,
517
517
  groups: this.data.groups,
518
- collapsed: Zs(this.collapsed, this.openForGesture),
518
+ collapsed: tn(this.collapsed, this.openForGesture),
519
519
  laneHeight: Math.round(this.options.laneHeight * this.fontScale),
520
- headHeight: Math.round(ss * this.fontScale)
520
+ headHeight: Math.round(is * this.fontScale)
521
521
  }), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
522
522
  const t = this.viewport();
523
523
  this.laidBoxes = [], this.laidBoxById = /* @__PURE__ */ new Map();
524
524
  for (const e of this.data.subtasks) {
525
- const n = oe(this.rows, e.lane);
526
- if (n === null) continue;
527
- const i = is(t, e, n, this.data.depth.get(e.id) ?? 0);
525
+ const s = re(this.rows, e.lane);
526
+ if (s === null) continue;
527
+ const i = as(t, e, s, this.data.depth.get(e.id) ?? 0);
528
528
  this.laidBoxes.push(i), this.laidBoxById.set(e.id, i);
529
529
  }
530
530
  this.laidPaths = [];
531
531
  for (const e of this.data.dependencies) {
532
- const n = this.boxById.get(e.from), i = this.boxById.get(e.to);
533
- n === void 0 || i === void 0 || this.laidPaths.push(Vt(t, e, n, i, this.options));
532
+ const s = this.boxById.get(e.from), i = this.boxById.get(e.to);
533
+ s === void 0 || i === void 0 || this.laidPaths.push(zt(t, e, s, i, this.options));
534
534
  }
535
535
  }
536
536
  /** The days of the coarse band and the ticks of the fine band, in pixels. */
537
537
  bands() {
538
538
  const t = this.step();
539
539
  if (this.width <= 0) return { days: [], ticks: [], step: t };
540
- const e = this.viewport().scale, n = this.options.calendar;
540
+ const e = this.viewport().scale, s = this.options.calendar;
541
541
  return {
542
- days: cn(this.domain, n, this.options.timeZone).map((i) => {
542
+ days: mn(this.domain, s, this.options.timeZone).map((i) => {
543
543
  const o = Math.round(e.toPx(i.from));
544
544
  return { start: i.start, x: o, width: Math.round(e.toPx(i.to)) - o };
545
545
  }),
546
- ticks: hn(this.domain, t, n, this.options.timeZone).map((i) => ({ wallClock: i.wallClock, x: Math.round(e.toPx(i.workingTime)) })),
546
+ ticks: fn(this.domain, t, s, this.options.timeZone).map((i) => ({ wallClock: i.wallClock, x: Math.round(e.toPx(i.workingTime)) })),
547
547
  step: t
548
548
  };
549
549
  }
@@ -551,32 +551,32 @@ class pn {
551
551
  nowX() {
552
552
  const t = this.options.now;
553
553
  if (t === null || this.width <= 0) return null;
554
- const e = Math.round(this.viewport().scale.toPx(V(t, this.options.calendar)));
554
+ const e = Math.round(this.viewport().scale.toPx(z(t, this.options.calendar)));
555
555
  return e >= 0 && e <= this.width ? e : null;
556
556
  }
557
557
  hitAt(t, e) {
558
- const n = this.viewport();
558
+ const s = this.viewport();
559
559
  for (let r = this.data.milestones.length - 1; r >= 0; r--) {
560
- const l = this.data.milestones[r], d = ae(n, l);
560
+ const l = this.data.milestones[r], d = le(s, l);
561
561
  if (d !== null && Math.abs(t - d.x) + Math.abs(e - d.y) <= d.half + 2) return { kind: "milestone", milestone: l };
562
562
  }
563
563
  for (let r = this.boxes.length - 1; r >= 0; r--) {
564
- const l = this.boxes[r], d = os(l, t, e);
564
+ const l = this.boxes[r], d = rs(l, t, e);
565
565
  if (d !== null) return { kind: "subtask", subtask: l.subtask, part: d };
566
566
  }
567
567
  let i = null, o = 4;
568
568
  for (const r of this.paths) {
569
- const l = an(r, t, e);
569
+ const l = dn(r, t, e);
570
570
  l <= o && (o = l, i = r);
571
571
  }
572
572
  if (i !== null) return { kind: "dependency", dependency: i.dependency };
573
- const a = Oe(this.viewport(), e);
573
+ const a = Fe(this.viewport(), e);
574
574
  return a !== null ? { kind: "lane", lane: a } : { kind: "nothing" };
575
575
  }
576
576
  /** The wall-clock time at a plot x; within the calendar's extent. */
577
577
  timeAt(t) {
578
578
  const e = this.viewport().scale.fromPx(t);
579
- return ut(e, this.options.calendar);
579
+ return ft(e, this.options.calendar);
580
580
  }
581
581
  /** The lane at a y, strips included: what the pointer is ON.
582
582
 
@@ -585,7 +585,7 @@ class pn {
585
585
  `foldedGroupAt` - and a caller that reached through `viewport()` for it
586
586
  would be depending on the layout rather than asking the view. */
587
587
  laneIdAt(t) {
588
- return Oe(this.viewport(), t);
588
+ return Fe(this.viewport(), t);
589
589
  }
590
590
  /** The lane a DROP at this y would land on.
591
591
 
@@ -606,302 +606,313 @@ class pn {
606
606
  /** Pans by pixels. Says what moved: the span through time, the lanes, or
607
607
  neither - a scroll through the lanes is no news about the time. */
608
608
  pan(t, e) {
609
- const n = this.domain[0], i = this.scrollY, o = this.domain[1] - n;
610
- this.width > 0 && t !== 0 && (this.domain = mn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
611
- const a = this.domain[0] !== n;
609
+ const s = this.domain[0], i = this.scrollY, o = this.domain[1] - s;
610
+ this.width > 0 && t !== 0 && (this.domain = kn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
611
+ const a = this.domain[0] !== s;
612
612
  return { moved: a || this.scrollY !== i, time: a };
613
613
  }
614
614
  /** Zooms around a plot x; says whether the span changed. */
615
615
  zoomAt(t, e) {
616
616
  if (this.width <= 0 || !Number.isFinite(e)) return !1;
617
- const n = this.domain, i = this.viewport().scale.fromPx(t);
618
- return this.domain = fn(this.domain, i, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
619
- }
620
- }
621
- const gn = "_root_9ariw_4 _text_18806_22", kn = "_corner_9ariw_19", wn = "_zoneLabel_9ariw_24", vn = "_dayBand_9ariw_43", yn = "_headers_9ariw_48", bn = "_plot_9ariw_53", Mn = "_cornerBottom_9ariw_58", Tn = "_tickBand_9ariw_63", Sn = "_dataKey_9ariw_69", In = "_dataPanel_9ariw_100", Ln = "_dataTable_9ariw_119", Cn = "_day_9ariw_43", An = "_dayLabel_9ariw_179", Dn = "_tick_9ariw_63", _n = "_tickLabel_9ariw_200", On = "_header_9ariw_48", Fn = "_headerLabel_9ariw_229", $n = "_headerCount_9ariw_265", En = "_chevron_9ariw_274", Bn = "_focusRing_9ariw_372", xn = "_layer_9ariw_390", Nn = "_grip_9ariw_417", Pn = "_ghostLabel_9ariw_427", Rn = "_finding_9ariw_440", Gn = "_refusal_9ariw_448", Hn = "_tooltip_9ariw_452", Kn = "_tooltipHead_9ariw_471", Yn = "_tooltipTimes_9ariw_476", Vn = "_now_9ariw_485", zn = "_barLabel_9ariw_499", Wn = "_barLabelText_9ariw_512", g = {
622
- root: gn,
623
- corner: kn,
624
- zoneLabel: wn,
625
- dayBand: vn,
626
- headers: yn,
627
- plot: bn,
628
- cornerBottom: Mn,
629
- tickBand: Tn,
630
- dataKey: Sn,
631
- dataPanel: In,
632
- dataTable: Ln,
633
- day: Cn,
634
- dayLabel: An,
635
- tick: Dn,
636
- tickLabel: _n,
637
- header: On,
638
- headerLabel: Fn,
639
- headerCount: $n,
640
- chevron: En,
641
- focusRing: Bn,
642
- layer: xn,
643
- grip: Nn,
644
- ghostLabel: Pn,
645
- finding: Rn,
646
- refusal: Gn,
647
- tooltip: Hn,
648
- tooltipHead: Kn,
649
- tooltipTimes: Yn,
650
- now: Vn,
651
- barLabel: zn,
652
- barLabelText: Wn
617
+ const s = this.domain, i = this.viewport().scale.fromPx(t);
618
+ return this.domain = gn(this.domain, i, e, this.options.zoomLimits), s[0] !== this.domain[0] || s[1] !== this.domain[1];
619
+ }
620
+ }
621
+ const yn = "_root_1ep59_4 _text_1j10m_22", wn = "_corner_1ep59_19", bn = "_zoneLabel_1ep59_24", Mn = "_dayBand_1ep59_43", Tn = "_headers_1ep59_48", Sn = "_plot_1ep59_53", In = "_cornerBottom_1ep59_58", Ln = "_tickBand_1ep59_63", An = "_dataKey_1ep59_69", Cn = "_dataPanel_1ep59_100", Dn = "_dataTable_1ep59_119", _n = "_day_1ep59_43", On = "_dayLabel_1ep59_179", $n = "_tick_1ep59_63", Fn = "_tickLabel_1ep59_200", En = "_header_1ep59_48", Bn = "_headerLabel_1ep59_229", xn = "_headerCount_1ep59_265", Nn = "_chevron_1ep59_274", Pn = "_focusRing_1ep59_372", Rn = "_layer_1ep59_390", Gn = "_grip_1ep59_417", Hn = "_ghostLabel_1ep59_427", Kn = "_finding_1ep59_440", Yn = "_refusal_1ep59_448", Vn = "_tooltip_1ep59_452", zn = "_tooltipHead_1ep59_471", Wn = "_tooltipTimes_1ep59_476", Un = "_now_1ep59_485", Xn = "_barLabel_1ep59_499", qn = "_barLabelText_1ep59_512", k = {
622
+ root: yn,
623
+ corner: wn,
624
+ zoneLabel: bn,
625
+ dayBand: Mn,
626
+ headers: Tn,
627
+ plot: Sn,
628
+ cornerBottom: In,
629
+ tickBand: Ln,
630
+ dataKey: An,
631
+ dataPanel: Cn,
632
+ dataTable: Dn,
633
+ day: _n,
634
+ dayLabel: On,
635
+ tick: $n,
636
+ tickLabel: Fn,
637
+ header: En,
638
+ headerLabel: Bn,
639
+ headerCount: xn,
640
+ chevron: Nn,
641
+ focusRing: Pn,
642
+ layer: Rn,
643
+ grip: Gn,
644
+ ghostLabel: Hn,
645
+ finding: Kn,
646
+ refusal: Yn,
647
+ tooltip: Vn,
648
+ tooltipHead: zn,
649
+ tooltipTimes: Wn,
650
+ now: Un,
651
+ barLabel: Xn,
652
+ barLabelText: qn
653
653
  };
654
- function re() {
655
- const s = mt();
654
+ function de() {
655
+ const n = rt();
656
656
  return (t) => {
657
- const e = Math.round(t / Z), n = Math.floor(e / 60), i = e % 60;
658
- return [n > 0 ? s.hoursShort(n) : "", i > 0 || n === 0 ? s.minutesShort(i) : ""].filter(Boolean).join(" ");
657
+ const e = Math.round(t / Z), s = Math.floor(e / 60), i = e % 60;
658
+ return [s > 0 ? n.hoursShort(s) : "", i > 0 || s === 0 ? n.minutesShort(i) : ""].filter(Boolean).join(" ");
659
659
  };
660
660
  }
661
- function Un({ target: s, lane: t }) {
662
- const e = St(), n = mt(), i = re(), o = (c) => j(e, c);
663
- if (s.kind === "subtask") {
664
- const { subtask: c, task: m } = s, k = [
665
- m?.name ?? c.task,
666
- c.name ?? c.id,
667
- `${e.dateShort(new Date(c.from))} ${n.scheduleGhostTimes(o(c.from), o(c.to))}`,
668
- ...s.overlapping.map((f) => n.scheduleOverlapWith(f.name ?? f.id)),
669
- ...s.violatedDependencies.map((f) => n.scheduleViolatedBy(i(f.shortBy))),
670
- ...s.blocked.map((f) => n.scheduleInBlockedTime(f.label))
661
+ function jn() {
662
+ const n = pt(), t = rt();
663
+ return (e, s) => {
664
+ const [i, o] = [new Date(e), new Date(s)], a = n.date(i);
665
+ return a === n.date(o) ? `${a} ${t.scheduleGhostTimes(V(n, e), V(n, s))}` : t.scheduleGhostTimes(`${a} ${V(n, e)}`, `${n.date(o)} ${V(n, s)}`);
666
+ };
667
+ }
668
+ function cs(n, t, e) {
669
+ return Math.round(e / Z) === 0 ? n.scheduleDependency : `${n.scheduleDependency} ${t(e)}`;
670
+ }
671
+ function Zn({ target: n, lane: t }) {
672
+ const e = pt(), s = rt(), i = de(), o = (h) => V(e, h);
673
+ if (n.kind === "subtask") {
674
+ const { subtask: h, task: p } = n, g = [
675
+ p?.name ?? h.task,
676
+ h.name ?? h.id,
677
+ `${e.dateShort(new Date(h.from))} ${s.scheduleGhostTimes(o(h.from), o(h.to))}`,
678
+ ...n.overlapping.map((f) => s.scheduleOverlapWith(f.name ?? f.id)),
679
+ ...n.violatedDependencies.map((f) => s.scheduleViolatedBy(i(f.shortBy))),
680
+ ...n.blocked.map((f) => s.scheduleInBlockedTime(f.label))
671
681
  ];
672
682
  return /* @__PURE__ */ E(ot, { children: [
673
683
  t,
674
- `, ${k.join(", ")}`
684
+ `, ${g.join(", ")}`
675
685
  ] });
676
686
  }
677
- if (s.kind === "milestone") {
678
- const { milestone: c } = s;
687
+ if (n.kind === "milestone") {
688
+ const { milestone: h } = n;
679
689
  return /* @__PURE__ */ E(ot, { children: [
680
690
  t,
681
- `, ${n.scheduleMilestone(c.label ?? c.id)}, ${e.dateShort(new Date(c.at))} ${o(c.at)}`
691
+ `, ${s.scheduleMilestone(h.label ?? h.id)}, ${e.dateShort(new Date(h.at))} ${o(h.at)}`
682
692
  ] });
683
693
  }
684
- const { dependency: a, task: r, from: l, to: d, violated: h } = s;
694
+ const { dependency: a, task: r, from: l, to: d, violated: c } = n;
685
695
  return [
686
696
  r?.name ?? r?.id ?? a.id,
687
- `${n.scheduleDependency} ${i(a.lag)}`,
688
- n.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to),
689
- ...h === void 0 ? [] : [n.scheduleViolatedBy(i(h.shortBy))]
697
+ cs(s, i, a.lag),
698
+ s.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to),
699
+ ...c === void 0 ? [] : [s.scheduleViolatedBy(i(c.shortBy))]
690
700
  ].join(", ");
691
701
  }
692
- function Xn({ target: s }) {
693
- const t = St(), e = mt(), n = (h) => j(t, h), i = re();
694
- if (s.kind === "subtask") {
695
- const { subtask: h, task: c } = s;
702
+ function Jn({ target: n }) {
703
+ const t = pt(), e = rt(), s = (h) => V(t, h), i = de(), o = jn();
704
+ if (n.kind === "subtask") {
705
+ const { subtask: h, task: p } = n;
696
706
  return /* @__PURE__ */ E(ot, { children: [
697
- /* @__PURE__ */ p("span", { className: g.tooltipHead, children: c?.name ?? h.task }),
698
- /* @__PURE__ */ p("span", { children: h.name ?? h.id }),
699
- /* @__PURE__ */ p("span", { className: g.tooltipTimes, children: e.scheduleGhostTimes(n(h.from), n(h.to)) }),
700
- (h.leadIn ?? 0) > 0 && /* @__PURE__ */ p("span", { children: `${e.scheduleLeadIn} ${i(h.leadIn)}` }),
701
- (h.leadOut ?? 0) > 0 && /* @__PURE__ */ p("span", { children: `${e.scheduleLeadOut} ${i(h.leadOut)}` }),
702
- s.overlapping.map((m) => /* @__PURE__ */ p("span", { className: g.finding, children: e.scheduleOverlapWith(m.name ?? m.id) }, m.id)),
703
- s.violatedDependencies.map((m) => /* @__PURE__ */ p("span", { className: g.finding, children: e.scheduleViolatedBy(i(m.shortBy)) }, m.dependency)),
704
- s.blocked.map((m) => /* @__PURE__ */ p("span", { className: g.finding, children: e.scheduleInBlockedTime(m.label) }, m.id))
707
+ /* @__PURE__ */ m("span", { className: k.tooltipHead, children: p?.name ?? h.task }),
708
+ /* @__PURE__ */ m("span", { children: h.name ?? h.id }),
709
+ /* @__PURE__ */ m("span", { className: k.tooltipTimes, children: o(h.from, h.to) }),
710
+ /* @__PURE__ */ m("span", { children: i(h.to - h.from) }),
711
+ (h.leadIn ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadIn} ${i(h.leadIn)}` }),
712
+ (h.leadOut ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadOut} ${i(h.leadOut)}` }),
713
+ n.overlapping.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleOverlapWith(g.name ?? g.id) }, g.id)),
714
+ n.violatedDependencies.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleViolatedBy(i(g.shortBy)) }, g.dependency)),
715
+ n.blocked.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleInBlockedTime(g.label) }, g.id))
705
716
  ] });
706
717
  }
707
- if (s.kind === "milestone") {
708
- const { milestone: h } = s;
718
+ if (n.kind === "milestone") {
719
+ const { milestone: h } = n;
709
720
  return /* @__PURE__ */ E(ot, { children: [
710
- /* @__PURE__ */ p("span", { className: g.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
711
- /* @__PURE__ */ p("span", { className: g.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${n(h.at)}` })
721
+ /* @__PURE__ */ m("span", { className: k.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
722
+ /* @__PURE__ */ m("span", { className: k.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${s(h.at)}` })
712
723
  ] });
713
724
  }
714
- const { dependency: o, task: a, from: r, to: l, violated: d } = s;
725
+ const { dependency: a, task: r, from: l, to: d, violated: c } = n;
715
726
  return /* @__PURE__ */ E(ot, { children: [
716
- /* @__PURE__ */ p("span", { className: g.tooltipHead, children: a?.name ?? a?.id ?? o.id }),
717
- /* @__PURE__ */ p("span", { children: e.scheduleRoute(r?.name ?? o.from, l?.name ?? o.to) }),
718
- /* @__PURE__ */ p("span", { children: `${e.scheduleDependency} ${i(o.lag)}` }),
719
- d !== void 0 && /* @__PURE__ */ p("span", { className: g.finding, children: e.scheduleViolatedBy(i(d.shortBy)) })
727
+ /* @__PURE__ */ m("span", { className: k.tooltipHead, children: r?.name ?? r?.id ?? a.id }),
728
+ /* @__PURE__ */ m("span", { children: e.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to) }),
729
+ /* @__PURE__ */ m("span", { children: cs(e, i, a.lag) }),
730
+ c !== void 0 && /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleViolatedBy(i(c.shortBy)) })
720
731
  ] });
721
732
  }
722
- const qn = [], $e = { min: jt, max: 28 * J }, jn = [], Ee = 20, Zn = 44, Jn = 84, Qn = 200;
723
- function ti(s) {
733
+ const Qn = [], Be = { min: Jt, max: 28 * Q }, ti = [], xe = 20, ei = 44, si = 84, ni = 200;
734
+ function ii(n) {
724
735
  const {
725
736
  ref: t,
726
737
  scene: e,
727
- "aria-label": n,
738
+ "aria-label": s,
728
739
  "aria-labelledby": i,
729
740
  "aria-describedby": o,
730
741
  height: a,
731
- laneHeight: r = zt,
742
+ laneHeight: r = Wt,
732
743
  headerWidth: l = 160,
733
- calendar: d = jn,
734
- zoomLimits: h,
735
- snap: c = "ticks",
736
- intents: m = qn,
737
- onIntent: k,
744
+ calendar: d = ti,
745
+ zoomLimits: c,
746
+ snap: h = "ticks",
747
+ intents: p = Qn,
748
+ onIntent: g,
738
749
  canMoveTo: f,
739
- onInteraction: v,
740
- selectedTask: C,
741
- onSelectedTaskChange: A,
750
+ onInteraction: y,
751
+ selectedTask: A,
752
+ onSelectedTaskChange: C,
742
753
  placing: M,
743
754
  route: b = "curve",
744
755
  attach: S = "centre",
745
756
  ends: I = "dot",
746
- label: F,
757
+ label: $,
747
758
  tooltip: O,
748
759
  now: R,
749
- loading: q = !1,
750
- className: gt,
751
- style: kt,
752
- children: gs,
753
- ...ks
754
- } = s, de = { "aria-label": n, "aria-labelledby": i }, Ct = Ze(), At = `${Ct}-summary`, Dt = W(null), he = W(null), ce = W(null), ue = W(null), N = St(), B = mt(), rt = N.timeZone, wt = Ns(), fe = h?.min ?? $e.min, me = h?.max ?? $e.max, pe = typeof c == "object" ? c.step : null, ge = typeof c == "object" ? c.offset : null, ke = typeof c == "object" ? null : c, [ws, vs] = ht(() => Date.now());
760
+ loading: J = !1,
761
+ className: kt,
762
+ style: vt,
763
+ children: ys,
764
+ ...ws
765
+ } = n, ce = { "aria-label": s, "aria-labelledby": i }, At = Qe(), Ct = `${At}-summary`, Dt = U(null), ue = U(null), fe = U(null), me = U(null), N = pt(), B = rt(), lt = N.timeZone, yt = Gs(), pe = c?.min ?? Be.min, ge = c?.max ?? Be.max, ke = typeof h == "object" ? h.step : null, ve = typeof h == "object" ? h.offset : null, ye = typeof h == "object" ? null : h, [bs, Ms] = ct(() => Date.now());
755
766
  Y(() => {
756
767
  if (R !== !0) return;
757
- const u = setInterval(() => vs(Date.now()), Z);
768
+ const u = setInterval(() => Ms(Date.now()), Z);
758
769
  return () => clearInterval(u);
759
770
  }, [R]);
760
- const we = R === !0 ? ws : typeof R == "number" ? R : null;
761
- yt(() => {
762
- const u = ke ?? { step: pe ?? 0, offset: ge ?? 0 };
763
- e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: fe, max: me }, snap: u, intents: m, now: we, timeZone: rt, route: b, attach: S, ends: I });
764
- }, [e, r, d, fe, me, ke, pe, ge, m, we, rt, b, S, I]), Y(() => {
765
- e.setHandlers({ onIntent: k, canMoveTo: f, onInteraction: v, onSelectedTaskChange: A });
766
- }, [e, k, f, v, A]), Bs(t, () => Dt.current, []), Y(() => {
771
+ const we = R === !0 ? bs : typeof R == "number" ? R : null;
772
+ bt(() => {
773
+ const u = ye ?? { step: ke ?? 0, offset: ve ?? 0 };
774
+ e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: pe, max: ge }, snap: u, intents: p, now: we, timeZone: lt, route: b, attach: S, ends: I });
775
+ }, [e, r, d, pe, ge, ye, ke, ve, p, we, lt, b, S, I]), Y(() => {
776
+ e.setHandlers({ onIntent: g, canMoveTo: f, onInteraction: y, onSelectedTaskChange: C });
777
+ }, [e, g, f, y, C]), Ps(t, () => Dt.current, []), Y(() => {
767
778
  e.data.warnOfMalformedData();
768
779
  }), Y(() => {
769
- e.setLoading(q);
770
- }, [e, q]), Y(() => {
771
- e.setControlledTask(C);
772
- }, [e, C]), Y(() => {
780
+ e.setLoading(J);
781
+ }, [e, J]), Y(() => {
782
+ e.setControlledTask(A);
783
+ }, [e, A]), Y(() => {
773
784
  e.setPlacing(M ?? null);
774
785
  }, [e, M]), Y(() => {
775
- const u = Dt.current, y = he.current, L = ce.current, $ = ue.current;
776
- if (!u || !y || !L || !$) return;
777
- e.bind(u, y, L, $);
778
- const D = y.getBoundingClientRect();
786
+ const u = Dt.current, w = ue.current, L = fe.current, F = me.current;
787
+ if (!u || !w || !L || !F) return;
788
+ e.bind(u, w, L, F);
789
+ const D = w.getBoundingClientRect();
779
790
  e.resize(D.width, D.height);
780
- const _ = new ResizeObserver((z) => {
781
- const Nt = z[z.length - 1]?.contentRect;
791
+ const _ = new ResizeObserver((W) => {
792
+ const Nt = W[W.length - 1]?.contentRect;
782
793
  Nt !== void 0 && e.resize(Nt.width, Nt.height);
783
794
  });
784
- _.observe(y);
795
+ _.observe(w);
785
796
  const P = document.createElement("div");
786
797
  P.setAttribute("aria-hidden", "true"), P.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(P);
787
- const H = () => e.setFontScale(rn(parseFloat(getComputedStyle(P).width)));
798
+ const H = () => e.setFontScale(hn(parseFloat(getComputedStyle(P).width)));
788
799
  H();
789
800
  const K = new ResizeObserver(H);
790
801
  K.observe(P);
791
- const st = (z) => e.wheel(z);
792
- u.addEventListener("wheel", st, { passive: !1 });
793
- const Se = (z) => e.touchMove(z);
794
- u.addEventListener("touchmove", Se, { passive: !1 });
795
- const Ie = (z) => {
796
- z.key === "Escape" && e.cancelEdit() && z.preventDefault();
802
+ const nt = (W) => e.wheel(W);
803
+ u.addEventListener("wheel", nt, { passive: !1 });
804
+ const Le = (W) => e.touchMove(W);
805
+ u.addEventListener("touchmove", Le, { passive: !1 });
806
+ const Ae = (W) => {
807
+ W.key === "Escape" && e.cancelEdit() && W.preventDefault();
797
808
  };
798
- return window.addEventListener("keydown", Ie), () => {
799
- window.removeEventListener("keydown", Ie), u.removeEventListener("wheel", st), u.removeEventListener("touchmove", Se), _.disconnect(), K.disconnect(), P.remove(), e.unbind();
809
+ return window.addEventListener("keydown", Ae), () => {
810
+ window.removeEventListener("keydown", Ae), u.removeEventListener("wheel", nt), u.removeEventListener("touchmove", Le), _.disconnect(), K.disconnect(), P.remove(), e.unbind();
800
811
  };
801
812
  }, [e]);
802
- const w = Jt(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: lt } = w, _t = Zn * lt, ys = Jn * lt, bs = Qn * lt, Ms = (u, y) => {
813
+ const v = te(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: dt } = v, _t = ei * dt, Ts = si * dt, Ss = ni * dt, Is = (u, w) => {
803
814
  const L = new Date(u);
804
- return y >= bs ? N.dateLong(L) : y >= ys ? N.date(L) : y >= _t ? N.dateShort(L) : "";
805
- }, Ts = w.days.reduce((u, y) => Math.max(u, y.width), 0), et = un(Ts, _t), ve = w.step >= J ? et : 1, ye = w.dataTable?.open === !0, T = w.ghost, G = w.spoken, Ot = w.summary, vt = (u) => `${N.dateShort(new Date(u))} ${j(N, u)}`, Ft = (u) => `${Ct}-row-${encodeURIComponent(u.key)}`, Ss = U(() => {
815
+ return w >= Ss ? N.dateLong(L) : w >= Ts ? N.date(L) : w >= _t ? N.dateShort(L) : "";
816
+ }, Ls = v.days.reduce((u, w) => Math.max(u, w.width), 0), st = pn(Ls, _t), be = v.step >= Q ? st : 1, Me = v.dataTable?.open === !0, T = v.ghost, G = v.spoken, Ot = v.summary, wt = (u) => `${N.dateShort(new Date(u))} ${V(N, u)}`, $t = (u) => `${At}-row-${encodeURIComponent(u.key)}`, As = X(() => {
806
817
  const u = /* @__PURE__ */ new Map();
807
- for (const y of w.headers)
808
- for (const L of y.within)
809
- y.kind === "groupHead" && L === y.group || u.set(L, [...u.get(L) ?? [], Ft(y)]);
818
+ for (const w of v.headers)
819
+ for (const L of w.within)
820
+ w.kind === "groupHead" && L === w.group || u.set(L, [...u.get(L) ?? [], $t(w)]);
810
821
  return u;
811
- }, [w.headers, Ct]), be = W(null);
812
- yt(() => {
813
- const u = be.current;
822
+ }, [v.headers, At]), Te = U(null);
823
+ bt(() => {
824
+ const u = Te.current;
814
825
  if (u === null) return;
815
- let y = !0;
826
+ let w = !0;
816
827
  const L = () => {
817
- if (!y) return;
828
+ if (!w) return;
818
829
  const _ = [...u.querySelectorAll("[data-lane-count]")];
819
830
  for (const H of _) H.hidden = !1;
820
831
  const P = _.some((H) => {
821
832
  const K = H.previousElementSibling;
822
833
  if (!(K instanceof HTMLElement)) return !1;
823
- const st = parseFloat(getComputedStyle(K).lineHeight);
824
- return K.scrollWidth > K.clientWidth || K.clientHeight > st * 1.5;
834
+ const nt = parseFloat(getComputedStyle(K).lineHeight);
835
+ return K.scrollWidth > K.clientWidth || K.clientHeight > nt * 1.5;
825
836
  });
826
837
  for (const H of _) H.hidden = P;
827
838
  };
828
839
  L(), document.fonts?.ready.then(L);
829
- const $ = new ResizeObserver(L);
830
- $.observe(u);
840
+ const F = new ResizeObserver(L);
841
+ F.observe(u);
831
842
  const D = new MutationObserver(L);
832
843
  return D.observe(u, { childList: !0, characterData: !0, subtree: !0 }), () => {
833
- y = !1, $.disconnect(), D.disconnect();
844
+ w = !1, F.disconnect(), D.disconnect();
834
845
  };
835
846
  }, []);
836
- const Is = U(() => new Set(T?.refusedLanes ?? []), [T?.refusedLanes]), Me = W(null), [$t, Ls] = ht({ x: 0, y: 0, at: "" }), Et = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.violated}:${T.refused}:${T.blocked}`;
837
- yt(() => {
838
- const u = Me.current;
847
+ const Cs = X(() => new Set(T?.refusedLanes ?? []), [T?.refusedLanes]), Se = U(null), [Ft, Ds] = ct({ x: 0, y: 0, at: "" }), Et = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.violated}:${T.refused}:${T.blocked}`;
848
+ bt(() => {
849
+ const u = Se.current;
839
850
  if (T === null || u === null) return;
840
- const y = 4, L = T.y - u.offsetHeight - y, $ = T.y + T.height + y, D = {
841
- x: Math.max(2, Math.min(T.x, w.width - u.offsetWidth - 2)),
842
- y: L >= 2 ? L : Math.min($, w.height - u.offsetHeight - 2),
851
+ const w = 4, L = T.y - u.offsetHeight - w, F = T.y + T.height + w, D = {
852
+ x: Math.max(2, Math.min(T.x, v.width - u.offsetWidth - 2)),
853
+ y: L >= 2 ? L : Math.min(F, v.height - u.offsetHeight - 2),
843
854
  at: Et
844
855
  };
845
- Ls((_) => _.x === D.x && _.y === D.y && _.at === D.at ? _ : D);
846
- }, [T, Et, w.width, w.height]);
847
- const Te = W(null), [Bt, Cs] = ht({ x: 0, y: 0, at: "" }), X = w.tooltip, xt = X === null ? "" : `${X.x}:${X.y}:${X.target.kind}`;
848
- return yt(() => {
849
- const u = Te.current;
850
- if (X === null || u === null) return;
851
- const y = 12, L = (D, _, P) => {
852
- const H = D + y, K = D - y - _, st = H + _ <= P - 4 || K < 4 ? H : K;
853
- return Math.max(4, Math.min(st, P - _ - 4));
854
- }, $ = {
855
- x: L(X.x, u.offsetWidth, w.width),
856
- y: L(X.y, u.offsetHeight, w.height),
856
+ Ds((_) => _.x === D.x && _.y === D.y && _.at === D.at ? _ : D);
857
+ }, [T, Et, v.width, v.height]);
858
+ const Ie = U(null), [Bt, _s] = ct({ x: 0, y: 0, at: "" }), q = v.tooltip, xt = q === null ? "" : `${q.x}:${q.y}:${q.target.kind}`;
859
+ return bt(() => {
860
+ const u = Ie.current;
861
+ if (q === null || u === null) return;
862
+ const w = 12, L = (D, _, P) => {
863
+ const H = D + w, K = D - w - _, nt = H + _ <= P - 4 || K < 4 ? H : K;
864
+ return Math.max(4, Math.min(nt, P - _ - 4));
865
+ }, F = {
866
+ x: L(q.x, u.offsetWidth, v.width),
867
+ y: L(q.y, u.offsetHeight, v.height),
857
868
  at: xt
858
869
  };
859
- Cs((D) => D.x === $.x && D.y === $.y && D.at === $.at ? D : $);
860
- }, [X, xt, w.width, w.height]), /* @__PURE__ */ p(ne, { value: e, children: /* @__PURE__ */ E(
870
+ _s((D) => D.x === F.x && D.y === F.y && D.at === F.at ? D : F);
871
+ }, [q, xt, v.width, v.height]), /* @__PURE__ */ m(oe, { value: e, children: /* @__PURE__ */ E(
861
872
  "div",
862
873
  {
863
- ...ks,
874
+ ...ws,
864
875
  ref: Dt,
865
876
  role: "figure",
866
877
  "data-schedule-clip": "schedule",
867
- ...de,
868
- className: gt ? `${g.root} ${gt}` : g.root,
869
- style: { ...a === void 0 ? { height: "100%", minHeight: 400 } : { height: `${a}px` }, gridTemplateColumns: `min(${l}px, 40%) minmax(0, 1fr)`, ...kt },
878
+ ...ce,
879
+ className: kt ? `${k.root} ${kt}` : k.root,
880
+ style: { ...a === void 0 ? { height: "100%", minHeight: 400 } : { height: `${a}px` }, gridTemplateColumns: `min(${l}px, max(120px, 28%)) minmax(0, 1fr)`, ...vt },
870
881
  children: [
871
- /* @__PURE__ */ p("div", { className: g.corner, children: wt !== null && /* @__PURE__ */ p("span", { className: g.zoneLabel, "data-schedule-overlay": "zone label", children: wt }) }),
872
- /* @__PURE__ */ p("div", { className: g.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: w.days.map((u, y) => {
873
- const L = et === 1 || y === 0 || Gt(u.start, et, rt, N.weekStart), $ = et === 1 ? u.x + u.width : w.days.slice(y + 1).find((P) => Gt(P.start, et, rt, N.weekStart))?.x ?? w.width, D = Math.max(0, -u.x), _ = Math.min($, w.width) - Math.max(u.x, 0);
874
- return /* @__PURE__ */ p("span", { className: g.day, style: { left: `${u.x}px`, width: `${L ? $ - u.x : u.width}px` }, children: /* @__PURE__ */ p("span", { className: g.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? Ms(u.start, et === 1 ? _ : Math.min(_, _t)) : "" }) }, u.start);
882
+ /* @__PURE__ */ m("div", { className: k.corner, children: yt !== null && /* @__PURE__ */ m("span", { className: k.zoneLabel, "data-schedule-overlay": "zone label", children: yt }) }),
883
+ /* @__PURE__ */ m("div", { className: k.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: v.days.map((u, w) => {
884
+ const L = st === 1 || w === 0 || Gt(u.start, st, lt, N.weekStart), F = st === 1 ? u.x + u.width : v.days.slice(w + 1).find((P) => Gt(P.start, st, lt, N.weekStart))?.x ?? v.width, D = Math.max(0, -u.x), _ = Math.min(F, v.width) - Math.max(u.x, 0);
885
+ return /* @__PURE__ */ m("span", { className: k.day, style: { left: `${u.x}px`, width: `${L ? F - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: k.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? Is(u.start, st === 1 ? _ : Math.min(_, _t)) : "" }) }, u.start);
875
886
  }) }),
876
- /* @__PURE__ */ p("div", { ref: be, className: g.headers, "data-schedule-headers": "", inert: ye || void 0, children: /* @__PURE__ */ E("div", { className: g.headerRun, style: { transform: `translateY(${-w.scrollY}px)` }, children: [
877
- q && w.headers.length === 0 && Array.from({ length: Math.floor(w.height / Math.round(r * lt)) }, (u, y) => /* @__PURE__ */ p("div", { className: g.header, style: { height: `${Math.round(r * lt)}px` }, children: /* @__PURE__ */ p(Ps, { width: "60%" }) }, y)),
878
- w.headers.map((u) => /* @__PURE__ */ E(
887
+ /* @__PURE__ */ m("div", { ref: Te, className: k.headers, "data-schedule-headers": "", inert: Me || void 0, children: /* @__PURE__ */ E("div", { className: k.headerRun, style: { transform: `translateY(${-v.scrollY}px)` }, children: [
888
+ J && v.headers.length === 0 && Array.from({ length: Math.floor(v.height / Math.round(r * dt)) }, (u, w) => /* @__PURE__ */ m("div", { className: k.header, style: { height: `${Math.round(r * dt)}px` }, children: /* @__PURE__ */ m(Hs, { width: "60%" }) }, w)),
889
+ v.headers.map((u) => /* @__PURE__ */ E(
879
890
  "div",
880
891
  {
881
- id: Ft(u),
882
- className: g.header,
892
+ id: $t(u),
893
+ className: k.header,
883
894
  style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
884
895
  "data-lane": u.lane,
885
896
  "data-group": u.group,
886
897
  "data-row": u.kind,
887
898
  "data-schedule-clip": `header ${u.kind}`,
888
- "data-refused": u.lane !== void 0 && Is.has(u.lane) ? "" : void 0,
899
+ "data-refused": u.lane !== void 0 && Cs.has(u.lane) ? "" : void 0,
889
900
  children: [
890
- u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ p(
901
+ u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ m(
891
902
  "button",
892
903
  {
893
904
  type: "button",
894
- className: g.chevron,
905
+ className: k.chevron,
895
906
  "data-schedule-overlay": "fold control",
896
907
  "aria-expanded": u.collapsed === !1,
897
- "aria-controls": (Ss.get(u.group) ?? [Ft(u)]).join(" "),
908
+ "aria-controls": (As.get(u.group) ?? [$t(u)]).join(" "),
898
909
  "aria-label": `${u.collapsed === !0 ? B.scheduleUnfoldGroup : B.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
899
910
  onClick: () => e.toggleGroup(u.group),
900
- children: /* @__PURE__ */ p(Rs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
911
+ children: /* @__PURE__ */ m(Ks, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
901
912
  }
902
913
  ),
903
- /* @__PURE__ */ p("span", { className: g.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
904
- u.kind !== "lane" && /* @__PURE__ */ p("span", { className: g.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: B.scheduleLaneCount(u.lanes) })
914
+ /* @__PURE__ */ m("span", { className: k.headerLabel, "data-schedule-overlay": "header label", title: typeof u.label == "string" ? u.label : void 0, children: u.label }),
915
+ u.kind !== "lane" && /* @__PURE__ */ m("span", { className: k.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: B.scheduleLaneCount(u.lanes) })
905
916
  ]
906
917
  },
907
918
  u.key
@@ -910,24 +921,24 @@ function ti(s) {
910
921
  /* @__PURE__ */ E(
911
922
  "div",
912
923
  {
913
- ref: he,
914
- className: g.plot,
924
+ ref: ue,
925
+ className: k.plot,
915
926
  "data-schedule-plot": "",
916
927
  "data-schedule-clip": "plot",
917
- style: { cursor: w.cursor },
918
- "aria-busy": q || void 0,
919
- inert: ye || void 0,
920
- "data-stale": w.loading && w.headers.length > 0 || void 0,
928
+ style: { cursor: v.cursor },
929
+ "aria-busy": J || void 0,
930
+ inert: Me || void 0,
931
+ "data-stale": v.loading && v.headers.length > 0 || void 0,
921
932
  tabIndex: 0,
922
933
  role: "application",
923
934
  "aria-roledescription": B.scheduleRoleDescription,
924
- ...de,
925
- "aria-label": n === void 0 ? void 0 : B.schedulePlotName(n),
926
- "aria-describedby": o ? `${At} ${o}` : At,
935
+ ...ce,
936
+ "aria-label": s === void 0 ? void 0 : B.schedulePlotName(s),
937
+ "aria-describedby": o ? `${Ct} ${o}` : Ct,
927
938
  onKeyDown: (u) => {
928
939
  e.key(u.nativeEvent) && u.preventDefault();
929
940
  },
930
- onFocus: (u) => e.focus(ei(u.currentTarget)),
941
+ onFocus: (u) => e.focus(oi(u.currentTarget)),
931
942
  onBlur: () => e.blur(),
932
943
  onPointerDown: (u) => e.pointerDown(u.nativeEvent),
933
944
  onPointerMove: (u) => e.pointerMove(u.nativeEvent),
@@ -938,42 +949,42 @@ function ti(s) {
938
949
  onDragOver: (u) => e.dragOver(u.nativeEvent),
939
950
  onDrop: (u) => e.drop(u.nativeEvent),
940
951
  onDragLeave: (u) => {
941
- const y = u.nativeEvent.relatedTarget;
942
- (!(y instanceof Node) || !u.currentTarget.contains(y)) && e.dragLeave();
952
+ const w = u.nativeEvent.relatedTarget;
953
+ (!(w instanceof Node) || !u.currentTarget.contains(w)) && e.dragLeave();
943
954
  },
944
955
  children: [
945
- /* @__PURE__ */ p("canvas", { ref: ce, className: g.layer, "aria-hidden": "true" }),
946
- /* @__PURE__ */ p("canvas", { ref: ue, className: g.layer, "aria-hidden": "true" }),
947
- w.grips.map((u) => /* @__PURE__ */ p(
956
+ /* @__PURE__ */ m("canvas", { ref: fe, className: k.layer, "aria-hidden": "true" }),
957
+ /* @__PURE__ */ m("canvas", { ref: me, className: k.layer, "aria-hidden": "true" }),
958
+ v.grips.map((u) => /* @__PURE__ */ m(
948
959
  "span",
949
960
  {
950
961
  "data-grip": u.kind,
951
962
  "data-schedule-overlay": `${u.kind} grip`,
952
963
  "aria-hidden": "true",
953
- className: g.grip,
964
+ className: k.grip,
954
965
  style: { left: `${u.x}px`, top: `${u.y}px`, height: `${u.height}px` }
955
966
  },
956
967
  u.kind
957
968
  )),
958
- F !== void 0 && w.bars.map((u) => /* @__PURE__ */ p(
969
+ $ !== void 0 && v.bars.map((u) => /* @__PURE__ */ m(
959
970
  "span",
960
971
  {
961
- className: g.barLabel,
972
+ className: k.barLabel,
962
973
  "data-bar-label": u.subtask.id,
963
974
  "data-schedule-overlay": "bar label",
964
975
  "data-schedule-may-cover": "",
965
976
  "data-on": u.dark ? "dark" : "light",
966
977
  style: { left: `${u.x}px`, top: `${u.y}px`, width: `${u.width}px`, height: `${u.height}px` },
967
- children: /* @__PURE__ */ p("span", { className: g.barLabelText, children: F(u.subtask) })
978
+ children: /* @__PURE__ */ m("span", { className: k.barLabelText, children: $(u.subtask) })
968
979
  },
969
980
  u.subtask.id
970
981
  )),
971
- O !== !1 && w.tooltip !== null && /* @__PURE__ */ p(
982
+ O !== !1 && v.tooltip !== null && /* @__PURE__ */ m(
972
983
  "span",
973
984
  {
974
- ref: Te,
985
+ ref: Ie,
975
986
  role: "tooltip",
976
- className: g.tooltip,
987
+ className: k.tooltip,
977
988
  "data-schedule-tooltip": "",
978
989
  "data-schedule-overlay": "tooltip",
979
990
  style: {
@@ -981,46 +992,46 @@ function ti(s) {
981
992
  top: `${Bt.y}px`,
982
993
  visibility: Bt.at === xt ? void 0 : "hidden"
983
994
  },
984
- children: typeof O == "function" ? O(w.tooltip.target) : /* @__PURE__ */ p(Xn, { target: w.tooltip.target })
995
+ children: typeof O == "function" ? O(v.tooltip.target) : /* @__PURE__ */ m(Jn, { target: v.tooltip.target })
985
996
  }
986
997
  ),
987
998
  T !== null && /* @__PURE__ */ E(
988
999
  "span",
989
1000
  {
990
- ref: Me,
991
- className: g.ghostLabel,
1001
+ ref: Se,
1002
+ className: k.ghostLabel,
992
1003
  "data-ghost": "",
993
1004
  "data-schedule-overlay": "ghost label",
994
1005
  "data-findings": [T.overlap ? "overlap" : "", T.violated ? "violated-dependency" : ""].filter(Boolean).join(" "),
995
1006
  "data-refused": T.refused ? "" : void 0,
996
1007
  "data-blocked": T.blocked ? "" : void 0,
997
1008
  style: {
998
- left: `${$t.x}px`,
999
- top: `${$t.y}px`,
1000
- visibility: $t.at === Et ? void 0 : "hidden"
1009
+ left: `${Ft.x}px`,
1010
+ top: `${Ft.y}px`,
1011
+ visibility: Ft.at === Et ? void 0 : "hidden"
1001
1012
  },
1002
1013
  children: [
1003
- B.scheduleGhostTimes(j(N, T.from), j(N, T.to)),
1004
- T.refused && /* @__PURE__ */ p("span", { className: g.refusal, children: B.scheduleLaneRefused }),
1005
- T.blocked && /* @__PURE__ */ p("span", { className: g.refusal, children: B.scheduleBlockedTime }),
1006
- T.overlap && /* @__PURE__ */ p("span", { className: g.finding, children: B.scheduleOverlap }),
1007
- T.violated && /* @__PURE__ */ p("span", { className: g.finding, children: B.scheduleViolatedDependency })
1014
+ B.scheduleGhostTimes(V(N, T.from), V(N, T.to)),
1015
+ T.refused && /* @__PURE__ */ m("span", { className: k.refusal, children: B.scheduleLaneRefused }),
1016
+ T.blocked && /* @__PURE__ */ m("span", { className: k.refusal, children: B.scheduleBlockedTime }),
1017
+ T.overlap && /* @__PURE__ */ m("span", { className: k.finding, children: B.scheduleOverlap }),
1018
+ T.violated && /* @__PURE__ */ m("span", { className: k.finding, children: B.scheduleViolatedDependency })
1008
1019
  ]
1009
1020
  }
1010
1021
  ),
1011
- /* @__PURE__ */ p("span", { className: g.focusRing, "aria-hidden": "true" })
1022
+ /* @__PURE__ */ m("span", { className: k.focusRing, "aria-hidden": "true" })
1012
1023
  ]
1013
1024
  }
1014
1025
  ),
1015
- /* @__PURE__ */ p("div", { className: `${g.corner} ${g.cornerBottom}` }),
1016
- /* @__PURE__ */ E("div", { className: g.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
1017
- w.now !== null && /* @__PURE__ */ p("span", { className: g.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${w.now}px` } }),
1018
- w.ticks.map((u) => /* @__PURE__ */ p("span", { className: g.tick, style: { left: `${u.x}px` }, children: u.x >= Ee && u.x <= w.width - Ee && (ve === 1 || Gt(u.wallClock, ve, rt, N.weekStart)) && /* @__PURE__ */ p("span", { className: g.tickLabel, "data-schedule-overlay": "time label", children: w.step >= J ? N.dateShort(new Date(u.wallClock)) : j(N, u.wallClock) }) }, u.wallClock))
1026
+ /* @__PURE__ */ m("div", { className: `${k.corner} ${k.cornerBottom}` }),
1027
+ /* @__PURE__ */ E("div", { className: k.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
1028
+ v.now !== null && /* @__PURE__ */ m("span", { className: k.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${v.now}px` } }),
1029
+ v.ticks.map((u) => /* @__PURE__ */ m("span", { className: k.tick, style: { left: `${u.x}px` }, children: u.x >= xe && u.x <= v.width - xe && (be === 1 || Gt(u.wallClock, be, lt, N.weekStart)) && /* @__PURE__ */ m("span", { className: k.tickLabel, "data-schedule-overlay": "time label", children: v.step >= Q ? N.dateShort(new Date(u.wallClock)) : V(N, u.wallClock) }) }, u.wallClock))
1019
1030
  ] }),
1020
- /* @__PURE__ */ E(Le, { "aria-live": "polite", children: [
1021
- G?.span !== void 0 && /* @__PURE__ */ p("span", { children: B.scheduleVisibleRange(vt(G.span[0]), vt(G.span[1])) }, G.count),
1022
- G !== null && G.target !== null && /* @__PURE__ */ p(
1023
- Un,
1031
+ /* @__PURE__ */ E(Ce, { "aria-live": "polite", children: [
1032
+ G?.span !== void 0 && /* @__PURE__ */ m("span", { children: B.scheduleVisibleRange(wt(G.span[0]), wt(G.span[1])) }, G.count),
1033
+ G !== null && G.target !== null && /* @__PURE__ */ m(
1034
+ Zn,
1024
1035
  {
1025
1036
  target: G.target,
1026
1037
  lane: G.lane === null ? null : e.data.lanes.find((u) => u.id === G.lane)?.label ?? G.lane
@@ -1028,22 +1039,22 @@ function ti(s) {
1028
1039
  G.count
1029
1040
  )
1030
1041
  ] }),
1031
- /* @__PURE__ */ p(Le, { id: At, children: w === e.getServerSnapshot() ? B.scheduleKeyHelp : `${B.scheduleSummary({ ...Ot, from: vt(Ot.from), to: vt(Ot.to) })}${wt === null ? "" : ` ${wt}.`} ${B.scheduleKeyHelp}` }),
1032
- gs
1042
+ /* @__PURE__ */ m(Ce, { id: Ct, children: v === e.getServerSnapshot() ? B.scheduleKeyHelp : `${B.scheduleSummary({ ...Ot, from: wt(Ot.from), to: wt(Ot.to) })}${yt === null ? "" : ` ${yt}.`} ${B.scheduleKeyHelp}` }),
1043
+ ys
1033
1044
  ]
1034
1045
  }
1035
1046
  ) });
1036
1047
  }
1037
- function ei(s) {
1048
+ function oi(n) {
1038
1049
  try {
1039
- return s.matches(":focus-visible");
1050
+ return n.matches(":focus-visible");
1040
1051
  } catch {
1041
1052
  return !0;
1042
1053
  }
1043
1054
  }
1044
- function si() {
1045
- const s = Ze(), t = Xs(s), e = St(), n = mt(), i = re(), o = Jt(
1046
- t?.subscribe ?? ni,
1055
+ function ai() {
1056
+ const n = Qe(), t = Zs(n), e = pt(), s = rt(), i = de(), o = te(
1057
+ t?.subscribe ?? ri,
1047
1058
  t?.getSnapshot ?? (() => null),
1048
1059
  t?.getServerSnapshot ?? (() => null)
1049
1060
  );
@@ -1051,96 +1062,96 @@ function si() {
1051
1062
  const a = o?.dataTable?.open === !0;
1052
1063
  let r = null;
1053
1064
  if (a && o !== null) {
1054
- const { from: l, to: d } = o.summary, { data: h } = t, c = (f) => `${e.dateShort(new Date(f))} ${j(e, f)}`, m = new Map(h.lanes.map((f, v) => [f.id, v])), k = h.subtasks.filter((f) => {
1055
- const v = Q(f);
1056
- return m.has(f.lane) && v.to >= l && v.from <= d;
1057
- }).sort((f, v) => m.get(f.lane) - m.get(v.lane) || f.from - v.from);
1058
- r = /* @__PURE__ */ E("table", { className: g.dataTable, children: [
1059
- /* @__PURE__ */ p("caption", { children: n.scheduleTableCaption(c(l), c(d)) }),
1060
- /* @__PURE__ */ p("thead", { children: /* @__PURE__ */ p("tr", { children: [
1061
- n.scheduleColumnLane,
1062
- n.scheduleColumnTask,
1063
- n.scheduleColumnSubtask,
1064
- n.scheduleColumnFrom,
1065
- n.scheduleColumnTo,
1066
- n.scheduleColumnDuration,
1067
- n.scheduleColumnFindings
1068
- ].map((f) => /* @__PURE__ */ p("th", { scope: "col", children: f }, f)) }) }),
1069
- /* @__PURE__ */ p("tbody", { children: k.map((f) => {
1070
- const v = h.tooltipTargetFor({ kind: "subtask", subtask: f, part: "main" }), C = v?.kind !== "subtask" ? [] : [
1071
- ...v.overlapping.map((M) => n.scheduleOverlapWith(M.name ?? M.id)),
1072
- ...v.violatedDependencies.map((M) => n.scheduleViolatedBy(i(M.shortBy))),
1073
- ...v.blocked.map((M) => n.scheduleInBlockedTime(M.label))
1074
- ], A = [
1065
+ const { from: l, to: d } = o.summary, { data: c } = t, h = (f) => `${e.dateShort(new Date(f))} ${V(e, f)}`, p = new Map(c.lanes.map((f, y) => [f.id, y])), g = c.subtasks.filter((f) => {
1066
+ const y = tt(f);
1067
+ return p.has(f.lane) && y.to >= l && y.from <= d;
1068
+ }).sort((f, y) => p.get(f.lane) - p.get(y.lane) || f.from - y.from);
1069
+ r = /* @__PURE__ */ E("table", { className: k.dataTable, children: [
1070
+ /* @__PURE__ */ m("caption", { children: s.scheduleTableCaption(h(l), h(d)) }),
1071
+ /* @__PURE__ */ m("thead", { children: /* @__PURE__ */ m("tr", { children: [
1072
+ s.scheduleColumnLane,
1073
+ s.scheduleColumnTask,
1074
+ s.scheduleColumnSubtask,
1075
+ s.scheduleColumnFrom,
1076
+ s.scheduleColumnTo,
1077
+ s.scheduleColumnDuration,
1078
+ s.scheduleColumnFindings
1079
+ ].map((f) => /* @__PURE__ */ m("th", { scope: "col", children: f }, f)) }) }),
1080
+ /* @__PURE__ */ m("tbody", { children: g.map((f) => {
1081
+ const y = c.tooltipTargetFor({ kind: "subtask", subtask: f, part: "main" }), A = y?.kind !== "subtask" ? [] : [
1082
+ ...y.overlapping.map((M) => s.scheduleOverlapWith(M.name ?? M.id)),
1083
+ ...y.violatedDependencies.map((M) => s.scheduleViolatedBy(i(M.shortBy))),
1084
+ ...y.blocked.map((M) => s.scheduleInBlockedTime(M.label))
1085
+ ], C = [
1075
1086
  i(f.to - f.from),
1076
- ...(f.leadIn ?? 0) > 0 ? [`${n.scheduleLeadIn} ${i(f.leadIn)}`] : [],
1077
- ...(f.leadOut ?? 0) > 0 ? [`${n.scheduleLeadOut} ${i(f.leadOut)}`] : []
1087
+ ...(f.leadIn ?? 0) > 0 ? [`${s.scheduleLeadIn} ${i(f.leadIn)}`] : [],
1088
+ ...(f.leadOut ?? 0) > 0 ? [`${s.scheduleLeadOut} ${i(f.leadOut)}`] : []
1078
1089
  ].join(", ");
1079
1090
  return /* @__PURE__ */ E("tr", { children: [
1080
- /* @__PURE__ */ p("td", { children: h.lanes.find((M) => M.id === f.lane)?.label }),
1081
- /* @__PURE__ */ p("td", { children: h.tasks.get(f.task)?.name ?? f.task }),
1082
- /* @__PURE__ */ p("th", { scope: "row", children: f.name ?? f.id }),
1083
- /* @__PURE__ */ p("td", { children: c(f.from) }),
1084
- /* @__PURE__ */ p("td", { children: c(f.to) }),
1085
- /* @__PURE__ */ p("td", { children: A }),
1086
- /* @__PURE__ */ p("td", { children: C.join("; ") })
1091
+ /* @__PURE__ */ m("td", { children: c.lanes.find((M) => M.id === f.lane)?.label }),
1092
+ /* @__PURE__ */ m("td", { children: c.tasks.get(f.task)?.name ?? f.task }),
1093
+ /* @__PURE__ */ m("th", { scope: "row", children: f.name ?? f.id }),
1094
+ /* @__PURE__ */ m("td", { children: h(f.from) }),
1095
+ /* @__PURE__ */ m("td", { children: h(f.to) }),
1096
+ /* @__PURE__ */ m("td", { children: C }),
1097
+ /* @__PURE__ */ m("td", { children: A.join("; ") })
1087
1098
  ] }, f.id);
1088
1099
  }) })
1089
1100
  ] });
1090
1101
  }
1091
1102
  return /* @__PURE__ */ E(ot, { children: [
1092
- /* @__PURE__ */ p(
1103
+ /* @__PURE__ */ m(
1093
1104
  "button",
1094
1105
  {
1095
1106
  type: "button",
1096
- className: g.dataKey,
1107
+ className: k.dataKey,
1097
1108
  "data-schedule-overlay": "data key",
1098
1109
  "aria-expanded": a,
1099
- "aria-controls": a ? s : void 0,
1110
+ "aria-controls": a ? n : void 0,
1100
1111
  onClick: () => t.toggleDataTable(),
1101
- children: a ? n.scheduleHideData : n.scheduleShowData
1112
+ children: a ? s.scheduleHideData : s.scheduleShowData
1102
1113
  }
1103
1114
  ),
1104
1115
  a && // A tab stop of its own: the panel scrolls, and a keyboard has to be
1105
1116
  // able to scroll it.
1106
- /* @__PURE__ */ p("div", { id: s, className: g.dataPanel, tabIndex: 0, children: r })
1117
+ /* @__PURE__ */ m("div", { id: n, className: k.dataPanel, tabIndex: 0, children: r })
1107
1118
  ] });
1108
1119
  }
1109
- const ni = () => () => {
1120
+ const ri = () => () => {
1110
1121
  };
1111
- function ii({ id: s, label: t }) {
1112
- const e = es(), n = U(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
1113
- return Ws(n), null;
1122
+ function li({ id: n, label: t }) {
1123
+ const e = ns(), s = X(() => ({ id: n, label: t ?? n, ...e === null ? {} : { parent: e } }), [n, t, e]);
1124
+ return qs(s), null;
1114
1125
  }
1115
- function oi({ id: s, label: t, children: e }) {
1116
- const n = es(), i = U(() => ({ id: s, label: t ?? s, ...n === null ? {} : { parent: n } }), [s, t, n]);
1117
- return Us(i), /* @__PURE__ */ p(ts, { value: s, children: e });
1126
+ function di({ id: n, label: t, children: e }) {
1127
+ const s = ns(), i = X(() => ({ id: n, label: t ?? n, ...s === null ? {} : { parent: s } }), [n, t, s]);
1128
+ return js(i), /* @__PURE__ */ m(ss, { value: n, children: e });
1118
1129
  }
1119
- function ai({ data: s, tasks: t }) {
1120
- const e = U(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
1130
+ function hi({ data: n, tasks: t }) {
1131
+ const e = X(() => ({ kind: "subtasks", data: n, tasks: t }), [n, t]);
1121
1132
  return Lt("Subtasks", e), null;
1122
1133
  }
1123
- function ri({ data: s }) {
1124
- const t = U(() => ({ kind: "dependencies", data: s }), [s]);
1134
+ function ci({ data: n }) {
1135
+ const t = X(() => ({ kind: "dependencies", data: n }), [n]);
1125
1136
  return Lt("Dependencies", t), null;
1126
1137
  }
1127
- function li({ data: s }) {
1128
- const t = U(() => ({ kind: "blocked", data: s }), [s]);
1138
+ function ui({ data: n }) {
1139
+ const t = X(() => ({ kind: "blocked", data: n }), [n]);
1129
1140
  return Lt("BlockedTimes", t), null;
1130
1141
  }
1131
- function di({ data: s }) {
1132
- const t = U(() => ({ kind: "milestones", data: s }), [s]);
1142
+ function fi({ data: n }) {
1143
+ const t = X(() => ({ kind: "milestones", data: n }), [n]);
1133
1144
  return Lt("Milestones", t), null;
1134
1145
  }
1135
- function hi() {
1146
+ function mi() {
1136
1147
  try {
1137
1148
  return process.env.NODE_ENV !== "production";
1138
1149
  } catch {
1139
1150
  return !1;
1140
1151
  }
1141
1152
  }
1142
- const ci = hi(), ui = "@umriss-ui/schedule", nt = (s, t) => Gs(ui, s, t);
1143
- class fi {
1153
+ const Ut = mi(), pi = "@umriss-ui/schedule", j = (n, t) => Ys(pi, n, t);
1154
+ class gi {
1144
1155
  /** `changed` is called after every registration change. */
1145
1156
  constructor(t) {
1146
1157
  this.changed = t;
@@ -1206,14 +1217,21 @@ class fi {
1206
1217
  rebuild() {
1207
1218
  if (!this.dirty) return !1;
1208
1219
  this.dirty = !1;
1209
- const t = (e) => [...e.keys()].sort((n, i) => n - i).map((n) => e.get(n));
1210
- this.lanes = t(this.laneEntries), this.groups = t(this.groupEntries), this.layers = t(this.layerEntries), this.subtasks = [], this.dependencies = [], this.blocked = [], this.milestones = [], this.tasks = /* @__PURE__ */ new Map();
1211
- for (const e of this.layers)
1212
- if (e.kind === "subtasks") {
1213
- this.subtasks.push(...e.data);
1214
- for (const n of e.tasks) this.tasks.set(n.id, n);
1215
- } else e.kind === "dependencies" ? this.dependencies.push(...e.data) : e.kind === "milestones" ? this.milestones.push(...e.data) : this.blocked.push(...e.data);
1216
- return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = ee(this.subtasks), this.violatedById = new Map(se(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Ys(this.subtasks), this.inBlocked = Qe(this.subtasks, this.blocked), this.unchecked = !0, !0;
1220
+ const t = (s) => [...s.keys()].sort((i, o) => i - o).map((i) => s.get(i));
1221
+ this.lanes = t(this.laneEntries), this.groups = t(this.groupEntries);
1222
+ const e = (s) => {
1223
+ if (!(!Array.isArray(s.data) || s.kind === "subtasks" && !Array.isArray(s.tasks))) return s;
1224
+ Ut && j(`array:${s.kind}`, `the ${s.kind} layer's data${s.kind === "subtasks" ? " and tasks" : ""} must be arrays, not ${typeof s.data}; what is not an array is not drawn.`);
1225
+ const o = Array.isArray(s.data) ? s.data : [];
1226
+ return s.kind === "subtasks" ? { ...s, data: o, tasks: Array.isArray(s.tasks) ? s.tasks : [] } : { ...s, data: o };
1227
+ };
1228
+ this.layers = t(this.layerEntries).map(e), this.subtasks = [], this.dependencies = [], this.blocked = [], this.milestones = [], this.tasks = /* @__PURE__ */ new Map();
1229
+ for (const s of this.layers)
1230
+ if (s.kind === "subtasks") {
1231
+ this.subtasks.push(...s.data);
1232
+ for (const i of s.tasks) this.tasks.set(i.id, i);
1233
+ } else s.kind === "dependencies" ? this.dependencies.push(...s.data) : s.kind === "milestones" ? this.milestones.push(...s.data) : this.blocked.push(...s.data);
1234
+ return this.subtaskById = new Map(this.subtasks.map((s) => [s.id, s])), this.overlaps = ne(this.subtasks), this.violatedById = new Map(ie(this.subtasks, this.dependencies).map((s) => [s.dependency, s])), this.depth = Ws(this.subtasks), this.inBlocked = es(this.subtasks, this.blocked), this.unchecked = !0, !0;
1217
1235
  }
1218
1236
  /** Says in development what the data gets wrong and is drawn, dropped or
1219
1237
  counted regardless. The Schedule calls it from an effect of its own,
@@ -1222,32 +1240,32 @@ class fi {
1222
1240
  missing. With no lane declared the lanes are still on their way, and an
1223
1241
  empty `tasks` is a plan drawn muted on purpose. */
1224
1242
  warnOfMalformedData() {
1225
- if (!this.unchecked || (this.unchecked = !1, !ci)) return;
1243
+ if (!this.unchecked || (this.unchecked = !1, !Ut)) return;
1226
1244
  const t = (i, o) => {
1227
1245
  const a = /* @__PURE__ */ new Set();
1228
1246
  for (const r of o)
1229
- a.has(r) && nt(`twice:${i}:${r}`, `the ${i} id "${r}" stands twice; give each ${i} an id of its own, or only the first is found.`), a.add(r);
1247
+ a.has(r) && j(`twice:${i}:${r}`, `the ${i} id "${r}" stands twice; give each ${i} an id of its own, or only the first is found.`), a.add(r);
1230
1248
  };
1231
1249
  t("subtask", this.subtasks.map((i) => i.id)), t("dependency", this.dependencies.map((i) => i.id)), t("lane", this.lanes.map((i) => i.id));
1232
1250
  for (const i of this.subtasks) {
1233
1251
  const o = (a) => typeof a != "number" || a !== 0 && Math.abs(a) < 1e11;
1234
- (o(i.from) || o(i.to)) && nt(`ms:${i.id}`, `subtask "${i.id}" has from: ${String(i.from)}, to: ${String(i.to)}, which are not times in milliseconds since 1970 (as Date.getTime() gives); a string, a Date or seconds are not drawn. Pass date.getTime().`), i.to > i.from || nt(`span:${i.id}`, `subtask "${i.id}" does not end after it starts (from ${i.from}, to ${i.to}); a point in time is a Milestone, and a span with no length is drawn as a hairline.`);
1252
+ (o(i.from) || o(i.to)) && j(`ms:${i.id}`, `subtask "${i.id}" has from: ${String(i.from)}, to: ${String(i.to)}, which are not times in milliseconds since 1970 (as Date.getTime() gives); a string, a Date or seconds are not drawn. Pass date.getTime().`), i.to > i.from || j(`span:${i.id}`, `subtask "${i.id}" does not end after it starts (from ${i.from}, to ${i.to}); a point in time is a Milestone, and a span with no length is drawn as a hairline.`);
1235
1253
  }
1236
1254
  for (const i of this.layers) {
1237
1255
  if (i.kind !== "subtasks" || i.tasks.length === 0) continue;
1238
1256
  const o = new Set(i.tasks.map((a) => a.id));
1239
1257
  for (const a of i.data)
1240
- o.has(a.task) || nt(`task:${a.id}`, `subtask "${a.id}" names the task "${a.task}", which is not among the tasks of its Subtasks layer; it is drawn muted. Add the task, or correct the subtask's task.`);
1258
+ o.has(a.task) || j(`task:${a.id}`, `subtask "${a.id}" names the task "${a.task}", which is not among the tasks of its Subtasks layer; it is drawn muted. Add the task, or correct the subtask's task.`);
1241
1259
  }
1242
1260
  for (const i of this.dependencies)
1243
1261
  for (const o of [i.from, i.to])
1244
- this.subtaskById.has(o) || nt(`end:${i.id}:${o}`, `dependency "${i.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
1262
+ this.subtaskById.has(o) || j(`end:${i.id}:${o}`, `dependency "${i.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
1245
1263
  if (this.lanes.length === 0) return;
1246
- const e = new Set(this.lanes.map((i) => i.id)), n = (i, o) => {
1264
+ const e = new Set(this.lanes.map((i) => i.id)), s = (i, o) => {
1247
1265
  for (const { id: a, lane: r } of o)
1248
- e.has(r) || nt(`lane:${i}:${a}`, `${i} "${a}" is on the lane "${r}", which no Lane declares; it is left out. Declare <Lane id="${r}" />.`);
1266
+ e.has(r) || j(`lane:${i}:${a}`, `${i} "${a}" is on the lane "${r}", which no Lane declares; it is left out. Declare <Lane id="${r}" />.`);
1249
1267
  };
1250
- n("subtask", this.subtasks), n("milestone", this.milestones), n("blocked time", this.blocked);
1268
+ s("subtask", this.subtasks), s("milestone", this.milestones), s("blocked time", this.blocked);
1251
1269
  }
1252
1270
  /** The task a dependency belongs to: its departing subtask's. */
1253
1271
  taskOfDependency(t) {
@@ -1262,71 +1280,71 @@ class fi {
1262
1280
  }
1263
1281
  if (t.kind === "milestone") return { kind: "milestone", milestone: t.milestone };
1264
1282
  if (t.kind !== "dependency") return null;
1265
- const e = t.dependency, n = this.taskOfDependency(e);
1283
+ const e = t.dependency, s = this.taskOfDependency(e);
1266
1284
  return {
1267
1285
  kind: "dependency",
1268
1286
  dependency: e,
1269
- task: n !== null ? this.tasks.get(n) : void 0,
1287
+ task: s !== null ? this.tasks.get(s) : void 0,
1270
1288
  from: this.subtaskById.get(e.from),
1271
1289
  to: this.subtaskById.get(e.to),
1272
1290
  violated: this.violatedById.get(e.id)
1273
1291
  };
1274
1292
  }
1275
1293
  }
1276
- const mi = 6;
1277
- function ds(s, t, e, n, i, o) {
1278
- s.save(), s.beginPath(), s.rect(t, e, n, i), s.clip(), s.globalAlpha = 0.35, s.strokeStyle = o, s.lineWidth = 1, s.beginPath();
1279
- for (let a = t - i; a < t + n + i; a += mi)
1280
- s.moveTo(a, e + i), s.lineTo(a + i, e);
1281
- s.stroke(), s.restore();
1294
+ const ki = 6;
1295
+ function us(n, t, e, s, i, o) {
1296
+ n.save(), n.beginPath(), n.rect(t, e, s, i), n.clip(), n.globalAlpha = 0.35, n.strokeStyle = o, n.lineWidth = 1, n.beginPath();
1297
+ for (let a = t - i; a < t + s + i; a += ki)
1298
+ n.moveTo(a, e + i), n.lineTo(a + i, e);
1299
+ n.stroke(), n.restore();
1282
1300
  }
1283
- function pi(s, t, e, n) {
1284
- if (n.size === 0) return;
1301
+ function vi(n, t, e, s) {
1302
+ if (s.size === 0) return;
1285
1303
  const { width: i, height: o } = t.view;
1286
- for (const a of n) {
1287
- const r = tt(e, a);
1304
+ for (const a of s) {
1305
+ const r = et(e, a);
1288
1306
  if (r === null) continue;
1289
1307
  const { top: l, height: d } = r;
1290
- l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, i, d), s.globalAlpha = 1, ds(s, 0, l, i, d, t.colours.muted));
1308
+ l + d < 0 || l > o || (n.globalAlpha = 0.6, n.fillStyle = t.colours.surface, n.fillRect(0, l, i, d), n.globalAlpha = 1, us(n, 0, l, i, d, t.colours.muted));
1291
1309
  }
1292
1310
  }
1293
- function gi(s, t, e) {
1294
- const { data: n } = t;
1295
- if (n.violatedById.size !== 0)
1296
- for (const i of n.violatedById.values()) {
1297
- const o = n.dependencies.find((c) => c.id === i.dependency), a = o === void 0 ? void 0 : n.subtaskById.get(o.to);
1311
+ function yi(n, t, e) {
1312
+ const { data: s } = t;
1313
+ if (s.violatedById.size !== 0)
1314
+ for (const i of s.violatedById.values()) {
1315
+ const o = s.dependencies.find((h) => h.id === i.dependency), a = o === void 0 ? void 0 : s.subtaskById.get(o.to);
1298
1316
  if (a === void 0) continue;
1299
- const r = tt(e, a.lane);
1317
+ const r = et(e, a.lane);
1300
1318
  if (r === null || !r.miniature) continue;
1301
1319
  const l = at(e.rows, r.top + e.scrollY);
1302
1320
  if (l === null) continue;
1303
- const d = x(e, i.arrival), h = Math.max(d + 2, x(e, i.arrival + i.shortBy));
1304
- Wt(s, t, d, h, l.top - e.scrollY + 1, 3);
1321
+ const d = x(e, i.arrival), c = Math.max(d + 2, x(e, i.arrival + i.shortBy));
1322
+ Xt(n, t, d, c, l.top - e.scrollY + 1, 3);
1305
1323
  }
1306
1324
  }
1307
- function Wt(s, t, e, n, i, o) {
1325
+ function Xt(n, t, e, s, i, o) {
1308
1326
  if (!t.colours.forced) {
1309
- s.fillStyle = t.colours.alarm, s.fillRect(e, i, n - e, o);
1327
+ n.fillStyle = t.colours.alarm, n.fillRect(e, i, s - e, o);
1310
1328
  return;
1311
1329
  }
1312
- s.strokeStyle = t.colours.alarm, s.lineWidth = o, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, i + o / 2), s.lineTo(n, i + o / 2), s.stroke(), s.setLineDash([]);
1330
+ n.strokeStyle = t.colours.alarm, n.lineWidth = o, n.setLineDash([4, 3]), n.beginPath(), n.moveTo(e, i + o / 2), n.lineTo(s, i + o / 2), n.stroke(), n.setLineDash([]);
1313
1331
  }
1314
- function ki(s, t, e, n) {
1315
- const i = tt(e, n.lane);
1332
+ function wi(n, t, e, s) {
1333
+ const i = et(e, s.lane);
1316
1334
  if (i === null || i.top + i.height < 0 || i.top > t.view.height) return;
1317
- const o = Math.max(0, x(e, n.from)), a = Math.min(t.view.width, x(e, n.to));
1318
- a <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, a - o, i.height), s.globalAlpha = 1, ds(s, o, i.top, a - o, i.height, t.colours.muted));
1335
+ const o = Math.max(0, x(e, s.from)), a = Math.min(t.view.width, x(e, s.to));
1336
+ a <= o || (n.globalAlpha = 0.1, n.fillStyle = t.colours.muted, n.fillRect(o, i.top, a - o, i.height), n.globalAlpha = 1, us(n, o, i.top, a - o, i.height, t.colours.muted));
1319
1337
  }
1320
- function Ut(s, t, e, n) {
1321
- const i = tt(e, n.lane);
1338
+ function qt(n, t, e, s) {
1339
+ const i = et(e, s.lane);
1322
1340
  if (i === null) return;
1323
- const o = x(e, n.from), a = Math.max(o + 2, x(e, n.to));
1324
- if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, i.top + 1, a - o, Math.max(1, i.height - 2)), s.globalAlpha = 1, Wt(s, t, o, a, i.top + 1, Math.min(3, Math.max(1, i.height - 1))), i.miniature) {
1341
+ const o = x(e, s.from), a = Math.max(o + 2, x(e, s.to));
1342
+ if (n.fillStyle = t.colours.alarm, n.globalAlpha = 0.14, n.fillRect(o, i.top + 1, a - o, Math.max(1, i.height - 2)), n.globalAlpha = 1, Xt(n, t, o, a, i.top + 1, Math.min(3, Math.max(1, i.height - 1))), i.miniature) {
1325
1343
  const r = at(e.rows, i.top + e.scrollY);
1326
- r !== null && Wt(s, t, o, a, r.top - e.scrollY + 1, 3);
1344
+ r !== null && Xt(n, t, o, a, r.top - e.scrollY + 1, 3);
1327
1345
  }
1328
1346
  }
1329
- const wi = {
1347
+ const bi = {
1330
1348
  line: "var(--u-hairline)",
1331
1349
  lineStrong: "var(--u-hairline-strong)",
1332
1350
  text: "var(--u-color-text)",
@@ -1340,7 +1358,7 @@ const wi = {
1340
1358
  /* What text and marks take ON a filled bar - the same token the bar labels
1341
1359
  use in CSS, so a cap and the label beside it are one colour. */
1342
1360
  onAccent: "var(--u-color-on-accent)"
1343
- }, hs = {
1361
+ }, fs = {
1344
1362
  line: "GrayText",
1345
1363
  lineStrong: "CanvasText",
1346
1364
  text: "CanvasText",
@@ -1350,11 +1368,11 @@ const wi = {
1350
1368
  active: "Highlight",
1351
1369
  now: "GrayText",
1352
1370
  onAccent: "Canvas"
1353
- }, vi = (s) => s ? hs : wi, yi = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1354
- function bi(s, t) {
1355
- const e = yi(), n = {};
1356
- for (const a of t.tasks.values()) n[`task:${a.id}`] = e ? hs.text : a.color;
1357
- const i = Fs(s, { ...vi(e), ...n }), o = /* @__PURE__ */ new Map();
1371
+ }, Mi = (n) => n ? fs : bi, Ti = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1372
+ function Si(n, t) {
1373
+ const e = Ti(), s = {};
1374
+ for (const a of t.tasks.values()) s[`task:${a.id}`] = e ? fs.text : a.color;
1375
+ const i = Bs(n, { ...Mi(e), ...s }), o = /* @__PURE__ */ new Map();
1358
1376
  for (const a of t.tasks.values()) o.set(a.id, i[`task:${a.id}`] ?? a.color);
1359
1377
  return {
1360
1378
  line: i.line,
@@ -1370,277 +1388,277 @@ function bi(s, t) {
1370
1388
  forced: e
1371
1389
  };
1372
1390
  }
1373
- function ft(s) {
1374
- const t = s.match(/[\d.]+/g);
1391
+ function mt(n) {
1392
+ const t = n.match(/[\d.]+/g);
1375
1393
  return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
1376
1394
  }
1377
- function Be(s) {
1378
- const t = ft(s);
1379
- return t === null ? 0 : us(cs(t));
1395
+ function Ne(n) {
1396
+ const t = mt(n);
1397
+ return t === null ? 0 : ps(ms(t));
1380
1398
  }
1381
- function cs(s) {
1382
- return s.map((t) => {
1399
+ function ms(n) {
1400
+ return n.map((t) => {
1383
1401
  const e = t / 255;
1384
1402
  return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
1385
1403
  });
1386
1404
  }
1387
- function us([s, t, e]) {
1388
- return 0.2126 * s + 0.7152 * t + 0.0722 * e;
1389
- }
1390
- function xe(s, t) {
1391
- const e = Be(s), n = Be(t);
1392
- return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
1393
- }
1394
- function Ne(s, t, e) {
1395
- if (s === null) return null;
1396
- const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * n), o = Math.round(e * n);
1397
- s.width !== i && (s.width = i), s.height !== o && (s.height = o);
1398
- const a = s.getContext("2d");
1399
- return a === null ? null : (a.setTransform(n, 0, 0, n, 0, 0), a.clearRect(0, 0, t, e), a);
1400
- }
1401
- function Mi(s, t) {
1402
- const { data: e, view: n } = t, i = n.viewport();
1403
- Ii(s, t, i);
1404
- for (const o of e.blocked) ki(s, t, i, o);
1405
- Li(s, t);
1405
+ function ps([n, t, e]) {
1406
+ return 0.2126 * n + 0.7152 * t + 0.0722 * e;
1407
+ }
1408
+ function Pe(n, t) {
1409
+ const e = Ne(n), s = Ne(t);
1410
+ return (Math.max(e, s) + 0.05) / (Math.min(e, s) + 0.05);
1411
+ }
1412
+ function Re(n, t, e) {
1413
+ if (n === null) return null;
1414
+ const s = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * s), o = Math.round(e * s);
1415
+ n.width !== i && (n.width = i), n.height !== o && (n.height = o);
1416
+ const a = n.getContext("2d");
1417
+ return a === null ? null : (a.setTransform(s, 0, 0, s, 0, 0), a.clearRect(0, 0, t, e), a);
1418
+ }
1419
+ function Ii(n, t) {
1420
+ const { data: e, view: s } = t, i = s.viewport();
1421
+ Ci(n, t, i);
1422
+ for (const o of e.blocked) wi(n, t, i, o);
1423
+ Di(n, t);
1406
1424
  for (const o of e.layers) {
1407
1425
  if (o.kind === "blocked" || o.kind === "milestones") continue;
1408
1426
  const a = new Set(o.data);
1409
1427
  if (o.kind === "dependencies")
1410
- for (const r of n.paths) a.has(r.dependency) && en(r, n.width, n.height) && Xt(s, t, r, !1);
1428
+ for (const r of s.paths) a.has(r.dependency) && on(r, s.width, s.height) && jt(n, t, r, !1);
1411
1429
  else
1412
- for (const r of n.boxes) a.has(r.subtask) && ms(s, t, r, 1);
1430
+ for (const r of s.boxes) a.has(r.subtask) && ks(n, t, r, 1);
1413
1431
  }
1414
- for (const o of e.overlaps) Ut(s, t, i, o);
1415
- for (const o of e.inBlocked) Ut(s, t, i, o);
1416
- gi(s, t, i);
1417
- for (const o of e.milestones) ps(s, t, i, o, !1);
1418
- Ei(s, t);
1432
+ for (const o of e.overlaps) qt(n, t, i, o);
1433
+ for (const o of e.inBlocked) qt(n, t, i, o);
1434
+ yi(n, t, i);
1435
+ for (const o of e.milestones) vs(n, t, i, o, !1);
1436
+ Ni(n, t);
1419
1437
  }
1420
- function Ti(s, t) {
1421
- const { view: e, hover: n } = t, i = e.viewport();
1438
+ function Li(n, t) {
1439
+ const { view: e, hover: s } = t, i = e.viewport();
1422
1440
  if (t.ghost === null) {
1423
- if (n.kind === "subtask") {
1424
- const c = e.boxById.get(n.subtask.id);
1425
- c !== void 0 && Fi(s, t, c);
1426
- } else if (n.kind === "dependency") {
1427
- const c = e.paths.find((m) => m.dependency === n.dependency);
1428
- c !== void 0 && Xt(s, t, c, !0);
1429
- } else n.kind === "milestone" && ps(s, t, i, n.milestone, !0);
1441
+ if (s.kind === "subtask") {
1442
+ const h = e.boxById.get(s.subtask.id);
1443
+ h !== void 0 && Bi(n, t, h);
1444
+ } else if (s.kind === "dependency") {
1445
+ const h = e.paths.find((p) => p.dependency === s.dependency);
1446
+ h !== void 0 && jt(n, t, h, !0);
1447
+ } else s.kind === "milestone" && vs(n, t, i, s.milestone, !0);
1430
1448
  return;
1431
1449
  }
1432
1450
  const o = t.ghost, { ghost: a, overlaps: r, violated: l } = o;
1433
- pi(s, t, i, o.refusedLanes);
1434
- const d = fs(i, a);
1451
+ vi(n, t, i, o.refusedLanes);
1452
+ const d = gs(i, a);
1435
1453
  if (d === null) return;
1436
- for (const c of r) Ut(s, t, i, c);
1437
- const h = new Set(l.map((c) => c.dependency));
1438
- for (const c of t.data.dependencies) {
1439
- if (c.from !== a.id && c.to !== a.id) continue;
1440
- const m = e.boxById.get(c.from === a.id ? c.to : c.from);
1441
- if (m === void 0) continue;
1442
- const k = c.from === a.id ? Vt(i, c, d, m, e.options) : Vt(i, c, m, d, e.options);
1443
- Xt(s, t, k, !0, h.has(c.id));
1444
- }
1445
- ms(s, { ...t, selectedTask: null }, d, 0.55), s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([3, 2]), s.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), s.setLineDash([]), o.tether !== null && Si(s, t, d, o.tether);
1446
- }
1447
- function Si(s, t, e, n) {
1448
- const i = Math.max(e.outerFrom, Math.min(e.outerTo, n.x)), o = Math.max(e.y, Math.min(e.y + e.height, n.y));
1449
- Math.hypot(n.x - i, n.y - o) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(i + 0.5, o + 0.5), s.lineTo(n.x + 0.5, n.y + 0.5), s.stroke(), s.setLineDash([]));
1450
- }
1451
- function fs(s, t) {
1452
- const e = oe(s.rows, t.lane);
1453
- return e === null ? null : is(s, t, e, 0);
1454
- }
1455
- function Ii(s, t, e) {
1456
- const { view: n, colours: i, bands: o } = t, { width: a, height: r } = n;
1457
- s.lineWidth = 1, s.strokeStyle = i.line, s.beginPath();
1458
- for (const h of o.ticks)
1459
- s.moveTo(h.x + 0.5, 0), s.lineTo(h.x + 0.5, r);
1460
- for (const h of e.rows.rows) {
1461
- const c = h.top + h.height - e.scrollY - 0.5;
1462
- c < 0 || c > r || (s.moveTo(0, c), s.lineTo(a, c));
1463
- }
1464
- const l = [...e.rows.slots.values()].filter((h) => h.miniature).sort((h, c) => h.top - c.top);
1465
- l.forEach((h, c) => {
1466
- const m = l[c + 1];
1467
- if (m === void 0 || m.top !== h.top + h.height || m.group === h.group) return;
1468
- const k = h.top + h.height - e.scrollY - 0.5;
1469
- k < 0 || k > r || (s.moveTo(0, k), s.lineTo(a, k));
1470
- }), s.stroke(), s.strokeStyle = i.lineStrong, s.beginPath();
1471
- for (const h of o.days)
1472
- s.moveTo(h.x + 0.5, 0), s.lineTo(h.x + 0.5, r);
1473
- s.stroke();
1474
- const d = $s(n.options.calendar);
1454
+ for (const h of r) qt(n, t, i, h);
1455
+ const c = new Set(l.map((h) => h.dependency));
1456
+ for (const h of t.data.dependencies) {
1457
+ if (h.from !== a.id && h.to !== a.id) continue;
1458
+ const p = e.boxById.get(h.from === a.id ? h.to : h.from);
1459
+ if (p === void 0) continue;
1460
+ const g = h.from === a.id ? zt(i, h, d, p, e.options) : zt(i, h, p, d, e.options);
1461
+ jt(n, t, g, !0, c.has(h.id));
1462
+ }
1463
+ ks(n, { ...t, selectedTask: null }, d, 0.55), n.strokeStyle = t.colours.text, n.lineWidth = 1, n.setLineDash([3, 2]), n.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), n.setLineDash([]), o.tether !== null && Ai(n, t, d, o.tether);
1464
+ }
1465
+ function Ai(n, t, e, s) {
1466
+ const i = Math.max(e.outerFrom, Math.min(e.outerTo, s.x)), o = Math.max(e.y, Math.min(e.y + e.height, s.y));
1467
+ Math.hypot(s.x - i, s.y - o) < 2 || (n.strokeStyle = t.colours.text, n.lineWidth = 1, n.setLineDash([2, 3]), n.beginPath(), n.moveTo(i + 0.5, o + 0.5), n.lineTo(s.x + 0.5, s.y + 0.5), n.stroke(), n.setLineDash([]));
1468
+ }
1469
+ function gs(n, t) {
1470
+ const e = re(n.rows, t.lane);
1471
+ return e === null ? null : as(n, t, e, 0);
1472
+ }
1473
+ function Ci(n, t, e) {
1474
+ const { view: s, colours: i, bands: o } = t, { width: a, height: r } = s;
1475
+ n.lineWidth = 1, n.strokeStyle = i.line, n.beginPath();
1476
+ for (const c of o.ticks)
1477
+ n.moveTo(c.x + 0.5, 0), n.lineTo(c.x + 0.5, r);
1478
+ for (const c of e.rows.rows) {
1479
+ const h = c.top + c.height - e.scrollY - 0.5;
1480
+ h < 0 || h > r || (n.moveTo(0, h), n.lineTo(a, h));
1481
+ }
1482
+ const l = [...e.rows.slots.values()].filter((c) => c.miniature).sort((c, h) => c.top - h.top);
1483
+ l.forEach((c, h) => {
1484
+ const p = l[h + 1];
1485
+ if (p === void 0 || p.top !== c.top + c.height || p.group === c.group) return;
1486
+ const g = c.top + c.height - e.scrollY - 0.5;
1487
+ g < 0 || g > r || (n.moveTo(0, g), n.lineTo(a, g));
1488
+ }), n.stroke(), n.strokeStyle = i.lineStrong, n.beginPath();
1489
+ for (const c of o.days)
1490
+ n.moveTo(c.x + 0.5, 0), n.lineTo(c.x + 0.5, r);
1491
+ n.stroke();
1492
+ const d = xs(s.options.calendar);
1475
1493
  if (d.length > 0) {
1476
- s.strokeStyle = i.muted, s.setLineDash([2, 3]), s.beginPath();
1477
- for (const h of d) {
1478
- const c = Math.round(e.scale.toPx(h.workingTime)) + 0.5;
1479
- c < 0 || c > a || (s.moveTo(c, 0), s.lineTo(c, r));
1494
+ n.strokeStyle = i.muted, n.setLineDash([2, 3]), n.beginPath();
1495
+ for (const c of d) {
1496
+ const h = Math.round(e.scale.toPx(c.workingTime)) + 0.5;
1497
+ h < 0 || h > a || (n.moveTo(h, 0), n.lineTo(h, r));
1480
1498
  }
1481
- s.stroke(), s.setLineDash([]);
1499
+ n.stroke(), n.setLineDash([]);
1482
1500
  }
1483
1501
  }
1484
- function Li(s, t) {
1502
+ function Di(n, t) {
1485
1503
  const e = t.view.nowX();
1486
- e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
1504
+ e !== null && (n.fillStyle = t.colours.now, n.fillRect(e, 0, 2, t.view.height));
1487
1505
  }
1488
- function Ci(s, t, e, n) {
1489
- const i = pt(t.colours, t, e.subtask.task, e.subtask.id);
1490
- s.fillStyle = i;
1506
+ function _i(n, t, e, s) {
1507
+ const i = gt(t.colours, t, e.subtask.task, e.subtask.id);
1508
+ n.fillStyle = i;
1491
1509
  for (const [o, a] of [
1492
1510
  [e.outerFrom, e.mainFrom],
1493
1511
  [e.mainTo, e.outerTo]
1494
1512
  ])
1495
- a <= o || (s.globalAlpha = 0.28 * n, s.fillRect(o, e.y, a - o, e.height));
1496
- s.globalAlpha = n, s.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), s.globalAlpha = 1;
1497
- }
1498
- function le(s, t, e) {
1499
- if (s.dashed) return { fill: null, onDark: !1 };
1500
- const n = s.muted ? Ai(t, e.surface, 0.5) : t;
1501
- return { fill: n, onDark: xe(n, e.onAccent) > xe(n, e.text) };
1502
- }
1503
- function Ai(s, t, e) {
1504
- const n = ft(s), i = ft(t);
1505
- if (n === null || i === null) return s;
1506
- const o = (a) => Math.round(n[a] + (i[a] - n[a]) * e);
1513
+ a <= o || (n.globalAlpha = 0.28 * s, n.fillRect(o, e.y, a - o, e.height));
1514
+ n.globalAlpha = s, n.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), n.globalAlpha = 1;
1515
+ }
1516
+ function he(n, t, e) {
1517
+ if (n.dashed) return { fill: null, onDark: !1 };
1518
+ const s = n.muted ? Oi(t, e.surface, 0.5) : t;
1519
+ return { fill: s, onDark: Pe(s, e.onAccent) > Pe(s, e.text) };
1520
+ }
1521
+ function Oi(n, t, e) {
1522
+ const s = mt(n), i = mt(t);
1523
+ if (s === null || i === null) return n;
1524
+ const o = (a) => Math.round(s[a] + (i[a] - s[a]) * e);
1507
1525
  return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
1508
1526
  }
1509
- function Pe(s, t) {
1510
- const e = ft(s);
1511
- if (e === null || t === 0) return s;
1512
- const n = cs(e), i = us(n), [o, a, r] = n.map((l) => {
1513
- const d = l + (i - l) * t, h = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
1514
- return Math.round(Math.min(1, Math.max(0, h)) * 255);
1527
+ function Ge(n, t) {
1528
+ const e = mt(n);
1529
+ if (e === null || t === 0) return n;
1530
+ const s = ms(e), i = ps(s), [o, a, r] = s.map((l) => {
1531
+ const d = l + (i - l) * t, c = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
1532
+ return Math.round(Math.min(1, Math.max(0, c)) * 255);
1515
1533
  });
1516
1534
  return `rgb(${o}, ${a}, ${r})`;
1517
1535
  }
1518
- function pt(s, t, e, n) {
1519
- const i = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
1520
- return t.selectedTask === null ? i : e !== t.selectedTask ? s.forced ? s.muted : Pe(i, 1) : s.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? i : Pe(i, 0.5);
1536
+ function gt(n, t, e, s) {
1537
+ const i = (e === null ? void 0 : n.tasks.get(e)) ?? n.muted;
1538
+ return t.selectedTask === null ? i : e !== t.selectedTask ? n.forced ? n.muted : Ge(i, 1) : n.forced || t.selectedSubtask === null || s === null || s === t.selectedSubtask ? i : Ge(i, 0.5);
1521
1539
  }
1522
- const Di = 2;
1523
- function ms(s, t, e, n) {
1540
+ const $i = 2;
1541
+ function ks(n, t, e, s) {
1524
1542
  const { view: i, colours: o } = t;
1525
- if (!Yt(e, i.width, i.height)) return;
1543
+ if (!Vt(e, i.width, i.height)) return;
1526
1544
  if (e.miniature) {
1527
- Ci(s, t, e, n);
1545
+ _i(n, t, e, s);
1528
1546
  return;
1529
1547
  }
1530
- const a = It(e.subtask.appearance), r = pt(o, t, e.subtask.task, e.subtask.id), l = le(a, r, o), d = e.y, h = e.height, c = Math.max(1, e.mainTo - e.mainFrom), m = l.onDark ? o.onAccent : o.text;
1531
- s.lineWidth = 1, s.fillStyle = r, s.strokeStyle = r;
1532
- for (const [f, v] of [
1548
+ const a = It(e.subtask.appearance), r = gt(o, t, e.subtask.task, e.subtask.id), l = he(a, r, o), d = e.y, c = e.height, h = Math.max(1, e.mainTo - e.mainFrom), p = l.onDark ? o.onAccent : o.text;
1549
+ n.lineWidth = 1, n.fillStyle = r, n.strokeStyle = r;
1550
+ for (const [f, y] of [
1533
1551
  [e.outerFrom, e.mainFrom],
1534
1552
  [e.mainTo, e.outerTo]
1535
1553
  ])
1536
- v <= f || (s.globalAlpha = 0.28 * n, s.fillRect(f, d, v - f, h), s.globalAlpha = n, s.strokeRect(f + 0.5, d + 0.5, v - f - 1, h - 1));
1537
- l.fill !== null && (s.globalAlpha = n, s.fillStyle = l.fill, s.fillRect(e.mainFrom, d, c, h));
1538
- const k = e.subtask.progress;
1539
- if (k !== void 0) {
1540
- const f = Math.min(4, Math.max(2, Math.round(h / 6))), v = d + h - f - Di, C = Math.round(c * Math.max(0, Math.min(1, k)));
1541
- s.fillStyle = l.fill === null ? r : m, s.globalAlpha = 0.3 * n, s.fillRect(e.mainFrom, v, c, f), s.globalAlpha = n, C > 0 && s.fillRect(e.mainFrom, v, C, f);
1554
+ y <= f || (n.globalAlpha = 0.28 * s, n.fillRect(f, d, y - f, c), n.globalAlpha = s, n.strokeRect(f + 0.5, d + 0.5, y - f - 1, c - 1));
1555
+ l.fill !== null && (n.globalAlpha = s, n.fillStyle = l.fill, n.fillRect(e.mainFrom, d, h, c));
1556
+ const g = e.subtask.progress;
1557
+ if (g !== void 0) {
1558
+ const f = Math.min(4, Math.max(2, Math.round(c / 6))), y = d + c - f - $i, A = Math.round(h * Math.max(0, Math.min(1, g)));
1559
+ n.fillStyle = l.fill === null ? r : p, n.globalAlpha = 0.3 * s, n.fillRect(e.mainFrom, y, h, f), n.globalAlpha = s, A > 0 && n.fillRect(e.mainFrom, y, A, f);
1542
1560
  }
1543
1561
  if (a.hatched) {
1544
- const f = Math.max(1, Math.min(ns, Math.floor((c - 2 * dt) / 3))), v = c >= 4 * f ? dt : 0, C = h >= 4 * dt ? dt : 0;
1545
- s.globalAlpha = n, s.fillStyle = m, s.fillRect(e.mainFrom + v, d + C, f, h - 2 * C), s.fillRect(e.mainTo - v - f, d + C, f, h - 2 * C);
1562
+ const f = Math.max(1, Math.min(os, Math.floor((h - 2 * ht) / 3))), y = h >= 4 * f ? ht : 0, A = c >= 4 * ht ? ht : 0;
1563
+ n.globalAlpha = s, n.fillStyle = p, n.fillRect(e.mainFrom + y, d + A, f, c - 2 * A), n.fillRect(e.mainTo - y - f, d + A, f, c - 2 * A);
1546
1564
  }
1547
- a.open && Oi(s, e, d, h, o.surface, i.width), a.dashed && (s.globalAlpha = n, s.strokeStyle = r, s.setLineDash([4, 3]), s.strokeRect(e.mainFrom + 0.5, d + 0.5, c - 1, h - 1), s.setLineDash([])), s.globalAlpha = 1, e.depth > 0 && n === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, h + 1));
1565
+ a.open && Ei(n, e, d, c, o.surface, i.width), a.dashed && (n.globalAlpha = s, n.strokeStyle = r, n.setLineDash([4, 3]), n.strokeRect(e.mainFrom + 0.5, d + 0.5, h - 1, c - 1), n.setLineDash([])), n.globalAlpha = 1, e.depth > 0 && s === 1 && (n.strokeStyle = o.surface, n.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, c + 1));
1548
1566
  }
1549
- const _i = 16;
1550
- function Oi(s, t, e, n, i, o) {
1551
- const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(_i, l);
1552
- a && Re(s, 0, d, e, n, i), r && Re(s, o, -d, e, n, i);
1567
+ const Fi = 16;
1568
+ function Ei(n, t, e, s, i, o) {
1569
+ const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(Fi, l);
1570
+ a && He(n, 0, d, e, s, i), r && He(n, o, -d, e, s, i);
1553
1571
  }
1554
- function Re(s, t, e, n, i, o) {
1555
- const a = s.createLinearGradient(t, 0, t + e, 0);
1556
- a.addColorStop(0, Ge(o, 1)), a.addColorStop(1, Ge(o, 0)), s.globalAlpha = 1, s.fillStyle = a, s.fillRect(Math.min(t, t + e), n, Math.abs(e), i);
1572
+ function He(n, t, e, s, i, o) {
1573
+ const a = n.createLinearGradient(t, 0, t + e, 0);
1574
+ a.addColorStop(0, Ke(o, 1)), a.addColorStop(1, Ke(o, 0)), n.globalAlpha = 1, n.fillStyle = a, n.fillRect(Math.min(t, t + e), s, Math.abs(e), i);
1557
1575
  }
1558
- function Ge(s, t) {
1559
- const e = ft(s);
1560
- return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
1576
+ function Ke(n, t) {
1577
+ const e = mt(n);
1578
+ return e === null ? n : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
1561
1579
  }
1562
- function Xt(s, t, e, n, i) {
1563
- const { data: o, colours: a } = t, r = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = r !== null && r === t.selectedTask, h = l ? a.alarm : pt(a, t, r, null);
1564
- if (s.strokeStyle = h, s.fillStyle = h, s.lineWidth = n || d ? 2 : 1.25, s.setLineDash(l ? [4, 3] : []), s.beginPath(), s.moveTo(e.x1, e.y1), e.kind === "curve")
1565
- s.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
1580
+ function jt(n, t, e, s, i) {
1581
+ const { data: o, colours: a } = t, r = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = r !== null && r === t.selectedTask, c = l ? a.alarm : gt(a, t, r, null);
1582
+ if (n.strokeStyle = c, n.fillStyle = c, n.lineWidth = s || d ? 2 : 1.25, n.setLineDash(l ? [4, 3] : []), n.beginPath(), n.moveTo(e.x1, e.y1), e.kind === "curve")
1583
+ n.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
1566
1584
  else
1567
- for (let c = 2; c + 1 < e.points.length; c += 2) s.lineTo(e.points[c], e.points[c + 1]);
1568
- if (s.stroke(), s.setLineDash([]), e.ends === "dot")
1569
- for (const [c, m] of [
1585
+ for (let h = 2; h + 1 < e.points.length; h += 2) n.lineTo(e.points[h], e.points[h + 1]);
1586
+ if (n.stroke(), n.setLineDash([]), e.ends === "dot")
1587
+ for (const [h, p] of [
1570
1588
  [e.x1, e.y1],
1571
1589
  [e.x2, e.y2]
1572
1590
  ])
1573
- s.beginPath(), s.arc(c, m, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
1591
+ n.beginPath(), n.arc(h, p, l ? 3 : 2.5, 0, Math.PI * 2), n.fill();
1574
1592
  }
1575
- function ps(s, t, e, n, i) {
1576
- const o = ae(e, n);
1593
+ function vs(n, t, e, s, i) {
1594
+ const o = le(e, s);
1577
1595
  if (o === null || o.x < -o.half || o.x > t.view.width + o.half) return;
1578
1596
  const a = (r) => {
1579
- s.beginPath(), s.moveTo(o.x, o.y - r), s.lineTo(o.x + r, o.y), s.lineTo(o.x, o.y + r), s.lineTo(o.x - r, o.y), s.closePath();
1597
+ n.beginPath(), n.moveTo(o.x, o.y - r), n.lineTo(o.x + r, o.y), n.lineTo(o.x, o.y + r), n.lineTo(o.x - r, o.y), n.closePath();
1580
1598
  };
1581
- i && (a(o.half + 3), s.fillStyle = t.colours.active, s.fill()), a(o.half + 1), s.fillStyle = t.colours.surface, s.fill(), a(o.half), s.fillStyle = t.colours.text, s.fill();
1599
+ i && (a(o.half + 3), n.fillStyle = t.colours.active, n.fill()), a(o.half + 1), n.fillStyle = t.colours.surface, n.fill(), a(o.half), n.fillStyle = t.colours.text, n.fill();
1582
1600
  }
1583
- function Fi(s, t, e) {
1584
- const { colours: n } = t, i = It(e.subtask.appearance), o = le(i, pt(n, t, e.subtask.task, e.subtask.id), n);
1585
- if (n.forced) {
1586
- s.strokeStyle = n.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
1601
+ function Bi(n, t, e) {
1602
+ const { colours: s } = t, i = It(e.subtask.appearance), o = he(i, gt(s, t, e.subtask.task, e.subtask.id), s);
1603
+ if (s.forced) {
1604
+ n.strokeStyle = s.active, n.lineWidth = 2, n.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
1587
1605
  return;
1588
1606
  }
1589
- s.globalAlpha = $i, s.fillStyle = o.onDark ? n.onAccent : n.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
1607
+ n.globalAlpha = xi, n.fillStyle = o.onDark ? s.onAccent : s.text, n.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), n.globalAlpha = 1;
1590
1608
  }
1591
- const $i = 0.2;
1592
- function Ei(s, t) {
1609
+ const xi = 0.2;
1610
+ function Ni(n, t) {
1593
1611
  const e = t.selectedTask;
1594
1612
  if (e !== null) {
1595
- s.strokeStyle = t.colours.text;
1596
- for (const n of t.view.boxes) {
1597
- if (n.subtask.task !== e) continue;
1598
- const i = n.subtask.id === t.selectedSubtask;
1599
- s.lineWidth = i ? 2 : 1;
1613
+ n.strokeStyle = t.colours.text;
1614
+ for (const s of t.view.boxes) {
1615
+ if (s.subtask.task !== e) continue;
1616
+ const i = s.subtask.id === t.selectedSubtask;
1617
+ n.lineWidth = i ? 2 : 1;
1600
1618
  const o = i ? 1 : 0.5;
1601
- s.strokeRect(n.outerFrom - o, n.y - o, n.outerTo - n.outerFrom + 2 * o, n.height + 2 * o);
1619
+ n.strokeRect(s.outerFrom - o, s.y - o, s.outerTo - s.outerFrom + 2 * o, s.height + 2 * o);
1602
1620
  }
1603
1621
  }
1604
1622
  }
1605
- const bt = 32, Bi = 18;
1606
- function He(s, t) {
1607
- if (!(t > 2 * bt)) return 0;
1608
- const e = bt - s, n = s - (t - bt), i = Math.max(e, n);
1623
+ const Mt = 32, Pi = 18;
1624
+ function Ye(n, t) {
1625
+ if (!(t > 2 * Mt)) return 0;
1626
+ const e = Mt - n, s = n - (t - Mt), i = Math.max(e, s);
1609
1627
  if (i <= 0) return 0;
1610
- const o = Math.min(1, i / bt), a = Bi * o * o;
1628
+ const o = Math.min(1, i / Mt), a = Pi * o * o;
1611
1629
  return e > 0 ? -a : a;
1612
1630
  }
1613
- function ct(s, t, e) {
1614
- const n = (i, o) => {
1615
- const a = Q(i);
1631
+ function ut(n, t, e) {
1632
+ const s = (i, o) => {
1633
+ const a = tt(i);
1616
1634
  return i.lane === o.lane && a.from < o.to && o.from < a.to;
1617
1635
  };
1618
- return e.some((i) => n(s, i) && !(t !== null && n(t, i)));
1636
+ return e.some((i) => s(n, i) && !(t !== null && s(t, i)));
1619
1637
  }
1620
- function xi(s, t, e, n) {
1638
+ function Ri(n, t, e, s) {
1621
1639
  const i = /* @__PURE__ */ new Set();
1622
- if (n === void 0) return i;
1623
- for (const o of s)
1624
- o !== e && (n(t, o) || i.add(o));
1640
+ if (s === void 0) return i;
1641
+ for (const o of n)
1642
+ o !== e && (s(t, o) || i.add(o));
1625
1643
  return i;
1626
1644
  }
1627
- const Ke = "\0placing", Ye = /* @__PURE__ */ new Set();
1628
- function Ht(s) {
1629
- switch (s.kind) {
1645
+ const Ve = "\0placing", ze = /* @__PURE__ */ new Set();
1646
+ function Ht(n) {
1647
+ switch (n.kind) {
1630
1648
  case "subtask":
1631
- return `subtask:${s.subtask.id}:${s.part}`;
1649
+ return `subtask:${n.subtask.id}:${n.part}`;
1632
1650
  case "dependency":
1633
- return `dependency:${s.dependency.id}`;
1651
+ return `dependency:${n.dependency.id}`;
1634
1652
  case "milestone":
1635
- return `milestone:${s.milestone.id}`;
1653
+ return `milestone:${n.milestone.id}`;
1636
1654
  case "lane":
1637
- return `lane:${s.lane}`;
1655
+ return `lane:${n.lane}`;
1638
1656
  default:
1639
1657
  return "nothing";
1640
1658
  }
1641
1659
  }
1642
- const Ve = 3, Ni = 10, Pi = 600;
1643
- class Ri {
1660
+ const We = 3, Gi = 10, Hi = 600;
1661
+ class Ki {
1644
1662
  constructor(t) {
1645
1663
  this.host = t;
1646
1664
  }
@@ -1667,7 +1685,7 @@ class Ri {
1667
1685
  /** The finger's long press, armed by a touch on a bar that may be moved.
1668
1686
  `armed` is whether the press may still turn into a grab - and, once it
1669
1687
  has, whether the `contextmenu` Android fires for it is the grab's. */
1670
- press = Hs((t) => this.grab(t));
1688
+ press = Vs((t) => this.grab(t));
1671
1689
  armed = !1;
1672
1690
  hover = { kind: "nothing" };
1673
1691
  /** Where the pointer rests on the plot while nothing is being dragged - or,
@@ -1706,9 +1724,9 @@ class Ri {
1706
1724
  ghostSummary() {
1707
1725
  const t = this.gesture;
1708
1726
  if (t.kind !== "edit" && t.kind !== "place") return null;
1709
- const e = fs(this.host.view.viewport(), t.ghost);
1727
+ const e = gs(this.host.view.viewport(), t.ghost);
1710
1728
  if (e === null) return null;
1711
- const n = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ? Q(t.ghost) : t.ghost;
1729
+ const s = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ? tt(t.ghost) : t.ghost;
1712
1730
  return {
1713
1731
  refused: this.refused,
1714
1732
  refusedLanes: [...t.refused],
@@ -1718,34 +1736,34 @@ class Ri {
1718
1736
  height: e.height,
1719
1737
  from: o.from,
1720
1738
  to: o.to,
1721
- overlap: n.overlaps.length > 0,
1722
- violated: n.violated.length > 0
1739
+ overlap: s.overlaps.length > 0,
1740
+ violated: s.violated.length > 0
1723
1741
  };
1724
1742
  }
1725
1743
  /* ---------------------------------------------------------------- */
1726
1744
  /* Pointer */
1727
1745
  /* ---------------------------------------------------------------- */
1728
1746
  local(t, e) {
1729
- const n = this.host.plotElement()?.getBoundingClientRect();
1730
- return { x: t - (n?.left ?? 0), y: e - (n?.top ?? 0) };
1747
+ const s = this.host.plotElement()?.getBoundingClientRect();
1748
+ return { x: t - (s?.left ?? 0), y: e - (s?.top ?? 0) };
1731
1749
  }
1732
- report(t, e, n, i, o, a) {
1750
+ report(t, e, s, i, o, a) {
1733
1751
  const r = this.host.view;
1734
- this.host.handlers().onInteraction?.({ type: t, hit: e, clientX: n, clientY: i, time: r.timeAt(o), lane: r.laneIdAt(a) });
1752
+ this.host.handlers().onInteraction?.({ type: t, hit: e, clientX: s, clientY: i, time: r.timeAt(o), lane: r.laneIdAt(a) });
1735
1753
  }
1736
1754
  /** The plan is on its way: no drag, no hover, no placing begins. One under
1737
1755
  way finishes and reports as usual. */
1738
1756
  loading = !1;
1739
1757
  pointerDown(t) {
1740
1758
  if (this.loading) return;
1741
- const { x: e, y: n } = this.local(t.clientX, t.clientY);
1742
- if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: n }), this.touches.size >= 2)) {
1759
+ const { x: e, y: s } = this.local(t.clientX, t.clientY);
1760
+ if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: s }), this.touches.size >= 2)) {
1743
1761
  this.press.dispose(), this.armed = !1, this.gesture.kind !== "pinch" && (this.cancelEdit(), this.gesture = { kind: "pinch", distance: this.touchDistance() });
1744
1762
  return;
1745
1763
  }
1746
1764
  if (t.button !== 0) return;
1747
1765
  const i = t.target?.closest?.("[data-grip]")?.getAttribute("data-grip"), o = this.host.selectedSubtask(), a = o !== null ? this.host.data.subtaskById.get(o) ?? null : null;
1748
- t.pointerType === "touch" ? (this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: "pan", subtask: null }, this.armed = this.modeAt(e, n).mode === "move", this.press.pointerDown(t)) : (i === "leadIn" || i === "leadOut") && a !== null ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: i, subtask: a } : this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, ...this.modeAt(e, n) }, this.host.plotElement()?.setPointerCapture?.(t.pointerId);
1766
+ t.pointerType === "touch" ? (this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, mode: "pan", subtask: null }, this.armed = this.modeAt(e, s).mode === "move", this.press.pointerDown(t)) : (i === "leadIn" || i === "leadOut") && a !== null ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, mode: i, subtask: a } : this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, ...this.modeAt(e, s) }, this.host.plotElement()?.setPointerCapture?.(t.pointerId);
1749
1767
  }
1750
1768
  /** A drag over a folded group: resting on one opens it for the GESTURE.
1751
1769
 
@@ -1755,12 +1773,12 @@ class Ri {
1755
1773
  never written to and no change is reported, because the application did
1756
1774
  not fold anything (ADR-0025). */
1757
1775
  restOver(t) {
1758
- const e = this.host.view, n = e.foldedGroupAt(t);
1759
- n !== this.resting?.group && (this.stopResting(), n !== null && (this.resting = {
1760
- group: n,
1776
+ const e = this.host.view, s = e.foldedGroupAt(t);
1777
+ s !== this.resting?.group && (this.stopResting(), s !== null && (this.resting = {
1778
+ group: s,
1761
1779
  timer: setTimeout(() => {
1762
- this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, n]), this.host.viewChanged();
1763
- }, Pi)
1780
+ this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, s]), this.host.viewChanged();
1781
+ }, Hi)
1764
1782
  }));
1765
1783
  }
1766
1784
  stopResting() {
@@ -1788,64 +1806,64 @@ class Ri {
1788
1806
  gesture that cannot change a lane at all asks nothing: the intents the
1789
1807
  caller handles decide whether the question exists. */
1790
1808
  askRefused(t, e) {
1791
- if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return Ye;
1792
- const n = this.host.data.lanes.map((i) => i.id);
1793
- return xi(n, t, e, this.host.handlers().canMoveTo);
1809
+ if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return ze;
1810
+ const s = this.host.data.lanes.map((i) => i.id);
1811
+ return Ri(s, t, e, this.host.handlers().canMoveTo);
1794
1812
  }
1795
1813
  /** What a press at a point would start, given the intents the caller handles. */
1796
1814
  modeAt(t, e) {
1797
- const n = this.host.view, i = n.options.intents;
1798
- if (n.hitAt(t, e).kind === "milestone") return { mode: "pan", subtask: null };
1799
- for (let o = n.boxes.length - 1; o >= 0; o--) {
1800
- const a = n.boxes[o];
1815
+ const s = this.host.view, i = s.options.intents;
1816
+ if (s.hitAt(t, e).kind === "milestone") return { mode: "pan", subtask: null };
1817
+ for (let o = s.boxes.length - 1; o >= 0; o--) {
1818
+ const a = s.boxes[o];
1801
1819
  if (i.includes("stretch")) {
1802
- const r = tn(a, t, e);
1820
+ const r = nn(a, t, e);
1803
1821
  if (r !== null) return { mode: r === "from" ? "stretch-from" : "stretch-to", subtask: a.subtask };
1804
1822
  }
1805
- if (os(a, t, e) !== null)
1823
+ if (rs(a, t, e) !== null)
1806
1824
  return i.includes("move") || i.includes("lane") ? { mode: "move", subtask: a.subtask } : { mode: "pan", subtask: a.subtask };
1807
1825
  }
1808
1826
  return { mode: "pan", subtask: null };
1809
1827
  }
1810
1828
  pointerMove(t) {
1811
- const { x: e, y: n } = this.local(t.clientX, t.clientY);
1812
- if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y: n }), this.press.pointerMove(t), this.gesture.kind === "pinch")) {
1829
+ const { x: e, y: s } = this.local(t.clientX, t.clientY);
1830
+ if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y: s }), this.press.pointerMove(t), this.gesture.kind === "pinch")) {
1813
1831
  const a = this.touchDistance();
1814
1832
  a > 0 && this.gesture.distance > 0 && this.host.view.zoomAt(this.touchCentre(), this.gesture.distance / a) && this.host.viewMoved(!0), this.gesture = { kind: "pinch", distance: a };
1815
1833
  return;
1816
1834
  }
1817
1835
  const i = this.gesture;
1818
1836
  if (i.kind === "pending" && i.pointerId === t.pointerId) {
1819
- if (Math.hypot(e - i.x0, n - i.y0) < (t.pointerType === "touch" ? Ni : Ve)) return;
1837
+ if (Math.hypot(e - i.x0, s - i.y0) < (t.pointerType === "touch" ? Gi : We)) return;
1820
1838
  i.mode === "pan" || i.subtask === null ? (this.gesture = { kind: "pan", pointerId: i.pointerId, lastX: i.x0, lastY: i.y0 }, this.setCursor("grabbing")) : this.startEdit(i, i.mode, i.subtask);
1821
1839
  }
1822
1840
  const o = this.gesture;
1823
1841
  if (o.kind === "pan" && o.pointerId === t.pointerId) {
1824
- const a = this.host.view.pan(o.lastX - e, o.lastY - n);
1825
- a.moved && this.host.viewMoved(a.time), this.gesture = { ...o, lastX: e, lastY: n };
1842
+ const a = this.host.view.pan(o.lastX - e, o.lastY - s);
1843
+ a.moved && this.host.viewMoved(a.time), this.gesture = { ...o, lastX: e, lastY: s };
1826
1844
  return;
1827
1845
  }
1828
1846
  if (o.kind === "edit" && o.pointerId === t.pointerId) {
1829
- this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: n }, this.restOver(n), this.gesture = { ...o, ghost: this.heldGhost(o, e, n) }, this.setCursor(this.refused || this.blocked ? "not-allowed" : o.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
1847
+ this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: s }, this.restOver(s), this.gesture = { ...o, ghost: this.heldGhost(o, e, s) }, this.setCursor(this.refused || this.blocked ? "not-allowed" : o.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
1830
1848
  return;
1831
1849
  }
1832
- o.kind === "none" && !this.loading && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, n));
1850
+ o.kind === "none" && !this.loading && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, s));
1833
1851
  }
1834
1852
  /** The drag of `subtask` in `mode`, taking hold where the pending press
1835
1853
  stands. */
1836
- startEdit(t, e, n) {
1854
+ startEdit(t, e, s) {
1837
1855
  this.gesture = {
1838
1856
  kind: "edit",
1839
1857
  pointerId: t.pointerId,
1840
1858
  mode: e,
1841
- subtask: n,
1859
+ subtask: s,
1842
1860
  /* The working time the drag took hold at - not a pixel, because
1843
1861
  auto-pan moves the scale under a drag in flight. */
1844
1862
  t0: this.host.view.viewport().scale.fromPx(t.x0),
1845
- ghost: n,
1863
+ ghost: s,
1846
1864
  /* Asked here, once, and drawn from the first frame of the drag: the
1847
1865
  lanes that are closed are marked before the pointer reaches one. */
1848
- refused: e === "move" ? this.askRefused(n, n.lane) : Ye
1866
+ refused: e === "move" ? this.askRefused(s, s.lane) : ze
1849
1867
  }, this.setCursor(e === "move" ? "grabbing" : "ew-resize");
1850
1868
  }
1851
1869
  /** The finger has been held on a bar: the bar is grabbed, unless the finger
@@ -1853,8 +1871,8 @@ class Ri {
1853
1871
  grab(t) {
1854
1872
  const e = this.gesture;
1855
1873
  if (!this.armed || this.loading || e.kind !== "pending") return;
1856
- const { x: n, y: i } = this.local(t.x, t.y), { mode: o, subtask: a } = this.modeAt(e.x0, e.y0);
1857
- o !== "move" || a === null || (this.lastClient = { x: t.x, y: t.y }, this.dragPoint = { x: n, y: i }, this.startEdit(e, o, a), this.host.interactionChanged());
1874
+ const { x: s, y: i } = this.local(t.x, t.y), { mode: o, subtask: a } = this.modeAt(e.x0, e.y0);
1875
+ o !== "move" || a === null || (this.lastClient = { x: t.x, y: t.y }, this.dragPoint = { x: s, y: i }, this.startEdit(e, o, a), this.host.interactionChanged());
1858
1876
  }
1859
1877
  /** The page's own scroll, while a bar is grabbed. Registered as not passive
1860
1878
  by the component: a passive listener cannot cancel it. Before the grab and
@@ -1868,13 +1886,13 @@ class Ri {
1868
1886
  this.touches.size === 1 && o !== void 0 ? this.gesture = { kind: "pan", pointerId: o[0], lastX: o[1].x, lastY: o[1].y } : this.touches.size === 0 && (this.gesture = { kind: "none" });
1869
1887
  return;
1870
1888
  }
1871
- const e = this.gesture, { x: n, y: i } = this.local(t.clientX, t.clientY);
1889
+ const e = this.gesture, { x: s, y: i } = this.local(t.clientX, t.clientY);
1872
1890
  if (e.kind === "pending" && e.pointerId === t.pointerId)
1873
- this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY, n, i);
1891
+ this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY, s, i);
1874
1892
  else if (e.kind === "pan" && e.pointerId === t.pointerId)
1875
- this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY, n, i);
1893
+ this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY, s, i);
1876
1894
  else if (e.kind === "edit" && e.pointerId === t.pointerId) {
1877
- if (t.pointerType === "touch" && (n < 0 || i < 0 || n > this.host.view.width || i > this.host.view.height)) {
1895
+ if (t.pointerType === "touch" && (s < 0 || i < 0 || s > this.host.view.width || i > this.host.view.height)) {
1878
1896
  this.cancelEdit();
1879
1897
  return;
1880
1898
  }
@@ -1895,9 +1913,9 @@ class Ri {
1895
1913
  this.panFrame = 0;
1896
1914
  const e = this.gesture;
1897
1915
  if (e.kind !== "edit" && e.kind !== "place") return;
1898
- const n = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), a = He(i, n.width), r = He(o, n.height);
1916
+ const s = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), a = Ye(i, s.width), r = Ye(o, s.height);
1899
1917
  if (a === 0 && r === 0) return;
1900
- const l = n.pan(a, r);
1918
+ const l = s.pan(a, r);
1901
1919
  if (l.moved) {
1902
1920
  if (this.dragPoint = { x: i, y: o }, e.kind === "edit")
1903
1921
  this.gesture = { ...e, ghost: this.heldGhost(e, i, o) };
@@ -1922,8 +1940,8 @@ class Ri {
1922
1940
  times would be a lie. Nothing is reported: no interaction happened. */
1923
1941
  refreshHover() {
1924
1942
  if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
1925
- const { x: t, y: e } = this.hoverPoint, n = this.host.view.hitAt(t, e);
1926
- this.hover = n, this.hoverKey = Ht(n);
1943
+ const { x: t, y: e } = this.hoverPoint, s = this.host.view.hitAt(t, e);
1944
+ this.hover = s, this.hoverKey = Ht(s);
1927
1945
  }
1928
1946
  pointerLeave() {
1929
1947
  this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
@@ -1935,19 +1953,19 @@ class Ri {
1935
1953
  }
1936
1954
  contextMenu(t) {
1937
1955
  if (this.host.handlers().onInteraction === void 0 || (t.preventDefault(), this.armed || this.editing || this.loading)) return;
1938
- const { x: e, y: n } = this.local(t.clientX, t.clientY);
1939
- this.report("contextmenu", this.host.view.hitAt(e, n), t.clientX, t.clientY, e, n);
1956
+ const { x: e, y: s } = this.local(t.clientX, t.clientY);
1957
+ this.report("contextmenu", this.host.view.hitAt(e, s), t.clientX, t.clientY, e, s);
1940
1958
  }
1941
1959
  /** The wheel, as every scrolling area has it:
1942
1960
  vertical scrolls the lanes, and lets the page scroll on once they are at
1943
1961
  their end; Ctrl or ⌘ zooms - a trackpad pinch arrives as a wheel with
1944
1962
  Ctrl -; horizontal or Shift pans through time. */
1945
1963
  wheel(t) {
1946
- const e = this.host.view, n = Math.max(0, Math.min(e.width, this.local(t.clientX, t.clientY).x)), i = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.height : 1, o = t.deltaX * i, a = t.deltaY * i;
1964
+ const e = this.host.view, s = Math.max(0, Math.min(e.width, this.local(t.clientX, t.clientY).x)), i = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.height : 1, o = t.deltaX * i, a = t.deltaY * i;
1947
1965
  if (t.ctrlKey || t.metaKey) {
1948
1966
  t.preventDefault();
1949
1967
  const d = Math.abs(a) < 50 ? 0.01 : 15e-4;
1950
- e.zoomAt(n, Math.exp(a * d)) && this.host.viewMoved(!0);
1968
+ e.zoomAt(s, Math.exp(a * d)) && this.host.viewMoved(!0);
1951
1969
  return;
1952
1970
  }
1953
1971
  if (Math.abs(o) > Math.abs(a) || t.shiftKey) {
@@ -1962,17 +1980,17 @@ class Ri {
1962
1980
  const l = e.pan(0, a);
1963
1981
  l.moved && this.host.viewMoved(l.time);
1964
1982
  }
1965
- click(t, e, n, i) {
1966
- const o = this.host.view.hitAt(n, i), a = o.kind === "subtask" ? o.subtask.task : o.kind === "dependency" ? this.host.data.taskOfDependency(o.dependency) : null;
1967
- this.host.select(a, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, n, i);
1983
+ click(t, e, s, i) {
1984
+ const o = this.host.view.hitAt(s, i), a = o.kind === "subtask" ? o.subtask.task : o.kind === "dependency" ? this.host.data.taskOfDependency(o.dependency) : null;
1985
+ this.host.select(a, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, s, i);
1968
1986
  }
1969
- hoverAt(t, e, n, i) {
1970
- const o = this.host.view.hitAt(n, i), a = Ht(o), { mode: r } = this.modeAt(n, i);
1971
- if (this.setCursor(r === "move" ? "grab" : r === "stretch-from" || r === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: n, y: i }, a === this.hoverKey) {
1987
+ hoverAt(t, e, s, i) {
1988
+ const o = this.host.view.hitAt(s, i), a = Ht(o), { mode: r } = this.modeAt(s, i);
1989
+ if (this.setCursor(r === "move" ? "grab" : r === "stretch-from" || r === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: s, y: i }, a === this.hoverKey) {
1972
1990
  (o.kind === "subtask" || o.kind === "dependency" || o.kind === "milestone") && this.host.hoverChanged();
1973
1991
  return;
1974
1992
  }
1975
- this.setHover(o, a), this.report("hover", o, t, e, n, i);
1993
+ this.setHover(o, a), this.report("hover", o, t, e, s, i);
1976
1994
  }
1977
1995
  /** The keyboard sets the hover: drawn, and its tooltip shown, as the
1978
1996
  pointer's would be - and reported to nobody, since `onInteraction`
@@ -2001,10 +2019,10 @@ class Ri {
2001
2019
  dragging and handles the place intent, the drop is accepted and a ghost
2002
2020
  shows where the work would land. */
2003
2021
  dragOver(t, e) {
2004
- const n = this.host.view;
2005
- if (this.loading || e === null || !n.options.intents.includes("place")) return;
2022
+ const s = this.host.view;
2023
+ if (this.loading || e === null || !s.options.intents.includes("place")) return;
2006
2024
  const { x: i, y: o } = this.local(t.clientX, t.clientY);
2007
- if (n.laneIdAt(o) === null && n.foldedGroupAt(o) === null) {
2025
+ if (s.laneIdAt(o) === null && s.foldedGroupAt(o) === null) {
2008
2026
  this.clearPlacing();
2009
2027
  return;
2010
2028
  }
@@ -2024,18 +2042,18 @@ class Ri {
2024
2042
  lanes, none where the caller refuses that lane and none where it would
2025
2043
  cover blocked time - which the answer says apart, because they mean
2026
2044
  different things to the drag. */
2027
- placeGhost(t, e, n, i) {
2028
- const o = this.onLane(n);
2045
+ placeGhost(t, e, s, i) {
2046
+ const o = this.onLane(s);
2029
2047
  if (o === null) return { ghost: null, refused: !1, blocked: !1 };
2030
2048
  if (i.has(o)) return { ghost: null, refused: !0, blocked: !1 };
2031
- const a = { ...this.askedFor(t, o, e), id: Ke };
2032
- return ct(a, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: a, refused: !1, blocked: !1 };
2049
+ const a = { ...this.askedFor(t, o, e), id: Ve };
2050
+ return ut(a, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: a, refused: !1, blocked: !1 };
2033
2051
  }
2034
2052
  /** The dragged item as a subtask, under the caller's key for it - not the
2035
2053
  internal sentinel: the rule is asked about the thing the application says
2036
2054
  it is dragging, and the ghost only afterwards takes the sentinel. */
2037
- askedFor(t, e, n) {
2038
- const i = this.snapInside(this.host.view.timeAt(n), this.snapStep());
2055
+ askedFor(t, e, s) {
2056
+ const i = this.snapInside(this.host.view.timeAt(s), this.snapStep());
2039
2057
  return {
2040
2058
  id: t.item,
2041
2059
  task: t.task,
@@ -2052,17 +2070,17 @@ class Ri {
2052
2070
  const e = this.gesture;
2053
2071
  if (e.kind !== "place") return;
2054
2072
  t.preventDefault();
2055
- const { ghost: n, item: i } = e;
2056
- if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...n, id: i.item }, n.lane)) return;
2073
+ const { ghost: s, item: i } = e;
2074
+ if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...s, id: i.item }, s.lane)) return;
2057
2075
  const o = {
2058
2076
  kind: "place",
2059
2077
  item: i.item,
2060
- task: n.task,
2061
- lane: n.lane,
2062
- from: n.from,
2063
- to: n.to,
2064
- ...n.leadIn === void 0 ? {} : { leadIn: n.leadIn },
2065
- ...n.leadOut === void 0 ? {} : { leadOut: n.leadOut }
2078
+ task: s.task,
2079
+ lane: s.lane,
2080
+ from: s.from,
2081
+ to: s.to,
2082
+ ...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
2083
+ ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
2066
2084
  };
2067
2085
  this.host.handlers().onIntent?.(o);
2068
2086
  }
@@ -2084,24 +2102,24 @@ class Ri {
2084
2102
  put the work into blocked time it did not already cover, the ghost where
2085
2103
  it last stood. It is held, not clamped: a pointer carried on past the
2086
2104
  blocked time takes the ghost along again. */
2087
- heldGhost(t, e, n) {
2088
- const i = this.ghostFor(t, e, n);
2089
- return this.blocked = ct(i, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : i;
2105
+ heldGhost(t, e, s) {
2106
+ const i = this.ghostFor(t, e, s);
2107
+ return this.blocked = ut(i, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : i;
2090
2108
  }
2091
- ghostFor(t, e, n) {
2109
+ ghostFor(t, e, s) {
2092
2110
  const i = this.host.view, o = t.subtask, a = this.snapStep(), r = i.options.intents, l = this.snapInside(i.timeAt(e), a);
2093
2111
  switch (t.mode) {
2094
2112
  case "move": {
2095
2113
  let d = o.from;
2096
- const h = i.viewport().scale, c = h.fromPx(e) - t.t0;
2097
- r.includes("move") && Math.abs(c * h.m) >= Ve && (d = this.shifted(o.from, c, a));
2098
- let m = t.ghost.lane;
2114
+ const c = i.viewport().scale, h = c.fromPx(e) - t.t0;
2115
+ r.includes("move") && Math.abs(h * c.m) >= We && (d = this.shifted(o.from, h, a));
2116
+ let p = t.ghost.lane;
2099
2117
  if (r.includes("lane")) {
2100
- const k = this.onLane(n) ?? m;
2101
- this.refused = t.refused.has(k), this.refused || (m = k);
2118
+ const g = this.onLane(s) ?? p;
2119
+ this.refused = t.refused.has(g), this.refused || (p = g);
2102
2120
  } else
2103
2121
  this.refused = !1;
2104
- return { ...o, from: d, to: d + (o.to - o.from), lane: m };
2122
+ return { ...o, from: d, to: d + (o.to - o.from), lane: p };
2105
2123
  }
2106
2124
  case "stretch-from":
2107
2125
  return { ...o, from: Math.min(l, o.to - Math.max(a.step, Z)) };
@@ -2116,20 +2134,27 @@ class Ri {
2116
2134
  /** A time moved by an amount of WORKING time and snapped: a drag moves
2117
2135
  a start this way, and a key by one step of the raster - one arithmetic,
2118
2136
  so a key proposes exactly what a drag of that length would. */
2119
- shifted(t, e, n) {
2120
- const i = Tt(this.host.view.options.calendar), o = V(t, i) + e, a = ut(o, i);
2121
- return this.snapInside(a, n);
2137
+ shifted(t, e, s) {
2138
+ const i = St(this.host.view.options.calendar), o = z(t, i) + e, a = ft(o, i);
2139
+ return this.snapInside(a, s);
2122
2140
  }
2123
2141
  /** Snapped - and, where the raster lands in time the calendar removes, moved
2124
2142
  on to the seam, where time counts again. An intent never asks for a time
2125
2143
  nobody works. */
2126
2144
  snapInside(t, e) {
2127
- const n = Vs(t, e, this.host.view.options.timeZone), i = Tt(this.host.view.options.calendar);
2128
- return i.intervals.length === 0 ? n : qt(V(n, i), i);
2145
+ const s = Us(t, e, this.host.view.options.timeZone), i = St(this.host.view.options.calendar);
2146
+ return i.intervals.length === 0 ? s : Zt(z(s, i), i);
2147
+ }
2148
+ /** The id to report: a host may have reminted its ids since the drag began,
2149
+ so where the old id is gone the subtask is found again by what it is -
2150
+ task, lane and times. */
2151
+ currentId(t) {
2152
+ const e = this.host.data;
2153
+ return e.subtaskById.has(t.id) ? t.id : e.subtasks.find((i) => i.task === t.task && i.lane === t.lane && i.from === t.from && i.to === t.to)?.id ?? t.id;
2129
2154
  }
2130
- intentsOf(t, e, n) {
2131
- const i = [], o = this.host.view.options.intents, a = t.id;
2132
- return n === "move" ? (e.from !== t.from && o.includes("move") && i.push({ kind: "move", subtask: a, from: e.from, to: e.to }), e.lane !== t.lane && o.includes("lane") && i.push({ kind: "lane", subtask: a, lane: e.lane })) : n === "stretch-from" || n === "stretch-to" ? (e.from !== t.from || e.to !== t.to) && i.push({ kind: "stretch", subtask: a, from: e.from, to: e.to }) : n === "leadIn" ? (e.leadIn ?? 0) !== (t.leadIn ?? 0) && i.push({ kind: "leadIn", subtask: a, leadIn: e.leadIn ?? 0 }) : (e.leadOut ?? 0) !== (t.leadOut ?? 0) && i.push({ kind: "leadOut", subtask: a, leadOut: e.leadOut ?? 0 }), i;
2155
+ intentsOf(t, e, s) {
2156
+ const i = [], o = this.host.view.options.intents, a = this.currentId(t);
2157
+ return s === "move" ? (e.from !== t.from && o.includes("move") && i.push({ kind: "move", subtask: a, from: e.from, to: e.to }), e.lane !== t.lane && o.includes("lane") && i.push({ kind: "lane", subtask: a, lane: e.lane })) : s === "stretch-from" || s === "stretch-to" ? (e.from !== t.from || e.to !== t.to) && i.push({ kind: "stretch", subtask: a, from: e.from, to: e.to }) : s === "leadIn" ? (e.leadIn ?? 0) !== (t.leadIn ?? 0) && i.push({ kind: "leadIn", subtask: a, leadIn: e.leadIn ?? 0 }) : (e.leadOut ?? 0) !== (t.leadOut ?? 0) && i.push({ kind: "leadOut", subtask: a, leadOut: e.leadOut ?? 0 }), i;
2133
2158
  }
2134
2159
  /** The lane the ghost came from - the only other lane a drag can touch. */
2135
2160
  ghostHome(t) {
@@ -2145,33 +2170,33 @@ class Ri {
2145
2170
  keeps a plan of hundreds of tasks fluid while a drag runs, since this is
2146
2171
  computed on every pointer movement. */
2147
2172
  ghostFindings(t, e) {
2148
- const n = this.host.data, i = (h) => h.lane === t.lane || h.lane === e, a = [...n.subtasks.filter((h) => h.id !== t.id && i(h)), t], r = (h) => h.first === t.id || h.second === t.id, l = n.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id === Ke ? n.subtasks : n.subtasks.map((h) => h.id === t.id ? t : h);
2149
- return { overlaps: ee(a).filter(r), violated: se(d, l) };
2173
+ const s = this.host.data, i = (c) => c.lane === t.lane || c.lane === e, a = [...s.subtasks.filter((c) => c.id !== t.id && i(c)), t], r = (c) => c.first === t.id || c.second === t.id, l = s.dependencies.filter((c) => c.from === t.id || c.to === t.id), d = t.id === Ve ? s.subtasks : s.subtasks.map((c) => c.id === t.id ? t : c);
2174
+ return { overlaps: ne(a).filter(r), violated: ie(d, l) };
2150
2175
  }
2151
2176
  }
2152
- function Gi(s, t) {
2177
+ function Yi(n, t) {
2153
2178
  const e = /* @__PURE__ */ new Map();
2154
- for (const n of t) {
2155
- const i = s.slots.get(n.lane), o = i === void 0 ? null : at(s, i.top);
2179
+ for (const s of t) {
2180
+ const i = n.slots.get(s.lane), o = i === void 0 ? null : at(n, i.top);
2156
2181
  if (o === null) continue;
2157
- const a = s.rows.indexOf(o);
2158
- e.set(a, [...e.get(a) ?? [], n]);
2182
+ const a = n.rows.indexOf(o);
2183
+ e.set(a, [...e.get(a) ?? [], s]);
2159
2184
  }
2160
- return [...e.entries()].sort(([n], [i]) => n - i).map(([, n]) => n.sort((i, o) => i.from - o.from || i.to - o.to));
2185
+ return [...e.entries()].sort(([s], [i]) => s - i).map(([, s]) => s.sort((i, o) => i.from - o.from || i.to - o.to));
2161
2186
  }
2162
- const ze = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
2163
- function Hi(s, t, e, n) {
2187
+ const Ue = (n, t) => t < n.from ? n.from - t : t > n.to ? t - n.to : 0;
2188
+ function Vi(n, t, e, s) {
2164
2189
  let i = -1, o = -1;
2165
- for (let d = 0; d < s.length && t !== null && i < 0; d++)
2166
- o = s[d].findIndex((h) => h.id === t), o >= 0 && (i = d);
2190
+ for (let d = 0; d < n.length && t !== null && i < 0; d++)
2191
+ o = n[d].findIndex((c) => c.id === t), o >= 0 && (i = d);
2167
2192
  if (i < 0) {
2168
- for (const d of s) {
2169
- const h = d.find((c) => c.to > n[0] && c.from < n[1]);
2170
- if (h !== void 0) return h;
2193
+ for (const d of n) {
2194
+ const c = d.find((h) => h.to > s[0] && h.from < s[1]);
2195
+ if (c !== void 0) return c;
2171
2196
  }
2172
- return s[0]?.[0] ?? null;
2197
+ return n[0]?.[0] ?? null;
2173
2198
  }
2174
- const a = s[i], r = a[o], l = (n[1] - n[0]) / 10;
2199
+ const a = n[i], r = a[o], l = (s[1] - s[0]) / 10;
2175
2200
  switch (e) {
2176
2201
  case "next":
2177
2202
  return a[o + 1] ?? r;
@@ -2182,31 +2207,31 @@ function Hi(s, t, e, n) {
2182
2207
  case "last":
2183
2208
  return a[a.length - 1];
2184
2209
  case "pageNext":
2185
- return a.find((d, h) => h > o && d.from >= r.from + l) ?? a[a.length - 1];
2210
+ return a.find((d, c) => c > o && d.from >= r.from + l) ?? a[a.length - 1];
2186
2211
  case "pagePrevious":
2187
2212
  for (let d = o - 1; d >= 0; d--) if (a[d].from <= r.from - l) return a[d];
2188
2213
  return a[0];
2189
2214
  case "up":
2190
2215
  case "down": {
2191
- const d = s[e === "up" ? i - 1 : i + 1];
2216
+ const d = n[e === "up" ? i - 1 : i + 1];
2192
2217
  if (d === void 0) return r;
2193
- const h = (r.from + r.to) / 2;
2194
- return d.reduce((c, m) => ze(m, h) < ze(c, h) ? m : c);
2218
+ const c = (r.from + r.to) / 2;
2219
+ return d.reduce((h, p) => Ue(p, c) < Ue(h, c) ? p : h);
2195
2220
  }
2196
2221
  }
2197
2222
  }
2198
- function Ki(s, t, e, n) {
2223
+ function zi(n, t, e, s) {
2199
2224
  if (e.kind === "milestone") return e;
2200
2225
  if (e.kind === "dependency") {
2201
- const o = s.find((r) => r.id === e.id), a = o === void 0 ? void 0 : n === "out" ? o.to : o.from;
2226
+ const o = n.find((r) => r.id === e.id), a = o === void 0 ? void 0 : s === "out" ? o.to : o.from;
2202
2227
  return a !== void 0 && t.has(a) ? { kind: "subtask", id: a } : e;
2203
2228
  }
2204
- const i = s.find(
2205
- (o) => (n === "out" ? o.from : o.to) === e.id && t.has(n === "out" ? o.to : o.from)
2229
+ const i = n.find(
2230
+ (o) => (s === "out" ? o.from : o.to) === e.id && t.has(s === "out" ? o.to : o.from)
2206
2231
  );
2207
2232
  return i === void 0 ? e : { kind: "dependency", id: i.id };
2208
2233
  }
2209
- const Mt = "\0milestone:", We = 150, Ue = 1.25, Yi = {
2234
+ const Tt = "\0milestone:", Xe = 150, qe = 1.25, Wi = {
2210
2235
  ArrowRight: "next",
2211
2236
  ArrowLeft: "previous",
2212
2237
  ArrowUp: "up",
@@ -2216,7 +2241,7 @@ const Mt = "\0milestone:", We = 150, Ue = 1.25, Yi = {
2216
2241
  PageDown: "pageNext",
2217
2242
  PageUp: "pagePrevious"
2218
2243
  };
2219
- class Vi {
2244
+ class Ui {
2220
2245
  constructor(t) {
2221
2246
  this.host = t;
2222
2247
  }
@@ -2241,12 +2266,12 @@ class Vi {
2241
2266
  key(t) {
2242
2267
  const e = this.host.gestures;
2243
2268
  if (t.metaKey || !e.idle) return !1;
2244
- const n = t.key.toLowerCase() === "t" && !t.ctrlKey && !t.altKey;
2245
- if (t.key === "]" || t.key === "[" || n) {
2269
+ const s = t.key.toLowerCase() === "t" && !t.ctrlKey && !t.altKey;
2270
+ if (t.key === "]" || t.key === "[" || s) {
2246
2271
  const o = this.active();
2247
2272
  if (o === null) return !1;
2248
- const a = this.host.data, r = n ? !t.shiftKey : t.key === "]";
2249
- return this.show(Ki(a.dependencies, a.subtaskById, o, r ? "out" : "back")), !0;
2273
+ const a = this.host.data, r = s ? !t.shiftKey : t.key === "]";
2274
+ return this.show(zi(a.dependencies, a.subtaskById, o, r ? "out" : "back")), !0;
2250
2275
  }
2251
2276
  if (t.ctrlKey) return !1;
2252
2277
  if (!t.altKey && this.zoom(t)) return !0;
@@ -2254,33 +2279,33 @@ class Vi {
2254
2279
  if (t.key === "Escape")
2255
2280
  return e.byKeyboard ? (this.blur(), !0) : !1;
2256
2281
  if (t.key === "Enter" || t.key === " ") return this.select();
2257
- const i = t.shiftKey ? void 0 : Yi[t.key];
2282
+ const i = t.shiftKey ? void 0 : Wi[t.key];
2258
2283
  return i === void 0 ? !1 : (this.walk(i), !0);
2259
2284
  }
2260
2285
  /** + and = zoom in, - and _ zoom out, 0 fits the work: by the character, so
2261
2286
  that every layout reaches them (Shift is how a US keyboard types +). The
2262
2287
  anchor is the middle of the active subtask's main time, else of the plot. */
2263
2288
  zoom(t) {
2264
- const e = t.key === "+" || t.key === "=" ? 1 / Ue : t.key === "-" || t.key === "_" ? Ue : 1;
2289
+ const e = t.key === "+" || t.key === "=" ? 1 / qe : t.key === "-" || t.key === "_" ? qe : 1;
2265
2290
  if (e === 1 && t.key !== "0") return !1;
2266
2291
  if (e !== 1) {
2267
- const n = this.active(), i = n?.kind === "subtask" ? this.host.view.boxById.get(n.id) : void 0, o = this.host.view.width;
2292
+ const s = this.active(), i = s?.kind === "subtask" ? this.host.view.boxById.get(s.id) : void 0, o = this.host.view.width;
2268
2293
  this.host.zoomBy(i === void 0 ? o / 2 : Math.max(0, Math.min(o, (i.mainFrom + i.mainTo) / 2)), e);
2269
2294
  } else this.host.fitWork();
2270
2295
  return this.scheduleSpan(), !0;
2271
2296
  }
2272
2297
  walk(t) {
2273
- const { data: e, view: n } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ? Mt + i.id : e.dependencies.find((d) => d.id === i.id)?.from ?? null, a = [...e.subtasks, ...e.milestones.map((d) => ({ id: Mt + d.id, lane: d.lane, from: d.at, to: d.at }))];
2274
- let r = Gi(n.rows, a);
2298
+ const { data: e, view: s } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ? Tt + i.id : e.dependencies.find((d) => d.id === i.id)?.from ?? null, a = [...e.subtasks, ...e.milestones.map((d) => ({ id: Tt + d.id, lane: d.lane, from: d.at, to: d.at }))];
2299
+ let r = Yi(s.rows, a);
2275
2300
  if (o === null) {
2276
- const d = r.filter((h) => {
2277
- const c = tt(n.viewport(), h[0].lane);
2278
- return c !== null && c.top + c.height > 0 && c.top < n.height;
2301
+ const d = r.filter((c) => {
2302
+ const h = et(s.viewport(), c[0].lane);
2303
+ return h !== null && h.top + h.height > 0 && h.top < s.height;
2279
2304
  });
2280
2305
  d.length > 0 && (r = d);
2281
2306
  }
2282
- const l = Hi(r, o, t, this.host.visibleDomain());
2283
- l !== null && this.show(l.id.startsWith(Mt) ? { kind: "milestone", id: l.id.slice(Mt.length) } : { kind: "subtask", id: l.id });
2307
+ const l = Vi(r, o, t, this.host.visibleDomain());
2308
+ l !== null && this.show(l.id.startsWith(Tt) ? { kind: "milestone", id: l.id.slice(Tt.length) } : { kind: "subtask", id: l.id });
2284
2309
  }
2285
2310
  /** Space and Enter select as a click does: the whole task, and the subtask. */
2286
2311
  select() {
@@ -2291,37 +2316,49 @@ class Vi {
2291
2316
  return !0;
2292
2317
  }
2293
2318
  /** Alt+←/→ proposes a move by one step of the raster, Alt+Shift+←/→ a new
2294
- end - the intents a drag of that length reports (ADR-0023), and only
2295
- where the caller handles them. Nothing is applied here. */
2319
+ end, Alt+↑/↓ a change to the lane above or below - the intents a drag
2320
+ reports (ADR-0023), and only where the caller handles them. Nothing is
2321
+ applied here. */
2296
2322
  edit(t) {
2297
- const e = this.host.gestures.hover, n = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0;
2298
- if (n === 0) return !1;
2323
+ const e = this.host.gestures.hover, s = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0, i = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
2324
+ if (s === 0 && i === 0) return !1;
2299
2325
  if (this.host.gestures.loading || e.kind !== "subtask") return !0;
2300
- const i = e.subtask, o = this.host.gestures, a = this.host.view.options.intents, r = o.snapStep(), l = r.step > 0 ? r : { step: this.host.view.step(), offset: 0 }, d = this.host.data.blocked;
2326
+ const o = e.subtask, a = this.host.gestures, r = this.host.view.options.intents;
2327
+ if (i !== 0) {
2328
+ const p = this.laneBeside(o.lane, i);
2329
+ return p !== null && r.includes("lane") && (this.host.handlers().canMoveTo?.(o, p) ?? !0) && (a.byKeyboard = !0, this.host.handlers().onIntent?.({ kind: "lane", subtask: o.id, lane: p }), this.scheduleReadout()), !0;
2330
+ }
2331
+ const l = a.snapStep(), d = l.step > 0 ? l : { step: this.host.view.step(), offset: 0 }, c = this.host.data.blocked;
2301
2332
  let h = null;
2302
- if (!t.shiftKey && a.includes("move")) {
2303
- const c = (k) => ({ ...i, from: k, to: k + (i.to - i.from) });
2304
- let m = i.from;
2305
- for (let k = 0; k < 1e3; k++) {
2306
- const f = o.shifted(m, n * l.step, l);
2307
- if (f === m || (m = f, !ct(c(m), i, d))) break;
2333
+ if (!t.shiftKey && r.includes("move")) {
2334
+ const p = (f) => ({ ...o, from: f, to: f + (o.to - o.from) });
2335
+ let g = o.from;
2336
+ for (let f = 0; f < 1e3; f++) {
2337
+ const y = a.shifted(g, s * d.step, d);
2338
+ if (y === g || (g = y, !ut(p(g), o, c))) break;
2308
2339
  }
2309
- m !== i.from && !ct(c(m), i, d) && (h = { kind: "move", subtask: i.id, from: m, to: c(m).to });
2310
- } else if (t.shiftKey && a.includes("stretch")) {
2311
- const c = Math.max(o.shifted(i.to, n * l.step, l), i.from + Math.max(l.step, Z));
2312
- c !== i.to && !ct({ ...i, to: c }, i, d) && (h = { kind: "stretch", subtask: i.id, from: i.from, to: c });
2340
+ g !== o.from && !ut(p(g), o, c) && (h = { kind: "move", subtask: o.id, from: g, to: p(g).to });
2341
+ } else if (t.shiftKey && r.includes("stretch")) {
2342
+ const p = Math.max(a.shifted(o.to, s * d.step, d), o.from + Math.max(d.step, Z));
2343
+ p !== o.to && !ut({ ...o, to: p }, o, c) && (h = { kind: "stretch", subtask: o.id, from: o.from, to: p });
2313
2344
  }
2314
- return o.byKeyboard = !0, h !== null && this.host.handlers().onIntent?.(h), this.scheduleReadout(), !0;
2345
+ return a.byKeyboard = !0, h !== null && this.host.handlers().onIntent?.(h), this.scheduleReadout(), !0;
2346
+ }
2347
+ /** The lane drawn one row above (-1) or below (1) a lane - group heads and
2348
+ folded groups are passed over; null at the first or last lane. */
2349
+ laneBeside(t, e) {
2350
+ const s = this.host.view.rows.rows.flatMap((o) => o.kind === "lane" && o.lane !== void 0 ? [o.lane] : []), i = s.indexOf(t);
2351
+ return i < 0 ? null : s[i + e] ?? null;
2315
2352
  }
2316
2353
  /** The keys stand on this target: brought into view, drawn as the hover. */
2317
2354
  show(t, e = !0) {
2318
- const n = this.hitOf(t);
2319
- if (n === null) return;
2355
+ const s = this.hitOf(t);
2356
+ if (s === null) return;
2320
2357
  e && this.reveal(t);
2321
2358
  const i = this.bounds(t);
2322
2359
  if (i === null) return;
2323
2360
  const { view: o } = this.host, a = (r, l) => Math.max(0, Math.min(l, r));
2324
- this.host.gestures.setKeyboardHover(n, {
2361
+ this.host.gestures.setKeyboardHover(s, {
2325
2362
  x: (a(i.x0, o.width) + a(i.x1, o.width)) / 2,
2326
2363
  y: (a(i.y0, o.height) + a(i.y1, o.height)) / 2
2327
2364
  }), e && this.scheduleReadout();
@@ -2336,22 +2373,22 @@ class Vi {
2336
2373
  const i = e.milestones.find((o) => o.id === t.id);
2337
2374
  return i === void 0 ? null : { kind: "milestone", milestone: i };
2338
2375
  }
2339
- const n = e.dependencies.find((i) => i.id === t.id);
2340
- return n === void 0 ? null : { kind: "dependency", dependency: n };
2376
+ const s = e.dependencies.find((i) => i.id === t.id);
2377
+ return s === void 0 ? null : { kind: "dependency", dependency: s };
2341
2378
  }
2342
2379
  /** Where a target lies on the plot: a subtask's bar, or the span between
2343
2380
  the two bars a dependency joins. */
2344
2381
  bounds(t) {
2345
- const e = this.host.view, n = (r) => e.boxById.get(r);
2382
+ const e = this.host.view, s = (r) => e.boxById.get(r);
2346
2383
  if (t.kind === "subtask") {
2347
- const r = n(t.id);
2384
+ const r = s(t.id);
2348
2385
  return r === void 0 ? null : { x0: r.outerFrom, x1: r.outerTo, y0: r.y, y1: r.y + r.height };
2349
2386
  }
2350
2387
  if (t.kind === "milestone") {
2351
- const r = this.host.data.milestones.find((d) => d.id === t.id), l = r === void 0 ? null : ae(e.viewport(), r);
2388
+ const r = this.host.data.milestones.find((d) => d.id === t.id), l = r === void 0 ? null : le(e.viewport(), r);
2352
2389
  return l === null ? null : { x0: l.x - l.half, x1: l.x + l.half, y0: l.y - l.half, y1: l.y + l.half };
2353
2390
  }
2354
- const i = this.host.data.dependencies.find((r) => r.id === t.id), o = i === void 0 ? void 0 : n(i.from), a = i === void 0 ? void 0 : n(i.to);
2391
+ const i = this.host.data.dependencies.find((r) => r.id === t.id), o = i === void 0 ? void 0 : s(i.from), a = i === void 0 ? void 0 : s(i.to);
2355
2392
  return o === void 0 || a === void 0 ? null : {
2356
2393
  x0: Math.min(o.mainTo, a.mainFrom),
2357
2394
  x1: Math.max(o.mainTo, a.mainFrom),
@@ -2363,11 +2400,11 @@ class Vi {
2363
2400
  at the side it came in from; a target wider than the view shows its
2364
2401
  start. As a drag at the edge pans along, the keys do. */
2365
2402
  reveal(t) {
2366
- const e = this.bounds(t), n = this.host.view;
2367
- if (e === null || n.width <= 0) return;
2368
- const i = Math.min(24, n.width / 10), o = e.x0 < 0 ? e.x0 - i : e.x1 > n.width ? Math.max(0, Math.min(e.x1 - n.width + i, e.x0 - i)) : 0, a = e.y0 < 0 ? e.y0 : e.y1 > n.height ? Math.min(e.y1 - n.height, e.y0) : 0;
2403
+ const e = this.bounds(t), s = this.host.view;
2404
+ if (e === null || s.width <= 0) return;
2405
+ const i = Math.min(24, s.width / 10), o = e.x0 < 0 ? e.x0 - i : e.x1 > s.width ? Math.max(0, Math.min(e.x1 - s.width + i, e.x0 - i)) : 0, a = e.y0 < 0 ? e.y0 : e.y1 > s.height ? Math.min(e.y1 - s.height, e.y0) : 0;
2369
2406
  if (o === 0 && a === 0) return;
2370
- const r = n.pan(o, a);
2407
+ const r = s.pan(o, a);
2371
2408
  r.moved && this.host.viewMoved(r.time);
2372
2409
  }
2373
2410
  /** After the data or the view changed: the keys' target is read anew by its
@@ -2385,42 +2422,49 @@ class Vi {
2385
2422
  if (!this.host.gestures.byKeyboard) return;
2386
2423
  const e = this.host.data.tooltipTargetFor(t);
2387
2424
  e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : t.kind === "milestone" ? t.milestone.lane : null, count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged());
2388
- }, We);
2425
+ }, Xe);
2389
2426
  }
2390
2427
  /** The span in view, said once the keys rest - also after a key that changed nothing. */
2391
2428
  scheduleSpan() {
2392
2429
  this.timer !== null && clearTimeout(this.timer), this.timer = setTimeout(() => {
2393
2430
  this.timer = null, this.spoken = { target: null, lane: null, span: this.host.visibleDomain(), count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged();
2394
- }, We);
2431
+ }, Xe);
2395
2432
  }
2396
2433
  /** Unmount: no readout after it. */
2397
2434
  stop() {
2398
2435
  this.timer !== null && clearTimeout(this.timer), this.timer = null;
2399
2436
  }
2400
2437
  }
2401
- const it = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
2402
- function zi(s, t) {
2403
- if (t.size === 0 || s.folded === void 0) return s;
2404
- const e = s.folded.filter((n) => t.has(n));
2405
- return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
2406
- }
2407
- function Wi(s, t, e = (n) => n) {
2408
- if (s.length === 0) return null;
2409
- let n = 1 / 0, i = -1 / 0;
2410
- for (const r of s)
2411
- n = Math.min(n, r.from - (r.leadIn ?? 0)), i = Math.max(i, r.to + (r.leadOut ?? 0));
2412
- n = e(n), i = e(i);
2413
- const o = Math.min(t.max, Math.max(t.min, i - n)), a = (n + i) / 2;
2414
- return [a - o / 2, a + o / 2];
2415
- }
2416
- const Xe = {
2438
+ const it = (n) => JSON.stringify([n.domain ?? null, [...n.folded ?? []].sort()]);
2439
+ function Xi(n, t) {
2440
+ if (t.size === 0 || n.folded === void 0) return n;
2441
+ const e = n.folded.filter((s) => t.has(s));
2442
+ return e.length === n.folded.length ? n : { ...n.domain ? { domain: n.domain } : {}, ...e.length ? { folded: e } : {} };
2443
+ }
2444
+ function Kt(n) {
2445
+ if (n == null) return null;
2446
+ const [t, e] = Array.isArray(n) ? n : [];
2447
+ return Array.isArray(n) && n.length === 2 && Number.isFinite(t) && Number.isFinite(e) && typeof t == "number" && typeof e == "number" && t < e ? [t, e] : (Ut && j("domain", `the view's domain must be [from, to], two numbers in milliseconds since 1970 with from before to (as Date.getTime() gives), not ${JSON.stringify(n)}; the schedule shows its subtasks instead.`), null);
2448
+ }
2449
+ function qi(n, t, e = (i) => i, s = "middle") {
2450
+ if (n.length === 0) return null;
2451
+ let i = 1 / 0, o = -1 / 0;
2452
+ for (const l of n)
2453
+ i = Math.min(i, l.from - (l.leadIn ?? 0)), o = Math.max(o, l.to + (l.leadOut ?? 0));
2454
+ i = e(i), o = e(o);
2455
+ const a = Math.min(t.max, Math.max(t.min, o - i));
2456
+ if (s === "start" && o - i > a) return [i, i + a];
2457
+ const r = (i + o) / 2;
2458
+ return [r - a / 2, r + a / 2];
2459
+ }
2460
+ const je = {
2417
2461
  width: 0,
2418
2462
  height: 0,
2419
2463
  scrollY: 0,
2420
2464
  headers: [],
2421
2465
  days: [],
2422
2466
  ticks: [],
2423
- step: jt,
2467
+ step: Jt,
2424
2468
  fontScale: 1,
2425
2469
  ghost: null,
2426
2470
  grips: [],
@@ -2433,9 +2477,9 @@ const Xe = {
2433
2477
  spoken: null,
2434
2478
  summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0, milestones: 0 }
2435
2479
  };
2436
- class Ui {
2437
- data = new fi(() => this.viewChanged());
2438
- view = new pn(this.data);
2480
+ class ji {
2481
+ data = new gi(() => this.viewChanged());
2482
+ view = new vn(this.data);
2439
2483
  gestures;
2440
2484
  keys;
2441
2485
  handlersNow = {};
@@ -2476,31 +2520,31 @@ class Ui {
2476
2520
  movePending = !1;
2477
2521
  domainFrame = 0;
2478
2522
  unsubscribeTheme = null;
2479
- snapshot = Xe;
2523
+ snapshot = je;
2480
2524
  dataTable = null;
2481
2525
  listeners = /* @__PURE__ */ new Set();
2482
2526
  constructor(t = {}) {
2483
- this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Ri({
2527
+ this.folded = t.folded ?? [], this.domainInView = Kt(t.domain), this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Ki({
2484
2528
  data: this.data,
2485
2529
  view: this.view,
2486
2530
  plotElement: () => this.plot,
2487
2531
  handlers: () => this.handlersNow,
2488
2532
  selectedSubtask: () => this.selected,
2489
- select: (e, n) => this.select(e, n),
2533
+ select: (e, s) => this.select(e, s),
2490
2534
  viewChanged: () => this.viewChanged(),
2491
2535
  viewMoved: (e) => this.viewMoved(e),
2492
2536
  interactionChanged: () => this.interactionChanged(),
2493
2537
  hoverChanged: () => this.hoverChanged()
2494
- }), this.keys = new Vi({
2538
+ }), this.keys = new Ui({
2495
2539
  data: this.data,
2496
2540
  view: this.view,
2497
2541
  gestures: this.gestures,
2498
2542
  handlers: () => this.handlersNow,
2499
2543
  visibleDomain: () => this.visibleDomain(),
2500
- select: (e, n) => this.select(e, n),
2544
+ select: (e, s) => this.select(e, s),
2501
2545
  viewMoved: (e) => this.viewMoved(e),
2502
- zoomBy: (e, n) => {
2503
- this.view.zoomAt(e, n) && this.viewMoved(!0);
2546
+ zoomBy: (e, s) => {
2547
+ this.view.zoomAt(e, s) && this.viewMoved(!0);
2504
2548
  },
2505
2549
  fitWork: () => this.setDomain(null),
2506
2550
  spokenChanged: () => this.publish()
@@ -2556,17 +2600,18 @@ class Ui {
2556
2600
  getView = () => this.viewNow;
2557
2601
  /** Goes to a whole view (`setView`); what it leaves out goes back to its default. */
2558
2602
  applyView(t) {
2559
- it(t) !== it(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
2603
+ it(t) !== it(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain === void 0 ? null : Kt(t.domain)));
2560
2604
  }
2561
2605
  /** Puts a span of two wall-clock instants in view; null shows the
2562
2606
  subtasks' extent. */
2563
2607
  setDomain = (t) => {
2564
- this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.domainFrame = 0, this.actedOn = !0, this.domainInView = t === null ? null : [t[0], t[1]], t === null ? this.fitted = !1 : this.view.showWall(t), this.viewChanged();
2608
+ const e = Kt(t);
2609
+ this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.domainFrame = 0, this.actedOn = !0, this.domainInView = e === null ? null : [e[0], e[1]], e === null ? this.fitted = !1 : this.view.showWall(e), this.viewChanged();
2565
2610
  };
2566
2611
  /** Folds or unfolds one group. */
2567
2612
  toggleGroup = (t) => {
2568
2613
  const e = this.viewNow.folded ?? [];
2569
- this.actedOn = !0, this.folded = e.includes(t) ? e.filter((n) => n !== t) : [...e, t], this.viewChanged();
2614
+ this.actedOn = !0, this.folded = e.includes(t) ? e.filter((s) => s !== t) : [...e, t], this.viewChanged();
2570
2615
  };
2571
2616
  foldAll = () => {
2572
2617
  this.actedOn = !0, this.folded = this.data.groups.map((t) => t.id), this.viewChanged();
@@ -2575,7 +2620,7 @@ class Ui {
2575
2620
  this.actedOn = !0, this.folded = [], this.viewChanged();
2576
2621
  };
2577
2622
  currentView() {
2578
- return zi(
2623
+ return Xi(
2579
2624
  { ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
2580
2625
  new Set(this.data.groups.map((t) => t.id))
2581
2626
  );
@@ -2590,13 +2635,13 @@ class Ui {
2590
2635
  /** The subtasks' extent within the zoom limits, while the view names no
2591
2636
  span - and the local day of today while there is no work to show. */
2592
2637
  fit() {
2593
- const t = this.view.options.calendar, e = Wi(this.data.subtasks, this.view.options.zoomLimits, (l) => V(l, t));
2638
+ const t = this.view.options.calendar, e = qi(this.data.subtasks, this.view.options.zoomLimits, (l) => z(l, t), "start");
2594
2639
  if (e !== null) {
2595
2640
  this.view.domain = e, this.fitted = !0;
2596
2641
  return;
2597
2642
  }
2598
- const n = this.view.options.timeZone, i = Ks(Date.now(), n), { year: o, month: a, day: r } = Je(i, n);
2599
- this.view.showWall([i.getTime(), Kt({ year: o, month: a, day: r + 1 }, n).getTime()]);
2643
+ const s = this.view.options.timeZone, i = zs(Date.now(), s), { year: o, month: a, day: r } = ts(i, s);
2644
+ this.view.showWall([i.getTime(), Yt({ year: o, month: a, day: r + 1 }, s).getTime()]);
2600
2645
  }
2601
2646
  /** `undefined`: the scene keeps the selection itself. */
2602
2647
  setControlledTask(t) {
@@ -2613,14 +2658,14 @@ class Ui {
2613
2658
  return t !== void 0 && t.task === this.selectedTask ? t.id : null;
2614
2659
  }
2615
2660
  select(t, e) {
2616
- const n = t !== this.selectedTask || e !== this.selected;
2617
- this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t), n && this.handlersNow.onSelectedTaskChange?.(t, e), this.interactionChanged();
2661
+ const s = t !== this.selectedTask || e !== this.selected;
2662
+ this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t), s && this.handlersNow.onSelectedTaskChange?.(t, e), this.interactionChanged();
2618
2663
  }
2619
2664
  /* ---------------------------------------------------------------- */
2620
2665
  /* DOM binding */
2621
2666
  /* ---------------------------------------------------------------- */
2622
- bind(t, e, n, i) {
2623
- this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = i, this.unsubscribeTheme = Es(() => {
2667
+ bind(t, e, s, i) {
2668
+ this.root = t, this.plot = e, this.dataCanvas = s, this.overlayCanvas = i, this.unsubscribeTheme = Ns(() => {
2624
2669
  this.colours = null, this.dataStale = !0, this.requestDraw();
2625
2670
  }), this.viewChanged();
2626
2671
  }
@@ -2628,14 +2673,14 @@ class Ui {
2628
2673
  this.gestures.cancelEdit(), this.keys.stop(), this.unsubscribeTheme?.(), this.unsubscribeTheme = null, this.frame !== 0 && cancelAnimationFrame(this.frame), this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.frame = this.domainFrame = 0, this.movePending = !1, this.root = this.plot = this.dataCanvas = this.overlayCanvas = null;
2629
2674
  }
2630
2675
  resize(t, e) {
2631
- const n = Math.max(0, Math.round(t)), i = Math.max(0, Math.round(e));
2632
- n === this.view.width && i === this.view.height || (this.view.width = n, this.view.height = i, this.viewChanged());
2676
+ const s = Math.max(0, Math.round(t)), i = Math.max(0, Math.round(e));
2677
+ s === this.view.width && i === this.view.height || (this.view.width = s, this.view.height = i, this.viewChanged());
2633
2678
  }
2634
2679
  subscribe = (t) => (this.listeners.add(t), () => {
2635
2680
  this.listeners.delete(t);
2636
2681
  });
2637
2682
  getSnapshot = () => this.snapshot;
2638
- getServerSnapshot = () => Xe;
2683
+ getServerSnapshot = () => je;
2639
2684
  /* ---------------------------------------------------------------- */
2640
2685
  /* Changes */
2641
2686
  /* ---------------------------------------------------------------- */
@@ -2666,8 +2711,8 @@ class Ui {
2666
2711
  this.requestDraw();
2667
2712
  }
2668
2713
  publish() {
2669
- const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, n = [];
2670
- e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") && n.push({ kind: "leadIn", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("leadOut") && n.push({ kind: "leadOut", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
2714
+ const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, s = [];
2715
+ e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") && s.push({ kind: "leadIn", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("leadOut") && s.push({ kind: "leadOut", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
2671
2716
  width: t.width,
2672
2717
  height: t.height,
2673
2718
  scrollY: t.scrollY,
@@ -2675,7 +2720,7 @@ class Ui {
2675
2720
  ...t.bands(),
2676
2721
  fontScale: t.fontScale,
2677
2722
  ghost: this.gestures.ghostSummary(),
2678
- grips: n,
2723
+ grips: s,
2679
2724
  cursor: this.gestures.cursor,
2680
2725
  tooltip: this.tooltip(),
2681
2726
  loading: this.gestures.loading,
@@ -2691,7 +2736,7 @@ class Ui {
2691
2736
  not taken off here: the header column is moved as a whole, as it always
2692
2737
  was, so that a header and its row cannot drift apart by a rounding. */
2693
2738
  headers() {
2694
- const t = new Map(this.data.lanes.map((i) => [i.id, i.label])), e = new Map(this.data.groups.map((i) => [i.id, i.label])), n = new Set(this.folded);
2739
+ const t = new Map(this.data.lanes.map((i) => [i.id, i.label])), e = new Map(this.data.groups.map((i) => [i.id, i.label])), s = new Set(this.folded);
2695
2740
  return this.view.rows.rows.map((i) => ({
2696
2741
  key: i.lane ?? i.group ?? "",
2697
2742
  kind: i.kind,
@@ -2701,7 +2746,7 @@ class Ui {
2701
2746
  depth: i.depth,
2702
2747
  within: i.within,
2703
2748
  lanes: i.lanes,
2704
- collapsed: i.group === void 0 ? void 0 : n.has(i.group),
2749
+ collapsed: i.group === void 0 ? void 0 : s.has(i.group),
2705
2750
  top: i.top,
2706
2751
  height: i.height
2707
2752
  }));
@@ -2713,27 +2758,27 @@ class Ui {
2713
2758
  const t = this.view;
2714
2759
  if (t.width <= 0) return [];
2715
2760
  const e = this.colours;
2716
- return t.boxes.flatMap((n) => {
2717
- if (!Yt(n, t.width, t.height)) return [];
2718
- const i = nn(n, t.width);
2761
+ return t.boxes.flatMap((s) => {
2762
+ if (!Vt(s, t.width, t.height)) return [];
2763
+ const i = rn(s, t.width);
2719
2764
  if (i === null) return [];
2720
- const o = e === null ? !0 : le(
2721
- It(n.subtask.appearance),
2722
- pt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, n.subtask.task, n.subtask.id),
2765
+ const o = e === null ? !0 : he(
2766
+ It(s.subtask.appearance),
2767
+ gt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, s.subtask.task, s.subtask.id),
2723
2768
  e
2724
2769
  ).onDark;
2725
- return [{ subtask: n.subtask, ...i, dark: o }];
2770
+ return [{ subtask: s.subtask, ...i, dark: o }];
2726
2771
  });
2727
2772
  }
2728
2773
  /** The findings count the whole plan - an overlap out of view is still one
2729
2774
  to know of -, the subtasks only what is in view. */
2730
2775
  summary() {
2731
- const t = this.view, [e, n] = this.visibleDomain();
2776
+ const t = this.view, [e, s] = this.visibleDomain();
2732
2777
  return {
2733
2778
  lanes: this.data.lanes.length,
2734
- subtasks: t.boxes.filter((i) => Yt(i, t.width, t.height)).length,
2779
+ subtasks: t.boxes.filter((i) => Vt(i, t.width, t.height)).length,
2735
2780
  from: e,
2736
- to: n,
2781
+ to: s,
2737
2782
  overlaps: this.data.overlaps.length,
2738
2783
  violated: this.data.violatedById.size,
2739
2784
  blocked: this.data.inBlocked.length,
@@ -2745,12 +2790,12 @@ class Ui {
2745
2790
  if (!this.gestures.idle) return null;
2746
2791
  const e = this.data.tooltipTargetFor(t);
2747
2792
  if (e === null) return null;
2748
- const { x: n, y: i } = this.gestures.hoverPoint;
2749
- return { target: e, x: n, y: i };
2793
+ const { x: s, y: i } = this.gestures.hoverPoint;
2794
+ return { target: e, x: s, y: i };
2750
2795
  }
2751
2796
  /** The visible span, as two wall-clock instants. */
2752
2797
  visibleDomain() {
2753
- const t = (e) => ut(e, this.view.options.calendar);
2798
+ const t = (e) => ft(e, this.view.options.calendar);
2754
2799
  return [t(this.view.domain[0]), t(this.view.domain[1])];
2755
2800
  }
2756
2801
  /** A pan or zoom of the planner's goes into the view once per frame,
@@ -2764,18 +2809,18 @@ class Ui {
2764
2809
  }
2765
2810
  /** The time and the lane at a client point, or null outside the plot. */
2766
2811
  positionAt(t, e) {
2767
- const n = this.plot?.getBoundingClientRect();
2768
- if (n === void 0) return null;
2769
- const i = t - n.left, o = e - n.top;
2770
- return i < 0 || o < 0 || i > n.width || o > n.height ? null : { time: this.view.timeAt(i), lane: this.view.laneIdAt(o) };
2812
+ const s = this.plot?.getBoundingClientRect();
2813
+ if (s === void 0) return null;
2814
+ const i = t - s.left, o = e - s.top;
2815
+ return i < 0 || o < 0 || i > s.width || o > s.height ? null : { time: this.view.timeAt(i), lane: this.view.laneIdAt(o) };
2771
2816
  }
2772
2817
  /** The client point of a time, on a lane's middle where one is named, or
2773
2818
  null while the schedule is not on screen. */
2774
2819
  clientPointOf(t, e) {
2775
- const n = this.plot?.getBoundingClientRect();
2776
- if (n === void 0) return null;
2777
- const i = this.view.viewport(), o = e === void 0 ? null : tt(i, e), a = o === null ? 0 : o.top + o.height / 2;
2778
- return { x: n.left + x(i, t), y: n.top + a };
2820
+ const s = this.plot?.getBoundingClientRect();
2821
+ if (s === void 0) return null;
2822
+ const i = this.view.viewport(), o = e === void 0 ? null : et(i, e), a = o === null ? 0 : o.top + o.height / 2;
2823
+ return { x: s.left + x(i, t), y: s.top + a };
2779
2824
  }
2780
2825
  /** Whether a lane has a row of its own on a mounted plot: not unknown, not
2781
2826
  in a folded group, whose lanes are strips and no rows. */
@@ -2787,7 +2832,7 @@ class Ui {
2787
2832
  moved, for a lane without a row. */
2788
2833
  scrollToLane(t) {
2789
2834
  if (!this.hasRow(t)) return !1;
2790
- const e = this.view.rows.slots.get(t), n = e.top - this.view.scrollY, i = n < 0 ? n : n + e.height > this.view.height ? Math.min(n + e.height - this.view.height, n) : 0;
2835
+ const e = this.view.rows.slots.get(t), s = e.top - this.view.scrollY, i = s < 0 ? s : s + e.height > this.view.height ? Math.min(s + e.height - this.view.height, s) : 0;
2791
2836
  return this.view.pan(0, i).moved && this.viewMoved(!1), !0;
2792
2837
  }
2793
2838
  /** Brings a subtask's lane and time into view, the span keeping its width;
@@ -2807,9 +2852,9 @@ class Ui {
2807
2852
  }
2808
2853
  draw() {
2809
2854
  if (this.root === null) return;
2810
- this.colours === null && (this.colours = bi(this.root, this.data), this.publish());
2811
- const { width: t, height: e } = this.view, n = this.dataStale ? Ne(this.dataCanvas, t, e) : null, i = Ne(this.overlayCanvas, t, e);
2812
- if (i === null || t === 0 || this.dataStale && n === null) return;
2855
+ this.colours === null && (this.colours = Si(this.root, this.data), this.publish());
2856
+ const { width: t, height: e } = this.view, s = this.dataStale ? Re(this.dataCanvas, t, e) : null, i = Re(this.overlayCanvas, t, e);
2857
+ if (i === null || t === 0 || this.dataStale && s === null) return;
2813
2858
  this.dataStale = !1;
2814
2859
  const o = {
2815
2860
  data: this.data,
@@ -2821,7 +2866,7 @@ class Ui {
2821
2866
  hover: this.gestures.hover,
2822
2867
  ghost: this.gestures.ghostDrawing()
2823
2868
  };
2824
- n !== null && Mi(n, o), Ti(i, o);
2869
+ s !== null && Ii(s, o), Li(i, o);
2825
2870
  }
2826
2871
  /* ---------------------------------------------------------------- */
2827
2872
  /* Gestures, as the component hands them in */
@@ -2842,50 +2887,50 @@ class Ui {
2842
2887
  focus = (t) => this.keys.focus(t);
2843
2888
  blur = () => this.keys.blur();
2844
2889
  }
2845
- function so(s = {}) {
2846
- const { initialView: t, onViewChange: e } = s, [n] = ht(() => new Ui(t)), i = W(""), [o] = ht(() => {
2847
- const l = (d) => xs(ti, { ...d, scene: n });
2890
+ function oo(n = {}) {
2891
+ const { initialView: t, onViewChange: e } = n, [s] = ct(() => new ji(t)), i = U(""), [o] = ct(() => {
2892
+ const l = (d) => Rs(ii, { ...d, scene: s });
2848
2893
  return l.displayName = "Schedule", {
2849
2894
  Schedule: l,
2850
- Lane: ii,
2851
- LaneGroup: oi,
2852
- Subtasks: ai,
2853
- Dependencies: ri,
2854
- BlockedTimes: li,
2855
- Milestones: di,
2856
- DataTable: si,
2895
+ Lane: li,
2896
+ LaneGroup: di,
2897
+ Subtasks: hi,
2898
+ Dependencies: ci,
2899
+ BlockedTimes: ui,
2900
+ Milestones: fi,
2901
+ DataTable: ai,
2857
2902
  setView: (d) => {
2858
- n.applyView(d), i.current = it(n.getView());
2903
+ s.applyView(d), i.current = it(s.getView());
2859
2904
  },
2860
- setDomain: n.setDomain,
2861
- positionAt: (d, h) => n.positionAt(d, h),
2862
- clientPointOf: (d, h) => n.clientPointOf(d, h),
2863
- visibleDomain: () => n.visibleDomain(),
2864
- scrollToLane: (d) => n.scrollToLane(d),
2865
- scrollToSubtask: (d) => n.scrollToSubtask(d),
2866
- focusSubtask: (d) => n.focusSubtask(d),
2867
- toggleGroup: n.toggleGroup,
2868
- foldAll: n.foldAll,
2869
- unfoldAll: n.unfoldAll
2905
+ setDomain: s.setDomain,
2906
+ positionAt: (d, c) => s.positionAt(d, c),
2907
+ clientPointOf: (d, c) => s.clientPointOf(d, c),
2908
+ visibleDomain: () => s.visibleDomain(),
2909
+ scrollToLane: (d) => s.scrollToLane(d),
2910
+ scrollToSubtask: (d) => s.scrollToSubtask(d),
2911
+ focusSubtask: (d) => s.focusSubtask(d),
2912
+ toggleGroup: s.toggleGroup,
2913
+ foldAll: s.foldAll,
2914
+ unfoldAll: s.unfoldAll
2870
2915
  };
2871
- }), a = Jt(n.subscribeView, n.getView, n.getView), r = it(a);
2916
+ }), a = te(s.subscribeView, s.getView, s.getView), r = it(a);
2872
2917
  return Y(() => {
2873
- i.current !== r && (i.current = r, n.acted && e?.(a));
2874
- }, [r]), U(() => ({ ...o, view: a }), [o, a]);
2918
+ i.current !== r && (i.current = r, s.acted && e?.(a));
2919
+ }, [r]), X(() => ({ ...o, view: a }), [o, a]);
2875
2920
  }
2876
2921
  export {
2877
- Ce as applyIntent,
2878
- te as arrival,
2879
- Qt as departure,
2880
- Qi as findings,
2881
- Qe as inBlockedTime,
2882
- Q as occupied,
2883
- ee as overlaps,
2922
+ De as applyIntent,
2923
+ se as arrival,
2924
+ ee as departure,
2925
+ so as findings,
2926
+ es as inBlockedTime,
2927
+ tt as occupied,
2928
+ ne as overlaps,
2884
2929
  It as resolveAppearance,
2885
- to as ripple,
2886
- eo as shiftTask,
2887
- Vs as snapTime,
2888
- Ji as subtaskFromPlace,
2889
- so as useSchedule,
2890
- se as violatedDependencies
2930
+ no as ripple,
2931
+ io as shiftTask,
2932
+ Us as snapTime,
2933
+ eo as subtaskFromPlace,
2934
+ oo as useSchedule,
2935
+ ie as violatedDependencies
2891
2936
  };