@telepath-computer/television 0.1.205 → 0.1.208

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.
Files changed (46) hide show
  1. package/dist/THIRD-PARTY-NOTICES.txt +46 -12
  2. package/dist/canonical/v1/components.js +1 -258
  3. package/dist/canonical/v1/styles.css +372 -312
  4. package/dist/cli.cjs +11311 -10219
  5. package/dist/onboarding/README.md +19 -14
  6. package/dist/onboarding/business-ops/about.html +4 -8
  7. package/dist/onboarding/business-ops/retention-vs-releases.html +0 -9
  8. package/dist/onboarding/business-ops/revenue-vs-goals.html +0 -11
  9. package/dist/onboarding/onboarding-channels.json +114 -0
  10. package/dist/onboarding/productivity/about.html +4 -8
  11. package/dist/onboarding/productivity/company-todos/index.html +0 -3
  12. package/dist/onboarding/productivity/company-todos/task.css +3 -3
  13. package/dist/onboarding/productivity/company-todos/task.js +1 -4
  14. package/dist/onboarding/productivity/meeting-prep.html +0 -7
  15. package/dist/onboarding/productivity/priorities-today.html +0 -7
  16. package/dist/onboarding/productivity/todays-calendar/calendar.js +327 -643
  17. package/dist/onboarding/productivity/todays-calendar/index.html +0 -4
  18. package/dist/onboarding/research/about.html +5 -9
  19. package/dist/onboarding/research/open-model-research.html +0 -9
  20. package/dist/onboarding/research/todays-news.html +3 -10
  21. package/dist/onboarding/tv-guide/welcome/index.html +5 -5
  22. package/dist/skills/television/SKILL.md +180 -136
  23. package/dist/skills/tv-calendar/calendar.js +327 -643
  24. package/dist/skills/tv-tasks/SKILL.md +10 -9
  25. package/dist/skills/tv-tasks/task.css +5 -6
  26. package/dist/skills/tv-tasks/task.js +2 -5
  27. package/dist/skills/tv-theme/SKILL.md +293 -193
  28. package/dist/views/artifact-missing/index.html +125 -60
  29. package/dist/views/markdown/THIRD-PARTY-NOTICES.txt +7 -7
  30. package/dist/views/markdown/index.html +23 -46
  31. package/dist/web/THIRD-PARTY-NOTICES.txt +4 -4
  32. package/dist/web/assets/artifact-bridge-BXDhGuL-.js +1 -0
  33. package/dist/web/assets/{artifactMissing-DY3nzD0p.js → artifactMissing-9rcTXhkH.js} +1 -1
  34. package/dist/web/assets/main-Blg8fuaV.css +1 -0
  35. package/dist/web/assets/main-C15ixkrL.js +593 -0
  36. package/dist/web/assets/{urlUnsupported-B2K6eB7H.js → urlUnsupported-kgq7Zh2V.js} +1 -1
  37. package/dist/web/index.html +4 -3
  38. package/dist/web/views/artifact-missing/index.html +125 -60
  39. package/dist/web/views/url-unsupported/index.html +127 -74
  40. package/package.json +4 -1
  41. package/dist/onboarding/onboarding-screens.json +0 -167
  42. package/dist/skills/tv-calendar/THIRD-PARTY-NOTICES.txt +0 -36
  43. package/dist/web/assets/artifact-bridge-BhiFDvPj.js +0 -1
  44. package/dist/web/assets/main-5017mprd.css +0 -1
  45. package/dist/web/assets/main-C6W2LLUt.js +0 -865
  46. /package/dist/canonical/v1/fonts/{Hind-Variable.woff2 → Hind-Variable.933e9900.woff2} +0 -0
