import { i as u, x as c } from "./lit-CWlWuEHk.mjs"; import { e as d, n as m, a as o, t as h } from "./ref-DuYNkSJ_.mjs"; import { a as b } from "./webdav-Bz4I5vNH.mjs"; var y = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, a = (t, e, l, s) => { for (var i = s > 1 ? void 0 : s ? $(e, l) : e, n = t.length - 1, p; n >= 0; n--) (p = t[n]) && (i = (s ? p(e, l, i) : p(i)) || i); return s && i && y(e, l, i), i; }; let r = class extends u { constructor() { super(), this.client = b("/caldav"), this.user = "", this.id = "", this.displayname = "", this.description = "", this.color = "", this.subscriptionUrl = "", this.components = /* @__PURE__ */ new Set(), this.dialog = d(), this.form = d(); } createRenderRoot() { return this; } render() { return c`

Create calendar






${["VEVENT", "VTODO", "VJOURNAL"].map((t) => c` `)}
`; } async submit(t) { if (console.log(this.displayname), t.preventDefault(), !this.id) { alert("Empty id"); return; } if (!this.displayname) { alert("Empty displayname"); return; } if (!this.components.size) { alert("No calendar components selected"); return; } return await this.client.createDirectory(`/ principal / ${this.user}/${this.id}`, { data: ` ${this.displayname} ${this.description ? `${this.description}` : ""} ${this.color ? `${this.color}` : ""} ${this.subscriptionUrl ? `${this.subscriptionUrl}` : ""} ${Array.from(this.components.keys()).map((e) => ``).join(` `)} ` }), window.location.reload(), null; } }; a([ o() ], r.prototype, "user", 2); a([ o() ], r.prototype, "id", 2); a([ o() ], r.prototype, "displayname", 2); a([ o() ], r.prototype, "description", 2); a([ o() ], r.prototype, "color", 2); a([ o() ], r.prototype, "subscriptionUrl", 2); a([ o() ], r.prototype, "components", 2); r = a([ h("create-calendar-form") ], r); export { r as CreateCalendarForm };