@hintergrund/ui 0.2.0 → 0.2.2

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.
@@ -1,5 +1,5 @@
1
- import { i as v, r as I, m as M, G as S, c as R, a as L, b as _ } from "./google-shared-tABuvUYZ.js";
2
- import { d as x, h as G, e as O, f as A } from "./Builder-RvOmGKW5.js";
1
+ import { i as v, r as I, m as M, G as S, c as R, a as L, b as _ } from "./google-shared-zl4aoTwW.js";
2
+ import { d as x, h as G, e as O, f as A } from "./Builder-BhGmzNTC.js";
3
3
  import { b as N, s as P } from "./transform-messages-CkpQp6fJ.js";
4
4
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
5
5
  return Promise.resolve().then(e);
@@ -1,4 +1,4 @@
1
- import { bf as ii } from "./global-JDSIqdYm.js";
1
+ import { b9 as ii } from "./global-DdaMTl90.js";
2
2
  import { t as ri, s as re } from "./transform-messages-CkpQp6fJ.js";
3
3
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(t) {
4
4
  return Promise.resolve().then(t);
@@ -1,5 +1,5 @@
1
- import { i as E, r as x, m as v, G as O, c as w, a as R, b as M, T as h, R as G } from "./google-shared-tABuvUYZ.js";
2
- import { h as S, e as N, f as A } from "./Builder-RvOmGKW5.js";
1
+ import { i as E, r as x, m as v, G as O, c as w, a as R, b as M, T as h, R as G } from "./google-shared-zl4aoTwW.js";
2
+ import { h as S, e as N, f as A } from "./Builder-BhGmzNTC.js";
3
3
  import { b as P, s as U } from "./transform-messages-CkpQp6fJ.js";
4
4
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
5
5
  return Promise.resolve().then(e);
@@ -1,4 +1,4 @@
1
- import { i as s } from "./Builder-RvOmGKW5.js";
1
+ import { i as s } from "./Builder-BhGmzNTC.js";
2
2
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
3
3
  return Promise.resolve().then(e);
4
4
  } });
package/dist/login.js CHANGED
@@ -1,106 +1,110 @@
1
- import { a2 as G, a3 as I, a4 as K, as as W, Q as Y, Z as r, a7 as l, a8 as o, ad as y, ab as n, ag as ee, X as m, ah as g, au as ae, V as a, aj as i, ae as q, am as E, al as M, a9 as te, aD as re, a6 as se, aa as D, aE as oe, af as J } from "./global-JDSIqdYm.js";
2
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(p) {
3
- return Promise.resolve().then(p);
1
+ import { Y as W, Z as X, _ as $, am as ee, K as ae, P as s, a1 as i, a2 as l, a7 as y, a3 as te, ax as re, a0 as se, a5 as u, N as t, a8 as h, ay as oe, a9 as B, aa as ie, Q as v, ab as g, ao as le, af as k, ad as n, a4 as T, ag as O, ar as ne } from "./global-DdaMTl90.js";
2
+ typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(w) {
3
+ return Promise.resolve().then(w);
4
4
  } });
