PageSourceSearch

https://www.svnk.nl/_assets/c25ace7dfe73fbb8c05f07ae9ca2a4bb/Vite/LoginForm-tOXysvSl.js

js svnk.nl collected 2026-10-06 04:29:22 UTC 9,270 bytes, 202 lines download raw bytes

1import { s as je, n as ve, u as _e, C as ye, q as Ze, r as te, t as Le, j as r, G as be } from "./useQueryParams-B1rlhbJY.js";
2import { d as ze } from "./useForm-BXyysjJn.js";
3import { Z as Ce } from "./index-B0PTeNME.js";
4import { u as se } from "./useTranslation-CVgknHzH.js";
5const me = {
6  "ins-inlog-doorstromerdeeltadres": "account_loginfrontend_doorstromer_deelt_adres_popup"
7}, oe = window.ZigDesignSystem.ZdsAlert, ie = window.ZigDesignSystem.ZdsButton, ae = window.ZigDesignSystem.ZdsIcon, Ie = window.ZigDesignSystem.ZdsInputPassword, Te = window.ZigDesignSystem.ZdsInputText, le = window.ZigDesignSystem.ZdsLink, Ee = window.ZigDesignSystem.ZdsModal, de = window.ZigDesignSystem.ZdsProgressCircle, ce = window.ZigDesignSystem.ZdsTooltip, ke = je.div`
8	a {
9		text-decoration: underline;
10
11		&:hover {
12			text-decoration: none;
13		}
14	}
15`, Re = (l) => {
16  const e = ve.c(100), {
17    onLogin: K
18  } = l, {
19    t: s
20  } = se(), {
21    t: c
22  } = se("Common"), {
23    t: m
24  } = se("Login"), {
25    data: d,
26    isLoading: ue
27  } = _e(), [Q, ge] = ye(), {
28    isLoading: J,
29    isSuccess: u,
30    error: i,
31    reset: X
32  } = ge, [Y, fe] = Ze(), {
33    isLoading: pe,
34    isSuccess: he,
35    error: G,
36    reset: ee
37  } = fe;
38  let M;
39  e[0] !== K || e[1] !== Y ? (M = () => {
40    Y().unwrap().then((t) => K(t.redirectUrl)).catch(Ne);
41  }, e[0] = K, e[1] = Y, e[2] = M) : M = e[2];
42  const g = M;
43  let V;
44  e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = {
45    username: "",
46    password: ""
47  }, e[3] = V) : V = e[3];
48  let H;
49  e[4] !== g || e[5] !== u || e[6] !== Q ? (H = {
50    defaultValues: V,
51    onSubmit: (t) => {
52      const {
53        value: n
54      } = t;
55      u || Q({
56        clientId: "wzp",
57        grantType: "password",
58        username: n.username,
59        password: n.password
60      }).unwrap().then(g);
61    }
62  }, e[4] = g, e[5] = u, e[6] = Q, e[7] = H) : H = e[7];
63  const a = ze(H);
64  if (ue || pe || he) {
65    let t;
66    e[8] !== c ? (t = c("loading"), e[8] = c, e[9] = t) : t = e[9];
67    let n;
68    return e[10] !== t ? (n = /* @__PURE__ */ r.jsx("div", { className: "zds-flex zds-justify-content-center", children: /* @__PURE__ */ r.jsx(de, { ariaLabel: t, indeterminate: !0 }) }), e[10] = t, e[11] = n) : n = e[11], n;
69  } else if (!d) {
70    let t;
71    e[12] !== s ? (t = s("SomethingWentWrong"), e[12] = s, e[13] = t) : t = e[13];
72    let n;
73    return e[14] !== t ? (n = /* @__PURE__ */ r.jsx(oe, { type: "warning", children: t }), e[14] = t, e[15] = n) : n = e[15], n;
74  }
75  if (te(i) && Le(i.data)) {
76    let t;
77    return e[16] !== g || e[17] !== i.data.mfa_token ? (t = /* @__PURE__ */ r.jsx(Ce, { mfaToken: i.data.mfa_token, onSuccess: g }), e[16] = g, e[17] = i.data.mfa_token, e[18] = t) : t = e[18], t;
78  }
79  let O;
80  e[19] !== i ? (O = te(i) && be(i.data), e[19] = i, e[20] = O) : O = e[20];
81  const R = O, re = R ? i.data.error_description : void 0, xe = te(G) && G.data && typeof G.data == "object" && Array.isArray(G.data.aErrorCodes) ? G.data.aErrorCodes.filter(Pe) : [], ne = [...typeof re == "string" ? [re] : [], ...xe].map(De).find(Fe), o = ne ? me[ne] : void 0, f = o !== void 0;
82  let A;
83  e[21] !== X || e[22] !== ee ? (A = () => {
84    X(), ee();
85  }, e[21] = X, e[22] = ee, e[23] = A) : A = e[23];
86  const p = A;
87  let W;
88  e[24] !== s ? (W = s("account_form_loginfrontend_username_help"), e[24] = s, e[25] = W) : W = e[25];
89  const $ = W;
90  let q;
91  e[26] !== s ? (q = s("account_form_loginfrontend_password_help"), e[26] = s, e[27] = q) : q = e[27];
92  const B = q;
93  let h;
94  e[28] !== R || e[29] !== f || e[30] !== s ? (h = R && !f && /* @__PURE__ */ r.jsx(oe, { type: "error", children: /* @__PURE__ */ r.jsx(ke, { dangerouslySetInnerHTML: {
95    __html: s("Invalid credentials.")
96  }, className: "zsd-link" }) }), e[28] = R, e[29] = f, e[30] = s, e[31] = h) : h = e[31];
97  let x;
98  e[32] !== a ? (x = (t) => {
99    t.preventDefault(), a.handleSubmit();
100  }, e[32] = a, e[33] = x) : x = e[33];
101  let w;
102  e[34] !== m ? (w = {
103    onSubmit: (t) => {
104      const {
105        value: n
106      } = t;
107      return n ? void 0 : m("requiredField");
108    }
109  }, e[34] = m, e[35] = w) : w = e[35];
110  let S;
111  e[36] !== s || e[37] !== $ ? (S = (t) => /* @__PURE__ */ r.jsx(Te, { name: t.name, value: t.state.value, onChange: t.handleChange, error: t.state.meta.errors.length >
111 0 ? t.state.meta.errors[0] : void 0, label: $ ? /* @__PURE__ */ r.jsxs("div", { className: "zds-flex-row", children: [
112    s("loginname"),
113    /* @__PURE__ */ r.jsx(ce, { arrow: !0, placement: "right", target: /* @__PURE__ */ r.jsx(ae, { className: "zds-margin-left-2", library: "fa-solid", name: "circle-info", size: 5 }), children: /* @__PURE__ */ r.jsx("div", { dangerouslySetInnerHTML: {
114      __html: $
115    } }) })
116  ] }) : s("loginname") }), e[36] = s, e[37] = $, e[38] = S) : S = e[38];
117  let j;
118  e[39] !== a.Field || e[40] !== w || e[41] !== S ? (j = /* @__PURE__ */ r.jsx(a.Field, { name: "username", validators: w, children: S }), e[39] = a.Field, e[40] = w, e[41] = S, e[42] = j) : j = e[42];
119  let v;
120  e[43] !== m ? (v = {
121    onSubmit: (t) => {
122      const {
123        value: n
124      } = t;
125      return n ? void 0 : m("requiredField");
126    }
127  }, e[43] = m, e[44] = v) : v = e[44];
128  let _;
129  e[45] !== B || e[46] !== s ? (_ = (t) => /* @__PURE__ */ r.jsx(Ie, { name: t.name, value: t.state.value, onChange: t.handleChange, error: t.state.meta.errors.length > 0 ? t.state.meta.errors[0] : void 0, autocomplete: "off", contentStart: null, label: B ? /* @__PURE__ */ r.jsxs("div", { className: "zds-flex-row", children: [
130    s("password"),
131    /* @__PURE__ */ r.jsx(ce, { arrow: !0, placement: "right", target: /* @__PURE__ */ r.jsx(ae, { className: "zds-margin-left-2", library: "fa-solid", name: "circle-info", size: 5 }), children: /* @__PURE__ */ r.jsx("div", { dangerouslySetInnerHTML: {
132      __html: B
133    } }) })
134  ] }) : s("password") }), e[45] = B, e[46] = s, e[47] = _) : _ = e[47];
135  let y;
136  e[48] !== a.Field || e[49] !== v || e[50] !== _ ? (y = /* @__PURE__ */ r.jsx(a.Field, { name: "password", validators: v, children: _ }), e[48] = a.Field, e[49] = v, e[50] = _, e[51] = y) : y = e[51];
137  let Z;
138  e[52] !== j || e[53] !== y ? (Z = /* @__PURE__ */ r.jsxs("div", { className: "zds-flex-col zds-gap-4", children: [
139    j,
140    y
141  ] }), e[52] = j, e[53] = y, e[54] = Z) : Z = e[54];
142  let L;
143  e[55] !== c || e[56] !== u || e[57] !== J || e[58] !== s ? (L = J || u ? /* @__P
143URE__ */ r.jsx("div", { className: "zds-flex zds-justify-content-center", children: /* @__PURE__ */ r.jsx(de, { ariaLabel: c("loading"), indeterminate: !0 }) }) : /* @__PURE__ */ r.jsx(ie, { type: "submit", preset: "primary", children: s("InloggenSubmit") }), e[55] = c, e[56] = u, e[57] = J, e[58] = s, e[59] = L) : L = e[59];
144  let b;
145  e[60] !== x || e[61] !== Z || e[62] !== L ? (b = /* @__PURE__ */ r.jsxs("form", { onSubmit: x, className: "zds-flex-col zds-gap-8", children: [
146    Z,
147    L
148  ] }), e[60] = x, e[61] = Z, e[62] = L, e[63] = b) : b = e[63];
149  const we = d.urlWachtwoordVergeten;
150  let z;
151  e[64] !== s ? (z = s("passwordforgotten"), e[64] = s, e[65] = z) : z = e[65];
152  let C;
153  e[66] !== d.urlWachtwoordVergeten || e[67] !== z ? (C = /* @__PURE__ */ r.jsx(le, { link: we, children: z }), e[66] = d.urlWachtwoordVergeten, e[67] = z, e[68] = C) : C = e[68];
154  const Se = d.urlGebruikersnaamVergeten;
155  let I;
156  e[69] !== s ? (I = s("usernameforgotten"), e[69] = s, e[70] = I) : I = e[70];
157  let T;
158  e[71] !== d.urlGebruikersnaamVergeten || e[72] !== I ? (T = /* @__PURE__ */ r.jsx(le, { link: Se, children: I }), e[71] = d.urlGebruikersnaamVergeten, e[72] = I, e[73] = T) : T = e[73];
159  let E;
160  e[74] !== C || e[75] !== T ? (E = /* @__PURE__ */ r.jsxs("div", { className: "zds-flex-col zds-gap-4", children: [
161    C,
162    T
163  ] }), e[74] = C, e[75] = T, e[76] = E) : E = e[76];
164  let k;
165  e[77] !== o || e[78] !== s ? (k = s(o ? `${o}_header` : "LoginToReact"), e[77] = o, e[78] = s, e[79] = k) : k = e[79];
166  let N;
167  e[80] !== o || e[81] !== s ? (N = o ? s(`${o}_header`) : "", e[80] = o, e[81] = s, e[82] = N) : N = e[82];
168  let P;
169  e[83] !== p ? (P = (t) => {
170    t || p();
171  }, e[83] = p, e[84] = P) : P = e[84];
172  let D;
173  e[85] !== o || e[86] !== p || e[87] !== s ? (D = o && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
174    /* @__PURE__ */ r.jsx("p", { dangerouslySetInnerHTML: {
175      __html: s(`${o}_body`)
176    } }),
177    /* @__PURE__ */ r.jsx(ie, { preset: "primary", onClick: p, children: s(`${o}_close`) })
178  ] }), e[85] = o, e[86] = p, e[87] = s, e[88] = D) : D = e[88];
179  let F;
180  e[89] !== f || e[90] !== k || e[91] !== N || e[92] !== P || e[93] !== D ? (F = /* @__PURE__ */ r.jsx(Ee, { ariaLabel: k, header: N, open: f, onOpenChange: P, children: D }), e[89] = f, e[90] = k, e[91] = N, e[92] = P, e[93] = D, e[94] = F) : F = e[94];
181  let U;
182  return e[95] !== h || e[96] !== b || e[97] !== E || e[98] !== F ? (U = /* @__PURE__ */ r.jsxs("div", { className: "zds-flex-col zds-gap-8", children: [
183    h,
184    b,
185    E,
186    F
187  ] }), e[95] = h, e[96] = b, e[97] = E, e[98] = F, e[99] = U) : U = e[99], U;
188};
189function Ne() {
190}
191function Pe(l) {
192  return typeof l == "string";
193}
194function De(l) {
195  return l.toLowerCase();
196}
197function Fe(l) {
198  return Object.hasOwn(me, l);
199}
200export {
201  Re as L
202};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.