@hotosm/hanko-auth 0.3.0 → 0.3.1
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.
- package/dist/hanko-auth.esm.js +125 -128
- package/dist/hanko-auth.iife.js +6 -6
- package/dist/hanko-auth.umd.js +5 -5
- package/package.json +1 -1
- package/src/hanko-auth.ts +0 -2
package/dist/hanko-auth.esm.js
CHANGED
|
@@ -581,7 +581,7 @@ const cs = { attribute: !0, type: String, converter: vn, reflect: !1, hasChanged
|
|
|
581
581
|
}
|
|
582
582
|
throw Error("Unsupported decorator location: " + o);
|
|
583
583
|
};
|
|
584
|
-
function
|
|
584
|
+
function We(n) {
|
|
585
585
|
return (e, t) => typeof t == "object" ? ds(n, e, t) : ((o, i, s) => {
|
|
586
586
|
const a = i.hasOwnProperty(s);
|
|
587
587
|
return i.constructor.createProperty(s, o), a ? Object.getOwnPropertyDescriptor(i, s) : void 0;
|
|
@@ -593,7 +593,7 @@ function Re(n) {
|
|
|
593
593
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
594
594
|
*/
|
|
595
595
|
function at(n) {
|
|
596
|
-
return
|
|
596
|
+
return We({ ...n, state: !0, attribute: !1 });
|
|
597
597
|
}
|
|
598
598
|
/*! For license information please see elements.js.LICENSE.txt */
|
|
599
599
|
var us = { 7: function(n, e, t) {
|
|
@@ -645,7 +645,7 @@ var us = { 7: function(n, e, t) {
|
|
|
645
645
|
o.TranslateContext = f, o.TranslateProvider = function(x) {
|
|
646
646
|
var O = function(N, U) {
|
|
647
647
|
N = Object.assign({}, v, N), h = U || h;
|
|
648
|
-
var ie = c(s.useState(N.lang), 2),
|
|
648
|
+
var ie = c(s.useState(N.lang), 2), ye = ie[0], se = ie[1], we = c(s.useState(h), 2), M = we[0], z = we[1], ve = c(s.useState(!1), 2), $e = ve[0], Ee = ve[1], Le = function(re) {
|
|
649
649
|
if (!M.hasOwnProperty(re)) {
|
|
650
650
|
Ee(!1);
|
|
651
651
|
var ae = d(N.root, re);
|
|
@@ -659,11 +659,11 @@ var us = { 7: function(n, e, t) {
|
|
|
659
659
|
}
|
|
660
660
|
};
|
|
661
661
|
return s.useEffect(function() {
|
|
662
|
-
Le(N.fallbackLang), Le(
|
|
663
|
-
}, [
|
|
664
|
-
if (!M.hasOwnProperty(
|
|
665
|
-
var he = u(M,
|
|
666
|
-
return he === re &&
|
|
662
|
+
Le(N.fallbackLang), Le(ye);
|
|
663
|
+
}, [ye]), { lang: ye, setLang: se, t: function(re, ae) {
|
|
664
|
+
if (!M.hasOwnProperty(ye)) return re;
|
|
665
|
+
var he = u(M, ye, re);
|
|
666
|
+
return he === re && ye !== N.fallbackLang && (he = u(M, N.fallbackLang, re)), l(he, ae);
|
|
667
667
|
}, isReady: $e };
|
|
668
668
|
}({ root: x.root || "assets", lang: x.lang || "en", fallbackLang: x.fallbackLang || "en" }, x.translations), C = O.t, S = O.setLang, P = O.lang, D = O.isReady;
|
|
669
669
|
return i.h(f.Provider, { value: { t: C, setLang: S, lang: P, isReady: D } }, x.children);
|
|
@@ -775,7 +775,7 @@ var us = { 7: function(n, e, t) {
|
|
|
775
775
|
return e[1];
|
|
776
776
|
};
|
|
777
777
|
}, 616: (n, e, t) => {
|
|
778
|
-
t.r(e), t.d(e, { Component: () => U, Fragment: () => N, cloneElement: () => qe, createContext: () => Fe, createElement: () => S, createRef: () => D, h: () => S, hydrate: () => ze, isValidElement: () => a, options: () => i, render: () => pe, toChildArray: () =>
|
|
778
|
+
t.r(e), t.d(e, { Component: () => U, Fragment: () => N, cloneElement: () => qe, createContext: () => Fe, createElement: () => S, createRef: () => D, h: () => S, hydrate: () => ze, isValidElement: () => a, options: () => i, render: () => pe, toChildArray: () => ve });
|
|
779
779
|
var o, i, s, a, c, d, l, u, h, v = {}, f = [], x = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
780
780
|
function O(m, g) {
|
|
781
781
|
for (var b in g) m[b] = g[b];
|
|
@@ -809,14 +809,14 @@ var us = { 7: function(n, e, t) {
|
|
|
809
809
|
for (var b; g < m.__k.length; g++) if ((b = m.__k[g]) != null && b.__e != null) return b.__e;
|
|
810
810
|
return typeof m.type == "function" ? ie(m) : null;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function ye(m) {
|
|
813
813
|
var g, b;
|
|
814
814
|
if ((m = m.__) != null && m.__c != null) {
|
|
815
815
|
for (m.__e = m.__c.base = null, g = 0; g < m.__k.length; g++) if ((b = m.__k[g]) != null && b.__e != null) {
|
|
816
816
|
m.__e = m.__c.base = b.__e;
|
|
817
817
|
break;
|
|
818
818
|
}
|
|
819
|
-
return
|
|
819
|
+
return ye(m);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
function se(m) {
|
|
@@ -824,21 +824,21 @@ var us = { 7: function(n, e, t) {
|
|
|
824
824
|
}
|
|
825
825
|
function we() {
|
|
826
826
|
var m, g, b, j, T, I, W, X;
|
|
827
|
-
for (c.sort(u); m = c.shift(); ) m.__d && (g = c.length, j = void 0, T = void 0, W = (I = (b = m).__v).__e, (X = b.__P) && (j = [], (T = O({}, I)).__v = I.__v + 1, Ie(X, I, T, b.__n, X.ownerSVGElement !== void 0, I.__h != null ? [W] : null, j, W ?? ie(I), I.__h), k(j, I), I.__e != W &&
|
|
827
|
+
for (c.sort(u); m = c.shift(); ) m.__d && (g = c.length, j = void 0, T = void 0, W = (I = (b = m).__v).__e, (X = b.__P) && (j = [], (T = O({}, I)).__v = I.__v + 1, Ie(X, I, T, b.__n, X.ownerSVGElement !== void 0, I.__h != null ? [W] : null, j, W ?? ie(I), I.__h), k(j, I), I.__e != W && ye(I)), c.length > g && c.sort(u));
|
|
828
828
|
we.__r = 0;
|
|
829
829
|
}
|
|
830
830
|
function M(m, g, b, j, T, I, W, X, G, _e) {
|
|
831
|
-
var w,
|
|
831
|
+
var w, be, J, H, E, Se, B, F = j && j.__k || f, Me = F.length;
|
|
832
832
|
for (b.__k = [], w = 0; w < g.length; w++) if ((H = b.__k[w] = (H = g[w]) == null || typeof H == "boolean" || typeof H == "function" ? null : typeof H == "string" || typeof H == "number" || typeof H == "bigint" ? P(null, H, null, null, H) : Array.isArray(H) ? P(N, { children: H }, null, null, null) : H.__b > 0 ? P(H.type, H.props, H.key, H.ref ? H.ref : null, H.__v) : H) != null) {
|
|
833
833
|
if (H.__ = b, H.__b = b.__b + 1, (J = F[w]) === null || J && H.key == J.key && H.type === J.type) F[w] = void 0;
|
|
834
|
-
else for (
|
|
835
|
-
if ((J = F[
|
|
836
|
-
F[
|
|
834
|
+
else for (be = 0; be < Me; be++) {
|
|
835
|
+
if ((J = F[be]) && H.key == J.key && H.type === J.type) {
|
|
836
|
+
F[be] = void 0;
|
|
837
837
|
break;
|
|
838
838
|
}
|
|
839
839
|
J = null;
|
|
840
840
|
}
|
|
841
|
-
Ie(m, H, J = J || v, T, I, W, X, G, _e), E = H.__e, (
|
|
841
|
+
Ie(m, H, J = J || v, T, I, W, X, G, _e), E = H.__e, (be = H.ref) && J.ref != be && (B || (B = []), J.ref && B.push(J.ref, null, H), B.push(be, H.__c || E, H)), E != null ? (Se == null && (Se = E), typeof H.type == "function" && H.__k === J.__k ? H.__d = G = z(H, G, m) : G = $e(m, H, J, F, E, G), typeof b.type == "function" && (b.__d = G)) : G && J.__e == G && G.parentNode != m && (G = ie(J));
|
|
842
842
|
}
|
|
843
843
|
for (b.__e = Se, w = Me; w--; ) F[w] != null && (typeof b.type == "function" && F[w].__e != null && F[w].__e == b.__d && (b.__d = Ee(j).nextSibling), L(F[w], F[w]));
|
|
844
844
|
if (B) for (w = 0; w < B.length; w++) y(B[w], B[++w], B[++w]);
|
|
@@ -847,9 +847,9 @@ var us = { 7: function(n, e, t) {
|
|
|
847
847
|
for (var j, T = m.__k, I = 0; T && I < T.length; I++) (j = T[I]) && (j.__ = m, g = typeof j.type == "function" ? z(j, g, b) : $e(b, j, j, T, j.__e, g));
|
|
848
848
|
return g;
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function ve(m, g) {
|
|
851
851
|
return g = g || [], m == null || typeof m == "boolean" || (Array.isArray(m) ? m.some(function(b) {
|
|
852
|
-
|
|
852
|
+
ve(b, g);
|
|
853
853
|
}) : g.push(m)), g;
|
|
854
854
|
}
|
|
855
855
|
function $e(m, g, b, j, T, I) {
|
|
@@ -898,12 +898,12 @@ var us = { 7: function(n, e, t) {
|
|
|
898
898
|
return this.l[m.type + !0](i.event ? i.event(m) : m);
|
|
899
899
|
}
|
|
900
900
|
function Ie(m, g, b, j, T, I, W, X, G) {
|
|
901
|
-
var _e, w,
|
|
901
|
+
var _e, w, be, J, H, E, Se, B, F, Me, ot, fe, Kt, it, R, V = g.type;
|
|
902
902
|
if (g.constructor !== void 0) return null;
|
|
903
903
|
b.__h != null && (G = b.__h, X = g.__e = b.__e, g.__h = null, I = [X]), (_e = i.__b) && _e(g);
|
|
904
904
|
try {
|
|
905
905
|
e: if (typeof V == "function") {
|
|
906
|
-
if (B = g.props, F = (_e = V.contextType) && j[_e.__c], Me = _e ? F ? F.props.value : _e.__ : j, b.__c ? Se = (w = g.__c = b.__c).__ = w.__E : ("prototype" in V && V.prototype.render ? g.__c = w = new V(B, Me) : (g.__c = w = new U(B, Me), w.constructor = V, w.render = K), F && F.sub(w), w.props = B, w.state || (w.state = {}), w.context = Me, w.__n = j,
|
|
906
|
+
if (B = g.props, F = (_e = V.contextType) && j[_e.__c], Me = _e ? F ? F.props.value : _e.__ : j, b.__c ? Se = (w = g.__c = b.__c).__ = w.__E : ("prototype" in V && V.prototype.render ? g.__c = w = new V(B, Me) : (g.__c = w = new U(B, Me), w.constructor = V, w.render = K), F && F.sub(w), w.props = B, w.state || (w.state = {}), w.context = Me, w.__n = j, be = w.__d = !0, w.__h = [], w._sb = []), w.__s == null && (w.__s = w.state), V.getDerivedStateFromProps != null && (w.__s == w.state && (w.__s = O({}, w.__s)), O(w.__s, V.getDerivedStateFromProps(B, w.__s))), J = w.props, H = w.state, w.__v = g, be) V.getDerivedStateFromProps == null && w.componentWillMount != null && w.componentWillMount(), w.componentDidMount != null && w.__h.push(w.componentDidMount);
|
|
907
907
|
else {
|
|
908
908
|
if (V.getDerivedStateFromProps == null && B !== J && w.componentWillReceiveProps != null && w.componentWillReceiveProps(B, Me), !w.__e && w.shouldComponentUpdate != null && w.shouldComponentUpdate(B, w.__s, Me) === !1 || g.__v === b.__v) {
|
|
909
909
|
for (g.__v !== b.__v && (w.props = B, w.state = w.__s, w.__d = !1), w.__e = !1, g.__e = b.__e, g.__k = b.__k, g.__k.forEach(function(Qe) {
|
|
@@ -922,7 +922,7 @@ var us = { 7: function(n, e, t) {
|
|
|
922
922
|
} else do
|
|
923
923
|
w.__d = !1, fe && fe(g), _e = w.render(w.props, w.state, w.context), w.state = w.__s;
|
|
924
924
|
while (w.__d && ++Kt < 25);
|
|
925
|
-
w.state = w.__s, w.getChildContext != null && (j = O(O({}, j), w.getChildContext())),
|
|
925
|
+
w.state = w.__s, w.getChildContext != null && (j = O(O({}, j), w.getChildContext())), be || w.getSnapshotBeforeUpdate == null || (E = w.getSnapshotBeforeUpdate(J, H)), R = _e != null && _e.type === N && _e.key == null ? _e.props.children : _e, M(m, Array.isArray(R) ? R : [R], g, b, j, T, I, W, X, G), w.base = g.__e, g.__h = null, w.__h.length && W.push(w), Se && (w.__E = w.__ = null), w.__e = !1;
|
|
926
926
|
} else I == null && g.__v === b.__v ? (g.__k = b.__k, g.__e = b.__e) : g.__e = p(b.__e, g, b, j, T, I, W, G);
|
|
927
927
|
(_e = i.diffed) && _e(g);
|
|
928
928
|
} catch (Qe) {
|
|
@@ -941,7 +941,7 @@ var us = { 7: function(n, e, t) {
|
|
|
941
941
|
});
|
|
942
942
|
}
|
|
943
943
|
function p(m, g, b, j, T, I, W, X) {
|
|
944
|
-
var G, _e, w,
|
|
944
|
+
var G, _e, w, be = b.props, J = g.props, H = g.type, E = 0;
|
|
945
945
|
if (H === "svg" && (T = !0), I != null) {
|
|
946
946
|
for (; E < I.length; E++) if ((G = I[E]) && "setAttribute" in G == !!H && (H ? G.localName === H : G.nodeType === 3)) {
|
|
947
947
|
m = G, I[E] = null;
|
|
@@ -952,19 +952,19 @@ var us = { 7: function(n, e, t) {
|
|
|
952
952
|
if (H === null) return document.createTextNode(J);
|
|
953
953
|
m = T ? document.createElementNS("http://www.w3.org/2000/svg", H) : document.createElement(H, J.is && J), I = null, X = !1;
|
|
954
954
|
}
|
|
955
|
-
if (H === null)
|
|
955
|
+
if (H === null) be === J || X && m.data === J || (m.data = J);
|
|
956
956
|
else {
|
|
957
|
-
if (I = I && o.call(m.childNodes), _e = (
|
|
958
|
-
if (I != null) for (
|
|
957
|
+
if (I = I && o.call(m.childNodes), _e = (be = b.props || v).dangerouslySetInnerHTML, w = J.dangerouslySetInnerHTML, !X) {
|
|
958
|
+
if (I != null) for (be = {}, E = 0; E < m.attributes.length; E++) be[m.attributes[E].name] = m.attributes[E].value;
|
|
959
959
|
(w || _e) && (w && (_e && w.__html == _e.__html || w.__html === m.innerHTML) || (m.innerHTML = w && w.__html || ""));
|
|
960
960
|
}
|
|
961
961
|
if (function(Se, B, F, Me, ot) {
|
|
962
962
|
var fe;
|
|
963
963
|
for (fe in F) fe === "children" || fe === "key" || fe in B || re(Se, fe, null, F[fe], Me);
|
|
964
964
|
for (fe in B) ot && typeof B[fe] != "function" || fe === "children" || fe === "key" || fe === "value" || fe === "checked" || F[fe] === B[fe] || re(Se, fe, B[fe], F[fe], Me);
|
|
965
|
-
}(m, J,
|
|
965
|
+
}(m, J, be, T, X), w) g.__k = [];
|
|
966
966
|
else if (E = g.props.children, M(m, Array.isArray(E) ? E : [E], g, b, j, T && H !== "foreignObject", I, W, I ? I[0] : b.__k && ie(b, 0), X), I != null) for (E = I.length; E--; ) I[E] != null && C(I[E]);
|
|
967
|
-
X || ("value" in J && (E = J.value) !== void 0 && (E !== m.value || H === "progress" && !E || H === "option" && E !==
|
|
967
|
+
X || ("value" in J && (E = J.value) !== void 0 && (E !== m.value || H === "progress" && !E || H === "option" && E !== be.value) && re(m, "value", E, be.value, !1), "checked" in J && (E = J.checked) !== void 0 && E !== m.checked && re(m, "checked", E, be.checked, !1));
|
|
968
968
|
}
|
|
969
969
|
return m;
|
|
970
970
|
}
|
|
@@ -1042,7 +1042,7 @@ var us = { 7: function(n, e, t) {
|
|
|
1042
1042
|
return m.__v.__b - g.__v.__b;
|
|
1043
1043
|
}, we.__r = 0, h = 0;
|
|
1044
1044
|
}, 78: (n, e, t) => {
|
|
1045
|
-
t.r(e), t.d(e, { useCallback: () => se, useContext: () => we, useDebugValue: () => M, useEffect: () => D, useErrorBoundary: () => z, useId: () =>
|
|
1045
|
+
t.r(e), t.d(e, { useCallback: () => se, useContext: () => we, useDebugValue: () => M, useEffect: () => D, useErrorBoundary: () => z, useId: () => ve, useImperativeHandle: () => ie, useLayoutEffect: () => N, useMemo: () => ye, useReducer: () => P, useRef: () => U, useState: () => S });
|
|
1046
1046
|
var o, i, s, a, c = t(616), d = 0, l = [], u = [], h = c.options.__b, v = c.options.__r, f = c.options.diffed, x = c.options.__c, O = c.options.unmount;
|
|
1047
1047
|
function C(k, p) {
|
|
1048
1048
|
c.options.__h && c.options.__h(i, k, d || p), d = 0;
|
|
@@ -1095,7 +1095,7 @@ var us = { 7: function(n, e, t) {
|
|
|
1095
1095
|
!c.options.__s && he(y.__H, p) && (y.__ = k, y.i = p, i.__h.push(y));
|
|
1096
1096
|
}
|
|
1097
1097
|
function U(k) {
|
|
1098
|
-
return d = 5,
|
|
1098
|
+
return d = 5, ye(function() {
|
|
1099
1099
|
return { current: k };
|
|
1100
1100
|
}, []);
|
|
1101
1101
|
}
|
|
@@ -1108,12 +1108,12 @@ var us = { 7: function(n, e, t) {
|
|
|
1108
1108
|
}) : void 0;
|
|
1109
1109
|
}, y == null ? y : y.concat(k));
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function ye(k, p) {
|
|
1112
1112
|
var y = C(o++, 7);
|
|
1113
1113
|
return he(y.__H, p) ? (y.__V = k(), y.i = p, y.__h = k, y.__V) : y.__;
|
|
1114
1114
|
}
|
|
1115
1115
|
function se(k, p) {
|
|
1116
|
-
return d = 8,
|
|
1116
|
+
return d = 8, ye(function() {
|
|
1117
1117
|
return k;
|
|
1118
1118
|
}, p);
|
|
1119
1119
|
}
|
|
@@ -1132,7 +1132,7 @@ var us = { 7: function(n, e, t) {
|
|
|
1132
1132
|
y[1](void 0);
|
|
1133
1133
|
}];
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function ve() {
|
|
1136
1136
|
var k = C(o++, 11);
|
|
1137
1137
|
if (!k.__) {
|
|
1138
1138
|
for (var p = i.__v; p !== null && !p.__m && p.__ !== null; ) p = p.__;
|
|
@@ -2558,10 +2558,10 @@ var Pt = function(n, e, t, o) {
|
|
|
2558
2558
|
};
|
|
2559
2559
|
const br = (n) => {
|
|
2560
2560
|
var e, t, o, i, s, a, c, d, l;
|
|
2561
|
-
const { t: u } = (0, _.useContext)(Z.TranslateContext), { init: h, hanko: v, initialComponentName: f, setLoadingAction: x, uiState: O, setUIState: C, stateHandler: S, hidePasskeyButtonOnLogin: P, lastLogin: D } = (0, _.useContext)(ue), [N, U] = (0, _.useState)(null), [ie,
|
|
2561
|
+
const { t: u } = (0, _.useContext)(Z.TranslateContext), { init: h, hanko: v, initialComponentName: f, setLoadingAction: x, uiState: O, setUIState: C, stateHandler: S, hidePasskeyButtonOnLogin: P, lastLogin: D } = (0, _.useContext)(ue), [N, U] = (0, _.useState)(null), [ie, ye] = (0, _.useState)(O.username || O.email), { flowState: se } = Ne(n.state), we = mt.supported(), [M, z] = (0, _.useState)(void 0), [ve, $e] = (0, _.useState)(null), [Ee, Le] = (0, _.useState)(!1), re = (k) => {
|
|
2562
2562
|
if (k.preventDefault(), k.target instanceof HTMLInputElement) {
|
|
2563
2563
|
const { value: p } = k.target;
|
|
2564
|
-
|
|
2564
|
+
ye(p), ae(p);
|
|
2565
2565
|
}
|
|
2566
2566
|
}, ae = (k) => {
|
|
2567
2567
|
const p = () => C((L) => Object.assign(Object.assign({}, L), { email: k, username: null })), y = () => C((L) => Object.assign(Object.assign({}, L), { email: null, username: k }));
|
|
@@ -2602,7 +2602,7 @@ const br = (n) => {
|
|
|
2602
2602
|
y.preventDefault(), $e(L);
|
|
2603
2603
|
const K = yield se.actions.thirdparty_oauth({ provider: L, redirect_to: window.location.toString() }).run();
|
|
2604
2604
|
K.error && $e(null), yield v.flow.run(K, S);
|
|
2605
|
-
}))(p, k.value) }, { children: r(te, Object.assign({ isLoading: k.value ==
|
|
2605
|
+
}))(p, k.value) }, { children: r(te, Object.assign({ isLoading: k.value == ve, secondary: !0, icon: k.value.startsWith("custom_") ? "customProvider" : k.value, showLastUsed: (D == null ? void 0 : D.login_method) == "third_party" && (D == null ? void 0 : D.third_party_provider) == k.value }, { children: u("labels.signInWith", { provider: k.name }) })) }), k.value)) : null, ((l = (d = se.actions).remember_me) === null || l === void 0 ? void 0 : l.call(d, null)) && r(A.Fragment, { children: [r(Pn, {}), r(yo, { required: !1, type: "checkbox", label: u("labels.staySignedIn"), checked: Ee, onChange: (k) => Pt(void 0, void 0, void 0, function* () {
|
|
2606
2606
|
const p = yield se.actions.remember_me({ remember_me: !Ee }).run();
|
|
2607
2607
|
Le((y) => !y), yield v.flow.run(p, S);
|
|
2608
2608
|
}) })] })] }), r(Ue, Object.assign({ hidden: f !== "auth" }, { children: [r("span", { hidden: !0 }), r(ee, Object.assign({ uiAction: "switch-flow", onClick: (k) => Pt(void 0, void 0, void 0, function* () {
|
|
@@ -2928,7 +2928,7 @@ var Gt = function(n, e, t, o) {
|
|
|
2928
2928
|
};
|
|
2929
2929
|
const Pr = (n) => {
|
|
2930
2930
|
var e, t, o, i, s, a, c;
|
|
2931
|
-
const { t: d } = (0, _.useContext)(Z.TranslateContext), { init: l, hanko: u, uiState: h, setUIState: v, stateHandler: f, setLoadingAction: x, initialComponentName: O } = (0, _.useContext)(ue), { flowState: C } = Ne(n.state), S = (t = (e = C.actions).register_login_identifier) === null || t === void 0 ? void 0 : t.call(e, null).inputs, P = !(!(S != null && S.email) || !(S != null && S.username)), [D, N] = (0, _.useState)(void 0), [U, ie] = (0, _.useState)(null), [
|
|
2931
|
+
const { t: d } = (0, _.useContext)(Z.TranslateContext), { init: l, hanko: u, uiState: h, setUIState: v, stateHandler: f, setLoadingAction: x, initialComponentName: O } = (0, _.useContext)(ue), { flowState: C } = Ne(n.state), S = (t = (e = C.actions).register_login_identifier) === null || t === void 0 ? void 0 : t.call(e, null).inputs, P = !(!(S != null && S.email) || !(S != null && S.username)), [D, N] = (0, _.useState)(void 0), [U, ie] = (0, _.useState)(null), [ye, se] = (0, _.useState)(!1), we = (0, _.useMemo)(() => {
|
|
2932
2932
|
var M, z;
|
|
2933
2933
|
return !!(!((z = (M = C.actions).thirdparty_oauth) === null || z === void 0) && z.call(M, null));
|
|
2934
2934
|
}, [C.actions]);
|
|
@@ -2937,8 +2937,8 @@ const Pr = (n) => {
|
|
|
2937
2937
|
if (M.get("error") == null || M.get("error").length === 0) return;
|
|
2938
2938
|
let z = "";
|
|
2939
2939
|
z = M.get("error") === "access_denied" ? "thirdPartyAccessDenied" : "somethingWentWrong";
|
|
2940
|
-
const
|
|
2941
|
-
N(
|
|
2940
|
+
const ve = { name: z, code: z, message: M.get("error_description") };
|
|
2941
|
+
N(ve), M.delete("error"), M.delete("error_description"), history.replaceState(null, null, window.location.pathname + (M.size < 1 ? "" : `?${M.toString()}`));
|
|
2942
2942
|
}, []), r(A.Fragment, { children: [r(Oe, { children: [r(de, { children: d("headlines.signUp") }), r(Pe, { state: C, error: D }), S ? r(A.Fragment, { children: [r(ne, Object.assign({ onSubmit: (M) => Gt(void 0, void 0, void 0, function* () {
|
|
2943
2943
|
M.preventDefault(), x("email-submit");
|
|
2944
2944
|
const z = yield C.actions.register_login_identifier({ email: h.email, username: h.username }).run();
|
|
@@ -2946,20 +2946,20 @@ const Pr = (n) => {
|
|
|
2946
2946
|
}), maxWidth: !0 }, { children: [S.username ? r(Be, { markOptional: P, markError: P, type: "text", autoComplete: "username", autoCorrect: "off", flowInput: S.username, onInput: (M) => {
|
|
2947
2947
|
if (M.preventDefault(), M.target instanceof HTMLInputElement) {
|
|
2948
2948
|
const { value: z } = M.target;
|
|
2949
|
-
v((
|
|
2949
|
+
v((ve) => Object.assign(Object.assign({}, ve), { username: z }));
|
|
2950
2950
|
}
|
|
2951
2951
|
}, value: h.username, placeholder: d("labels.username") }) : null, S.email ? r(Be, { markOptional: P, markError: P, type: "email", autoComplete: "email", autoCorrect: "off", flowInput: S.email, onInput: (M) => {
|
|
2952
2952
|
if (M.preventDefault(), M.target instanceof HTMLInputElement) {
|
|
2953
2953
|
const { value: z } = M.target;
|
|
2954
|
-
v((
|
|
2954
|
+
v((ve) => Object.assign(Object.assign({}, ve), { email: z }));
|
|
2955
2955
|
}
|
|
2956
|
-
}, value: h.email, placeholder: d("labels.email"), pattern: "^.*[^0-9]+$" }) : null, r(te, Object.assign({ uiAction: "email-submit", autofocus: !0 }, { children: d("labels.continue") }))] })), r(_o, Object.assign({ hidden: !we }, { children: d("labels.or") }))] }) : null, !((i = (o = C.actions).thirdparty_oauth) === null || i === void 0) && i.call(o, null) ? (s = C.actions.thirdparty_oauth(null).inputs.provider.allowed_values) === null || s === void 0 ? void 0 : s.map((M) => r(ne, Object.assign({ onSubmit: (z) => ((
|
|
2957
|
-
|
|
2956
|
+
}, value: h.email, placeholder: d("labels.email"), pattern: "^.*[^0-9]+$" }) : null, r(te, Object.assign({ uiAction: "email-submit", autofocus: !0 }, { children: d("labels.continue") }))] })), r(_o, Object.assign({ hidden: !we }, { children: d("labels.or") }))] }) : null, !((i = (o = C.actions).thirdparty_oauth) === null || i === void 0) && i.call(o, null) ? (s = C.actions.thirdparty_oauth(null).inputs.provider.allowed_values) === null || s === void 0 ? void 0 : s.map((M) => r(ne, Object.assign({ onSubmit: (z) => ((ve, $e) => Gt(void 0, void 0, void 0, function* () {
|
|
2957
|
+
ve.preventDefault(), ie($e);
|
|
2958
2958
|
const Ee = yield C.actions.thirdparty_oauth({ provider: $e, redirect_to: window.location.toString() }).run();
|
|
2959
2959
|
ie(null), yield u.flow.run(Ee, f);
|
|
2960
|
-
}))(z, M.value) }, { children: r(te, Object.assign({ isLoading: M.value == U, secondary: !0, icon: M.value.startsWith("custom_") ? "customProvider" : M.value }, { children: d("labels.signInWith", { provider: M.name }) })) }), M.value)) : null, ((c = (a = C.actions).remember_me) === null || c === void 0 ? void 0 : c.call(a, null)) && r(A.Fragment, { children: [r(Pn, {}), r(yo, { required: !1, type: "checkbox", label: d("labels.staySignedIn"), checked:
|
|
2961
|
-
const z = yield C.actions.remember_me({ remember_me: !
|
|
2962
|
-
se((
|
|
2960
|
+
}))(z, M.value) }, { children: r(te, Object.assign({ isLoading: M.value == U, secondary: !0, icon: M.value.startsWith("custom_") ? "customProvider" : M.value }, { children: d("labels.signInWith", { provider: M.name }) })) }), M.value)) : null, ((c = (a = C.actions).remember_me) === null || c === void 0 ? void 0 : c.call(a, null)) && r(A.Fragment, { children: [r(Pn, {}), r(yo, { required: !1, type: "checkbox", label: d("labels.staySignedIn"), checked: ye, onChange: (M) => Gt(void 0, void 0, void 0, function* () {
|
|
2961
|
+
const z = yield C.actions.remember_me({ remember_me: !ye }).run();
|
|
2962
|
+
se((ve) => !ve), yield u.flow.run(z, f);
|
|
2963
2963
|
}) })] })] }), r(Ue, Object.assign({ hidden: O !== "auth" }, { children: [r("span", { hidden: !0 }), r(ee, Object.assign({ uiAction: "switch-flow", onClick: (M) => Gt(void 0, void 0, void 0, function* () {
|
|
2964
2964
|
M.preventDefault(), l("login");
|
|
2965
2965
|
}), loadingSpinnerPosition: "left" }, { children: d("labels.alreadyHaveAnAccount") }))] }))] });
|
|
@@ -3019,14 +3019,14 @@ const Ze = fn.A && fn.A.locals ? fn.A.locals : void 0, En = function({ name: n,
|
|
|
3019
3019
|
s(v === i ? null : v);
|
|
3020
3020
|
};
|
|
3021
3021
|
return r("div", Object.assign({ className: Ze.accordion }, { children: o.map((u, h) => r("div", Object.assign({ className: Ze.accordionItem }, { children: [r("input", { type: "radio", className: Ze.accordionInput, id: `${n}-${h}`, name: n, onClick: l, value: h, checked: d(h) }), r("label", Object.assign({ className: Q()(Ze.label, a && Ze.dropdown), for: `${n}-${h}` }, { children: r("span", Object.assign({ className: Ze.labelText }, { children: e(u, h) })) })), r("div", Object.assign({ className: Q()(Ze.accordionContent, a && Ze.dropdownContent) }, { children: t(u, h) }))] }), h)) }));
|
|
3022
|
-
},
|
|
3022
|
+
}, Re = ({ children: n }) => r("h2", Object.assign({ part: "headline2", className: Q()(bn.headline, bn.grade2) }, { children: n })), Ir = ({ onEmailDelete: n, onEmailSetPrimary: e, onEmailVerify: t, checkedItemID: o, setCheckedItemID: i, emails: s = [], deletableEmailIDs: a = [] }) => {
|
|
3023
3023
|
const { t: c } = (0, _.useContext)(Z.TranslateContext), d = (0, _.useMemo)(() => !1, []);
|
|
3024
3024
|
return r(En, { name: "email-edit-dropdown", columnSelector: (l) => {
|
|
3025
3025
|
const u = r("span", Object.assign({ className: Ze.description }, { children: l.is_verified ? l.is_primary ? r(A.Fragment, { children: [" -", " ", c("labels.primaryEmail")] }) : null : r(A.Fragment, { children: [" -", " ", c("labels.unverifiedEmail")] }) }));
|
|
3026
3026
|
return l.is_primary ? r(A.Fragment, { children: [r("b", { children: l.address }), u] }) : r(A.Fragment, { children: [l.address, u] });
|
|
3027
3027
|
}, data: s, contentSelector: (l) => {
|
|
3028
3028
|
var u;
|
|
3029
|
-
return r(A.Fragment, { children: [l.is_primary ? r(A.Fragment, { children: r(q, { children: [r(
|
|
3029
|
+
return r(A.Fragment, { children: [l.is_primary ? r(A.Fragment, { children: r(q, { children: [r(Re, { children: c("headlines.isPrimaryEmail") }), c("texts.isPrimaryEmail")] }) }) : r(A.Fragment, { children: r(q, { children: [r(Re, { children: c("headlines.setPrimaryEmail") }), c("texts.setPrimaryEmail"), r("br", {}), r(ee, Object.assign({ uiAction: "email-set-primary", onClick: (h) => e(h, l.id), loadingSpinnerPosition: "right" }, { children: c("labels.setAsPrimaryEmail") }))] }) }), l.is_verified ? r(A.Fragment, { children: r(q, { children: [r(Re, { children: c("headlines.emailVerified") }), c("texts.emailVerified")] }) }) : r(A.Fragment, { children: r(q, { children: [r(Re, { children: c("headlines.emailUnverified") }), c("texts.emailUnverified"), r("br", {}), r(ee, Object.assign({ uiAction: "email-verify", onClick: (h) => t(h, l.id), loadingSpinnerPosition: "right" }, { children: c("labels.verify") }))] }) }), a.includes(l.id) ? r(A.Fragment, { children: r(q, { children: [r(Re, { children: c("headlines.emailDelete") }), c("texts.emailDelete"), r("br", {}), r(ee, Object.assign({ uiAction: "email-delete", dangerous: !0, onClick: (h) => n(h, l.id), disabled: d, loadingSpinnerPosition: "right" }, { children: c("labels.delete") }))] }) }) : null, ((u = l.identities) === null || u === void 0 ? void 0 : u.length) > 0 ? r(A.Fragment, { children: r(q, { children: [r(Re, { children: c("headlines.connectedAccounts") }), l.identities.map((h) => h.provider).join(", ")] }) }) : null] });
|
|
3030
3030
|
}, checkedItemID: o, setCheckedItemID: i });
|
|
3031
3031
|
}, jr = ({ onCredentialNameSubmit: n, oldName: e, onBack: t, credential: o, credentialType: i }) => {
|
|
3032
3032
|
const { t: s } = (0, _.useContext)(Z.TranslateContext), [a, c] = (0, _.useState)(e);
|
|
@@ -3064,9 +3064,9 @@ const Ze = fn.A && fn.A.locals ? fn.A.locals : void 0, En = function({ name: n,
|
|
|
3064
3064
|
const f = v.public_key.replace(/[\W_]/g, "");
|
|
3065
3065
|
return `${c === "security-key" ? "SecurityKey" : "Passkey"}-${f.substring(f.length - 7, f.length)}`;
|
|
3066
3066
|
}, h = (v) => new Date(v).toLocaleString();
|
|
3067
|
-
return r(En, { name: c === "security-key" ? "security-key-edit-dropdown" : "passkey-edit-dropdown", columnSelector: (v) => u(v), data: n, contentSelector: (v) => r(A.Fragment, { children: [r(q, { children: [r(
|
|
3067
|
+
return r(En, { name: c === "security-key" ? "security-key-edit-dropdown" : "passkey-edit-dropdown", columnSelector: (v) => u(v), data: n, contentSelector: (v) => r(A.Fragment, { children: [r(q, { children: [r(Re, { children: d(c === "security-key" ? "headlines.renameSecurityKey" : "headlines.renamePasskey") }), d(c === "security-key" ? "texts.renameSecurityKey" : "texts.renamePasskey"), r("br", {}), r(ee, Object.assign({ onClick: (f) => ((x, O, C) => {
|
|
3068
3068
|
x.preventDefault(), l(r(jr, { oldName: u(O), credential: O, credentialType: C, onBack: o, onCredentialNameSubmit: i }));
|
|
3069
|
-
})(f, v, c), loadingSpinnerPosition: "right" }, { children: d("labels.rename") }))] }), r(q, Object.assign({ hidden: !a }, { children: [r(
|
|
3069
|
+
})(f, v, c), loadingSpinnerPosition: "right" }, { children: d("labels.rename") }))] }), r(q, Object.assign({ hidden: !a }, { children: [r(Re, { children: d(c === "security-key" ? "headlines.deleteSecurityKey" : "headlines.deletePasskey") }), d(c === "security-key" ? "texts.deleteSecurityKey" : "texts.deletePasskey"), r("br", {}), r(ee, Object.assign({ uiAction: "password-delete", dangerous: !0, onClick: (f) => s(f, v.id), loadingSpinnerPosition: "right" }, { children: d("labels.delete") }))] })), r(q, { children: [r(Re, { children: d("headlines.lastUsedAt") }), v.last_used_at ? h(v.last_used_at) : "-"] }), r(q, { children: [r(Re, { children: d("headlines.createdAt") }), h(v.created_at)] })] }), checkedItemID: e, setCheckedItemID: t });
|
|
3070
3070
|
}, qt = ({ name: n, title: e, children: t, checkedItemID: o, setCheckedItemID: i }) => r(En, { dropdown: !0, name: n, columnSelector: () => e, contentSelector: () => r(A.Fragment, { children: t }), setCheckedItemID: i, checkedItemID: o, data: [{}] }), ko = ({ flowError: n }) => {
|
|
3071
3071
|
const { t: e } = (0, _.useContext)(Z.TranslateContext);
|
|
3072
3072
|
return r(A.Fragment, { children: n ? r("div", Object.assign({ className: $i.errorMessage }, { children: e(`flowErrors.${n == null ? void 0 : n.code}`) })) : null });
|
|
@@ -3099,10 +3099,10 @@ const Ze = fn.A && fn.A.locals ? fn.A.locals : void 0, En = function({ name: n,
|
|
|
3099
3099
|
return r(En, { name: "session-edit-dropdown", columnSelector: (c) => {
|
|
3100
3100
|
const d = r("b", { children: c.user_agent ? c.user_agent : c.id }), l = c.current ? r("span", Object.assign({ className: Ze.description }, { children: r(A.Fragment, { children: [" -", " ", s("labels.currentSession")] }) })) : null;
|
|
3101
3101
|
return r(A.Fragment, { children: [d, l] });
|
|
3102
|
-
}, data: n, contentSelector: (c) => r(A.Fragment, { children: [r(q, Object.assign({ hidden: !c.ip_address }, { children: [r(
|
|
3102
|
+
}, data: n, contentSelector: (c) => r(A.Fragment, { children: [r(q, Object.assign({ hidden: !c.ip_address }, { children: [r(Re, { children: s("headlines.ipAddress") }), c.ip_address] })), r(q, { children: [r(Re, { children: s("headlines.lastUsed") }), a(c.last_used)] }), r(q, { children: [r(Re, { children: s("headlines.createdAt") }), a(c.created_at)] }), i != null && i.includes(c.id) ? r(q, { children: [r(Re, { children: s("headlines.revokeSession") }), r(ee, Object.assign({ uiAction: "session-delete", dangerous: !0, onClick: (d) => o(d, c.id), loadingSpinnerPosition: "right" }, { children: s("labels.revoke") }))] }) : null] }), checkedItemID: e, setCheckedItemID: t });
|
|
3103
3103
|
}, Tr = ({ checkedItemID: n, setCheckedItemID: e, onDelete: t, onConnect: o, authAppSetUp: i, allowDeletion: s }) => {
|
|
3104
3104
|
const { t: a } = (0, _.useContext)(Z.TranslateContext), c = r("span", Object.assign({ className: Ze.description }, { children: i ? r(A.Fragment, { children: [" -", " ", a("labels.configured")] }) : null })), d = r(A.Fragment, { children: [a("labels.authenticatorAppManage"), " ", c] });
|
|
3105
|
-
return r(qt, Object.assign({ name: "authenticator-app-manage-dropdown", title: d, checkedItemID: n, setCheckedItemID: e }, { children: [r(
|
|
3105
|
+
return r(qt, Object.assign({ name: "authenticator-app-manage-dropdown", title: d, checkedItemID: n, setCheckedItemID: e }, { children: [r(Re, { children: a(i ? "headlines.authenticatorAppAlreadySetUp" : "headlines.authenticatorAppNotSetUp") }), r(q, { children: [a(i ? "texts.authenticatorAppAlreadySetUp" : "texts.authenticatorAppNotSetUp"), r("br", {}), r(ee, i ? Object.assign({ hidden: !s, uiAction: "auth-app-remove", onClick: (l) => t(l), loadingSpinnerPosition: "right", dangerous: !0 }, { children: a("labels.delete") }) : Object.assign({ uiAction: "auth-app-add", onClick: (l) => o(l), loadingSpinnerPosition: "right" }, { children: a("labels.authenticatorAppAdd") }))] })] }));
|
|
3106
3106
|
};
|
|
3107
3107
|
var je = function(n, e, t, o) {
|
|
3108
3108
|
return new (t || (t = Promise))(function(i, s) {
|
|
@@ -3130,11 +3130,11 @@ var je = function(n, e, t, o) {
|
|
|
3130
3130
|
});
|
|
3131
3131
|
};
|
|
3132
3132
|
const Li = (n) => {
|
|
3133
|
-
var e, t, o, i, s, a, c, d, l, u, h, v, f, x, O, C, S, P, D, N, U, ie,
|
|
3134
|
-
const { t: G } = (0, _.useContext)(Z.TranslateContext), { hanko: _e, setLoadingAction: w, stateHandler:
|
|
3133
|
+
var e, t, o, i, s, a, c, d, l, u, h, v, f, x, O, C, S, P, D, N, U, ie, ye, se, we, M, z, ve, $e, Ee, Le, re, ae, he, Ie, k, p, y, L, K, pe, ze, qe, Fe, m, g, b, j, T, I, W, X;
|
|
3134
|
+
const { t: G } = (0, _.useContext)(Z.TranslateContext), { hanko: _e, setLoadingAction: w, stateHandler: be, setUIState: J, setPage: H } = (0, _.useContext)(ue), { flowState: E } = Ne(n.state), [Se, B] = (0, _.useState)(""), F = (R, V, Qe) => je(void 0, void 0, void 0, function* () {
|
|
3135
3135
|
R.preventDefault(), w(V);
|
|
3136
3136
|
const In = yield Qe();
|
|
3137
|
-
In != null && In.error || (B(null), yield new Promise((Wi) => setTimeout(Wi, 360))), w(null), yield _e.flow.run(In,
|
|
3137
|
+
In != null && In.error || (B(null), yield new Promise((Wi) => setTimeout(Wi, 360))), w(null), yield _e.flow.run(In, be);
|
|
3138
3138
|
}), Me = (R) => je(void 0, void 0, void 0, function* () {
|
|
3139
3139
|
return F(R, "password-delete", E.actions.password_delete(null).run);
|
|
3140
3140
|
}), ot = (R) => je(void 0, void 0, void 0, function* () {
|
|
@@ -3154,11 +3154,11 @@ const Li = (n) => {
|
|
|
3154
3154
|
return F(R, "email-set-primary", E.actions.email_set_primary({ email_id: V }).run);
|
|
3155
3155
|
}), onEmailVerify: (R, V) => je(void 0, void 0, void 0, function* () {
|
|
3156
3156
|
return F(R, "email-verify", E.actions.email_verify({ email_id: V }).run);
|
|
3157
|
-
}), checkedItemID: Se, setCheckedItemID: B, deletableEmailIDs: (ie = (U = (N = E.actions).email_delete) === null || U === void 0 ? void 0 : U.call(N, null).inputs.email_id.allowed_values) === null || ie === void 0 ? void 0 : ie.map((R) => R.value) }), !((se = (
|
|
3157
|
+
}), checkedItemID: Se, setCheckedItemID: B, deletableEmailIDs: (ie = (U = (N = E.actions).email_delete) === null || U === void 0 ? void 0 : U.call(N, null).inputs.email_id.allowed_values) === null || ie === void 0 ? void 0 : ie.map((R) => R.value) }), !((se = (ye = E.actions).email_create) === null || se === void 0) && se.call(ye, null) ? r(Dr, { inputs: E.actions.email_create(null).inputs, onEmailSubmit: (R, V) => je(void 0, void 0, void 0, function* () {
|
|
3158
3158
|
return J((Qe) => Object.assign(Object.assign({}, Qe), { email: V })), F(R, "email-submit", E.actions.email_create({ email: V }).run);
|
|
3159
3159
|
}), checkedItemID: Se, setCheckedItemID: B }) : null] })] }) : null, !((M = (we = E.actions).password_create) === null || M === void 0) && M.call(we, null) ? r(A.Fragment, { children: [r(de, { children: G("headlines.profilePassword") }), r(q, { children: r(Jo, { inputs: E.actions.password_create(null).inputs, onPasswordSubmit: (R, V) => je(void 0, void 0, void 0, function* () {
|
|
3160
3160
|
return F(R, "password-submit", E.actions.password_create({ password: V }).run);
|
|
3161
|
-
}), onPasswordDelete: Me, checkedItemID: Se, setCheckedItemID: B }) })] }) : null, !((
|
|
3161
|
+
}), onPasswordDelete: Me, checkedItemID: Se, setCheckedItemID: B }) })] }) : null, !((ve = (z = E.actions).password_update) === null || ve === void 0) && ve.call(z, null) ? r(A.Fragment, { children: [r(de, { children: G("headlines.profilePassword") }), r(q, { children: r(Jo, { allowPasswordDelete: !!(!((Ee = ($e = E.actions).password_delete) === null || Ee === void 0) && Ee.call($e, null)), inputs: E.actions.password_update(null).inputs, onPasswordSubmit: (R, V) => je(void 0, void 0, void 0, function* () {
|
|
3162
3162
|
return F(R, "password-submit", E.actions.password_update({ password: V }).run);
|
|
3163
3163
|
}), onPasswordDelete: Me, checkedItemID: Se, setCheckedItemID: B, passwordExists: !0 }) })] }) : null, n.enablePasskeys && (!((re = (Le = E.payload) === null || Le === void 0 ? void 0 : Le.user) === null || re === void 0) && re.passkeys || !((he = (ae = E.actions).webauthn_credential_create) === null || he === void 0) && he.call(ae, null)) ? r(A.Fragment, { children: [r(de, { children: G("headlines.profilePasskeys") }), r(q, { children: [r(Zo, { onBack: it, onCredentialNameSubmit: fe, onCredentialDelete: (R, V) => je(void 0, void 0, void 0, function* () {
|
|
3164
3164
|
return F(R, "passkey-delete", E.actions.webauthn_credential_delete({ passkey_id: V }).run);
|
|
@@ -3645,9 +3645,9 @@ const tn = "flow-state", ue = (0, A.createContext)(null), Jr = (n) => {
|
|
|
3645
3645
|
}(n, ["lang", "experimental", "prefilledEmail", "prefilledUsername", "globalOptions", "createWebauthnAbortSignal"]);
|
|
3646
3646
|
const { hanko: d, injectStyles: l, hidePasskeyButtonOnLogin: u, translations: h, translationsLocation: v, fallbackLanguage: f } = s;
|
|
3647
3647
|
d.setLang((e == null ? void 0 : e.toString()) || f);
|
|
3648
|
-
const x = (0, _.useRef)(null), O = (0, _.useMemo)(() => `${s.storageKey}_last_login`, [s.storageKey]), [C, S] = (0, _.useState)(c.componentName), P = (0, _.useMemo)(() => t.split(" ").filter((p) => p.length).map((p) => p), [t]), D = (0, _.useMemo)(() => r(_r, {}), []), [N, U] = (0, _.useState)(D), [, ie] = (0, _.useState)(d), [
|
|
3648
|
+
const x = (0, _.useRef)(null), O = (0, _.useMemo)(() => `${s.storageKey}_last_login`, [s.storageKey]), [C, S] = (0, _.useState)(c.componentName), P = (0, _.useMemo)(() => t.split(" ").filter((p) => p.length).map((p) => p), [t]), D = (0, _.useMemo)(() => r(_r, {}), []), [N, U] = (0, _.useState)(D), [, ie] = (0, _.useState)(d), [ye, se] = (0, _.useState)(), [we, M] = (0, _.useState)({ email: o, username: i }), z = (0, _.useCallback)((p) => {
|
|
3649
3649
|
M((y) => Object.assign(Object.assign({}, y), { loadingAction: p, succeededAction: null, error: null, lastAction: p || y.lastAction }));
|
|
3650
|
-
}, []),
|
|
3650
|
+
}, []), ve = (0, _.useCallback)((p) => {
|
|
3651
3651
|
M((y) => Object.assign(Object.assign({}, y), { succeededAction: p, loadingAction: null }));
|
|
3652
3652
|
}, []), $e = (0, _.useCallback)(() => {
|
|
3653
3653
|
M((p) => Object.assign(Object.assign({}, p), { succeededAction: p.lastAction, loadingAction: null, error: null }));
|
|
@@ -3817,7 +3817,7 @@ const tn = "flow-state", ue = (0, A.createContext)(null), Jr = (n) => {
|
|
|
3817
3817
|
["auth", "login", "registration"].includes(C) ? (d.onUserLoggedOut(p), d.onSessionExpired(p), d.onUserDeleted(p)) : C === "profile" && d.onSessionCreated(p);
|
|
3818
3818
|
}, []);
|
|
3819
3819
|
const k = mt.supported();
|
|
3820
|
-
return r(ue.Provider, Object.assign({ value: { init: Ie, initialComponentName: c.componentName, isDisabled: Ee, setUIState: M, setLoadingAction: z, setSucceededAction:
|
|
3820
|
+
return r(ue.Provider, Object.assign({ value: { init: Ie, initialComponentName: c.componentName, isDisabled: Ee, setUIState: M, setLoadingAction: z, setSucceededAction: ve, uiState: we, hanko: d, setHanko: ie, lang: (e == null ? void 0 : e.toString()) || f, prefilledEmail: o, prefilledUsername: i, componentName: C, setComponentName: S, experimentalFeatures: P, hidePasskeyButtonOnLogin: u, page: N, setPage: U, stateHandler: ae, lastLogin: ye } }, { children: r(Z.TranslateProvider, Object.assign({ translations: h, fallbackLang: f, root: v }, { children: r(Xs, Object.assign({ ref: x }, { children: C !== "events" ? r(A.Fragment, { children: [l ? r("style", { dangerouslySetInnerHTML: { __html: window._hankoStyle.innerHTML } }) : null, N] }) : null })) })) }));
|
|
3821
3821
|
}, Qr = { en: Y(6).en };
|
|
3822
3822
|
var Ti = function(n, e, t, o) {
|
|
3823
3823
|
return new (t || (t = Promise))(function(i, s) {
|
|
@@ -4005,7 +4005,7 @@ var Ri = {
|
|
|
4005
4005
|
Mi(Ri);
|
|
4006
4006
|
var da = Ri;
|
|
4007
4007
|
Mi(da);
|
|
4008
|
-
var ua = Object.defineProperty, ha = Object.getOwnPropertyDescriptor,
|
|
4008
|
+
var ua = Object.defineProperty, ha = Object.getOwnPropertyDescriptor, ke = (n, e, t, o) => {
|
|
4009
4009
|
for (var i = o > 1 ? void 0 : o ? ha(e, t) : e, s = n.length - 1, a; s >= 0; s--)
|
|
4010
4010
|
(a = n[s]) && (i = (o ? a(e, t, i) : a(i)) || i);
|
|
4011
4011
|
return o && i && ua(e, t, i), i;
|
|
@@ -4023,9 +4023,9 @@ const le = {
|
|
|
4023
4023
|
profileDisplayName: ""
|
|
4024
4024
|
// Shared profile display name
|
|
4025
4025
|
}, ni = (n) => `hanko-verified-${n}`, oi = (n) => `hanko-onboarding-${n}`;
|
|
4026
|
-
let
|
|
4026
|
+
let ge = class extends Ut {
|
|
4027
4027
|
constructor() {
|
|
4028
|
-
super(...arguments), this.hankoUrlAttr = "", this.basePath = "", this.authPath = "/api/auth/osm", this.osmRequired = !1, this.osmScopes = "read_prefs", this.showProfile = !1, this.redirectAfterLogin = "", this.autoConnect = !1, this.verifySession = !1, this.redirectAfterLogout = "", this.displayNameAttr = "", this.mappingCheckUrl = "", this.appId = "", this.loginUrl = "", this.
|
|
4028
|
+
super(...arguments), this.hankoUrlAttr = "", this.basePath = "", this.authPath = "/api/auth/osm", this.osmRequired = !1, this.osmScopes = "read_prefs", this.showProfile = !1, this.redirectAfterLogin = "", this.autoConnect = !1, this.verifySession = !1, this.redirectAfterLogout = "", this.displayNameAttr = "", this.mappingCheckUrl = "", this.appId = "", this.loginUrl = "", this.user = null, this.osmConnected = !1, this.osmData = null, this.osmLoading = !1, this.loading = !0, this.error = null, this.profileDisplayName = "", this.hasAppMapping = !1, this._trailingSlashCache = {}, this._debugMode = !1, this._lastSessionId = null, this._hanko = null, this._isPrimary = !1, this._handleVisibilityChange = () => {
|
|
4029
4029
|
this._isPrimary && !document.hidden && !this.showProfile && !this.user && (this.log("👁️ Page visible, re-checking session..."), this.checkSession());
|
|
4030
4030
|
}, this._handleWindowFocus = () => {
|
|
4031
4031
|
this._isPrimary && !this.showProfile && !this.user && (this.log("🎯 Window focused, re-checking session..."), this.checkSession());
|
|
@@ -4749,7 +4749,7 @@ let ve = class extends Ut {
|
|
|
4749
4749
|
}
|
|
4750
4750
|
}
|
|
4751
4751
|
};
|
|
4752
|
-
|
|
4752
|
+
ge.styles = qi`
|
|
4753
4753
|
:host {
|
|
4754
4754
|
display: block;
|
|
4755
4755
|
font-family: var(--hot-font-sans);
|
|
@@ -5003,78 +5003,75 @@ ve.styles = qi`
|
|
|
5003
5003
|
background-color: var(--hot-color-neutral-50);
|
|
5004
5004
|
}
|
|
5005
5005
|
`;
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
],
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
],
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
],
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
],
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
],
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
],
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
],
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
],
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
],
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
],
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
],
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
],
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
],
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
],
|
|
5048
|
-
|
|
5049
|
-
Re({ type: String, attribute: "login-url" })
|
|
5050
|
-
], ve.prototype, "loginUrl", 2);
|
|
5051
|
-
ye([
|
|
5006
|
+
ke([
|
|
5007
|
+
We({ type: String, attribute: "hanko-url" })
|
|
5008
|
+
], ge.prototype, "hankoUrlAttr", 2);
|
|
5009
|
+
ke([
|
|
5010
|
+
We({ type: String, attribute: "base-path" })
|
|
5011
|
+
], ge.prototype, "basePath", 2);
|
|
5012
|
+
ke([
|
|
5013
|
+
We({ type: String, attribute: "auth-path" })
|
|
5014
|
+
], ge.prototype, "authPath", 2);
|
|
5015
|
+
ke([
|
|
5016
|
+
We({ type: Boolean, attribute: "osm-required" })
|
|
5017
|
+
], ge.prototype, "osmRequired", 2);
|
|
5018
|
+
ke([
|
|
5019
|
+
We({ type: String, attribute: "osm-scopes" })
|
|
5020
|
+
], ge.prototype, "osmScopes", 2);
|
|
5021
|
+
ke([
|
|
5022
|
+
We({ type: Boolean, attribute: "show-profile" })
|
|
5023
|
+
], ge.prototype, "showProfile", 2);
|
|
5024
|
+
ke([
|
|
5025
|
+
We({ type: String, attribute: "redirect-after-login" })
|
|
5026
|
+
], ge.prototype, "redirectAfterLogin", 2);
|
|
5027
|
+
ke([
|
|
5028
|
+
We({ type: Boolean, attribute: "auto-connect" })
|
|
5029
|
+
], ge.prototype, "autoConnect", 2);
|
|
5030
|
+
ke([
|
|
5031
|
+
We({ type: Boolean, attribute: "verify-session" })
|
|
5032
|
+
], ge.prototype, "verifySession", 2);
|
|
5033
|
+
ke([
|
|
5034
|
+
We({ type: String, attribute: "redirect-after-logout" })
|
|
5035
|
+
], ge.prototype, "redirectAfterLogout", 2);
|
|
5036
|
+
ke([
|
|
5037
|
+
We({ type: String, attribute: "display-name" })
|
|
5038
|
+
], ge.prototype, "displayNameAttr", 2);
|
|
5039
|
+
ke([
|
|
5040
|
+
We({ type: String, attribute: "mapping-check-url" })
|
|
5041
|
+
], ge.prototype, "mappingCheckUrl", 2);
|
|
5042
|
+
ke([
|
|
5043
|
+
We({ type: String, attribute: "app-id" })
|
|
5044
|
+
], ge.prototype, "appId", 2);
|
|
5045
|
+
ke([
|
|
5046
|
+
We({ type: String, attribute: "login-url" })
|
|
5047
|
+
], ge.prototype, "loginUrl", 2);
|
|
5048
|
+
ke([
|
|
5052
5049
|
at()
|
|
5053
|
-
],
|
|
5054
|
-
|
|
5050
|
+
], ge.prototype, "user", 2);
|
|
5051
|
+
ke([
|
|
5055
5052
|
at()
|
|
5056
|
-
],
|
|
5057
|
-
|
|
5053
|
+
], ge.prototype, "osmConnected", 2);
|
|
5054
|
+
ke([
|
|
5058
5055
|
at()
|
|
5059
|
-
],
|
|
5060
|
-
|
|
5056
|
+
], ge.prototype, "osmData", 2);
|
|
5057
|
+
ke([
|
|
5061
5058
|
at()
|
|
5062
|
-
],
|
|
5063
|
-
|
|
5059
|
+
], ge.prototype, "osmLoading", 2);
|
|
5060
|
+
ke([
|
|
5064
5061
|
at()
|
|
5065
|
-
],
|
|
5066
|
-
|
|
5062
|
+
], ge.prototype, "loading", 2);
|
|
5063
|
+
ke([
|
|
5067
5064
|
at()
|
|
5068
|
-
],
|
|
5069
|
-
|
|
5065
|
+
], ge.prototype, "error", 2);
|
|
5066
|
+
ke([
|
|
5070
5067
|
at()
|
|
5071
|
-
],
|
|
5072
|
-
|
|
5068
|
+
], ge.prototype, "profileDisplayName", 2);
|
|
5069
|
+
ke([
|
|
5073
5070
|
at()
|
|
5074
|
-
],
|
|
5075
|
-
|
|
5071
|
+
], ge.prototype, "hasAppMapping", 2);
|
|
5072
|
+
ge = ke([
|
|
5076
5073
|
ls("hotosm-auth")
|
|
5077
|
-
],
|
|
5074
|
+
], ge);
|
|
5078
5075
|
export {
|
|
5079
|
-
|
|
5076
|
+
ge as HankoAuth
|
|
5080
5077
|
};
|