5
- var ie = g('<div class="flash flash-error"><svg class="octicon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path></svg> </div>'), le = g('<div class="flash flash-success"><svg class="octicon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.78-9.72a.751.751 0 0 0-.018-1.042.751.751 0 0 0-1.042-.018L6.75 9.19 5.28 7.72a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042l2 2a.75.75 0 0 0 1.06 0Z"></path></svg> </div>'), ne = g('<div class="form-group"><label for="password">Password</label> <input type="password" id="password" name="password" class="form-control form-control-lg" required="" placeholder="••••••••"/></div>'), de = g('<div class="Box"><div class="Box-body"><form autocomplete="off"><div class="form-group"><label for="email">Email</label> <input type="email" id="email" name="email" class="form-control form-control-lg" required="" placeholder="you@example.com"/></div> <!> <!></form></div></div>'), ve = g('<main class="auth-wrapper svelte-uxwqu2"><div class="auth-container svelte-uxwqu2"><div class="auth-header svelte-uxwqu2"><svg class="auth-logo svelte-uxwqu2" viewBox="0 0 90 90" width="48" height="48" fill="currentColor"><rect x="12" y="12" width="66" height="66" fill="currentColor"></rect></svg> <h1 class="svelte-uxwqu2">Sign in to Hintergrund</h1></div> <!> <!></div></main>');
6
- const ue = {
5
+ var de = g('<div class="flash flash-error"><svg class="octicon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path></svg> </div>'), ue = g('<div class="flash flash-success"><svg class="octicon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.78-9.72a.751.751 0 0 0-.018-1.042.751.751 0 0 0-1.042-.018L6.75 9.19 5.28 7.72a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042l2 2a.75.75 0 0 0 1.06 0Z"></path></svg> </div>'), ve = g('<div class="form-group"><label for="password">Password</label> <input type="password" id="password" name="password" class="form-control form-control-lg" required="" placeholder="••••••••"/></div>'), ce = g('<div class="form-group"><label for="otp">Email code</label> <input type="text" id="otp" name="otp" class="form-control form-control-lg" required="" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="123456"/></div>'), fe = g('<main class="auth-wrapper svelte-uxwqu2"><div class="auth-container svelte-uxwqu2"><div class="auth-header svelte-uxwqu2"><svg class="auth-logo svelte-uxwqu2" viewBox="0 0 90 90" width="48" height="48" fill="currentColor"><rect x="12" y="12" width="66" height="66" fill="currentColor"></rect></svg> <h1 class="svelte-uxwqu2">Sign in to Hintergrund</h1></div> <!> <!> <div class="Box"><div class="Box-body"><form autocomplete="off"><div class="form-group"><label for="email">Email</label> <input type="email" id="email" name="email" class="form-control form-control-lg" required="" placeholder="you@example.com"/></div> <!> <!></form></div></div></div></main>');
6
+ const me = {
7
7
  hash: "svelte-uxwqu2",
8
8
  code: ".auth-wrapper.svelte-uxwqu2 {min-height:100vh;display:flex;align-items:center;justify-content:center;background-color:var(--bgColor-muted);padding:var(--base-size-24);}.auth-container.svelte-uxwqu2 {width:100%;max-width:340px;}.auth-header.svelte-uxwqu2 {text-align:center;margin-bottom:var(--base-size-24);}.auth-logo.svelte-uxwqu2 {color:var(--fgColor-default);margin-bottom:var(--base-size-16);}.auth-header.svelte-uxwqu2 h1:where(.svelte-uxwqu2) {font-size:var(--text-title-size-medium);font-weight:var(--base-text-weight-light);color:var(--fgColor-default);margin:0;}"
9
9
  };
10
- function ce(p, B) {
11
- I(B, !0), K(p, ue);
12
- let T = W(B, "config", 7), w = m(!1), P = m(""), x = m(""), u = m(""), _ = m(""), c = m(!1);
13
- Y(() => {
10
+ function pe(w, Z) {
11
+ X(Z, !0), $(w, me);
12
+ let A = ee(Z, "config", 7), x = v(!1), m = v(!1), q = v(""), P = v(""), _ = v(""), f = v(""), b = v(""), c = v(!1);
13
+ ae(() => {
14
14
  const e = new URLSearchParams(window.location.search).get("error");
15
- e && (r(u, e, !0), window.history.replaceState({}, "", window.location.pathname));
15
+ e && (s(f, e, !0), window.history.replaceState({}, "", window.location.pathname));
16
16
  });
17
- async function O(t) {
18
- t.preventDefault(), r(u, ""), r(_, ""), r(c, !0);
17
+ async function U(a) {
18
+ a.preventDefault(), s(f, ""), s(b, ""), s(c, !0);
19
19
  try {
20
20
  const e = {};
21
- a(x) && (e.email = a(x)), a(w) && (e.password = a(P));
22
- const s = await (await fetch("/api/admin/login", {
21
+ t(_) && (e.email = t(_)), t(x) && (e.password = t(q)), t(m) && (e.otp = t(P));
22
+ const o = await (await fetch("/api/admin/login", {
23
23
  method: "POST",
24
24
  headers: { "Content-Type": "application/json" },
25
25
  body: JSON.stringify(e)
26
26
  })).json();
27
- s.success ? s.requirePassword ? r(w, !0) : s.emailSent ? r(_, s.message || "Check your email for the login link.", !0) : window.location.href = "/admin" : r(u, s.message ?? "An error occurred. Please try again.", !0);
27
+ o.success ? o.requirePassword ? s(x, !0) : o.otpRequired ? (s(m, !0), s(b, o.message || "Check your email for a six-digit sign-in code.", !0)) : window.location.href = "/admin" : s(f, o.message ?? "An error occurred. Please try again.", !0);
28
28
  } catch {
29
- r(u, "An error occurred. Please try again.");
29
+ s(f, "An error occurred. Please try again.");
30
30
  } finally {
31
- r(c, !1);
31
+ s(c, !1);
32
32
  }
33
33
  }
34
- var U = {
34
+ var D = {
35
35
  get config() {
36
- return T();
36
+ return A();
37
37
  },
38
- set config(t) {
39
- T(t), ae();
38
+ set config(a) {
39
+ A(a), le();
40
40
  }
41
- }, C = ve(), Z = o(C), j = l(o(Z), 2);
41
+ }, C = fe(), E = l(C), j = i(l(E), 2);
42
42
  {
43
- var $ = (t) => {
44
- var e = ie(), d = l(o(e));
45
- i(e), q(() => E(d, ` ${a(u) ?? ""}`)), n(t, e);
43
+ var H = (a) => {
44
+ var e = de(), r = i(l(e));
45
+ n(e), h(() => O(r, ` ${t(f) ?? ""}`)), u(a, e);
46
46
  };
47
- y(j, (t) => {
48
- a(u) && t($);
47
+ y(j, (a) => {
48
+ t(f) && a(H);
49
49
  });
50
50
  }
51
- var H = l(j, 2);
51
+ var M = i(j, 2);
52
52
  {
53
- var N = (t) => {
54
- var e = le(), d = l(o(e));
55
- i(e), q(() => E(d, ` ${a(_) ?? ""}`)), n(t, e);
56
- }, Q = (t) => {
57
- var e = de(), d = o(e), s = o(d), L = o(s), S = l(o(L), 2);
58
- M(S), i(L);
59
- var A = l(L, 2);
53
+ var K = (a) => {
54
+ var e = ue(), r = i(l(e));
55
+ n(e), h(() => O(r, ` ${t(b) ?? ""}`)), u(a, e);
56
+ };
57
+ y(M, (a) => {
58
+ t(b) && a(K);
59
+ });
60
+ }
61
+ var R = i(M, 2), J = l(R), L = l(J), S = l(L), z = i(l(S), 2);
62
+ k(z), n(S);
63
+ var N = i(S, 2);
64
+ {
65
+ var Q = (a) => {
66
+ var e = ve(), r = i(l(e), 2);
67
+ k(r), n(e), h(() => r.disabled = t(c)), B(r, () => t(q), (o) => s(q, o)), u(a, e);
68
+ }, Y = (a) => {
69
+ var e = ce(), r = i(l(e), 2);
70
+ k(r), ne(r, "pattern", "[0-9]6"), n(e), h(() => r.disabled = t(c)), B(r, () => t(P), (o) => s(P, o)), u(a, e);
71
+ };
72
+ y(N, (a) => {
73
+ t(x) ? a(Q) : t(m) && a(Y, 1);
74
+ });
75
+ }
76
+ var F = i(N, 2);
77
+ return te(F, {
78
+ type: "submit",
79
+ variant: "primary",
80
+ size: "large",
81
+ block: !0,
82
+ get disabled() {
83
+ return t(c);
84
+ },
85
+ children: (a, e) => {
86
+ var r = re(), o = se(r);
60
87
  {
61
- var R = (v) => {
62
- var b = ne(), f = l(o(b), 2);
63
- M(f), i(b), q(() => f.disabled = a(c)), J(f, () => a(P), (k) => r(P, k)), n(v, b);
88
+ var G = (d) => {
89
+ var p = T("Please wait...");
90
+ u(d, p);
91
+ }, I = (d) => {
92
+ var p = T("Sign in");
93
+ u(d, p);
94
+ }, V = (d) => {
95
+ var p = T("Continue");
96
+ u(d, p);
64
97
  };
65
- y(A, (v) => {
66
- a(w) && v(R);
98
+ y(o, (d) => {
99
+ t(c) ? d(G) : t(m) ? d(I, 1) : d(V, -1);
67
100
  });
68
101
  }
69
- var V = l(A, 2);
70
- te(V, {
71
- type: "submit",
72
- variant: "primary",
73
- size: "large",
74
- block: !0,
75
- get disabled() {
76
- return a(c);
77
- },
78
- children: (v, b) => {
79
- var f = re(), k = se(f);
80
- {
81
- var X = (h) => {
82
- var z = D("Please wait...");
83
- n(h, z);
84
- }, F = (h) => {
85
- var z = D("Continue");
86
- n(h, z);
87
- };
88
- y(k, (h) => {
89
- a(c) ? h(X) : h(F, -1);
90
- });
91
- }
92
- n(v, f);
93
- },
94
- $$slots: { default: !0 }
95
- }), i(s), i(d), i(e), q(() => S.disabled = a(c) || a(w)), oe("submit", s, O), J(S, () => a(x), (v) => r(x, v)), n(t, e);
96
- };
97
- y(H, (t) => {
98
- a(_) ? t(N) : t(Q, -1);
99
- });
100
- }
101
- return i(Z), i(C), n(p, C), ee(U);
102
+ u(a, r);
103
+ },
104
+ $$slots: { default: !0 }
105
+ }), n(L), n(J), n(R), n(E), n(C), h(() => z.disabled = t(c) || t(x) || t(m)), oe("submit", L, U), B(z, () => t(_), (a) => s(_, a)), u(w, C), ie(D);
102
106
  }
103
- customElements.define("hintergrund-login", G(ce, { config: {} }, [], []));
107
+ customElements.define("hintergrund-login", W(pe, { config: {} }, [], []));
104
108
  export {
105
- ce as default
109
+ pe as default
106
110
  };
@@ -1,6 +1,6 @@
1
- import { d as Cn, h as Vu, e as Gu, f as Ju } from "./Builder-RvOmGKW5.js";
1
+ import { d as Cn, h as Vu, e as Gu, f as Ju } from "./Builder-BhGmzNTC.js";
2
2
  import { s as Bu } from "./hash-DFlR084x.js";
3
- import { p as Ir } from "./json-parse-Didq-LlA.js";
3
+ import { p as Ir } from "./json-parse-Dk_xwHcS.js";
4
4
  import { b as Yu, t as Qu, s as We } from "./transform-messages-CkpQp6fJ.js";
5
5
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
6
6
  return Promise.resolve().then(e);
@@ -1,6 +1,6 @@
1
- import { d as P, h as Z, e as ee } from "./Builder-RvOmGKW5.js";
1
+ import { d as P, h as Z, e as ee } from "./Builder-BhGmzNTC.js";
2
2
  import { h as N } from "./headers-u7rXGJ9f.js";
3
- import { c as $, a as te, p as F } from "./openai-responses-shared-qXvKLxLt.js";
3
+ import { c as $, a as te, p as F } from "./openai-responses-shared-CCD7nRqy.js";
4
4
  import { b as re } from "./transform-messages-CkpQp6fJ.js";
5
5
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
6
6
  return Promise.resolve().then(e);
@@ -1,7 +1,7 @@
1
1
  import { O as H } from "./client-Sh7wNjbG.js";
2
- import { d as F, h as j, e as G, f as $ } from "./Builder-RvOmGKW5.js";
2
+ import { d as F, h as j, e as G, f as $ } from "./Builder-BhGmzNTC.js";
3
3
  import { h as W } from "./headers-u7rXGJ9f.js";
4
- import { p as q } from "./json-parse-Didq-LlA.js";
4
+ import { p as q } from "./json-parse-Dk_xwHcS.js";
5
5
  import { b as J, t as K, s as A } from "./transform-messages-CkpQp6fJ.js";
6
6
  import { h as Y, b as V, i as Z, r as Q } from "./github-copilot-headers-DWh_6bE3.js";
7
7
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
@@ -1,8 +1,8 @@
1
1
  import { O as w } from "./client-Sh7wNjbG.js";
2
- import { d, h as y, e as E } from "./Builder-RvOmGKW5.js";
2
+ import { d, h as y, e as E } from "./Builder-BhGmzNTC.js";
3
3
  import { h as b } from "./headers-u7rXGJ9f.js";
4
4
  import { h as I, b as A, i as _, r as P } from "./github-copilot-headers-DWh_6bE3.js";
5
- import { p as T, c as O, a as S } from "./openai-responses-shared-qXvKLxLt.js";
5
+ import { p as T, c as O, a as S } from "./openai-responses-shared-CCD7nRqy.js";
6
6
  import { b as C } from "./transform-messages-CkpQp6fJ.js";
7
7
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
8
8
  return Promise.resolve().then(e);
@@ -1,6 +1,6 @@
1
- import { f as S } from "./Builder-RvOmGKW5.js";
1
+ import { f as S } from "./Builder-BhGmzNTC.js";
2
2
  import { s as v } from "./hash-DFlR084x.js";
3
- import { p as x } from "./json-parse-Didq-LlA.js";
3
+ import { p as x } from "./json-parse-Dk_xwHcS.js";
4
4
  import { t as T, s as _ } from "./transform-messages-CkpQp6fJ.js";
5
5
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(r) {
6
6
  return Promise.resolve().then(r);