@hintergrund/ui 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ globalThis.process === void 0 && (globalThis.process = {
8
8
  return Promise.resolve().then(e);
9
9
  }
10
10
  });
11
- import { g as e, h as t } from "./BuilderAgentPane-Vj3NCGvZ.js";
11
+ import { m as e, p as t } from "./BuilderAgentPane-DsEI4-Al.js";
12
12
  import { i as n } from "./diagnostics-x5QOwca_.js";
13
13
  import { n as r } from "./headers-CnTiKpOL.js";
14
14
  import { i, p as a } from "./transform-messages-DvxSeyBQ.js";
@@ -8,7 +8,7 @@ globalThis.process === void 0 && (globalThis.process = {
8
8
  return Promise.resolve().then(e);
9
9
  }
10
10
  });
11
- import { g as e, h as t } from "./BuilderAgentPane-Vj3NCGvZ.js";
11
+ import { m as e, p as t } from "./BuilderAgentPane-DsEI4-Al.js";
12
12
  import { i as n } from "./diagnostics-x5QOwca_.js";
13
13
  import { t as r } from "./provider-env-Cj6X7Wly.js";
14
14
  import { n as i } from "./headers-CnTiKpOL.js";
@@ -8,7 +8,7 @@ globalThis.process === void 0 && (globalThis.process = {
8
8
  return Promise.resolve().then(e);
9
9
  }
10
10
  });
11
- import { Gn as e } from "./global-xsR9gLDa.js";
11
+ import { lr as e } from "./global-5AbycIwc.js";
12
12
  //#region ../../../../node_modules/.pnpm/svelte@5.57.0/node_modules/svelte/src/internal/flags/legacy.js
13
13
  e();
14
14
  //#endregion
package/dist/login.js CHANGED
@@ -8,126 +8,126 @@ globalThis.process === void 0 && (globalThis.process = {
8
8
  return Promise.resolve().then(e);
9
9
  }
10
10
  });
11
- import { An as e, Bn as t, Cn as n, Ct as r, Dn as i, Kn as a, Mt as o, Nt as s, On as c, Sn as l, St as u, Vn as ee, Wt as d, an as f, bt as p, cn as te, dn as ne, en as m, in as h, jt as g, ln as _, nn as re, pn as v, qn as y, sn as b, un as ie, wn as x, xn as S, yn as C } from "./global-xsR9gLDa.js";
11
+ import { An as e, Bn as t, Cn as n, Dn as r, En as i, Hn as a, Ht as o, Kn as s, Mn as c, On as l, Qt as u, Rn as d, Rt as f, Un as p, Vn as m, Vt as h, Xt as g, Yn as ee, Zt as _, ar as te, dr as v, kn as y, ln as b, or as ne, qn as x, ur as re, wn as S, xn as ie, yn as C } from "./global-5AbycIwc.js";
12
12
  //#region src/lib/login/Login.svelte
