diff --git a/crates/frontend/js-components/deno.json b/crates/frontend/js-components/deno.json index 0f9db8d..b7d8e23 100644 --- a/crates/frontend/js-components/deno.json +++ b/crates/frontend/js-components/deno.json @@ -13,6 +13,6 @@ "imports": { "@deno/vite-plugin": "npm:@deno/vite-plugin@^1.0.5", "lit": "npm:lit@^3.3.1", - "vite": "npm:vite@^7.1.12" + "vite": "npm:vite@^7.2.7" } } diff --git a/crates/frontend/js-components/deno.lock b/crates/frontend/js-components/deno.lock index 8fa8620..5d7f8ce 100644 --- a/crates/frontend/js-components/deno.lock +++ b/crates/frontend/js-components/deno.lock @@ -1,13 +1,13 @@ { "version": "5", "specifiers": { - "npm:@deno/vite-plugin@^1.0.5": "1.0.5_vite@7.1.12__picomatch@4.0.3", + "npm:@deno/vite-plugin@^1.0.5": "1.0.5_vite@7.2.7__picomatch@4.0.3", "npm:lit@^3.3.1": "3.3.1", - "npm:vite@*": "7.1.12_picomatch@4.0.3", - "npm:vite@^7.1.12": "7.1.12_picomatch@4.0.3" + "npm:vite@*": "7.2.7_picomatch@4.0.3", + "npm:vite@^7.2.7": "7.2.7_picomatch@4.0.3" }, "npm": { - "@deno/vite-plugin@1.0.5_vite@7.1.12__picomatch@4.0.3": { + "@deno/vite-plugin@1.0.5_vite@7.2.7__picomatch@4.0.3": { "integrity": "sha512-tLja5n4dyMhcze1NzvSs2iiriBymfBlDCZIrjMTxb9O2ru0gvmV6mn5oBD2teNw5Sd92cj3YJzKwsAs8tMJXlg==", "dependencies": [ "vite" @@ -397,8 +397,8 @@ "picomatch" ] }, - "vite@7.1.12_picomatch@4.0.3": { - "integrity": "sha512-ZWyE8YXEXqJrrSLvYgrRP7p62OziLW7xI5HYGWFzOvupfAlrLvURSzv/FyGyy0eidogEM3ujU+kUG1zuHgb6Ug==", + "vite@7.2.7_picomatch@4.0.3": { + "integrity": "sha512-ITcnkFeR3+fI8P1wMgItjGrR10170d8auB4EpMLPqmx6uxElH3a/hHGQabSHKdqd4FXWO1nFIp9rRn7JQ34ACQ==", "dependencies": [ "esbuild", "fdir", @@ -417,7 +417,7 @@ "dependencies": [ "npm:@deno/vite-plugin@^1.0.5", "npm:lit@^3.3.1", - "npm:vite@^7.1.12" + "npm:vite@^7.2.7" ] } } diff --git a/crates/frontend/js-components/index.html b/crates/frontend/js-components/index.html deleted file mode 100644 index c4e4bf6..0000000 --- a/crates/frontend/js-components/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - Vite + Lit - - - - - -

Vite + Lit

-
- - diff --git a/crates/frontend/js-components/lib/bundle.ts b/crates/frontend/js-components/lib/bundle.ts new file mode 100644 index 0000000..d203e9f --- /dev/null +++ b/crates/frontend/js-components/lib/bundle.ts @@ -0,0 +1,8 @@ +export { CreateAddressbookForm } from './create-addressbook-form.ts' +export { CreateBirthdayCalendarForm } from './create-birthday-calendar-form.ts' +export { CreateCalendarForm } from './create-calendar-form.ts' +export { DeleteButton } from './delete-button.ts' +export { EditAddressbookForm } from './edit-addressbook-form.ts' +export { EditCalendarForm } from './edit-calendar-form.ts' +export { ImportAddressbookForm } from './import-addressbook-form.ts' +export { ImportCalendarForm } from './import-calendar-form.ts' diff --git a/crates/frontend/js-components/lib/create-birthday-calendar-form.ts b/crates/frontend/js-components/lib/create-birthday-calendar-form.ts index fb55141..392a2ac 100644 --- a/crates/frontend/js-components/lib/create-birthday-calendar-form.ts +++ b/crates/frontend/js-components/lib/create-birthday-calendar-form.ts @@ -5,7 +5,7 @@ import { escapeXml } from "."; import { getTimezones } from "./timezones.ts"; @customElement("create-birthday-calendar-form") -export class CreateCalendarForm extends LitElement { +export class CreateBirthdayCalendarForm extends LitElement { protected override createRenderRoot() { return this } diff --git a/crates/frontend/js-components/vite.config.ts b/crates/frontend/js-components/vite.config.ts index 9397a06..bac9be0 100644 --- a/crates/frontend/js-components/vite.config.ts +++ b/crates/frontend/js-components/vite.config.ts @@ -14,21 +14,14 @@ export default defineConfig({ rollupOptions: { input: [ - "lib/create-birthday-calendar-form.ts", - "lib/create-calendar-form.ts", - "lib/edit-calendar-form.ts", - "lib/import-calendar-form.ts", - "lib/create-addressbook-form.ts", - "lib/edit-addressbook-form.ts", - "lib/import-addressbook-form.ts", - "lib/delete-button.ts", + "lib/bundle.ts", ], output: { dir: "../public/assets/js/", format: "es", - manualChunks: { - lit: ["lit"], - } + // manualChunks: { + // lit: ["lit"], + // } } }, }, diff --git a/crates/frontend/public/assets/js/bundle.mjs b/crates/frontend/public/assets/js/bundle.mjs new file mode 100644 index 0000000..c8adc0c --- /dev/null +++ b/crates/frontend/public/assets/js/bundle.mjs @@ -0,0 +1,1625 @@ +const t$3 = globalThis, e$4 = t$3.ShadowRoot && (void 0 === t$3.ShadyCSS || t$3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$3 = Symbol(), o$6 = /* @__PURE__ */ new WeakMap(); +let n$5 = class n { + constructor(t2, e2, o2) { + if (this._$cssResult$ = true, o2 !== s$3) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e2; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e$4 && void 0 === t2) { + const e2 = void 0 !== s2 && 1 === s2.length; + e2 && (t2 = o$6.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$6.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +const r$4 = (t2) => new n$5("string" == typeof t2 ? t2 : t2 + "", void 0, s$3), S$1 = (s2, o2) => { + if (e$4) s2.adoptedStyleSheets = o2.map(((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet)); + else for (const e2 of o2) { + const o3 = document.createElement("style"), n3 = t$3.litNonce; + void 0 !== n3 && o3.setAttribute("nonce", n3), o3.textContent = e2.cssText, s2.appendChild(o3); + } +}, c$3 = e$4 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e2 = ""; + for (const s2 of t3.cssRules) e2 += s2.cssText; + return r$4(e2); +})(t2) : t2; +const { is: i$3, defineProperty: e$3, getOwnPropertyDescriptor: h$3, getOwnPropertyNames: r$3, getOwnPropertySymbols: o$5, getPrototypeOf: n$4 } = Object, a$1 = globalThis, c$2 = a$1.trustedTypes, l$1 = c$2 ? c$2.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (t2, s2) => t2, u$1 = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l$1 : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }, f$3 = (t2, s2) => !i$3(t2, s2), b$1 = { attribute: true, type: String, converter: u$1, reflect: false, useDefault: false, hasChanged: f$3 }; +Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +let y$1 = class y extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = b$1) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t2) && ((s2 = Object.create(s2)).wrapped = true), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), h2 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== h2 && e$3(this.prototype, t2, h2); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e2, set: r2 } = h$3(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get: e2, set(s3) { + const h2 = e2?.call(this); + r2?.call(this, s3), this.requestUpdate(t2, h2, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? b$1; + } + static _$Ei() { + if (this.hasOwnProperty(d$1("elementProperties"))) return; + const t2 = n$4(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d$1("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) { + const t3 = this.properties, s2 = [...r$3(t3), ...o$5(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e2 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e2) i3.unshift(c$3(s3)); + } else void 0 !== s2 && i3.push(c$3(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise(((t2) => this.enableUpdating = t2)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t2) => t2(this))); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S$1(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(((t2) => t2.hostConnected?.())); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach(((t2) => t2.hostDisconnected?.())); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$ET(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i3); + if (void 0 !== e2 && true === i3.reflect) { + const h2 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u$1).toAttribute(s2, i3.type); + this._$Em = t2, null == h2 ? this.removeAttribute(e2) : this.setAttribute(e2, h2), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e2 = i3._$Eh.get(t2); + if (void 0 !== e2 && this._$Em !== e2) { + const t3 = i3.getPropertyOptions(e2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u$1; + this._$Em = e2; + const r2 = h2.fromAttribute(s2, t3.type); + this[e2] = r2 ?? this._$Ej?.get(e2) ?? r2, this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + const e2 = this.constructor, h2 = this[t2]; + if (i3 ??= e2.getPropertyOptions(t2), !((i3.hasChanged ?? f$3)(h2, s2) || i3.useDefault && i3.reflect && h2 === this._$Ej?.get(t2) && !this.hasAttribute(e2._$Eu(t2, i3)))) return; + this.C(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$EP()); + } + C(t2, s2, { useDefault: i3, reflect: e2, wrapped: h2 }, r2) { + i3 && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t2) && (this._$Ej.set(t2, r2 ?? s2 ?? this[t2]), true !== h2 || void 0 !== r2) || (this._$AL.has(t2) || (this.hasUpdated || i3 || (s2 = void 0), this._$AL.set(t2, s2)), true === e2 && this._$Em !== t2 && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t2)); + } + async _$EP() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) { + const { wrapped: t4 } = i3, e2 = this[s3]; + true !== t4 || this._$AL.has(s3) || void 0 === e2 || this.C(s3, void 0, i3, e2); + } + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach(((t3) => t3.hostUpdate?.())), this.update(s2)) : this._$EM(); + } catch (s3) { + throw t2 = false, this._$EM(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach(((t3) => t3.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EM() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Eq &&= this._$Eq.forEach(((t3) => this._$ET(t3, this[t3]))), this._$EM(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: y$1 }), (a$1.reactiveElementVersions ??= []).push("2.1.1"); +const t$2 = globalThis, i$2 = t$2.trustedTypes, s$2 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$2 = "$lit$", h$2 = `lit$${Math.random().toFixed(9).slice(2)}$`, o$4 = "?" + h$2, n$3 = `<${o$4}>`, r$2 = document, l = () => r$2.createComment(""), c$1 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a = Array.isArray, u = (t2) => a(t2) || "function" == typeof t2?.[Symbol.iterator], d = "[ \n\f\r]", f$2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y2 = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }), x = y2(1), b = y2(2), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r$2.createTreeWalker(r$2, 129); +function P(t2, i3) { + if (!a(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== s$2 ? s$2.createHTML(i3) : i3; +} +const V = (t2, i3) => { + const s2 = t2.length - 1, o2 = []; + let r2, l2 = 2 === i3 ? "" : 3 === i3 ? "" : "", c2 = f$2; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let a2, u2, d2 = -1, y3 = 0; + for (; y3 < s3.length && (c2.lastIndex = y3, u2 = c2.exec(s3), null !== u2); ) y3 = c2.lastIndex, c2 === f$2 ? "!--" === u2[1] ? c2 = v : void 0 !== u2[1] ? c2 = _ : void 0 !== u2[2] ? ($.test(u2[2]) && (r2 = RegExp("" === u2[0] ? (c2 = r2 ?? f$2, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m : c2 === v || c2 === _ ? c2 = f$2 : (c2 = m, r2 = void 0); + const x2 = c2 === m && t2[i4 + 1].startsWith("/>") ? " " : ""; + l2 += c2 === f$2 ? s3 + n$3 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$2 + s3.slice(d2) + h$2 + x2) : s3 + h$2 + (-2 === d2 ? i4 : x2); + } + return [P(t2, l2 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), o2]; +}; +class N { + constructor({ strings: t2, _$litType$: s2 }, n3) { + let r2; + this.parts = []; + let c2 = 0, a2 = 0; + const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = V(t2, s2); + if (this.el = N.createElement(f2, n3), C.currentNode = this.el.content, 2 === s2 || 3 === s2) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (r2 = C.nextNode()) && d2.length < u2; ) { + if (1 === r2.nodeType) { + if (r2.hasAttributes()) for (const t3 of r2.getAttributeNames()) if (t3.endsWith(e$2)) { + const i3 = v2[a2++], s3 = r2.getAttribute(t3).split(h$2), e2 = /([.?@])?(.*)/.exec(i3); + d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? H : "?" === e2[1] ? I : "@" === e2[1] ? L : k }), r2.removeAttribute(t3); + } else t3.startsWith(h$2) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3)); + if ($.test(r2.tagName)) { + const t3 = r2.textContent.split(h$2), s3 = t3.length - 1; + if (s3 > 0) { + r2.textContent = i$2 ? i$2.emptyScript : ""; + for (let i3 = 0; i3 < s3; i3++) r2.append(t3[i3], l()), C.nextNode(), d2.push({ type: 2, index: ++c2 }); + r2.append(t3[s3], l()); + } + } + } else if (8 === r2.nodeType) if (r2.data === o$4) d2.push({ type: 2, index: c2 }); + else { + let t3 = -1; + for (; -1 !== (t3 = r2.data.indexOf(h$2, t3 + 1)); ) d2.push({ type: 7, index: c2 }), t3 += h$2.length - 1; + } + c2++; + } + } + static createElement(t2, i3) { + const s2 = r$2.createElement("template"); + return s2.innerHTML = t2, s2; + } +} +function S(t2, i3, s2 = t2, e2) { + if (i3 === T) return i3; + let h2 = void 0 !== e2 ? s2._$Co?.[e2] : s2._$Cl; + const o2 = c$1(i3) ? void 0 : i3._$litDirective$; + return h2?.constructor !== o2 && (h2?._$AO?.(false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ??= [])[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i3 = S(t2, h2._$AS(t2, i3.values), h2, e2)), i3; +} +class M { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e2 = (t2?.creationScope ?? r$2).importNode(i3, true); + C.currentNode = e2; + let h2 = C.nextNode(), o2 = 0, n3 = 0, l2 = s2[0]; + for (; void 0 !== l2; ) { + if (o2 === l2.index) { + let i4; + 2 === l2.type ? i4 = new R(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i4 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i4 = new z(h2, this, t2)), this._$AV.push(i4), l2 = s2[++n3]; + } + o2 !== l2?.index && (h2 = C.nextNode(), o2++); + } + return C.currentNode = r$2, e2; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +} +class R { + get _$AU() { + return this._$AM?._$AU ?? this._$Cv; + } + constructor(t2, i3, s2, e2) { + this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e2, this._$Cv = e2?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = S(this, t2, i3), c$1(t2) ? t2 === E || null == t2 || "" === t2 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t2 !== this._$AH && t2 !== T && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== E && c$1(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$2.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = N.createElement(P(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e2) this._$AH.p(i3); + else { + const t3 = new M(e2, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = A.get(t2.strings); + return void 0 === i3 && A.set(t2.strings, i3 = new N(t2)), i3; + } + k(t2) { + a(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e2 = 0; + for (const h2 of t2) e2 === i3.length ? i3.push(s2 = new R(this.O(l()), this.O(l()), this, this.options)) : s2 = i3[e2], s2._$AI(h2), e2++; + e2 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i3.length = e2); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this._$Cv = t2, this._$AP?.(t2)); + } +} +class k { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e2, h2) { + this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E; + } + _$AI(t2, i3 = this, s2, e2) { + const h2 = this.strings; + let o2 = false; + if (void 0 === h2) t2 = S(this, t2, i3, 0), o2 = !c$1(t2) || t2 !== this._$AH && t2 !== T, o2 && (this._$AH = t2); + else { + const e3 = t2; + let n3, r2; + for (t2 = h2[0], n3 = 0; n3 < h2.length - 1; n3++) r2 = S(this, e3[s2 + n3], i3, n3), r2 === T && (r2 = this._$AH[n3]), o2 ||= !c$1(r2) || r2 !== this._$AH[n3], r2 === E ? t2 = E : t2 !== E && (t2 += (r2 ?? "") + h2[n3 + 1]), this._$AH[n3] = r2; + } + o2 && !e2 && this.j(t2); + } + j(t2) { + t2 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +} +class H extends k { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === E ? void 0 : t2; + } +} +class I extends k { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== E); + } +} +class L extends k { + constructor(t2, i3, s2, e2, h2) { + super(t2, i3, s2, e2, h2), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = S(this, t2, i3, 0) ?? E) === T) return; + const s2 = this._$AH, e2 = t2 === E && s2 !== E || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== E && (s2 === E || e2); + e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +} +class z { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + S(this, t2); + } +} +const j = t$2.litHtmlPolyfillSupport; +j?.(N, R), (t$2.litHtmlVersions ??= []).push("3.3.1"); +const B = (t2, i3, s2) => { + const e2 = s2?.renderBefore ?? i3; + let h2 = e2._$litPart$; + if (void 0 === h2) { + const t3 = s2?.renderBefore ?? null; + e2._$litPart$ = h2 = new R(i3.insertBefore(l(), t3), t3, void 0, s2 ?? {}); + } + return h2._$AI(t2), h2; +}; +const s$1 = globalThis; +let i$1 = class i extends y$1 { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const r2 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = B(r2, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this._$Do?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this._$Do?.setConnected(false); + } + render() { + return T; + } +}; +i$1._$litElement$ = true, i$1["finalized"] = true, s$1.litElementHydrateSupport?.({ LitElement: i$1 }); +const o$3 = s$1.litElementPolyfillSupport; +o$3?.({ LitElement: i$1 }); +(s$1.litElementVersions ??= []).push("4.2.1"); +const t$1 = (t2) => (e2, o2) => { + void 0 !== o2 ? o2.addInitializer((() => { + customElements.define(t2, e2); + })) : customElements.define(t2, e2); +}; +const o$2 = { attribute: true, type: String, converter: u$1, reflect: false, hasChanged: f$3 }, r$1 = (t2 = o$2, e2, r2) => { + const { kind: n3, metadata: i3 } = r2; + let s2 = globalThis.litPropertyMetadata.get(i3); + if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), "setter" === n3 && ((t2 = Object.create(t2)).wrapped = true), s2.set(r2.name, t2), "accessor" === n3) { + const { name: o2 } = r2; + return { set(r3) { + const n4 = e2.get.call(this); + e2.set.call(this, r3), this.requestUpdate(o2, n4, t2); + }, init(e3) { + return void 0 !== e3 && this.C(o2, void 0, t2, e3), e3; + } }; + } + if ("setter" === n3) { + const { name: o2 } = r2; + return function(r3) { + const n4 = this[o2]; + e2.call(this, r3), this.requestUpdate(o2, n4, t2); + }; + } + throw Error("Unsupported decorator location: " + n3); +}; +function n$2(t2) { + return (e2, o2) => "object" == typeof o2 ? r$1(t2, e2, o2) : ((t3, e3, o3) => { + const r2 = e3.hasOwnProperty(o3); + return e3.constructor.createProperty(o3, t3), r2 ? Object.getOwnPropertyDescriptor(e3, o3) : void 0; + })(t2, e2, o2); +} +const f$1 = (o2) => void 0 === o2.strings; +const t = { CHILD: 2 }, e$1 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); +class i2 { + constructor(t2) { + } + get _$AU() { + return this._$AM._$AU; + } + _$AT(t2, e2, i3) { + this._$Ct = t2, this._$AM = e2, this._$Ci = i3; + } + _$AS(t2, e2) { + return this.update(t2, e2); + } + update(t2, e2) { + return this.render(...e2); + } +} +const s = (i3, t2) => { + const e2 = i3._$AN; + if (void 0 === e2) return false; + for (const i4 of e2) i4._$AO?.(t2, false), s(i4, t2); + return true; +}, o$1 = (i3) => { + let t2, e2; + do { + if (void 0 === (t2 = i3._$AM)) break; + e2 = t2._$AN, e2.delete(i3), i3 = t2; + } while (0 === e2?.size); +}, r = (i3) => { + for (let t2; t2 = i3._$AM; i3 = t2) { + let e2 = t2._$AN; + if (void 0 === e2) t2._$AN = e2 = /* @__PURE__ */ new Set(); + else if (e2.has(i3)) break; + e2.add(i3), c(t2); + } +}; +function h$1(i3) { + void 0 !== this._$AN ? (o$1(this), this._$AM = i3, r(this)) : this._$AM = i3; +} +function n$1(i3, t2 = false, e2 = 0) { + const r2 = this._$AH, h2 = this._$AN; + if (void 0 !== h2 && 0 !== h2.size) if (t2) if (Array.isArray(r2)) for (let i4 = e2; i4 < r2.length; i4++) s(r2[i4], false), o$1(r2[i4]); + else null != r2 && (s(r2, false), o$1(r2)); + else s(this, i3); +} +const c = (i3) => { + i3.type == t.CHILD && (i3._$AP ??= n$1, i3._$AQ ??= h$1); +}; +class f extends i2 { + constructor() { + super(...arguments), this._$AN = void 0; + } + _$AT(i3, t2, e2) { + super._$AT(i3, t2, e2), r(this), this.isConnected = i3._$AU; + } + _$AO(i3, t2 = true) { + i3 !== this.isConnected && (this.isConnected = i3, i3 ? this.reconnected?.() : this.disconnected?.()), t2 && (s(this, i3), o$1(this)); + } + setValue(t2) { + if (f$1(this._$Ct)) this._$Ct._$AI(t2, this); + else { + const i3 = [...this._$Ct._$AH]; + i3[this._$Ci] = t2, this._$Ct._$AI(i3, this, 0); + } + } + disconnected() { + } + reconnected() { + } +} +const e = () => new h(); +class h { +} +const o = /* @__PURE__ */ new WeakMap(), n2 = e$1(class extends f { + render(i3) { + return E; + } + update(i3, [s2]) { + const e2 = s2 !== this.G; + return e2 && void 0 !== this.G && this.rt(void 0), (e2 || this.lt !== this.ct) && (this.G = s2, this.ht = i3.options?.host, this.rt(this.ct = i3.element)), E; + } + rt(t2) { + if (this.isConnected || (t2 = void 0), "function" == typeof this.G) { + const i3 = this.ht ?? globalThis; + let s2 = o.get(i3); + void 0 === s2 && (s2 = /* @__PURE__ */ new WeakMap(), o.set(i3, s2)), void 0 !== s2.get(this.G) && this.G.call(this.ht, void 0), s2.set(this.G, t2), void 0 !== t2 && this.G.call(this.ht, t2); + } else this.G.value = t2; + } + get lt() { + return "function" == typeof this.G ? o.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value; + } + disconnected() { + this.lt === this.ct && this.rt(void 0); + } + reconnected() { + this.rt(this.ct); + } +}); +function escapeXml(unsafe) { + return unsafe.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); +} +const SVG_ICON_CALENDAR = b` + + + + + + +`; +const SVG_ICON_INTERNET = b` + + + + + + + + +`; +var __defProp$7 = Object.defineProperty; +var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor; +var __decorateClass$7 = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp$7(target, key, result); + return result; +}; +let CreateAddressbookForm = class extends i$1 { + constructor() { + super(); + this.user = ""; + this.principal = ""; + this.addr_id = self.crypto.randomUUID(); + this.displayname = ""; + this.description = ""; + this.dialog = e(); + this.form = e(); + } + createRenderRoot() { + return this; + } + render() { + return x` + + +

Create addressbook

+
+ +
+ +
+ +
+ +
+ + +
+
+ `; + } + async submit(e2) { + console.log(this.displayname); + e2.preventDefault(); + if (!this.addr_id) { + alert("Empty id"); + return; + } + if (!this.displayname) { + alert("Empty displayname"); + return; + } + let response = await fetch(`/carddav/principal/${this.principal || this.user}/${this.addr_id}`, { + method: "MKCOL", + headers: { + "Content-Type": "application/xml" + }, + body: ` + + + + ${escapeXml(this.displayname)} + ${this.description ? `${escapeXml(this.description)}` : ""} + + + + ` + }); + if (response.status >= 400) { + alert(`Error ${response.status}: ${await response.text()}`); + return null; + } + window.location.reload(); + return null; + } +}; +__decorateClass$7([ + n$2() +], CreateAddressbookForm.prototype, "user", 2); +__decorateClass$7([ + n$2() +], CreateAddressbookForm.prototype, "principal", 2); +__decorateClass$7([ + n$2() +], CreateAddressbookForm.prototype, "addr_id", 2); +__decorateClass$7([ + n$2() +], CreateAddressbookForm.prototype, "displayname", 2); +__decorateClass$7([ + n$2() +], CreateAddressbookForm.prototype, "description", 2); +CreateAddressbookForm = __decorateClass$7([ + t$1("create-addressbook-form") +], CreateAddressbookForm); +var __defProp$6 = Object.defineProperty; +var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor; +var __decorateClass$6 = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp$6(target, key, result); + return result; +}; +let CreateBirthdayCalendarForm = class extends i$1 { + constructor() { + super(...arguments); + this.principal = ""; + this.addr_id = ""; + this.displayname = ""; + this.description = ""; + this.color = ""; + this.dialog = e(); + this.form = e(); + this.timezones = []; + } + createRenderRoot() { + return this; + } + render() { + return x` + + +

Create calendar

+
+ +
+ +
+ +
+ + +
+
+ `; + } + async submit(e2) { + e2.preventDefault(); + if (!this.addr_id) { + alert("Empty id"); + return; + } + if (!this.displayname) { + alert("Empty displayname"); + return; + } + let response = await fetch(`/caldav/principal/${this.principal}/_birthdays_${this.addr_id}`, { + method: "MKCOL", + headers: { + "Content-Type": "application/xml" + }, + body: ` + + + + ${escapeXml(this.displayname)} + ${this.description ? `${escapeXml(this.description)}` : ""} + ${this.color ? `${escapeXml(this.color)}` : ""} + + + + + + + ` + }); + if (response.status >= 400) { + alert(`Error ${response.status}: ${await response.text()}`); + return null; + } + window.location.reload(); + return null; + } +}; +__decorateClass$6([ + n$2() +], CreateBirthdayCalendarForm.prototype, "principal", 2); +__decorateClass$6([ + n$2() +], CreateBirthdayCalendarForm.prototype, "addr_id", 2); +__decorateClass$6([ + n$2() +], CreateBirthdayCalendarForm.prototype, "displayname", 2); +__decorateClass$6([ + n$2() +], CreateBirthdayCalendarForm.prototype, "description", 2); +__decorateClass$6([ + n$2() +], CreateBirthdayCalendarForm.prototype, "color", 2); +__decorateClass$6([ + n$2() +], CreateBirthdayCalendarForm.prototype, "timezones", 2); +CreateBirthdayCalendarForm = __decorateClass$6([ + t$1("create-birthday-calendar-form") +], CreateBirthdayCalendarForm); +let timezonesPromise = null; +async function getTimezones() { + timezonesPromise ||= new Promise(async (resolve, reject) => { + try { + let response = await fetch("/frontend/_timezones.json"); + resolve(await response.json()); + } catch (e2) { + reject(e2); + } + }); + return await timezonesPromise; +} +var __defProp$5 = Object.defineProperty; +var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor; +var __decorateClass$5 = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp$5(target, key, result); + return result; +}; +let CreateCalendarForm = class extends i$1 { + constructor() { + super(); + this.user = ""; + this.dialog = e(); + this.form = e(); + this.timezones = []; + this.resetForm(); + this.fetchTimezones(); + } + resetForm() { + this.form.value?.reset(); + this.principal = this.user; + this.cal_id = self.crypto.randomUUID(); + this.displayname = ""; + this.description = ""; + this.timezone_id = ""; + this.color = ""; + this.isSubscription = false; + this.subscriptionUrl = null; + this.components = /* @__PURE__ */ new Set(["VEVENT", "VTODO"]); + } + async fetchTimezones() { + this.timezones = await getTimezones(); + } + createRenderRoot() { + return this; + } + render() { + return x` + + this.resetForm()}> +

Create calendar

+
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ + +
+
+ ${this.isSubscription ? x` + +
+
+ ` : x``} + + +
+ ${["VEVENT", "VTODO", "VJOURNAL"].map((comp) => x` + +
+ `)} +
+
+ + +
+
+ `; + } + async submit(e2) { + e2.preventDefault(); + if (!this.cal_id) { + alert("Empty id"); + return; + } + if (!this.displayname) { + alert("Empty displayname"); + return; + } + if (!this.components.size) { + alert("No calendar components selected"); + return; + } + if (this.isSubscription && !this.subscriptionUrl) { + alert("Invalid subscription url"); + return; + } + let response = await fetch(`/caldav/principal/${this.principal || this.user}/${this.cal_id}`, { + method: "MKCOL", + headers: { + "Content-Type": "application/xml" + }, + body: ` + + + + ${escapeXml(this.displayname)} + ${this.timezone_id ? `${escapeXml(this.timezone_id)}` : ""} + ${this.description ? `${escapeXml(this.description)}` : ""} + ${this.color ? `${escapeXml(this.color)}` : ""} + ${this.isSubscription && this.subscriptionUrl ? `${escapeXml(this.subscriptionUrl)}` : ""} + + ${Array.from(this.components.keys()).map((comp) => ``).join("\n")} + + + + + ` + }); + if (response.status >= 400) { + alert(`Error ${response.status}: ${await response.text()}`); + return null; + } + window.location.reload(); + return null; + } +}; +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "user", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "principal", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "cal_id", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "displayname", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "description", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "timezone_id", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "color", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "isSubscription", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "subscriptionUrl", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "components", 2); +__decorateClass$5([ + n$2() +], CreateCalendarForm.prototype, "timezones", 2); +CreateCalendarForm = __decorateClass$5([ + t$1("create-calendar-form") +], CreateCalendarForm); +var __defProp$4 = Object.defineProperty; +var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor; +var __decorateClass$4 = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp$4(target, key, result); + return result; +}; +let DeleteButton = class extends i$1 { + constructor() { + super(); + this.trash = false; + } + createRenderRoot() { + return this; + } + render() { + let text = this.trash ? "Trash" : "Delete"; + return x``; + } + async _onClick(event) { + event.preventDefault(); + if (!this.trash && !confirm("Do you want to delete this collection permanently?")) { + return; + } + let response = await fetch(this.href, { + method: "DELETE", + headers: { + "X-No-Trashbin": this.trash ? "0" : "1" + } + }); + if (response.status < 200 || response.status >= 300) { + alert("An error occured, look into the console"); + console.error(response); + return; + } + window.location.reload(); + } +}; +__decorateClass$4([ + n$2({ type: Boolean }) +], DeleteButton.prototype, "trash", 2); +__decorateClass$4([ + n$2() +], DeleteButton.prototype, "href", 2); +DeleteButton = __decorateClass$4([ + t$1("delete-button") +], DeleteButton); +var __defProp$3 = Object.defineProperty; +var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor; +var __decorateClass$3 = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp$3(target, key, result); + return result; +}; +let EditAddressbookForm = class extends i$1 { + constructor() { + super(); + this.principal = ""; + this.addr_id = ""; + this.displayname = ""; + this.description = ""; + this.dialog = e(); + this.form = e(); + } + createRenderRoot() { + return this; + } + render() { + return x` + + +

Edit addressbook

+
+ +
+ +
+ + +
+
+ `; + } + async submit(e2) { + e2.preventDefault(); + if (!this.principal) { + alert("Empty principal"); + return; + } + if (!this.addr_id) { + alert("Empty id"); + return; + } + if (!this.displayname) { + alert("Empty displayname"); + return; + } + let response = await fetch(`/carddav/principal/${this.principal}/${this.addr_id}`, { + method: "PROPPATCH", + headers: { + "Content-Type": "application/xml" + }, + body: ` + + + + ${escapeXml(this.displayname)} + ${this.description ? `${escapeXml(this.description)}` : ""} + + + + + ${!this.description ? "" : ""} + + + + ` + }); + if (response.status >= 400) { + alert(`Error ${response.status}: ${await response.text()}`); + return null; + } + window.location.reload(); + return null; + } +}; +__decorateClass$3([ + n$2() +], EditAddressbookForm.prototype, "principal", 2); +__decorateClass$3([ + n$2() +], EditAddressbookForm.prototype, "addr_id", 2); +__decorateClass$3([ + n$2() +], EditAddressbookForm.prototype, "displayname", 2); +__decorateClass$3([ + n$2() +], EditAddressbookForm.prototype, "description", 2); +EditAddressbookForm = __decorateClass$3([ + t$1("edit-addressbook-form") +], EditAddressbookForm); +var __defProp$2 = Object.defineProperty; +var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor; +var __decorateClass$2 = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp$2(target, key, result); + return result; +}; +let EditCalendarForm = class extends i$1 { + constructor() { + super(); + this.displayname = ""; + this.description = ""; + this.timezone_id = ""; + this.color = ""; + this.components = /* @__PURE__ */ new Set(); + this.dialog = e(); + this.form = e(); + this.timezones = []; + this.fetchTimezones(); + } + async fetchTimezones() { + this.timezones = await getTimezones(); + } + createRenderRoot() { + return this; + } + render() { + return x` + + +

Edit calendar

+
+ +
+ +
+ +
+ +
+ ${["VEVENT", "VTODO", "VJOURNAL"].map((comp) => x` + +
+ `)} +
+ + +
+
+ `; + } + async submit(e2) { + e2.preventDefault(); + if (!this.principal) { + alert("Empty principal"); + return; + } + if (!this.cal_id) { + alert("Empty id"); + return; + } + if (!this.displayname) { + alert("Empty displayname"); + return; + } + if (!this.components.size) { + alert("No calendar components selected"); + return; + } + let response = await fetch(`/caldav/principal/${this.principal}/${this.cal_id}`, { + method: "PROPPATCH", + headers: { + "Content-Type": "application/xml" + }, + body: ` + + + + ${escapeXml(this.displayname)} + ${this.timezone_id ? `${escapeXml(this.timezone_id)}` : ""} + ${this.description ? `${escapeXml(this.description)}` : ""} + ${this.color ? `${escapeXml(this.color)}` : ""} + + ${Array.from(this.components.keys()).map((comp) => ``).join("\n")} + + + + + + ${!this.timezone_id ? `` : ""} + ${!this.description ? "" : ""} + ${!this.color ? "" : ""} + + + + ` + }); + if (response.status >= 400) { + alert(`Error ${response.status}: ${await response.text()}`); + return null; + } + window.location.reload(); + return null; + } +}; +__decorateClass$2([ + n$2() +], EditCalendarForm.prototype, "principal", 2); +__decorateClass$2([ + n$2() +], EditCalendarForm.prototype, "cal_id", 2); +__decorateClass$2([ + n$2() +], EditCalendarForm.prototype, "displayname", 2); +__decorateClass$2([ + n$2() +], EditCalendarForm.prototype, "description", 2); +__decorateClass$2([ + n$2() +], EditCalendarForm.prototype, "timezone_id", 2); +__decorateClass$2([ + n$2() +], EditCalendarForm.prototype, "color", 2); +__decorateClass$2([ + n$2({ + converter: { + fromAttribute: (value, _type) => new Set(value ? JSON.parse(value) : []), + toAttribute: (value, _type) => JSON.stringify(value) + } + }) +], EditCalendarForm.prototype, "components", 2); +__decorateClass$2([ + n$2() +], EditCalendarForm.prototype, "timezones", 2); +EditCalendarForm = __decorateClass$2([ + t$1("edit-calendar-form") +], EditCalendarForm); +var __defProp$1 = Object.defineProperty; +var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor; +var __decorateClass$1 = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp$1(target, key, result); + return result; +}; +let ImportAddressbookForm = class extends i$1 { + constructor() { + super(); + this.user = ""; + this.addressbook_id = self.crypto.randomUUID(); + this.dialog = e(); + this.form = e(); + } + createRenderRoot() { + return this; + } + render() { + return x` + + +

Import addressbook

+
+ +
+ +
+ +
+
+ + +
+
+ `; + } + async submit(e2) { + e2.preventDefault(); + this.principal ||= this.user; + if (!this.principal) { + alert("Empty principal"); + return; + } + if (!this.addressbook_id) { + alert("Empty id"); + return; + } + let response = await fetch(`/carddav/principal/${this.principal}/${this.addressbook_id}`, { + method: "IMPORT", + headers: { + "Content-Type": "text/vcard" + }, + body: this.file + }); + if (response.status >= 400) { + alert(`Error ${response.status}: ${await response.text()}`); + return null; + } + window.location.reload(); + return null; + } +}; +__decorateClass$1([ + n$2() +], ImportAddressbookForm.prototype, "user", 2); +__decorateClass$1([ + n$2() +], ImportAddressbookForm.prototype, "principal", 2); +__decorateClass$1([ + n$2() +], ImportAddressbookForm.prototype, "addressbook_id", 2); +ImportAddressbookForm = __decorateClass$1([ + t$1("import-addressbook-form") +], ImportAddressbookForm); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __decorateClass = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp(target, key, result); + return result; +}; +let ImportCalendarForm = class extends i$1 { + constructor() { + super(); + this.user = ""; + this.cal_id = self.crypto.randomUUID(); + this.dialog = e(); + this.form = e(); + } + createRenderRoot() { + return this; + } + render() { + return x` + + +

Import calendar

+
+ +
+ +
+ +
+
+ + +
+
+ `; + } + async submit(e2) { + e2.preventDefault(); + this.principal ||= this.user; + if (!this.principal) { + alert("Empty principal"); + return; + } + if (!this.cal_id) { + alert("Empty id"); + return; + } + let response = await fetch(`/caldav/principal/${this.principal}/${this.cal_id}`, { + method: "IMPORT", + headers: { + "Content-Type": "text/calendar" + }, + body: this.file + }); + if (response.status >= 400) { + alert(`Error ${response.status}: ${await response.text()}`); + return null; + } + window.location.reload(); + return null; + } +}; +__decorateClass([ + n$2() +], ImportCalendarForm.prototype, "user", 2); +__decorateClass([ + n$2() +], ImportCalendarForm.prototype, "principal", 2); +__decorateClass([ + n$2() +], ImportCalendarForm.prototype, "cal_id", 2); +ImportCalendarForm = __decorateClass([ + t$1("import-calendar-form") +], ImportCalendarForm); +export { + CreateAddressbookForm, + CreateBirthdayCalendarForm, + CreateCalendarForm, + DeleteButton, + EditAddressbookForm, + EditCalendarForm, + ImportAddressbookForm, + ImportCalendarForm +}; diff --git a/crates/frontend/public/assets/js/create-addressbook-form.mjs b/crates/frontend/public/assets/js/create-addressbook-form.mjs deleted file mode 100644 index b418f98..0000000 --- a/crates/frontend/public/assets/js/create-addressbook-form.mjs +++ /dev/null @@ -1,125 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n as n$1, t } from "./property-C8WJQOrH.mjs"; -import { e, n } from "./ref-BivNNNRN.mjs"; -import { e as escapeXml } from "./index-fgowJCc1.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let CreateAddressbookForm = class extends i { - constructor() { - super(); - this.user = ""; - this.principal = ""; - this.addr_id = self.crypto.randomUUID(); - this.displayname = ""; - this.description = ""; - this.dialog = e(); - this.form = e(); - } - createRenderRoot() { - return this; - } - render() { - return x` - - -

Create addressbook

-
- -
- -
- -
- -
- - -
-
- `; - } - async submit(e2) { - console.log(this.displayname); - e2.preventDefault(); - if (!this.addr_id) { - alert("Empty id"); - return; - } - if (!this.displayname) { - alert("Empty displayname"); - return; - } - let response = await fetch(`/carddav/principal/${this.principal || this.user}/${this.addr_id}`, { - method: "MKCOL", - headers: { - "Content-Type": "application/xml" - }, - body: ` - - - - ${escapeXml(this.displayname)} - ${this.description ? `${escapeXml(this.description)}` : ""} - - - - ` - }); - if (response.status >= 400) { - alert(`Error ${response.status}: ${await response.text()}`); - return null; - } - window.location.reload(); - return null; - } -}; -__decorateClass([ - n$1() -], CreateAddressbookForm.prototype, "user", 2); -__decorateClass([ - n$1() -], CreateAddressbookForm.prototype, "principal", 2); -__decorateClass([ - n$1() -], CreateAddressbookForm.prototype, "addr_id", 2); -__decorateClass([ - n$1() -], CreateAddressbookForm.prototype, "displayname", 2); -__decorateClass([ - n$1() -], CreateAddressbookForm.prototype, "description", 2); -CreateAddressbookForm = __decorateClass([ - t("create-addressbook-form") -], CreateAddressbookForm); -export { - CreateAddressbookForm -}; diff --git a/crates/frontend/public/assets/js/create-birthday-calendar-form.mjs b/crates/frontend/public/assets/js/create-birthday-calendar-form.mjs deleted file mode 100644 index a243eaa..0000000 --- a/crates/frontend/public/assets/js/create-birthday-calendar-form.mjs +++ /dev/null @@ -1,122 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n as n$1, t } from "./property-C8WJQOrH.mjs"; -import { e, n } from "./ref-BivNNNRN.mjs"; -import { e as escapeXml } from "./index-fgowJCc1.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let CreateCalendarForm = class extends i { - constructor() { - super(...arguments); - this.principal = ""; - this.addr_id = ""; - this.displayname = ""; - this.description = ""; - this.color = ""; - this.dialog = e(); - this.form = e(); - this.timezones = []; - } - createRenderRoot() { - return this; - } - render() { - return x` - - -

Create calendar

-
- -
- -
- -
- - -
-
- `; - } - async submit(e2) { - e2.preventDefault(); - if (!this.addr_id) { - alert("Empty id"); - return; - } - if (!this.displayname) { - alert("Empty displayname"); - return; - } - let response = await fetch(`/caldav/principal/${this.principal}/_birthdays_${this.addr_id}`, { - method: "MKCOL", - headers: { - "Content-Type": "application/xml" - }, - body: ` - - - - ${escapeXml(this.displayname)} - ${this.description ? `${escapeXml(this.description)}` : ""} - ${this.color ? `${escapeXml(this.color)}` : ""} - - - - - - - ` - }); - if (response.status >= 400) { - alert(`Error ${response.status}: ${await response.text()}`); - return null; - } - window.location.reload(); - return null; - } -}; -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "principal", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "addr_id", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "displayname", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "description", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "color", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "timezones", 2); -CreateCalendarForm = __decorateClass([ - t("create-birthday-calendar-form") -], CreateCalendarForm); -export { - CreateCalendarForm -}; diff --git a/crates/frontend/public/assets/js/create-calendar-form.mjs b/crates/frontend/public/assets/js/create-calendar-form.mjs deleted file mode 100644 index 69c2640..0000000 --- a/crates/frontend/public/assets/js/create-calendar-form.mjs +++ /dev/null @@ -1,220 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n as n$1, t } from "./property-C8WJQOrH.mjs"; -import { e, n } from "./ref-BivNNNRN.mjs"; -import { S as SVG_ICON_CALENDAR, a as SVG_ICON_INTERNET, e as escapeXml } from "./index-fgowJCc1.mjs"; -import { g as getTimezones } from "./timezones-B0vBBzCP.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let CreateCalendarForm = class extends i { - constructor() { - super(); - this.user = ""; - this.dialog = e(); - this.form = e(); - this.timezones = []; - this.resetForm(); - this.fetchTimezones(); - } - resetForm() { - this.form.value?.reset(); - this.principal = this.user; - this.cal_id = self.crypto.randomUUID(); - this.displayname = ""; - this.description = ""; - this.timezone_id = ""; - this.color = ""; - this.isSubscription = false; - this.subscriptionUrl = null; - this.components = /* @__PURE__ */ new Set(["VEVENT", "VTODO"]); - } - async fetchTimezones() { - this.timezones = await getTimezones(); - } - createRenderRoot() { - return this; - } - render() { - return x` - - this.resetForm()}> -

Create calendar

-
- -
- -
- -
- -
- -
- -
-
- -
- - -
-
- ${this.isSubscription ? x` - -
-
- ` : x``} - - -
- ${["VEVENT", "VTODO", "VJOURNAL"].map((comp) => x` - -
- `)} -
-
- - -
-
- `; - } - async submit(e2) { - e2.preventDefault(); - if (!this.cal_id) { - alert("Empty id"); - return; - } - if (!this.displayname) { - alert("Empty displayname"); - return; - } - if (!this.components.size) { - alert("No calendar components selected"); - return; - } - if (this.isSubscription && !this.subscriptionUrl) { - alert("Invalid subscription url"); - return; - } - let response = await fetch(`/caldav/principal/${this.principal || this.user}/${this.cal_id}`, { - method: "MKCOL", - headers: { - "Content-Type": "application/xml" - }, - body: ` - - - - ${escapeXml(this.displayname)} - ${this.timezone_id ? `${escapeXml(this.timezone_id)}` : ""} - ${this.description ? `${escapeXml(this.description)}` : ""} - ${this.color ? `${escapeXml(this.color)}` : ""} - ${this.isSubscription && this.subscriptionUrl ? `${escapeXml(this.subscriptionUrl)}` : ""} - - ${Array.from(this.components.keys()).map((comp) => ``).join("\n")} - - - - - ` - }); - if (response.status >= 400) { - alert(`Error ${response.status}: ${await response.text()}`); - return null; - } - window.location.reload(); - return null; - } -}; -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "user", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "principal", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "cal_id", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "displayname", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "description", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "timezone_id", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "color", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "isSubscription", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "subscriptionUrl", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "components", 2); -__decorateClass([ - n$1() -], CreateCalendarForm.prototype, "timezones", 2); -CreateCalendarForm = __decorateClass([ - t("create-calendar-form") -], CreateCalendarForm); -export { - CreateCalendarForm -}; diff --git a/crates/frontend/public/assets/js/delete-button.mjs b/crates/frontend/public/assets/js/delete-button.mjs deleted file mode 100644 index 50cbc49..0000000 --- a/crates/frontend/public/assets/js/delete-button.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n, t } from "./property-C8WJQOrH.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let DeleteButton = class extends i { - constructor() { - super(); - this.trash = false; - } - createRenderRoot() { - return this; - } - render() { - let text = this.trash ? "Trash" : "Delete"; - return x``; - } - async _onClick(event) { - event.preventDefault(); - if (!this.trash && !confirm("Do you want to delete this collection permanently?")) { - return; - } - let response = await fetch(this.href, { - method: "DELETE", - headers: { - "X-No-Trashbin": this.trash ? "0" : "1" - } - }); - if (response.status < 200 || response.status >= 300) { - alert("An error occured, look into the console"); - console.error(response); - return; - } - window.location.reload(); - } -}; -__decorateClass([ - n({ type: Boolean }) -], DeleteButton.prototype, "trash", 2); -__decorateClass([ - n() -], DeleteButton.prototype, "href", 2); -DeleteButton = __decorateClass([ - t("delete-button") -], DeleteButton); -export { - DeleteButton -}; diff --git a/crates/frontend/public/assets/js/edit-addressbook-form.mjs b/crates/frontend/public/assets/js/edit-addressbook-form.mjs deleted file mode 100644 index fdcbfae..0000000 --- a/crates/frontend/public/assets/js/edit-addressbook-form.mjs +++ /dev/null @@ -1,114 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n as n$1, t } from "./property-C8WJQOrH.mjs"; -import { e, n } from "./ref-BivNNNRN.mjs"; -import { e as escapeXml } from "./index-fgowJCc1.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let EditAddressbookForm = class extends i { - constructor() { - super(); - this.principal = ""; - this.addr_id = ""; - this.displayname = ""; - this.description = ""; - this.dialog = e(); - this.form = e(); - } - createRenderRoot() { - return this; - } - render() { - return x` - - -

Edit addressbook

-
- -
- -
- - -
-
- `; - } - async submit(e2) { - e2.preventDefault(); - if (!this.principal) { - alert("Empty principal"); - return; - } - if (!this.addr_id) { - alert("Empty id"); - return; - } - if (!this.displayname) { - alert("Empty displayname"); - return; - } - let response = await fetch(`/carddav/principal/${this.principal}/${this.addr_id}`, { - method: "PROPPATCH", - headers: { - "Content-Type": "application/xml" - }, - body: ` - - - - ${escapeXml(this.displayname)} - ${this.description ? `${escapeXml(this.description)}` : ""} - - - - - ${!this.description ? "" : ""} - - - - ` - }); - if (response.status >= 400) { - alert(`Error ${response.status}: ${await response.text()}`); - return null; - } - window.location.reload(); - return null; - } -}; -__decorateClass([ - n$1() -], EditAddressbookForm.prototype, "principal", 2); -__decorateClass([ - n$1() -], EditAddressbookForm.prototype, "addr_id", 2); -__decorateClass([ - n$1() -], EditAddressbookForm.prototype, "displayname", 2); -__decorateClass([ - n$1() -], EditAddressbookForm.prototype, "description", 2); -EditAddressbookForm = __decorateClass([ - t("edit-addressbook-form") -], EditAddressbookForm); -export { - EditAddressbookForm -}; diff --git a/crates/frontend/public/assets/js/edit-calendar-form.mjs b/crates/frontend/public/assets/js/edit-calendar-form.mjs deleted file mode 100644 index 7b158b4..0000000 --- a/crates/frontend/public/assets/js/edit-calendar-form.mjs +++ /dev/null @@ -1,172 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n as n$1, t } from "./property-C8WJQOrH.mjs"; -import { e, n } from "./ref-BivNNNRN.mjs"; -import { e as escapeXml } from "./index-fgowJCc1.mjs"; -import { g as getTimezones } from "./timezones-B0vBBzCP.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let EditCalendarForm = class extends i { - constructor() { - super(); - this.displayname = ""; - this.description = ""; - this.timezone_id = ""; - this.color = ""; - this.components = /* @__PURE__ */ new Set(); - this.dialog = e(); - this.form = e(); - this.timezones = []; - this.fetchTimezones(); - } - async fetchTimezones() { - this.timezones = await getTimezones(); - } - createRenderRoot() { - return this; - } - render() { - return x` - - -

Edit calendar

-
- -
- -
- -
- -
- ${["VEVENT", "VTODO", "VJOURNAL"].map((comp) => x` - -
- `)} -
- - -
-
- `; - } - async submit(e2) { - e2.preventDefault(); - if (!this.principal) { - alert("Empty principal"); - return; - } - if (!this.cal_id) { - alert("Empty id"); - return; - } - if (!this.displayname) { - alert("Empty displayname"); - return; - } - if (!this.components.size) { - alert("No calendar components selected"); - return; - } - let response = await fetch(`/caldav/principal/${this.principal}/${this.cal_id}`, { - method: "PROPPATCH", - headers: { - "Content-Type": "application/xml" - }, - body: ` - - - - ${escapeXml(this.displayname)} - ${this.timezone_id ? `${escapeXml(this.timezone_id)}` : ""} - ${this.description ? `${escapeXml(this.description)}` : ""} - ${this.color ? `${escapeXml(this.color)}` : ""} - - ${Array.from(this.components.keys()).map((comp) => ``).join("\n")} - - - - - - ${!this.timezone_id ? `` : ""} - ${!this.description ? "" : ""} - ${!this.color ? "" : ""} - - - - ` - }); - if (response.status >= 400) { - alert(`Error ${response.status}: ${await response.text()}`); - return null; - } - window.location.reload(); - return null; - } -}; -__decorateClass([ - n$1() -], EditCalendarForm.prototype, "principal", 2); -__decorateClass([ - n$1() -], EditCalendarForm.prototype, "cal_id", 2); -__decorateClass([ - n$1() -], EditCalendarForm.prototype, "displayname", 2); -__decorateClass([ - n$1() -], EditCalendarForm.prototype, "description", 2); -__decorateClass([ - n$1() -], EditCalendarForm.prototype, "timezone_id", 2); -__decorateClass([ - n$1() -], EditCalendarForm.prototype, "color", 2); -__decorateClass([ - n$1({ - converter: { - fromAttribute: (value, _type) => new Set(value ? JSON.parse(value) : []), - toAttribute: (value, _type) => JSON.stringify(value) - } - }) -], EditCalendarForm.prototype, "components", 2); -__decorateClass([ - n$1() -], EditCalendarForm.prototype, "timezones", 2); -EditCalendarForm = __decorateClass([ - t("edit-calendar-form") -], EditCalendarForm); -export { - EditCalendarForm -}; diff --git a/crates/frontend/public/assets/js/import-addressbook-form.mjs b/crates/frontend/public/assets/js/import-addressbook-form.mjs deleted file mode 100644 index 00d9e27..0000000 --- a/crates/frontend/public/assets/js/import-addressbook-form.mjs +++ /dev/null @@ -1,102 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n as n$1, t } from "./property-C8WJQOrH.mjs"; -import { e, n } from "./ref-BivNNNRN.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let ImportAddressbookForm = class extends i { - constructor() { - super(); - this.user = ""; - this.addressbook_id = self.crypto.randomUUID(); - this.dialog = e(); - this.form = e(); - } - createRenderRoot() { - return this; - } - render() { - return x` - - -

Import addressbook

-
- -
- -
- -
-
- - -
-
- `; - } - async submit(e2) { - e2.preventDefault(); - this.principal ||= this.user; - if (!this.principal) { - alert("Empty principal"); - return; - } - if (!this.addressbook_id) { - alert("Empty id"); - return; - } - let response = await fetch(`/carddav/principal/${this.principal}/${this.addressbook_id}`, { - method: "IMPORT", - headers: { - "Content-Type": "text/vcard" - }, - body: this.file - }); - if (response.status >= 400) { - alert(`Error ${response.status}: ${await response.text()}`); - return null; - } - window.location.reload(); - return null; - } -}; -__decorateClass([ - n$1() -], ImportAddressbookForm.prototype, "user", 2); -__decorateClass([ - n$1() -], ImportAddressbookForm.prototype, "principal", 2); -__decorateClass([ - n$1() -], ImportAddressbookForm.prototype, "addressbook_id", 2); -ImportAddressbookForm = __decorateClass([ - t("import-addressbook-form") -], ImportAddressbookForm); -export { - ImportAddressbookForm -}; diff --git a/crates/frontend/public/assets/js/import-calendar-form.mjs b/crates/frontend/public/assets/js/import-calendar-form.mjs deleted file mode 100644 index 559c25f..0000000 --- a/crates/frontend/public/assets/js/import-calendar-form.mjs +++ /dev/null @@ -1,102 +0,0 @@ -import { i, x } from "./lit-DKg0et_P.mjs"; -import { n as n$1, t } from "./property-C8WJQOrH.mjs"; -import { e, n } from "./ref-BivNNNRN.mjs"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) - if (decorator = decorators[i2]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; -let ImportCalendarForm = class extends i { - constructor() { - super(); - this.user = ""; - this.cal_id = self.crypto.randomUUID(); - this.dialog = e(); - this.form = e(); - } - createRenderRoot() { - return this; - } - render() { - return x` - - -

Import calendar

-
- -
- -
- -
-
- - -
-
- `; - } - async submit(e2) { - e2.preventDefault(); - this.principal ||= this.user; - if (!this.principal) { - alert("Empty principal"); - return; - } - if (!this.cal_id) { - alert("Empty id"); - return; - } - let response = await fetch(`/caldav/principal/${this.principal}/${this.cal_id}`, { - method: "IMPORT", - headers: { - "Content-Type": "text/calendar" - }, - body: this.file - }); - if (response.status >= 400) { - alert(`Error ${response.status}: ${await response.text()}`); - return null; - } - window.location.reload(); - return null; - } -}; -__decorateClass([ - n$1() -], ImportCalendarForm.prototype, "user", 2); -__decorateClass([ - n$1() -], ImportCalendarForm.prototype, "principal", 2); -__decorateClass([ - n$1() -], ImportCalendarForm.prototype, "cal_id", 2); -ImportCalendarForm = __decorateClass([ - t("import-calendar-form") -], ImportCalendarForm); -export { - ImportCalendarForm -}; diff --git a/crates/frontend/public/assets/js/index-fgowJCc1.mjs b/crates/frontend/public/assets/js/index-fgowJCc1.mjs deleted file mode 100644 index 85f1e37..0000000 --- a/crates/frontend/public/assets/js/index-fgowJCc1.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import { b } from "./lit-DKg0et_P.mjs"; -function escapeXml(unsafe) { - return unsafe.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); -} -const SVG_ICON_CALENDAR = b` - - - - - - -`; -const SVG_ICON_INTERNET = b` - - - - - - - - -`; -export { - SVG_ICON_CALENDAR as S, - SVG_ICON_INTERNET as a, - escapeXml as e -}; diff --git a/crates/frontend/public/assets/js/lit-DKg0et_P.mjs b/crates/frontend/public/assets/js/lit-DKg0et_P.mjs deleted file mode 100644 index 5a0f181..0000000 --- a/crates/frontend/public/assets/js/lit-DKg0et_P.mjs +++ /dev/null @@ -1,521 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const t$1 = globalThis, e$2 = t$1.ShadowRoot && (void 0 === t$1.ShadyCSS || t$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$3 = /* @__PURE__ */ new WeakMap(); -let n$2 = class n { - constructor(t2, e2, o2) { - if (this._$cssResult$ = true, o2 !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = t2, this.t = e2; - } - get styleSheet() { - let t2 = this.o; - const s2 = this.t; - if (e$2 && void 0 === t2) { - const e2 = void 0 !== s2 && 1 === s2.length; - e2 && (t2 = o$3.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$3.set(s2, t2)); - } - return t2; - } - toString() { - return this.cssText; - } -}; -const r$2 = (t2) => new n$2("string" == typeof t2 ? t2 : t2 + "", void 0, s$2), S$1 = (s2, o2) => { - if (e$2) s2.adoptedStyleSheets = o2.map(((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet)); - else for (const e2 of o2) { - const o3 = document.createElement("style"), n3 = t$1.litNonce; - void 0 !== n3 && o3.setAttribute("nonce", n3), o3.textContent = e2.cssText, s2.appendChild(o3); - } -}, c$2 = e$2 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { - let e2 = ""; - for (const s2 of t3.cssRules) e2 += s2.cssText; - return r$2(e2); -})(t2) : t2; -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const { is: i$2, defineProperty: e$1, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$1, getOwnPropertySymbols: o$2, getPrototypeOf: n$1 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (t2, s2) => t2, u$1 = { toAttribute(t2, s2) { - switch (s2) { - case Boolean: - t2 = t2 ? l$1 : null; - break; - case Object: - case Array: - t2 = null == t2 ? t2 : JSON.stringify(t2); - } - return t2; -}, fromAttribute(t2, s2) { - let i2 = t2; - switch (s2) { - case Boolean: - i2 = null !== t2; - break; - case Number: - i2 = null === t2 ? null : Number(t2); - break; - case Object: - case Array: - try { - i2 = JSON.parse(t2); - } catch (t3) { - i2 = null; - } - } - return i2; -} }, f$1 = (t2, s2) => !i$2(t2, s2), b$1 = { attribute: true, type: String, converter: u$1, reflect: false, useDefault: false, hasChanged: f$1 }; -Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); -let y$1 = class y extends HTMLElement { - static addInitializer(t2) { - this._$Ei(), (this.l ??= []).push(t2); - } - static get observedAttributes() { - return this.finalize(), this._$Eh && [...this._$Eh.keys()]; - } - static createProperty(t2, s2 = b$1) { - if (s2.state && (s2.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t2) && ((s2 = Object.create(s2)).wrapped = true), this.elementProperties.set(t2, s2), !s2.noAccessor) { - const i2 = Symbol(), h2 = this.getPropertyDescriptor(t2, i2, s2); - void 0 !== h2 && e$1(this.prototype, t2, h2); - } - } - static getPropertyDescriptor(t2, s2, i2) { - const { get: e2, set: r2 } = h$1(this.prototype, t2) ?? { get() { - return this[s2]; - }, set(t3) { - this[s2] = t3; - } }; - return { get: e2, set(s3) { - const h2 = e2?.call(this); - r2?.call(this, s3), this.requestUpdate(t2, h2, i2); - }, configurable: true, enumerable: true }; - } - static getPropertyOptions(t2) { - return this.elementProperties.get(t2) ?? b$1; - } - static _$Ei() { - if (this.hasOwnProperty(d$1("elementProperties"))) return; - const t2 = n$1(this); - t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); - } - static finalize() { - if (this.hasOwnProperty(d$1("finalized"))) return; - if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) { - const t3 = this.properties, s2 = [...r$1(t3), ...o$2(t3)]; - for (const i2 of s2) this.createProperty(i2, t3[i2]); - } - const t2 = this[Symbol.metadata]; - if (null !== t2) { - const s2 = litPropertyMetadata.get(t2); - if (void 0 !== s2) for (const [t3, i2] of s2) this.elementProperties.set(t3, i2); - } - this._$Eh = /* @__PURE__ */ new Map(); - for (const [t3, s2] of this.elementProperties) { - const i2 = this._$Eu(t3, s2); - void 0 !== i2 && this._$Eh.set(i2, t3); - } - this.elementStyles = this.finalizeStyles(this.styles); - } - static finalizeStyles(s2) { - const i2 = []; - if (Array.isArray(s2)) { - const e2 = new Set(s2.flat(1 / 0).reverse()); - for (const s3 of e2) i2.unshift(c$2(s3)); - } else void 0 !== s2 && i2.push(c$2(s2)); - return i2; - } - static _$Eu(t2, s2) { - const i2 = s2.attribute; - return false === i2 ? void 0 : "string" == typeof i2 ? i2 : "string" == typeof t2 ? t2.toLowerCase() : void 0; - } - constructor() { - super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); - } - _$Ev() { - this._$ES = new Promise(((t2) => this.enableUpdating = t2)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t2) => t2(this))); - } - addController(t2) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); - } - removeController(t2) { - this._$EO?.delete(t2); - } - _$E_() { - const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; - for (const i2 of s2.keys()) this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]); - t2.size > 0 && (this._$Ep = t2); - } - createRenderRoot() { - const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return S$1(t2, this.constructor.elementStyles), t2; - } - connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(((t2) => t2.hostConnected?.())); - } - enableUpdating(t2) { - } - disconnectedCallback() { - this._$EO?.forEach(((t2) => t2.hostDisconnected?.())); - } - attributeChangedCallback(t2, s2, i2) { - this._$AK(t2, i2); - } - _$ET(t2, s2) { - const i2 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i2); - if (void 0 !== e2 && true === i2.reflect) { - const h2 = (void 0 !== i2.converter?.toAttribute ? i2.converter : u$1).toAttribute(s2, i2.type); - this._$Em = t2, null == h2 ? this.removeAttribute(e2) : this.setAttribute(e2, h2), this._$Em = null; - } - } - _$AK(t2, s2) { - const i2 = this.constructor, e2 = i2._$Eh.get(t2); - if (void 0 !== e2 && this._$Em !== e2) { - const t3 = i2.getPropertyOptions(e2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u$1; - this._$Em = e2; - const r2 = h2.fromAttribute(s2, t3.type); - this[e2] = r2 ?? this._$Ej?.get(e2) ?? r2, this._$Em = null; - } - } - requestUpdate(t2, s2, i2) { - if (void 0 !== t2) { - const e2 = this.constructor, h2 = this[t2]; - if (i2 ??= e2.getPropertyOptions(t2), !((i2.hasChanged ?? f$1)(h2, s2) || i2.useDefault && i2.reflect && h2 === this._$Ej?.get(t2) && !this.hasAttribute(e2._$Eu(t2, i2)))) return; - this.C(t2, s2, i2); - } - false === this.isUpdatePending && (this._$ES = this._$EP()); - } - C(t2, s2, { useDefault: i2, reflect: e2, wrapped: h2 }, r2) { - i2 && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t2) && (this._$Ej.set(t2, r2 ?? s2 ?? this[t2]), true !== h2 || void 0 !== r2) || (this._$AL.has(t2) || (this.hasUpdated || i2 || (s2 = void 0), this._$AL.set(t2, s2)), true === e2 && this._$Em !== t2 && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t2)); - } - async _$EP() { - this.isUpdatePending = true; - try { - await this._$ES; - } catch (t3) { - Promise.reject(t3); - } - const t2 = this.scheduleUpdate(); - return null != t2 && await t2, !this.isUpdatePending; - } - scheduleUpdate() { - return this.performUpdate(); - } - performUpdate() { - if (!this.isUpdatePending) return; - if (!this.hasUpdated) { - if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { - for (const [t4, s3] of this._$Ep) this[t4] = s3; - this._$Ep = void 0; - } - const t3 = this.constructor.elementProperties; - if (t3.size > 0) for (const [s3, i2] of t3) { - const { wrapped: t4 } = i2, e2 = this[s3]; - true !== t4 || this._$AL.has(s3) || void 0 === e2 || this.C(s3, void 0, i2, e2); - } - } - let t2 = false; - const s2 = this._$AL; - try { - t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach(((t3) => t3.hostUpdate?.())), this.update(s2)) : this._$EM(); - } catch (s3) { - throw t2 = false, this._$EM(), s3; - } - t2 && this._$AE(s2); - } - willUpdate(t2) { - } - _$AE(t2) { - this._$EO?.forEach(((t3) => t3.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); - } - _$EM() { - this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; - } - get updateComplete() { - return this.getUpdateComplete(); - } - getUpdateComplete() { - return this._$ES; - } - shouldUpdate(t2) { - return true; - } - update(t2) { - this._$Eq &&= this._$Eq.forEach(((t3) => this._$ET(t3, this[t3]))), this._$EM(); - } - updated(t2) { - } - firstUpdated(t2) { - } -}; -y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: y$1 }), (a$1.reactiveElementVersions ??= []).push("2.1.1"); -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const t = globalThis, i$1 = t.trustedTypes, s$1 = i$1 ? i$1.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$1 = "?" + h, n2 = `<${o$1}>`, r = document, l = () => r.createComment(""), c = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a = Array.isArray, u = (t2) => a(t2) || "function" == typeof t2?.[Symbol.iterator], d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y2 = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x = y2(1), b = y2(2), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129); -function P(t2, i2) { - if (!a(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return void 0 !== s$1 ? s$1.createHTML(i2) : i2; -} -const V = (t2, i2) => { - const s2 = t2.length - 1, o2 = []; - let r2, l2 = 2 === i2 ? "" : 3 === i2 ? "" : "", c2 = f; - for (let i3 = 0; i3 < s2; i3++) { - const s3 = t2[i3]; - let a2, u2, d2 = -1, y3 = 0; - for (; y3 < s3.length && (c2.lastIndex = y3, u2 = c2.exec(s3), null !== u2); ) y3 = c2.lastIndex, c2 === f ? "!--" === u2[1] ? c2 = v : void 0 !== u2[1] ? c2 = _ : void 0 !== u2[2] ? ($.test(u2[2]) && (r2 = RegExp("" === u2[0] ? (c2 = r2 ?? f, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m : c2 === v || c2 === _ ? c2 = f : (c2 = m, r2 = void 0); - const x2 = c2 === m && t2[i3 + 1].startsWith("/>") ? " " : ""; - l2 += c2 === f ? s3 + n2 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e + s3.slice(d2) + h + x2) : s3 + h + (-2 === d2 ? i3 : x2); - } - return [P(t2, l2 + (t2[s2] || "") + (2 === i2 ? "" : 3 === i2 ? "" : "")), o2]; -}; -class N { - constructor({ strings: t2, _$litType$: s2 }, n3) { - let r2; - this.parts = []; - let c2 = 0, a2 = 0; - const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = V(t2, s2); - if (this.el = N.createElement(f2, n3), C.currentNode = this.el.content, 2 === s2 || 3 === s2) { - const t3 = this.el.content.firstChild; - t3.replaceWith(...t3.childNodes); - } - for (; null !== (r2 = C.nextNode()) && d2.length < u2; ) { - if (1 === r2.nodeType) { - if (r2.hasAttributes()) for (const t3 of r2.getAttributeNames()) if (t3.endsWith(e)) { - const i2 = v2[a2++], s3 = r2.getAttribute(t3).split(h), e2 = /([.?@])?(.*)/.exec(i2); - d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? H : "?" === e2[1] ? I : "@" === e2[1] ? L : k }), r2.removeAttribute(t3); - } else t3.startsWith(h) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3)); - if ($.test(r2.tagName)) { - const t3 = r2.textContent.split(h), s3 = t3.length - 1; - if (s3 > 0) { - r2.textContent = i$1 ? i$1.emptyScript : ""; - for (let i2 = 0; i2 < s3; i2++) r2.append(t3[i2], l()), C.nextNode(), d2.push({ type: 2, index: ++c2 }); - r2.append(t3[s3], l()); - } - } - } else if (8 === r2.nodeType) if (r2.data === o$1) d2.push({ type: 2, index: c2 }); - else { - let t3 = -1; - for (; -1 !== (t3 = r2.data.indexOf(h, t3 + 1)); ) d2.push({ type: 7, index: c2 }), t3 += h.length - 1; - } - c2++; - } - } - static createElement(t2, i2) { - const s2 = r.createElement("template"); - return s2.innerHTML = t2, s2; - } -} -function S(t2, i2, s2 = t2, e2) { - if (i2 === T) return i2; - let h2 = void 0 !== e2 ? s2._$Co?.[e2] : s2._$Cl; - const o2 = c(i2) ? void 0 : i2._$litDirective$; - return h2?.constructor !== o2 && (h2?._$AO?.(false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ??= [])[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i2 = S(t2, h2._$AS(t2, i2.values), h2, e2)), i2; -} -class M { - constructor(t2, i2) { - this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2; - } - get parentNode() { - return this._$AM.parentNode; - } - get _$AU() { - return this._$AM._$AU; - } - u(t2) { - const { el: { content: i2 }, parts: s2 } = this._$AD, e2 = (t2?.creationScope ?? r).importNode(i2, true); - C.currentNode = e2; - let h2 = C.nextNode(), o2 = 0, n3 = 0, l2 = s2[0]; - for (; void 0 !== l2; ) { - if (o2 === l2.index) { - let i3; - 2 === l2.type ? i3 = new R(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i3 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i3 = new z(h2, this, t2)), this._$AV.push(i3), l2 = s2[++n3]; - } - o2 !== l2?.index && (h2 = C.nextNode(), o2++); - } - return C.currentNode = r, e2; - } - p(t2) { - let i2 = 0; - for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++; - } -} -class R { - get _$AU() { - return this._$AM?._$AU ?? this._$Cv; - } - constructor(t2, i2, s2, e2) { - this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cv = e2?.isConnected ?? true; - } - get parentNode() { - let t2 = this._$AA.parentNode; - const i2 = this._$AM; - return void 0 !== i2 && 11 === t2?.nodeType && (t2 = i2.parentNode), t2; - } - get startNode() { - return this._$AA; - } - get endNode() { - return this._$AB; - } - _$AI(t2, i2 = this) { - t2 = S(this, t2, i2), c(t2) ? t2 === E || null == t2 || "" === t2 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t2 !== this._$AH && t2 !== T && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u(t2) ? this.k(t2) : this._(t2); - } - O(t2) { - return this._$AA.parentNode.insertBefore(t2, this._$AB); - } - T(t2) { - this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); - } - _(t2) { - this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r.createTextNode(t2)), this._$AH = t2; - } - $(t2) { - const { values: i2, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = N.createElement(P(s2.h, s2.h[0]), this.options)), s2); - if (this._$AH?._$AD === e2) this._$AH.p(i2); - else { - const t3 = new M(e2, this), s3 = t3.u(this.options); - t3.p(i2), this.T(s3), this._$AH = t3; - } - } - _$AC(t2) { - let i2 = A.get(t2.strings); - return void 0 === i2 && A.set(t2.strings, i2 = new N(t2)), i2; - } - k(t2) { - a(this._$AH) || (this._$AH = [], this._$AR()); - const i2 = this._$AH; - let s2, e2 = 0; - for (const h2 of t2) e2 === i2.length ? i2.push(s2 = new R(this.O(l()), this.O(l()), this, this.options)) : s2 = i2[e2], s2._$AI(h2), e2++; - e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2); - } - _$AR(t2 = this._$AA.nextSibling, i2) { - for (this._$AP?.(false, true, i2); t2 !== this._$AB; ) { - const i3 = t2.nextSibling; - t2.remove(), t2 = i3; - } - } - setConnected(t2) { - void 0 === this._$AM && (this._$Cv = t2, this._$AP?.(t2)); - } -} -class k { - get tagName() { - return this.element.tagName; - } - get _$AU() { - return this._$AM._$AU; - } - constructor(t2, i2, s2, e2, h2) { - this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E; - } - _$AI(t2, i2 = this, s2, e2) { - const h2 = this.strings; - let o2 = false; - if (void 0 === h2) t2 = S(this, t2, i2, 0), o2 = !c(t2) || t2 !== this._$AH && t2 !== T, o2 && (this._$AH = t2); - else { - const e3 = t2; - let n3, r2; - for (t2 = h2[0], n3 = 0; n3 < h2.length - 1; n3++) r2 = S(this, e3[s2 + n3], i2, n3), r2 === T && (r2 = this._$AH[n3]), o2 ||= !c(r2) || r2 !== this._$AH[n3], r2 === E ? t2 = E : t2 !== E && (t2 += (r2 ?? "") + h2[n3 + 1]), this._$AH[n3] = r2; - } - o2 && !e2 && this.j(t2); - } - j(t2) { - t2 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); - } -} -class H extends k { - constructor() { - super(...arguments), this.type = 3; - } - j(t2) { - this.element[this.name] = t2 === E ? void 0 : t2; - } -} -class I extends k { - constructor() { - super(...arguments), this.type = 4; - } - j(t2) { - this.element.toggleAttribute(this.name, !!t2 && t2 !== E); - } -} -class L extends k { - constructor(t2, i2, s2, e2, h2) { - super(t2, i2, s2, e2, h2), this.type = 5; - } - _$AI(t2, i2 = this) { - if ((t2 = S(this, t2, i2, 0) ?? E) === T) return; - const s2 = this._$AH, e2 = t2 === E && s2 !== E || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== E && (s2 === E || e2); - e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; - } - handleEvent(t2) { - "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); - } -} -class z { - constructor(t2, i2, s2) { - this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2; - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(t2) { - S(this, t2); - } -} -const j = t.litHtmlPolyfillSupport; -j?.(N, R), (t.litHtmlVersions ??= []).push("3.3.1"); -const B = (t2, i2, s2) => { - const e2 = s2?.renderBefore ?? i2; - let h2 = e2._$litPart$; - if (void 0 === h2) { - const t3 = s2?.renderBefore ?? null; - e2._$litPart$ = h2 = new R(i2.insertBefore(l(), t3), t3, void 0, s2 ?? {}); - } - return h2._$AI(t2), h2; -}; -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const s = globalThis; -class i extends y$1 { - constructor() { - super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; - } - createRenderRoot() { - const t2 = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= t2.firstChild, t2; - } - update(t2) { - const r2 = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = B(r2, this.renderRoot, this.renderOptions); - } - connectedCallback() { - super.connectedCallback(), this._$Do?.setConnected(true); - } - disconnectedCallback() { - super.disconnectedCallback(), this._$Do?.setConnected(false); - } - render() { - return T; - } -} -i._$litElement$ = true, i["finalized"] = true, s.litElementHydrateSupport?.({ LitElement: i }); -const o = s.litElementPolyfillSupport; -o?.({ LitElement: i }); -(s.litElementVersions ??= []).push("4.2.1"); -export { - E, - b, - f$1 as f, - i, - u$1 as u, - x -}; diff --git a/crates/frontend/public/assets/js/property-C8WJQOrH.mjs b/crates/frontend/public/assets/js/property-C8WJQOrH.mjs deleted file mode 100644 index b491818..0000000 --- a/crates/frontend/public/assets/js/property-C8WJQOrH.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import { f, u } from "./lit-DKg0et_P.mjs"; -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const t = (t2) => (e, o2) => { - void 0 !== o2 ? o2.addInitializer((() => { - customElements.define(t2, e); - })) : customElements.define(t2, e); -}; -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const o = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }, r = (t2 = o, e, r2) => { - const { kind: n2, metadata: i } = r2; - let s = globalThis.litPropertyMetadata.get(i); - if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = /* @__PURE__ */ new Map()), "setter" === n2 && ((t2 = Object.create(t2)).wrapped = true), s.set(r2.name, t2), "accessor" === n2) { - const { name: o2 } = r2; - return { set(r3) { - const n3 = e.get.call(this); - e.set.call(this, r3), this.requestUpdate(o2, n3, t2); - }, init(e2) { - return void 0 !== e2 && this.C(o2, void 0, t2, e2), e2; - } }; - } - if ("setter" === n2) { - const { name: o2 } = r2; - return function(r3) { - const n3 = this[o2]; - e.call(this, r3), this.requestUpdate(o2, n3, t2); - }; - } - throw Error("Unsupported decorator location: " + n2); -}; -function n(t2) { - return (e, o2) => "object" == typeof o2 ? r(t2, e, o2) : ((t3, e2, o3) => { - const r2 = e2.hasOwnProperty(o3); - return e2.constructor.createProperty(o3, t3), r2 ? Object.getOwnPropertyDescriptor(e2, o3) : void 0; - })(t2, e, o2); -} -export { - n, - t -}; diff --git a/crates/frontend/public/assets/js/ref-BivNNNRN.mjs b/crates/frontend/public/assets/js/ref-BivNNNRN.mjs deleted file mode 100644 index 99ab2d2..0000000 --- a/crates/frontend/public/assets/js/ref-BivNNNRN.mjs +++ /dev/null @@ -1,124 +0,0 @@ -import { E } from "./lit-DKg0et_P.mjs"; -/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const f$1 = (o2) => void 0 === o2.strings; -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const t = { CHILD: 2 }, e$1 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); -class i { - constructor(t2) { - } - get _$AU() { - return this._$AM._$AU; - } - _$AT(t2, e2, i2) { - this._$Ct = t2, this._$AM = e2, this._$Ci = i2; - } - _$AS(t2, e2) { - return this.update(t2, e2); - } - update(t2, e2) { - return this.render(...e2); - } -} -/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const s = (i2, t2) => { - const e2 = i2._$AN; - if (void 0 === e2) return false; - for (const i3 of e2) i3._$AO?.(t2, false), s(i3, t2); - return true; -}, o$1 = (i2) => { - let t2, e2; - do { - if (void 0 === (t2 = i2._$AM)) break; - e2 = t2._$AN, e2.delete(i2), i2 = t2; - } while (0 === e2?.size); -}, r = (i2) => { - for (let t2; t2 = i2._$AM; i2 = t2) { - let e2 = t2._$AN; - if (void 0 === e2) t2._$AN = e2 = /* @__PURE__ */ new Set(); - else if (e2.has(i2)) break; - e2.add(i2), c(t2); - } -}; -function h$1(i2) { - void 0 !== this._$AN ? (o$1(this), this._$AM = i2, r(this)) : this._$AM = i2; -} -function n$1(i2, t2 = false, e2 = 0) { - const r2 = this._$AH, h2 = this._$AN; - if (void 0 !== h2 && 0 !== h2.size) if (t2) if (Array.isArray(r2)) for (let i3 = e2; i3 < r2.length; i3++) s(r2[i3], false), o$1(r2[i3]); - else null != r2 && (s(r2, false), o$1(r2)); - else s(this, i2); -} -const c = (i2) => { - i2.type == t.CHILD && (i2._$AP ??= n$1, i2._$AQ ??= h$1); -}; -class f extends i { - constructor() { - super(...arguments), this._$AN = void 0; - } - _$AT(i2, t2, e2) { - super._$AT(i2, t2, e2), r(this), this.isConnected = i2._$AU; - } - _$AO(i2, t2 = true) { - i2 !== this.isConnected && (this.isConnected = i2, i2 ? this.reconnected?.() : this.disconnected?.()), t2 && (s(this, i2), o$1(this)); - } - setValue(t2) { - if (f$1(this._$Ct)) this._$Ct._$AI(t2, this); - else { - const i2 = [...this._$Ct._$AH]; - i2[this._$Ci] = t2, this._$Ct._$AI(i2, this, 0); - } - } - disconnected() { - } - reconnected() { - } -} -/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ -const e = () => new h(); -class h { -} -const o = /* @__PURE__ */ new WeakMap(), n = e$1(class extends f { - render(i2) { - return E; - } - update(i2, [s2]) { - const e2 = s2 !== this.G; - return e2 && void 0 !== this.G && this.rt(void 0), (e2 || this.lt !== this.ct) && (this.G = s2, this.ht = i2.options?.host, this.rt(this.ct = i2.element)), E; - } - rt(t2) { - if (this.isConnected || (t2 = void 0), "function" == typeof this.G) { - const i2 = this.ht ?? globalThis; - let s2 = o.get(i2); - void 0 === s2 && (s2 = /* @__PURE__ */ new WeakMap(), o.set(i2, s2)), void 0 !== s2.get(this.G) && this.G.call(this.ht, void 0), s2.set(this.G, t2), void 0 !== t2 && this.G.call(this.ht, t2); - } else this.G.value = t2; - } - get lt() { - return "function" == typeof this.G ? o.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value; - } - disconnected() { - this.lt === this.ct && this.rt(void 0); - } - reconnected() { - this.rt(this.ct); - } -}); -export { - e, - n -}; diff --git a/crates/frontend/public/assets/js/timezones-B0vBBzCP.mjs b/crates/frontend/public/assets/js/timezones-B0vBBzCP.mjs deleted file mode 100644 index 986af83..0000000 --- a/crates/frontend/public/assets/js/timezones-B0vBBzCP.mjs +++ /dev/null @@ -1,15 +0,0 @@ -let timezonesPromise = null; -async function getTimezones() { - timezonesPromise ||= new Promise(async (resolve, reject) => { - try { - let response = await fetch("/frontend/_timezones.json"); - resolve(await response.json()); - } catch (e) { - reject(e); - } - }); - return await timezonesPromise; -} -export { - getTimezones as g -}; diff --git a/crates/frontend/public/templates/pages/user.html b/crates/frontend/public/templates/pages/user.html index ce658c2..333af8f 100644 --- a/crates/frontend/public/templates/pages/user.html +++ b/crates/frontend/public/templates/pages/user.html @@ -5,14 +5,7 @@ - - - - - - - - + {% endblock %} {% block header_center %}