@@ -1,716 +1,400 @@
1
- var te = Object.defineProperty;
2
- var At = (n) => {
3
- throw TypeError(n);
1
+ var St = Object.defineProperty;
2
+ var F = (e) => {
3
+ throw TypeError(e);
4
4
  };
5
- var ee = (n, t, e) => t in n ? te(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
6
- var E = (n, t, e) => ee(n, typeof t != "symbol" ? t + "" : t, e), it = (n, t, e) => t.has(n) || At("Cannot " + e);
7
- var a = (n, t, e) => (it(n, t, "read from private field"), e ? e.call(n) : t.get(n)), g = (n, t, e) => t.has(n) ? At("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), $ = (n, t, e, s) => (it(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), y = (n, t, e) => (it(n, t, "access private method"), e);
8
- function tt(n) {
9
- return typeof n == "object" && n !== null;
10
- }
11
- const ot = /* @__PURE__ */ new WeakMap(), gt = Object.prototype.hasOwnProperty, se = (() => {
12
- const n = /* @__PURE__ */ new Set();
13
- let t = HTMLElement.prototype;
14
- for (; t; ) {
15
- for (const e of Object.getOwnPropertyNames(t)) n.add(e);
16
- if (t === Node.prototype) break;
17
- t = Object.getPrototypeOf(t);
5
+ var bt = (e, r, t) => r in e ? St(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
6
+ var z = (e, r, t) => bt(e, typeof r != "symbol" ? r + "" : r, t), O = (e, r, t) => r.has(e) || F("Cannot " + t);
7
+ var s = (e, r, t) => (O(e, r, "read from private field"), t ? t.call(e) : r.get(e)), h = (e, r, t) => r.has(e) ? F("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), u = (e, r, t, n) => (O(e, r, "write to private field"), n ? n.call(e, t) : r.set(e, t), t), d = (e, r, t) => (O(e, r, "access private method"), t);
8
+ class vt extends HTMLElement {
9
+ connectedCallback() {
10
+ this.dispatchEvent(new Event("reactive:connect"));
11
+ }
12
+ disconnectedCallback() {
13
+ this.dispatchEvent(new Event("reactive:disconnect"));
18
14
  }
19
- return n;
20
- })();
21
- function ne(n, t) {
22
- if (tt(n))
23
- return t === null ? void 0 : n.parse(t);
24
- if (n === Boolean) return t !== null;
25
- if (t !== null)
26
- return n === Number ? Number(t) : t;
27
- }
28
- function re(n, t) {
29
- return tt(n) ? t == null ? null : n.serialize(t) : n === Boolean ? t ? "" : null : t == null ? null : String(t);
30
15
  }
31
- var F, ct, D, v, M, R, N, L, f, U, Tt, Dt, Nt, It, J;
32
- const w = class w extends HTMLElement {
16
+ customElements.define("calendar-event", vt);
17
+ const N = 12;
18
+ var K, Q;
19
+ class Pt extends HTMLElement {
33
20
  constructor() {
34
- var r;
35
- super();
36
- g(this, f);
37
- g(this, D, /* @__PURE__ */ new Map());
38
- g(this, v, /* @__PURE__ */ new Map());
39
- g(this, M, /* @__PURE__ */ new Map());
40
- g(this, R, !1);
41
- g(this, N, !1);
42
- g(this, L, !1);
43
- const e = y(r = w, F, ct).call(r, this.constructor), s = this;
44
- for (const i of e.properties)
45
- gt.call(s, i) && (a(this, M).set(i, s[i]), delete s[i]);
46
- }
47
- static get observedAttributes() {
48
- var e;
49
- return y(e = w, F, ct).call(e, this).observedAttributes;
50
- }
51
- connected() {
52
- }
53
- disconnected() {
54
- }
55
- changed(e) {
21
+ super(...arguments);
22
+ h(this, K);
56
23
  }
57
24
  connectedCallback() {
58
- if (y(this, f, It).call(this), !a(this, N))
59
- for (const e of y(this, f, U).call(this).properties)
60
- a(this, v).has(e) || a(this, v).set(e, void 0);
61
- this.dispatchEvent(new Event("reactive:connect")), this.connected(), y(this, f, J).call(this);
25
+ this.dispatchEvent(new Event("reactive:connect")), d(this, K, Q).call(this);
62
26
  }
63
27
  disconnectedCallback() {
64
- this.dispatchEvent(new Event("reactive:disconnect")), this.disconnected();
65
- }
66
- attributeChangedCallback(e, s, r) {
67
- if (s === r) return;
68
- const i = y(this, f, U).call(this).byAttr.get(e);
69
- i && (a(this, M).has(i.property) || (this[i.property] = ne(i.type, r)));
28
+ this.dispatchEvent(new Event("reactive:disconnect"));
70
29
  }
30
+ }
31
+ K = new WeakSet(), Q = function() {
32
+ const t = Array.from({ length: 24 }, (n, a) => {
33
+ const i = document.createElement("div");
34
+ return i.classList.add("hour-label"), i.style.setProperty("--hour-index", String(a)), i.setAttribute("data-hour", String(a)), i.textContent = Dt(a), i;
35
+ });
36
+ this.replaceChildren(...t);
71
37
  };
72
- F = new WeakSet(), ct = function(e) {
73
- const s = ot.get(e);
74
- if (s) return s;
75
- const r = [...e.properties ?? []], i = e.attributes ?? {}, o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
76
- for (const h of r)
77
- if (se.has(h))
78
- throw new Error(
79
- `Reactive property "${h}" collides with a built-in DOM property. Rename it to avoid shadowing the platform API.`
80
- );
81
- for (const [h, d] of Object.entries(i)) {
82
- if (h.includes("-") && d.property === void 0)
83
- throw new Error(
84
- `Attribute "${h}" must declare a "property" name because kebab-case cannot be a property.`
85
- );
86
- const u = d.property ?? h;
87
- if (!r.includes(u))
88
- throw new Error(
89
- `Attribute '${h}' references property '${u}', which isn't declared in \`static properties\`. Add it to \`properties\` to make it reactive.`
90
- );
91
- if (tt(d.type)) {
92
- if (typeof d.type.parse != "function")
93
- throw new Error(
94
- `Attribute "${h}" custom coercer is missing a \`parse\` function.`
95
- );
96
- if (typeof d.type.serialize != "function")
97
- throw new Error(
98
- `Attribute "${h}" custom coercer is missing a \`serialize\` function.`
99
- );
100
- }
101
- const b = { attribute: h, property: u, type: d.type };
102
- o.set(h, b), l.set(u, b);
103
- }
104
- for (const h of r) {
105
- const d = Object.getOwnPropertyDescriptor(e.prototype, h);
106
- if ((d == null ? void 0 : d.get) !== void 0 || (d == null ? void 0 : d.set) !== void 0)
107
- throw new Error(
108
- `Observed property "${h}" cannot define a custom getter/setter. Use changed() for side effects instead.`
109
- );
110
- d === void 0 && Object.defineProperty(e.prototype, h, {
111
- configurable: !0,
112
- enumerable: !0,
113
- get() {
114
- return a(this, D).get(h);
115
- },
116
- set(u) {
117
- y(this, f, Tt).call(this, h, u);
118
- }
119
- });
120
- }
121
- const c = {
122
- properties: r,
123
- observedAttributes: Object.keys(i),
124
- byAttr: o,
125
- byProp: l
126
- };
127
- return ot.set(e, c), c;
128
- }, D = new WeakMap(), v = new WeakMap(), M = new WeakMap(), R = new WeakMap(), N = new WeakMap(), L = new WeakMap(), f = new WeakSet(), U = function() {
129
- return ot.get(this.constructor);
130
- }, Tt = function(e, s) {
131
- if (!a(this, L) && a(this, M).has(e)) return;
132
- const r = a(this, D).get(e);
133
- y(this, f, Dt).call(this, e, r, s) || (a(this, v).has(e) || a(this, v).set(e, r), a(this, D).set(e, s), a(this, M).delete(e), y(this, f, Nt).call(this, e, s), this.isConnected && y(this, f, J).call(this));
134
- }, Dt = function(e, s, r) {
135
- if (Object.is(s, r)) return !0;
136
- const i = y(this, f, U).call(this).byProp.get(e);
137
- if (!i || !tt(i.type)) return !1;
138
- const o = s == null, l = r == null;
139
- if (o || l) return o && l;
140
- try {
141
- return i.type.serialize(s) === i.type.serialize(r);
142
- } catch {
143
- return !1;
144
- }
145
- }, Nt = function(e, s) {
146
- const r = y(this, f, U).call(this).byProp.get(e);
147
- if (!r) return;
148
- const { attribute: i, type: o } = r;
149
- if (o === Boolean) {
150
- const c = this.hasAttribute(i);
151
- s && !c ? this.setAttribute(i, "") : !s && c && this.removeAttribute(i);
152
- return;
38
+ customElements.define("calendar-time-axis", Pt);
39
+ function Dt(e) {
40
+ const r = e < N ? "AM" : "PM";
41
+ return `${e % N === 0 ? N : e % N} ${r}`;
42
+ }
43
+ const q = 24, Ct = 8, Mt = 6e4, Z = 23, xt = 59, Tt = 1e3, L = 60, $ = q * L, tt = $ * L * Tt, At = /^(\d{4})-(\d{2})-(\d{2})$/, kt = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/, Ht = ["days", "startDate", "startHour"];
44
+ var g, v, y, k, m, b, x, T, M, H, A, P, D, C, w, o, nt, R, I, rt, st, at, it, ot, lt, ct, dt, B, ut, ht, yt, Y, pt, U;
45
+ class et extends HTMLElement {
46
+ constructor() {
47
+ super();
48
+ h(this, o);
49
+ h(this, g, null);
50
+ h(this, v, 0);
51
+ h(this, y, null);
52
+ h(this, k, !1);
53
+ h(this, m, null);
54
+ h(this, b, null);
55
+ h(this, x, !1);
56
+ h(this, T, null);
57
+ h(this, M, /* @__PURE__ */ new Set());
58
+ h(this, H, /* @__PURE__ */ new Map());
59
+ h(this, A, null);
60
+ h(this, P, "");
61
+ h(this, D);
62
+ h(this, C, !1);
63
+ h(this, w, !1);
64
+ const t = this;
65
+ for (const n of Ht)
66
+ Object.hasOwn(this, n) && (s(this, H).set(n, t[n]), delete t[n]);
67
+ }
68
+ get days() {
69
+ return s(this, v);
70
+ }
71
+ set days(t) {
72
+ Object.is(s(this, v), t) || (u(this, v, t), d(this, o, R).call(this, "days"));
73
+ }
74
+ get startDate() {
75
+ return s(this, P);
76
+ }
77
+ set startDate(t) {
78
+ s(this, P) !== t && (u(this, P, t), d(this, o, R).call(this, "start-date"));
79
+ }
80
+ get startHour() {
81
+ return s(this, D);
82
+ }
83
+ set startHour(t) {
84
+ Object.is(s(this, D), t) || (u(this, D, t), d(this, o, R).call(this, "start-hour"));
153
85
  }
154
- const l = re(o, s);
155
- if (l === null) {
156
- this.hasAttribute(i) && this.removeAttribute(i);
157
- return;
86
+ connectedCallback() {
87
+ this.dispatchEvent(new Event("reactive:connect")), u(this, T, setInterval(() => d(this, o, Y).call(this), Mt)), s(this, k) ? (s(this, x) || s(this, C)) && d(this, o, I).call(this) : (u(this, k, !0), s(this, M).add("days"), s(this, M).add("start-date"), d(this, o, nt).call(this), u(this, C, !0), d(this, o, I).call(this));
158
88
  }
159
- this.getAttribute(i) !== l && this.setAttribute(i, l);
160
- }, It = function() {
161
- const e = this, s = y(this, f, U).call(this);
162
- for (const r of s.properties) {
163
- if (!gt.call(e, r)) continue;
164
- const i = e[r];
165
- delete e[r], !(a(this, M).has(r) || a(this, D).has(r)) && (e[r] = i);
89
+ disconnectedCallback() {
90
+ var t;
91
+ this.dispatchEvent(new Event("reactive:disconnect")), s(this, T) !== null && (clearInterval(s(this, T)), u(this, T, null)), (t = s(this, b)) == null || t.disconnect();
166
92
  }
167
- $(this, L, !0);
168
- try {
169
- for (const [r, i] of a(this, M))
170
- e[r] = i;
171
- a(this, M).clear();
172
- } finally {
173
- $(this, L, !1);
93
+ attributeChangedCallback(t, n, a) {
94
+ n !== a && d(this, o, at).call(this, t, a) && (u(this, C, !0), d(this, o, I).call(this));
174
95
  }
175
- }, J = function() {
176
- a(this, R) || !this.isConnected || a(this, N) && a(this, v).size === 0 || ($(this, R, !0), queueMicrotask(() => {
177
- if ($(this, R, !1), !this.isConnected || a(this, N) && a(this, v).size === 0) return;
178
- const e = new Map(a(this, v));
179
- a(this, v).clear(), $(this, N, !0);
180
- try {
181
- this.changed(e);
182
- } catch (s) {
183
- console.error(s);
184
- }
185
- this.isConnected && a(this, v).size > 0 && y(this, f, J).call(this);
186
- }));
187
- }, g(w, F), E(w, "properties"), E(w, "attributes");
188
- let j = w;
189
- class ie extends j {
190
96
  changed() {
191
- }
192
- }
193
- customElements.define("calendar-event", ie);
194
- /**
195
- * @license
196
- * Copyright 2017 Google LLC
197
- * SPDX-License-Identifier: BSD-3-Clause
198
- */
199
- const B = globalThis, $t = (n) => n, et = B.trustedTypes, _t = et ? et.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, kt = "$lit$", H = `lit$${Math.random().toFixed(9).slice(2)}$`, Ot = "?" + H, oe = `<${Ot}>`, O = document, q = () => O.createComment(""), W = (n) => n === null || typeof n != "object" && typeof n != "function", ft = Array.isArray, ae = (n) => ft(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", at = `[
200
- \f\r]`, z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, bt = /-->/g, vt = />/g, C = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
201
- \f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, Mt = /"/g, Ut = /^(?:script|style|textarea|title)$/i, le = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), xt = le(1), V = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Et = /* @__PURE__ */ new WeakMap(), T = O.createTreeWalker(O, 129);
202
- function Rt(n, t) {
203
- if (!ft(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
204
- return _t !== void 0 ? _t.createHTML(t) : t;
205
- }
206
- const ce = (n, t) => {
207
- const e = n.length - 1, s = [];
208
- let r, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = z;
209
- for (let l = 0; l < e; l++) {
210
- const c = n[l];
211
- let h, d, u = -1, b = 0;
212
- for (; b < c.length && (o.lastIndex = b, d = o.exec(c), d !== null); ) b = o.lastIndex, o === z ? d[1] === "!--" ? o = bt : d[1] !== void 0 ? o = vt : d[2] !== void 0 ? (Ut.test(d[2]) && (r = RegExp("</" + d[2], "g")), o = C) : d[3] !== void 0 && (o = C) : o === C ? d[0] === ">" ? (o = r ?? z, u = -1) : d[1] === void 0 ? u = -2 : (u = o.lastIndex - d[2].length, h = d[1], o = d[3] === void 0 ? C : d[3] === '"' ? Mt : St) : o === Mt || o === St ? o = C : o === bt || o === vt ? o = z : (o = C, r = void 0);
213
- const P = o === C && n[l + 1].startsWith("/>") ? " " : "";
214
- i += o === z ? c + oe : u >= 0 ? (s.push(h), c.slice(0, u) + kt + c.slice(u) + H + P) : c + H + (u === -2 ? l : P);
215
- }
216
- return [Rt(n, i + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
217
- };
218
- class Y {
219
- constructor({ strings: t, _$litType$: e }, s) {
220
- let r;
221
- this.parts = [];
222
- let i = 0, o = 0;
223
- const l = t.length - 1, c = this.parts, [h, d] = ce(t, e);
224
- if (this.el = Y.createElement(h, s), T.currentNode = this.el.content, e === 2 || e === 3) {
225
- const u = this.el.content.firstChild;
226
- u.replaceWith(...u.childNodes);
97
+ const t = d(this, o, lt).call(this), n = Lt(this.startDate, this.days), a = t.map((c) => ({
98
+ event: c,
99
+ placement: n ? _t(c, n) : null
100
+ })), i = qt(a), l = Kt(this.startHour, a.map(({ placement: c }) => c));
101
+ if (u(this, A, n), this.style.setProperty("--day-count", String((n == null ? void 0 : n.dayCount) ?? 0)), this.style.setProperty("--hour-count", String(q)), this.style.setProperty("--start-hour", String(l)), !n) {
102
+ d(this, o, ut).call(this);
103
+ for (const { event: c } of a)
104
+ W(c), this.append(c);
105
+ return;
227
106
  }
228
- for (; (r = T.nextNode()) !== null && c.length < l; ) {
229
- if (r.nodeType === 1) {
230
- if (r.hasAttributes()) for (const u of r.getAttributeNames()) if (u.endsWith(kt)) {
231
- const b = d[o++], P = r.getAttribute(u).split(H), X = /([.?@])?(.*)/.exec(b);
232
- c.push({ type: 1, index: i, name: X[2], strings: P, ctor: X[1] === "." ? de : X[1] === "?" ? ue : X[1] === "@" ? ye : nt }), r.removeAttribute(u);
233
- } else u.startsWith(H) && (c.push({ type: 6, index: i }), r.removeAttribute(u));
234
- if (Ut.test(r.tagName)) {
235
- const u = r.textContent.split(H), b = u.length - 1;
236
- if (b > 0) {
237
- r.textContent = et ? et.emptyScript : "";
238
- for (let P = 0; P < b; P++) r.append(u[P], q()), T.nextNode(), c.push({ type: 2, index: ++i });
239
- r.append(u[b], q());
240
- }
241
- }
242
- } else if (r.nodeType === 8) if (r.data === Ot) c.push({ type: 2, index: i });
243
- else {
244
- let u = -1;
245
- for (; (u = r.data.indexOf(H, u + 1)) !== -1; ) c.push({ type: 7, index: i }), u += H.length - 1;
246
- }
247
- i++;
107
+ d(this, o, ht).call(this, n), d(this, o, yt).call(this, a, n, i), d(this, o, Y).call(this), d(this, o, ot).call(this);
108
+ }
109
+ }
110
+ g = new WeakMap(), v = new WeakMap(), y = new WeakMap(), k = new WeakMap(), m = new WeakMap(), b = new WeakMap(), x = new WeakMap(), T = new WeakMap(), M = new WeakMap(), H = new WeakMap(), A = new WeakMap(), P = new WeakMap(), D = new WeakMap(), C = new WeakMap(), w = new WeakMap(), o = new WeakSet(), nt = function() {
111
+ for (const [t, n] of s(this, H))
112
+ switch (t) {
113
+ case "days":
114
+ this.days = n;
115
+ break;
116
+ case "startDate":
117
+ this.startDate = n;
118
+ break;
119
+ case "startHour":
120
+ this.startHour = n;
121
+ break;
248
122
  }
123
+ s(this, H).clear();
124
+ }, R = function(t) {
125
+ s(this, M).add(t), u(this, C, !0), d(this, o, I).call(this);
126
+ }, I = function() {
127
+ s(this, w) || (u(this, w, !0), queueMicrotask(() => d(this, o, rt).call(this)));
128
+ }, rt = function() {
129
+ if (u(this, w, !1), !s(this, k)) return;
130
+ const t = s(this, C) || s(this, x);
131
+ if (u(this, C, !1), u(this, x, !1), d(this, o, st).call(this), !this.isConnected) {
132
+ u(this, x, t);
133
+ return;
249
134
  }
250
- static createElement(t, e) {
251
- const s = O.createElement("template");
252
- return s.innerHTML = t, s;
253
- }
254
- }
255
- function K(n, t, e = n, s) {
256
- var o, l;
257
- if (t === V) return t;
258
- let r = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
259
- const i = W(t) ? void 0 : t._$litDirective$;
260
- return (r == null ? void 0 : r.constructor) !== i && ((l = r == null ? void 0 : r._$AO) == null || l.call(r, !1), i === void 0 ? r = void 0 : (r = new i(n), r._$AT(n, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = K(n, r._$AS(n, t.values), r, s)), t;
261
- }
262
- class he {
263
- constructor(t, e) {
264
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
265
- }
266
- get parentNode() {
267
- return this._$AM.parentNode;
268
- }
269
- get _$AU() {
270
- return this._$AM._$AU;
271
- }
272
- u(t) {
273
- const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? O).importNode(e, !0);
274
- T.currentNode = r;
275
- let i = T.nextNode(), o = 0, l = 0, c = s[0];
276
- for (; c !== void 0; ) {
277
- if (o === c.index) {
278
- let h;
279
- c.type === 2 ? h = new Z(i, i.nextSibling, this, t) : c.type === 1 ? h = new c.ctor(i, c.name, c.strings, this, t) : c.type === 6 && (h = new pe(i, this, t)), this._$AV.push(h), c = s[++l];
280
- }
281
- o !== (c == null ? void 0 : c.index) && (i = T.nextNode(), o++);
282
- }
283
- return T.currentNode = O, r;
284
- }
285
- p(t) {
286
- let e = 0;
287
- for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
288
- }
289
- }
290
- class Z {
291
- get _$AU() {
292
- var t;
293
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
294
- }
295
- constructor(t, e, s, r) {
296
- this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
297
- }
298
- get parentNode() {
299
- let t = this._$AA.parentNode;
300
- const e = this._$AM;
301
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
302
- }
303
- get startNode() {
304
- return this._$AA;
305
- }
306
- get endNode() {
307
- return this._$AB;
308
- }
309
- _$AI(t, e = this) {
310
- t = K(this, t, e), W(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== V && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ae(t) ? this.k(t) : this._(t);
311
- }
312
- O(t) {
313
- return this._$AA.parentNode.insertBefore(t, this._$AB);
314
- }
315
- T(t) {
316
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
317
- }
318
- _(t) {
319
- this._$AH !== m && W(this._$AH) ? this._$AA.nextSibling.data = t : this.T(O.createTextNode(t)), this._$AH = t;
320
- }
321
- $(t) {
322
- var i;
323
- const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = Y.createElement(Rt(s.h, s.h[0]), this.options)), s);
324
- if (((i = this._$AH) == null ? void 0 : i._$AD) === r) this._$AH.p(e);
325
- else {
326
- const o = new he(r, this), l = o.u(this.options);
327
- o.p(e), this.T(l), this._$AH = o;
135
+ t && d(this, o, it).call(this);
136
+ }, st = function() {
137
+ const t = [...s(this, M)];
138
+ s(this, M).clear();
139
+ for (const n of t) {
140
+ const a = n === "days" ? s(this, v) : n === "start-date" ? s(this, P) : s(this, D), i = a === void 0 ? null : String(a);
141
+ i === null ? this.removeAttribute(n) : this.getAttribute(n) !== i && this.setAttribute(n, i);
142
+ }
143
+ }, at = function(t, n) {
144
+ switch (t) {
145
+ case "days": {
146
+ const a = X(n);
147
+ return Object.is(s(this, v), a) ? !1 : (u(this, v, a), !0);
328
148
  }
329
- }
330
- _$AC(t) {
331
- let e = Et.get(t.strings);
332
- return e === void 0 && Et.set(t.strings, e = new Y(t)), e;
333
- }
334
- k(t) {
335
- ft(this._$AH) || (this._$AH = [], this._$AR());
336
- const e = this._$AH;
337
- let s, r = 0;
338
- for (const i of t) r === e.length ? e.push(s = new Z(this.O(q()), this.O(q()), this, this.options)) : s = e[r], s._$AI(i), r++;
339
- r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
340
- }
341
- _$AR(t = this._$AA.nextSibling, e) {
342
- var s;
343
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t !== this._$AB; ) {
344
- const r = $t(t).nextSibling;
345
- $t(t).remove(), t = r;
149
+ case "start-date": {
150
+ const a = n ?? void 0;
151
+ return s(this, P) === a ? !1 : (u(this, P, a), !0);
346
152
  }
347
- }
348
- setConnected(t) {
349
- var e;
350
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
351
- }
352
- }
353
- class nt {
354
- get tagName() {
355
- return this.element.tagName;
356
- }
357
- get _$AU() {
358
- return this._$AM._$AU;
359
- }
360
- constructor(t, e, s, r, i) {
361
- this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
362
- }
363
- _$AI(t, e = this, s, r) {
364
- const i = this.strings;
365
- let o = !1;
366
- if (i === void 0) t = K(this, t, e, 0), o = !W(t) || t !== this._$AH && t !== V, o && (this._$AH = t);
367
- else {
368
- const l = t;
369
- let c, h;
370
- for (t = i[0], c = 0; c < i.length - 1; c++) h = K(this, l[s + c], e, c), h === V && (h = this._$AH[c]), o || (o = !W(h) || h !== this._$AH[c]), h === m ? t = m : t !== m && (t += (h ?? "") + i[c + 1]), this._$AH[c] = h;
153
+ case "start-hour": {
154
+ const a = X(n);
155
+ return Object.is(s(this, D), a) ? !1 : (u(this, D, a), !0);
371
156
  }
372
- o && !r && this.j(t);
373
- }
374
- j(t) {
375
- t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
376
- }
377
- }
378
- class de extends nt {
379
- constructor() {
380
- super(...arguments), this.type = 3;
381
- }
382
- j(t) {
383
- this.element[this.name] = t === m ? void 0 : t;
384
- }
385
- }
386
- class ue extends nt {
387
- constructor() {
388
- super(...arguments), this.type = 4;
389
- }
390
- j(t) {
391
- this.element.toggleAttribute(this.name, !!t && t !== m);
157
+ default:
158
+ return !1;
392
159
  }
393
- }
394
- class ye extends nt {
395
- constructor(t, e, s, r, i) {
396
- super(t, e, s, r, i), this.type = 5;
397
- }
398
- _$AI(t, e = this) {
399
- if ((t = K(this, t, e, 0) ?? m) === V) return;
400
- const s = this._$AH, r = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== m && (s === m || r);
401
- r && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
402
- }
403
- handleEvent(t) {
404
- var e;
405
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
406
- }
407
- }
408
- class pe {
409
- constructor(t, e, s) {
410
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
411
- }
412
- get _$AU() {
413
- return this._$AM._$AU;
414
- }
415
- _$AI(t) {
416
- K(this, t);
417
- }
418
- }
419
- const lt = B.litHtmlPolyfillSupport;
420
- lt == null || lt(Y, Z), (B.litHtmlVersions ?? (B.litHtmlVersions = [])).push("3.3.2");
421
- const fe = (n, t, e) => {
422
- const s = t;
423
- let r = s._$litPart$;
424
- return r === void 0 && (s._$litPart$ = r = new Z(t.insertBefore(q(), null), null, void 0, {})), r._$AI(n), r;
425
- }, G = 12;
426
- class Lt extends j {
427
- changed() {
428
- fe(
429
- xt`${Array.from({ length: 24 }, (t, e) => xt`<div
430
- class="hour-label"
431
- style="--hour-index: ${e};"
432
- data-hour=${e}
433
- >${me(e)}</div>`)}`,
434
- this
435
- );
436
- }
437
- }
438
- E(Lt, "properties", []);
439
- customElements.define("calendar-time-axis", Lt);
440
- function me(n) {
441
- const t = n < G ? "AM" : "PM";
442
- return `${n % G === 0 ? G : n % G} ${t}`;
443
- }
444
- const ht = 24, Ae = 8, ge = 6e4, Kt = 23, $e = 59, _e = 1e3, rt = 60, dt = ht * rt, zt = dt * rt * _e, be = /^(\d{4})-(\d{2})-(\d{2})$/, ve = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/;
445
- var S, A, _, x, I, k, p, Bt, jt, qt, Wt, yt, Vt, Yt, Ft, pt, Zt, Q;
446
- class ut extends j {
447
- constructor() {
448
- super(...arguments);
449
- g(this, p);
450
- E(this, "days", 0);
451
- E(this, "startDate", "");
452
- E(this, "startHour");
453
- g(this, S, null);
454
- g(this, A, null);
455
- g(this, _, null);
456
- g(this, x, null);
457
- g(this, I, null);
458
- g(this, k, null);
459
- }
460
- connected() {
461
- $(this, I, setInterval(() => y(this, p, pt).call(this), ge));
462
- }
463
- disconnected() {
464
- var e;
465
- a(this, I) !== null && (clearInterval(a(this, I)), $(this, I, null)), (e = a(this, x)) == null || e.disconnect();
466
- }
467
- changed() {
468
- const e = y(this, p, jt).call(this), s = we(this.startDate, this.days), r = e.map((l) => ({
469
- event: l,
470
- placement: s ? He(l, s) : null
471
- })), i = De(r), o = Ce(this.startHour, r.map(({ placement: l }) => l));
472
- if ($(this, k, s), this.style.setProperty("--day-count", String((s == null ? void 0 : s.dayCount) ?? 0)), this.style.setProperty("--hour-count", String(ht)), this.style.setProperty("--start-hour", String(o)), !s) {
473
- y(this, p, Vt).call(this);
474
- for (const { event: l } of r)
475
- Ht(l), this.append(l);
476
- return;
477
- }
478
- y(this, p, Yt).call(this, s), y(this, p, Ft).call(this, r, s, i), y(this, p, pt).call(this), y(this, p, Bt).call(this);
160
+ }, it = function() {
161
+ try {
162
+ this.changed();
163
+ } catch (t) {
164
+ console.error(t);
479
165
  }
480
- }
481
- S = new WeakMap(), A = new WeakMap(), _ = new WeakMap(), x = new WeakMap(), I = new WeakMap(), k = new WeakMap(), p = new WeakSet(), Bt = function() {
166
+ }, ot = function() {
482
167
  requestAnimationFrame(() => {
483
- var o, l, c;
484
- y(this, p, Q).call(this);
485
- const e = (o = a(this, A)) == null ? void 0 : o.querySelector(":scope > .start-hour-marker");
486
- if (!e) return;
487
- const s = (((l = a(this, _)) == null ? void 0 : l.offsetHeight) ?? 0) + (((c = a(this, S)) == null ? void 0 : c.offsetHeight) ?? 0), r = Math.max(this.scrollHeight - this.clientHeight, 0);
488
- if (r <= 0) return;
489
- const i = this.scrollTop + (e.getBoundingClientRect().top - this.getBoundingClientRect().top) - s;
490
- this.scrollTop = Math.max(0, Math.min(i, r));
168
+ var l, c, p;
169
+ d(this, o, U).call(this);
170
+ const t = (l = s(this, y)) == null ? void 0 : l.querySelector(":scope > .start-hour-marker");
171
+ if (!t) return;
172
+ const n = (((c = s(this, m)) == null ? void 0 : c.offsetHeight) ?? 0) + (((p = s(this, g)) == null ? void 0 : p.offsetHeight) ?? 0), a = Math.max(this.scrollHeight - this.clientHeight, 0);
173
+ if (a <= 0) return;
174
+ const i = this.scrollTop + (t.getBoundingClientRect().top - this.getBoundingClientRect().top) - n;
175
+ this.scrollTop = Math.max(0, Math.min(i, a));
491
176
  });
492
- }, jt = function() {
177
+ }, lt = function() {
493
178
  return Array.from(this.querySelectorAll("calendar-event"));
494
- }, qt = function() {
495
- a(this, _) || ($(this, _, document.createElement("calendar-headers")), this.append(a(this, _))), a(this, A) || ($(this, A, document.createElement("calendar-grid")), this.append(a(this, A)));
496
- }, Wt = function(e) {
497
- a(this, S) || ($(this, S, document.createElement("calendar-allday")), this.insertBefore(a(this, S), a(this, A)));
498
- const s = e.days.map((r, i) => Se(r, i + 1));
499
- a(this, S).replaceChildren(...s);
500
- }, yt = function() {
501
- var e;
502
- (e = a(this, S)) == null || e.remove(), $(this, S, null), this.style.removeProperty("--allday-lane-count");
503
- }, Vt = function() {
504
- var e, s, r;
505
- (e = a(this, x)) == null || e.disconnect(), (s = a(this, _)) == null || s.remove(), y(this, p, yt).call(this), (r = a(this, A)) == null || r.remove(), $(this, _, null), $(this, A, null), this.style.removeProperty("--headers-height"), this.style.removeProperty("--allday-lane-count");
506
- }, Yt = function(e) {
507
- y(this, p, qt).call(this);
508
- const s = e.days.map((i, o) => Me(i, o + 1)), r = [
179
+ }, ct = function() {
180
+ s(this, m) || (u(this, m, document.createElement("calendar-headers")), this.append(s(this, m))), s(this, y) || (u(this, y, document.createElement("calendar-grid")), this.append(s(this, y)));
181
+ }, dt = function(t) {
182
+ s(this, g) || (u(this, g, document.createElement("calendar-allday")), this.insertBefore(s(this, g), s(this, y)));
183
+ const n = t.days.map((a, i) => wt(a, i + 1));
184
+ s(this, g).replaceChildren(...n);
185
+ }, B = function() {
186
+ var t;
187
+ (t = s(this, g)) == null || t.remove(), u(this, g, null), this.style.removeProperty("--allday-lane-count");
188
+ }, ut = function() {
189
+ var t, n, a;
190
+ (t = s(this, b)) == null || t.disconnect(), (n = s(this, m)) == null || n.remove(), d(this, o, B).call(this), (a = s(this, y)) == null || a.remove(), u(this, m, null), u(this, y, null), this.style.removeProperty("--headers-height"), this.style.removeProperty("--allday-lane-count");
191
+ }, ht = function(t) {
192
+ d(this, o, ct).call(this);
193
+ const n = t.days.map((i, l) => It(i, l + 1)), a = [
509
194
  document.createElement("calendar-time-axis"),
510
- ...e.days.map((i, o) => xe(i, o + 1)),
511
- Ee()
195
+ ...t.days.map((i, l) => Nt(i, l + 1)),
196
+ Rt()
512
197
  ];
513
- a(this, _).replaceChildren(...s), a(this, A).replaceChildren(...r), y(this, p, Zt).call(this);
514
- }, Ft = function(e, s, r) {
515
- const i = e.filter(Jt);
198
+ s(this, m).replaceChildren(...n), s(this, y).replaceChildren(...a), d(this, o, pt).call(this);
199
+ }, yt = function(t, n, a) {
200
+ const i = t.filter(Et);
516
201
  if (i.length > 0) {
517
- y(this, p, Wt).call(this, s), this.style.setProperty("--allday-lane-count", String(r));
518
- for (const { event: o, placement: l } of i)
519
- Pt(o, l), a(this, S).append(o);
202
+ d(this, o, dt).call(this, n), this.style.setProperty("--allday-lane-count", String(a));
203
+ for (const { event: l, placement: c } of i)
204
+ V(l, c), s(this, g).append(l);
520
205
  } else
521
- y(this, p, yt).call(this);
522
- for (const { event: o, placement: l } of e.filter(Qt).sort(Gt))
523
- Pt(o, l), a(this, A).append(o);
524
- for (const { event: o } of e.filter(({ placement: l }) => l === null))
525
- Ht(o), this.append(o);
526
- }, pt = function() {
527
- var d, u;
528
- const e = (d = a(this, A)) == null ? void 0 : d.querySelector(":scope > .now-line"), s = (u = a(this, A)) == null ? void 0 : u.querySelector(":scope > .now-line-faint");
529
- if (!a(this, A) || !a(this, k)) {
530
- s == null || s.remove(), e == null || e.remove();
206
+ d(this, o, B).call(this);
207
+ for (const { event: l, placement: c } of t.filter(gt).sort(ft))
208
+ V(l, c), s(this, y).append(l);
209
+ for (const { event: l } of t.filter(({ placement: c }) => c === null))
210
+ W(l), this.append(l);
211
+ }, Y = function() {
212
+ var f, S;
213
+ const t = (f = s(this, y)) == null ? void 0 : f.querySelector(":scope > .now-line"), n = (S = s(this, y)) == null ? void 0 : S.querySelector(":scope > .now-line-faint");
214
+ if (!s(this, y) || !s(this, A)) {
215
+ n == null || n.remove(), t == null || t.remove();
531
216
  return;
532
217
  }
533
- const r = /* @__PURE__ */ new Date(), o = mt(r.getFullYear(), r.getMonth() + 1, r.getDate()) - a(this, k).startDayKey + 1;
534
- if (o < 1 || o > a(this, k).dayCount) {
535
- s == null || s.remove(), e == null || e.remove();
218
+ const a = /* @__PURE__ */ new Date(), l = j(a.getFullYear(), a.getMonth() + 1, a.getDate()) - s(this, A).startDayKey + 1;
219
+ if (l < 1 || l > s(this, A).dayCount) {
220
+ n == null || n.remove(), t == null || t.remove();
536
221
  return;
537
222
  }
538
- const l = (r.getHours() + r.getMinutes() / rt) / ht, c = s ?? document.createElement("div");
539
- s || (c.classList.add("now-line-faint"), a(this, A).append(c));
540
- const h = e ?? document.createElement("div");
541
- e || (h.classList.add("now-line"), a(this, A).append(h)), c.style.setProperty("--y-fraction", String(l)), h.style.setProperty("--day-index", String(o)), h.style.setProperty("--y-fraction", String(l));
542
- }, Zt = function() {
543
- var e;
544
- if (!a(this, _)) {
545
- (e = a(this, x)) == null || e.disconnect(), this.style.removeProperty("--headers-height");
223
+ const c = (a.getHours() + a.getMinutes() / L) / q, p = n ?? document.createElement("div");
224
+ n || (p.classList.add("now-line-faint"), s(this, y).append(p));
225
+ const E = t ?? document.createElement("div");
226
+ t || (E.classList.add("now-line"), s(this, y).append(E)), p.style.setProperty("--y-fraction", String(c)), E.style.setProperty("--day-index", String(l)), E.style.setProperty("--y-fraction", String(c));
227
+ }, pt = function() {
228
+ var t;
229
+ if (!s(this, m)) {
230
+ (t = s(this, b)) == null || t.disconnect(), this.style.removeProperty("--headers-height");
546
231
  return;
547
232
  }
548
233
  if (typeof ResizeObserver != "function") {
549
- y(this, p, Q).call(this);
234
+ d(this, o, U).call(this);
550
235
  return;
551
236
  }
552
- a(this, x) || $(this, x, new ResizeObserver(() => y(this, p, Q).call(this))), a(this, x).disconnect(), a(this, x).observe(a(this, _));
553
- }, Q = function() {
554
- var e;
555
- this.style.setProperty("--headers-height", `${((e = a(this, _)) == null ? void 0 : e.offsetHeight) ?? 0}px`);
556
- }, E(ut, "properties", ["days", "startDate", "startHour"]), E(ut, "attributes", {
557
- days: { type: Number },
558
- "start-date": { type: String, property: "startDate" },
559
- "start-hour": { type: Number, property: "startHour" }
560
- });
561
- customElements.define("calendar-week", ut);
562
- function Se(n, t) {
563
- const e = document.createElement("calendar-cell");
564
- return e.setAttribute("date", n.iso), e.style.setProperty("--day-index", String(t)), e;
565
- }
566
- function Me(n, t) {
567
- const e = document.createElement("calendar-day");
568
- e.setAttribute("date", n.iso), e.style.setProperty("--day-index", String(t));
569
- const s = document.createElement("span");
570
- s.classList.add("weekday"), s.textContent = n.labelWeekday;
571
- const r = document.createElement("span");
572
- return r.classList.add("date-num"), r.textContent = n.labelDay, e.append(s, r), e;
573
- }
574
- function xe(n, t) {
575
- const e = document.createElement("calendar-column");
576
- return e.setAttribute("date", n.iso), e.style.setProperty("--day-index", String(t)), e;
577
- }
578
- function Ee() {
579
- const n = document.createElement("div");
580
- return n.classList.add("start-hour-marker"), n;
581
- }
582
- function Pt(n, t) {
583
- const e = Pe(n), s = n.getAttribute("title") ?? "";
584
- if (e.querySelector("h3").textContent = s, t.kind === "all-day") {
585
- n.style.setProperty("--day-start", String(t.dayStart)), n.style.setProperty("--day-span", String(t.daySpan)), n.style.setProperty("--lane-index", String(t.laneIndex)), n.style.removeProperty("--day-index"), n.style.removeProperty("--y-start"), n.style.removeProperty("--y-end"), n.style.removeProperty("--cascade-depth");
586
- return;
587
- }
588
- n.style.setProperty("--day-index", String(t.dayIndex)), n.style.setProperty("--y-start", String(t.yStart)), n.style.setProperty("--y-end", String(t.yEnd)), n.style.setProperty("--cascade-depth", String(t.cascadeDepth)), n.style.removeProperty("--day-start"), n.style.removeProperty("--day-span"), n.style.removeProperty("--lane-index");
589
- }
590
- function Ht(n) {
237
+ s(this, b) || u(this, b, new ResizeObserver(() => d(this, o, U).call(this))), s(this, b).disconnect(), s(this, b).observe(s(this, m));
238
+ }, U = function() {
591
239
  var t;
592
- (t = n.querySelector(":scope > .event-block")) == null || t.remove(), n.style.removeProperty("--day-index"), n.style.removeProperty("--y-start"), n.style.removeProperty("--y-end"), n.style.removeProperty("--day-start"), n.style.removeProperty("--day-span"), n.style.removeProperty("--lane-index"), n.style.removeProperty("--cascade-depth");
593
- }
594
- function Pe(n) {
595
- let t = n.querySelector(":scope > .event-block");
596
- if (t) return t;
597
- t = document.createElement("div"), t.classList.add("event-block");
240
+ this.style.setProperty("--headers-height", `${((t = s(this, m)) == null ? void 0 : t.offsetHeight) ?? 0}px`);
241
+ }, z(et, "observedAttributes", ["days", "start-date", "start-hour"]);
242
+ customElements.define("calendar-week", et);
243
+ function wt(e, r) {
244
+ const t = document.createElement("calendar-cell");
245
+ return t.setAttribute("date", e.iso), t.style.setProperty("--day-index", String(r)), t;
246
+ }
247
+ function It(e, r) {
248
+ const t = document.createElement("calendar-day");
249
+ t.setAttribute("date", e.iso), t.style.setProperty("--day-index", String(r));
250
+ const n = document.createElement("span");
251
+ n.classList.add("weekday"), n.textContent = e.labelWeekday;
252
+ const a = document.createElement("span");
253
+ return a.classList.add("date-num"), a.textContent = e.labelDay, t.append(n, a), t;
254
+ }
255
+ function Nt(e, r) {
256
+ const t = document.createElement("calendar-column");
257
+ return t.setAttribute("date", e.iso), t.style.setProperty("--day-index", String(r)), t;
258
+ }
259
+ function Rt() {
598
260
  const e = document.createElement("div");
599
- e.classList.add("event-block-inner");
600
- const s = document.createElement("h3");
601
- return e.append(s), t.append(e), n.append(t), t;
261
+ return e.classList.add("start-hour-marker"), e;
602
262
  }
603
- function He(n, t) {
604
- const e = n.getAttribute("title"), s = n.getAttribute("start"), r = n.getAttribute("end");
605
- if (e === null || s === null || r === null) return null;
606
- if (n.hasAttribute("all-day")) {
607
- const c = st(s), h = st(r);
608
- if (!c || !h || h.dayKey <= c.dayKey) return null;
609
- const d = Math.max(c.dayKey, t.startDayKey), u = Math.min(h.dayKey, t.endDayKey);
610
- return u <= d ? null : {
263
+ function V(e, r) {
264
+ const t = Ut(e), n = e.getAttribute("title") ?? "";
265
+ if (t.querySelector("h3").textContent = n, r.kind === "all-day") {
266
+ e.style.setProperty("--day-start", String(r.dayStart)), e.style.setProperty("--day-span", String(r.daySpan)), e.style.setProperty("--lane-index", String(r.laneIndex)), e.style.removeProperty("--day-index"), e.style.removeProperty("--y-start"), e.style.removeProperty("--y-end"), e.style.removeProperty("--cascade-depth");
267
+ return;
268
+ }
269
+ e.style.setProperty("--day-index", String(r.dayIndex)), e.style.setProperty("--y-start", String(r.yStart)), e.style.setProperty("--y-end", String(r.yEnd)), e.style.setProperty("--cascade-depth", String(r.cascadeDepth)), e.style.removeProperty("--day-start"), e.style.removeProperty("--day-span"), e.style.removeProperty("--lane-index");
270
+ }
271
+ function W(e) {
272
+ var r;
273
+ (r = e.querySelector(":scope > .event-block")) == null || r.remove(), e.style.removeProperty("--day-index"), e.style.removeProperty("--y-start"), e.style.removeProperty("--y-end"), e.style.removeProperty("--day-start"), e.style.removeProperty("--day-span"), e.style.removeProperty("--lane-index"), e.style.removeProperty("--cascade-depth");
274
+ }
275
+ function Ut(e) {
276
+ let r = e.querySelector(":scope > .event-block");
277
+ if (r) return r;
278
+ r = document.createElement("div"), r.classList.add("event-block");
279
+ const t = document.createElement("div");
280
+ t.classList.add("event-block-inner");
281
+ const n = document.createElement("h3");
282
+ return t.append(n), r.append(t), e.append(r), r;
283
+ }
284
+ function _t(e, r) {
285
+ const t = e.getAttribute("title"), n = e.getAttribute("start"), a = e.getAttribute("end");
286
+ if (t === null || n === null || a === null) return null;
287
+ if (e.hasAttribute("all-day")) {
288
+ const p = _(n), E = _(a);
289
+ if (!p || !E || E.dayKey <= p.dayKey) return null;
290
+ const f = Math.max(p.dayKey, r.startDayKey), S = Math.min(E.dayKey, r.endDayKey);
291
+ return S <= f ? null : {
611
292
  kind: "all-day",
612
- daySpan: u - d,
613
- dayStart: d - t.startDayKey + 1,
293
+ daySpan: S - f,
294
+ dayStart: f - r.startDayKey + 1,
614
295
  laneIndex: 1
615
296
  };
616
297
  }
617
- const i = Ct(s), o = Ct(r);
618
- if (!i || !o || i.dayKey !== o.dayKey || o.totalMinutes <= i.totalMinutes) return null;
619
- const l = i.dayKey - t.startDayKey + 1;
620
- return l < 1 || l > t.dayCount ? null : {
298
+ const i = G(n), l = G(a);
299
+ if (!i || !l || i.dayKey !== l.dayKey || l.totalMinutes <= i.totalMinutes) return null;
300
+ const c = i.dayKey - r.startDayKey + 1;
301
+ return c < 1 || c > r.dayCount ? null : {
621
302
  cascadeDepth: 0,
622
303
  kind: "timed",
623
- dayIndex: l,
624
- endMinutes: o.totalMinutes,
304
+ dayIndex: c,
305
+ endMinutes: l.totalMinutes,
625
306
  startHour: i.hour,
626
307
  startMinutes: i.totalMinutes,
627
- yEnd: o.totalMinutes / dt,
628
- yStart: i.totalMinutes / dt
308
+ yEnd: l.totalMinutes / $,
309
+ yStart: i.totalMinutes / $
629
310
  };
630
311
  }
631
- function Ce(n, t) {
632
- if (Number.isInteger(n) && n >= 0 && n <= Kt)
633
- return n;
634
- const e = t.filter((s) => (s == null ? void 0 : s.kind) === "timed").map((s) => s.startHour);
635
- return e.length > 0 ? Math.max(Math.min(...e) - 1, 0) : Ae;
312
+ function Kt(e, r) {
313
+ if (Number.isInteger(e) && e >= 0 && e <= Z)
314
+ return e;
315
+ const t = r.filter((n) => (n == null ? void 0 : n.kind) === "timed").map((n) => n.startHour);
316
+ return t.length > 0 ? Math.max(Math.min(...t) - 1, 0) : Ct;
636
317
  }
637
- function we(n, t) {
638
- if (!Number.isInteger(t) || t < 1) return null;
639
- const e = st(n);
640
- if (!e) return null;
641
- const s = Array.from({ length: t }, (r, i) => Te(e, i));
318
+ function Lt(e, r) {
319
+ if (typeof r != "number" || !Number.isInteger(r) || r < 1 || e === void 0) return null;
320
+ const t = _(e);
321
+ if (!t) return null;
322
+ const n = Array.from({ length: r }, (a, i) => Ot(t, i));
642
323
  return {
643
- dayCount: t,
644
- days: s,
645
- endDayKey: e.dayKey + t,
646
- startDayKey: e.dayKey
324
+ dayCount: r,
325
+ days: n,
326
+ endDayKey: t.dayKey + r,
327
+ startDayKey: t.dayKey
647
328
  };
648
329
  }
649
- function st(n) {
650
- const t = be.exec(n);
651
- if (!t) return null;
652
- const [, e, s, r] = t, i = Number(e), o = Number(s), l = Number(r);
653
- if (!Xt(i, o, l)) return null;
654
- const c = new Date(i, o - 1, l);
330
+ function X(e) {
331
+ return e === null ? void 0 : Number(e);
332
+ }
333
+ function _(e) {
334
+ const r = At.exec(e);
335
+ if (!r) return null;
336
+ const [, t, n, a] = r, i = Number(t), l = Number(n), c = Number(a);
337
+ if (!mt(i, l, c)) return null;
338
+ const p = new Date(i, l - 1, c);
655
339
  return {
656
- dayKey: mt(i, o, l),
657
- iso: n,
658
- labelDay: String(l),
659
- labelWeekday: c.toLocaleDateString(void 0, { weekday: "short" })
340
+ dayKey: j(i, l, c),
341
+ iso: e,
342
+ labelDay: String(c),
343
+ labelWeekday: p.toLocaleDateString(void 0, { weekday: "short" })
660
344
  };
661
345
  }
662
- function Ct(n) {
663
- const t = ve.exec(n);
664
- if (!t) return null;
665
- const [, e, s, r, i, o] = t, l = Number(e), c = Number(s), h = Number(r), d = Number(i), u = Number(o);
666
- return !Xt(l, c, h) || !Number.isInteger(d) || d < 0 || d > Kt || !Number.isInteger(u) || u < 0 || u > $e ? null : {
667
- dayKey: mt(l, c, h),
668
- hour: d,
669
- totalMinutes: d * rt + u
346
+ function G(e) {
347
+ const r = kt.exec(e);
348
+ if (!r) return null;
349
+ const [, t, n, a, i, l] = r, c = Number(t), p = Number(n), E = Number(a), f = Number(i), S = Number(l);
350
+ return !mt(c, p, E) || !Number.isInteger(f) || f < 0 || f > Z || !Number.isInteger(S) || S < 0 || S > xt ? null : {
351
+ dayKey: j(c, p, E),
352
+ hour: f,
353
+ totalMinutes: f * L + S
670
354
  };
671
355
  }
672
- function Te(n, t) {
673
- const e = new Date((n.dayKey + t) * zt), s = e.getUTCFullYear(), r = e.getUTCMonth() + 1, i = e.getUTCDate();
674
- return st(
675
- `${s}-${String(r).padStart(2, "0")}-${String(i).padStart(2, "0")}`
356
+ function Ot(e, r) {
357
+ const t = new Date((e.dayKey + r) * tt), n = t.getUTCFullYear(), a = t.getUTCMonth() + 1, i = t.getUTCDate();
358
+ return _(
359
+ `${n}-${String(a).padStart(2, "0")}-${String(i).padStart(2, "0")}`
676
360
  );
677
361
  }
678
- function Xt(n, t, e) {
679
- const s = new Date(Date.UTC(n, t - 1, e));
680
- return s.getUTCFullYear() === n && s.getUTCMonth() === t - 1 && s.getUTCDate() === e;
362
+ function mt(e, r, t) {
363
+ const n = new Date(Date.UTC(e, r - 1, t));
364
+ return n.getUTCFullYear() === e && n.getUTCMonth() === r - 1 && n.getUTCDate() === t;
681
365
  }
682
- function mt(n, t, e) {
683
- return Date.UTC(n, t - 1, e) / zt;
366
+ function j(e, r, t) {
367
+ return Date.UTC(e, r - 1, t) / tt;
684
368
  }
685
- function De(n) {
686
- const t = [];
687
- for (const { placement: s } of n.filter(Jt)) {
688
- const r = s.dayStart + s.daySpan;
689
- let i = t.findIndex(
690
- (o) => o.every((l) => !wt(l.dayStart, l.dayStart + l.daySpan, s.dayStart, r))
369
+ function qt(e) {
370
+ const r = [];
371
+ for (const { placement: n } of e.filter(Et)) {
372
+ const a = n.dayStart + n.daySpan;
373
+ let i = r.findIndex(
374
+ (l) => l.every((c) => !J(c.dayStart, c.dayStart + c.daySpan, n.dayStart, a))
691
375
  );
692
- i === -1 && (t.push([]), i = t.length - 1), s.laneIndex = i + 1, t[i].push(s);
376
+ i === -1 && (r.push([]), i = r.length - 1), n.laneIndex = i + 1, r[i].push(n);
693
377
  }
694
- const e = /* @__PURE__ */ new Map();
695
- for (const { placement: s } of n.filter(Qt).sort(Gt)) {
696
- const r = e.get(s.dayIndex) ?? [];
697
- s.cascadeDepth = r.filter(
698
- (i) => i.startMinutes < s.startMinutes && wt(i.startMinutes, i.endMinutes, s.startMinutes, s.endMinutes)
699
- ).length, r.push(s), e.set(s.dayIndex, r);
378
+ const t = /* @__PURE__ */ new Map();
379
+ for (const { placement: n } of e.filter(gt).sort(ft)) {
380
+ const a = t.get(n.dayIndex) ?? [];
381
+ n.cascadeDepth = a.filter(
382
+ (i) => i.startMinutes < n.startMinutes && J(i.startMinutes, i.endMinutes, n.startMinutes, n.endMinutes)
383
+ ).length, a.push(n), t.set(n.dayIndex, a);
700
384
  }
701
- return t.length;
385
+ return r.length;
702
386
  }
703
- function Gt(n, t) {
704
- return n.placement.dayIndex - t.placement.dayIndex || n.placement.startMinutes - t.placement.startMinutes || n.placement.endMinutes - t.placement.endMinutes;
387
+ function ft(e, r) {
388
+ return e.placement.dayIndex - r.placement.dayIndex || e.placement.startMinutes - r.placement.startMinutes || e.placement.endMinutes - r.placement.endMinutes;
705
389
  }
706
- function Jt(n) {
707
- var t;
708
- return ((t = n.placement) == null ? void 0 : t.kind) === "all-day";
390
+ function Et(e) {
391
+ var r;
392
+ return ((r = e.placement) == null ? void 0 : r.kind) === "all-day";
709
393
  }
710
- function Qt(n) {
711
- var t;
712
- return ((t = n.placement) == null ? void 0 : t.kind) === "timed";
394
+ function gt(e) {
395
+ var r;
396
+ return ((r = e.placement) == null ? void 0 : r.kind) === "timed";
713
397
  }
714
- function wt(n, t, e, s) {
715
- return n < s && e < t;
398
+ function J(e, r, t, n) {
399
+ return e < n && t < r;
716
400
  }