13
- var ae = b("<p class=\"svelte-uxwqu2\">We’ll send a setup link to your primary email address.</p>"), w = b("<p class=\"svelte-uxwqu2\">Use at least 12 characters. The link works once and expires after one hour.</p>"), T = b("<div class=\"flash flash-error svelte-uxwqu2\" role=\"alert\"> </div>"), oe = b("<div class=\"flash flash-success svelte-uxwqu2\" role=\"status\"> </div>"), se = b("<label for=\"email\" class=\"svelte-uxwqu2\">Primary email address</label><input id=\"email\" type=\"email\" class=\"form-control svelte-uxwqu2\" autocomplete=\"username\" required=\"\"/>", 1), E = b("<label for=\"password\" class=\"svelte-uxwqu2\"> </label><input id=\"password\" type=\"password\" class=\"form-control svelte-uxwqu2\" maxlength=\"256\" required=\"\"/>", 1), D = b("<label for=\"confirmation\" class=\"svelte-uxwqu2\">Confirm password</label><input id=\"confirmation\" type=\"password\" class=\"form-control svelte-uxwqu2\" autocomplete=\"new-password\" minlength=\"12\" maxlength=\"256\" required=\"\"/>", 1), O = b("<main class=\"auth-wrapper svelte-uxwqu2\"><div class=\"auth-container svelte-uxwqu2\"><header class=\"svelte-uxwqu2\"><svg aria-hidden=\"true\" viewBox=\"0 0 90 90\" width=\"48\" height=\"48\" fill=\"currentColor\"><rect x=\"12\" y=\"12\" width=\"66\" height=\"66\"></rect></svg> <h1 class=\"svelte-uxwqu2\"> </h1> <!></header> <!> <!> <form class=\"Box Box-body svelte-uxwqu2\"><!> <!> <!> <!></form> <footer class=\"svelte-uxwqu2\"><button class=\"svelte-uxwqu2\"> </button></footer></div></main>"), k = {
13
+ var ae = i("<p class=\"svelte-uxwqu2\">We’ll send a setup link to your primary email address.</p>"), w = i("<p class=\"svelte-uxwqu2\">Use at least 12 characters. The link works once and expires after one hour.</p>"), T = i("<div class=\"flash flash-error svelte-uxwqu2\" role=\"alert\"> </div>"), E = i("<div class=\"flash flash-success svelte-uxwqu2\" role=\"status\"> </div>"), D = i("<label for=\"email\" class=\"svelte-uxwqu2\">Primary email address</label><input id=\"email\" type=\"email\" class=\"form-control svelte-uxwqu2\" autocomplete=\"username\" required=\"\"/>", 1), O = i("<label for=\"password\" class=\"svelte-uxwqu2\"> </label><input id=\"password\" type=\"password\" class=\"form-control svelte-uxwqu2\" maxlength=\"256\" required=\"\"/>", 1), oe = i("<label for=\"confirmation\" class=\"svelte-uxwqu2\">Confirm password</label><input id=\"confirmation\" type=\"password\" class=\"form-control svelte-uxwqu2\" autocomplete=\"new-password\" minlength=\"12\" maxlength=\"256\" required=\"\"/>", 1), se = i("<main class=\"auth-wrapper svelte-uxwqu2\"><div class=\"auth-container svelte-uxwqu2\"><header class=\"svelte-uxwqu2\"><svg aria-hidden=\"true\" viewBox=\"0 0 90 90\" width=\"48\" height=\"48\" fill=\"currentColor\"><rect x=\"12\" y=\"12\" width=\"66\" height=\"66\"></rect></svg> <h1 class=\"svelte-uxwqu2\"> </h1> <!></header> <!> <!> <form class=\"Box Box-body svelte-uxwqu2\"><!> <!> <!> <!></form> <footer class=\"svelte-uxwqu2\"><button class=\"svelte-uxwqu2\"> </button></footer></div></main>"), ce = {
14
14
  hash: "svelte-uxwqu2",
15
15
  code: ".auth-wrapper.svelte-uxwqu2 {min-height:100dvh;display:grid;place-items:center;padding:1.5rem;background:var(--bgColor-muted);color:var(--fgColor-default);}.auth-container.svelte-uxwqu2 {width:100%;max-width:360px;}header.svelte-uxwqu2 {text-align:center;margin-bottom:1.5rem;}h1.svelte-uxwqu2 {font-size:1.4rem;font-weight:400;margin:1rem 0;}p.svelte-uxwqu2 {font-size:.875rem;color:var(--fgColor-muted);}form.svelte-uxwqu2 {display:grid;gap:.75rem;padding:1.5rem;background:var(--bgColor-default);border:1px solid var(--borderColor-default);border-radius:6px;}label.svelte-uxwqu2 {font-weight:600;font-size:.875rem;}input.svelte-uxwqu2 {width:100%;}.flash.svelte-uxwqu2 {margin-bottom:1rem;}footer.svelte-uxwqu2 {text-align:center;margin-top:1rem;}footer.svelte-uxwqu2 button:where(.svelte-uxwqu2) {border:0;background:none;color:var(--fgColor-accent);cursor:pointer;}"
16
16
  };
17
- function A(u, _) {
18
- ee(_, !0), d(u, k);
19
- let b = r(_, "config", 7), A = c("login"), j = c(""), M = c(""), N = c(""), P = c(""), F = c(""), I = c(""), L = c(!1);
20
- re(() => {
17
+ function k(i, l) {
18
+ ne(l, !0), b(i, ce);
19
+ let h = o(l, "config", 7), k = x("login"), A = x(""), j = x(""), M = x(""), N = x(""), P = x(""), F = x(""), I = x(!1);
20
+ ie(() => {
21
21
  let e = new URLSearchParams(window.location.hash.slice(1)).get("reset");
22
- e && (i(P, e, !0), i(A, "reset"), window.history.replaceState({}, "", window.location.pathname));
22
+ e && (s(N, e, !0), s(k, "reset"), window.history.replaceState({}, "", window.location.pathname));
23
23
  });
24
- function R(e) {
25
- i(A, e, !0), i(F, ""), i(I, ""), i(M, ""), i(N, "");
24
+ function L(e) {
25
+ s(k, e, !0), s(P, ""), s(F, ""), s(j, ""), s(M, "");
26
26
  }
27
- async function z(e) {
28
- if (e.preventDefault(), i(F, ""), i(I, ""), v(A) === "reset" && v(M) !== v(N)) {
29
- i(F, "Passwords do not match.");
27
+ async function R(e) {
28
+ if (e.preventDefault(), s(P, ""), s(F, ""), c(k) === "reset" && c(j) !== c(M)) {
29
+ s(P, "Passwords do not match.");
30
30
  return;
31
31
  }
32
- i(L, !0);
32
+ s(I, !0);
33
33
  try {
34
- let e = v(A) === "login" ? "login" : v(A) === "request" ? "password-reset/request" : "password-reset/complete", t = await fetch(`/api/admin/${e}`, {
34
+ let e = c(k) === "login" ? "login" : c(k) === "request" ? "password-reset/request" : "password-reset/complete", t = await fetch(`/api/admin/${e}`, {
35
35
  method: "POST",
36
36
  headers: { "Content-Type": "application/json" },
37
- body: JSON.stringify(v(A) === "reset" ? {
38
- token: v(P),
39
- password: v(M)
37
+ body: JSON.stringify(c(k) === "reset" ? {
38
+ token: c(N),
39
+ password: c(j)
40
40
  } : {
41
- email: v(j),
42
- password: v(A) === "login" ? v(M) : void 0
41
+ email: c(A),
42
+ password: c(k) === "login" ? c(j) : void 0
43
43
  })
44
44
  }), n = await t.json();
45
45
  if (!t.ok) throw Error(n.error || n.message || "Unable to continue. Try again.");
46
- if (v(A) === "login") {
46
+ if (c(k) === "login") {
47
47
  window.location.href = "/admin";
48
48
  return;
49
49
  }
50
- v(A) === "reset" && (i(P, ""), R("login")), i(I, n.message, !0);
50
+ c(k) === "reset" && (s(N, ""), L("login")), s(F, n.message, !0);
51
51
  } catch (e) {
52
- i(F, e instanceof Error ? e.message : "Unable to connect. Try again.", !0);
52
+ s(P, e instanceof Error ? e.message : "Unable to connect. Try again.", !0);
53
53
  } finally {
54
- i(L, !1);
54
+ s(I, !1);
55
55
  }
56
56
  }
57
- var B = {
57
+ var z = {
58
58
  get config() {
59
- return b();
59
+ return h();
60
60
  },
61
- set config(t) {
62
- b(t), e();
61
+ set config(e) {
62
+ h(e), ee();
63
63
  }
64
- }, V = O(), H = S(V), U = S(H), W = x(S(U), 2), G = n(W, !0), ce = x(W, 2), le = (e) => {
64
+ }, B = se(), V = t(B), H = t(V), U = p(t(H), 2), W = a(U, !0), le = p(U, 2), ue = (e) => {
65
65
  var t = ae();
66
- f(e, t);
67
- }, ue = (e) => {
66
+ S(e, t);
67
+ }, de = (e) => {
68
68
  var t = w();
69
- f(e, t);
69
+ S(e, t);
70
70
  };
71
- m(ce, (e) => {
72
- v(A) === "request" ? e(le) : v(A) === "reset" && e(ue, 1);
73
- }), y(U);
74
- var K = x(U, 2), de = (e) => {
75
- var t = T(), r = n(t, !0);
76
- C(() => h(r, v(F))), f(e, t);
71
+ C(le, (e) => {
72
+ c(k) === "request" ? e(ue) : c(k) === "reset" && e(de, 1);
73
+ }), v(H);
74
+ var G = p(H, 2), fe = (e) => {
75
+ var t = T(), r = a(t, !0);
76
+ d(() => n(r, c(P))), S(e, t);
77
77
  };
78
- m(K, (e) => {
79
- v(F) && e(de);
78
+ C(G, (e) => {
79
+ c(P) && e(fe);
80
80
  });
81
- var q = x(K, 2), fe = (e) => {
82
- var t = oe(), r = n(t, !0);
83
- C(() => h(r, v(I))), f(e, t);
81
+ var K = p(G, 2), pe = (e) => {
82
+ var t = E(), r = a(t, !0);
83
+ d(() => n(r, c(F))), S(e, t);
84
84
  };
85
- m(q, (e) => {
86
- v(I) && e(fe);
85
+ C(K, (e) => {
86
+ c(F) && e(pe);
87
87
  });
88
- var J = x(q, 2), Y = S(J), pe = (e) => {
89
- var t = se(), n = x(l(t));
90
- o(n), C(() => n.disabled = v(L)), g(n, () => v(j), (e) => i(j, e)), f(e, t);
88
+ var q = p(K, 2), J = t(q), Y = (e) => {
89
+ var t = D(), n = p(m(t));
90
+ _(n), d(() => n.disabled = c(I)), g(n, () => c(A), (e) => s(A, e)), S(e, t);
91
91
  };
92
- m(Y, (e) => {
93
- v(A) !== "reset" && e(pe);
92
+ C(J, (e) => {
93
+ c(k) !== "reset" && e(Y);
94
94
  });
95
- var X = x(Y, 2), me = (e) => {
96
- var t = E(), r = l(t), a = n(r, !0), c = x(r);
97
- o(c), C(() => {
98
- h(a, v(A) === "reset" ? "New password" : "Password"), s(c, "autocomplete", v(A) === "reset" ? "new-password" : "current-password"), s(c, "minlength", v(A) === "reset" ? 12 : void 0), c.disabled = v(L);
99
- }), g(c, () => v(M), (e) => i(M, e)), f(e, t);
95
+ var X = p(J, 2), me = (e) => {
96
+ var t = O(), r = m(t), i = a(r, !0), o = p(r);
97
+ _(o), d(() => {
98
+ n(i, c(k) === "reset" ? "New password" : "Password"), u(o, "autocomplete", c(k) === "reset" ? "new-password" : "current-password"), u(o, "minlength", c(k) === "reset" ? 12 : void 0), o.disabled = c(I);
99
+ }), g(o, () => c(j), (e) => s(j, e)), S(e, t);
100
100
  };
101
- m(X, (e) => {
102
- v(A) !== "request" && e(me);
101
+ C(X, (e) => {
102
+ c(k) !== "request" && e(me);
103
103
  });
104
- var Z = x(X, 2), he = (e) => {
105
- var t = D(), n = x(l(t));
106
- o(n), C(() => n.disabled = v(L)), g(n, () => v(N), (e) => i(N, e)), f(e, t);
104
+ var Z = p(X, 2), he = (e) => {
105
+ var t = oe(), n = p(m(t));
106
+ _(n), d(() => n.disabled = c(I)), g(n, () => c(M), (e) => s(M, e)), S(e, t);
107
107
  };
108
- m(Z, (e) => {
109
- v(A) === "reset" && e(he);
108
+ C(Z, (e) => {
109
+ c(k) === "reset" && e(he);
110
110
  });
111
- var ge = x(Z, 2);
112
- p(ge, {
111
+ var ge = p(Z, 2);
112
+ f(ge, {
113
113
  type: "submit",
114
114
  variant: "primary",
115
115
  block: !0,
116
116
  get disabled() {
117
- return v(L);
117
+ return c(I);
118
118
  },
119
119
  children: (e, t) => {
120
- a();
121
- var n = te();
122
- C(() => h(n, v(L) ? "Please wait…" : v(A) === "login" ? "Sign in" : v(A) === "request" ? "Send reset link" : "Save password")), f(e, n);
120
+ re();
121
+ var i = r();
122
+ d(() => n(i, c(I) ? "Please wait…" : c(k) === "login" ? "Sign in" : c(k) === "request" ? "Send reset link" : "Save password")), S(e, i);
123
123
  },
124
124
  $$slots: { default: !0 }
125
- }), y(J);
126
- var Q = x(J, 2), $ = S(Q), _e = n($, !0);
127
- return y(Q), y(H), y(V), C(() => {
128
- h(G, v(A) === "login" ? "Sign in to hintergrund" : v(A) === "request" ? "Reset your password" : "Choose your password"), $.disabled = v(L), h(_e, v(A) === "login" ? "Forgot your password?" : "Back to sign in");
129
- }), ne("submit", J, z), ie("click", $, () => R(v(A) === "login" ? "request" : "login")), f(u, V), t(B);
125
+ }), v(q);
126
+ var Q = p(q, 2), $ = t(Q), _e = a($, !0);
127
+ return v(Q), v(V), v(B), d(() => {
128
+ n(W, c(k) === "login" ? "Sign in to hintergrund" : c(k) === "request" ? "Reset your password" : "Choose your password"), $.disabled = c(I), n(_e, c(k) === "login" ? "Forgot your password?" : "Back to sign in");
129
+ }), e("submit", q, R), y("click", $, () => L(c(k) === "login" ? "request" : "login")), S(i, B), te(z);
130
130
  }
131
- _(["click"]), customElements.define("hintergrund-login", u(A, { config: {} }, [], []));
131
+ l(["click"]), customElements.define("hintergrund-login", h(k, { config: {} }, [], []));
132
132
  //#endregion
133
- export { A as default };
133
+ export { k as default };