@everymatrix/cashier-page-nd 1.69.111 → 1.69.112

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,4 +1,4 @@
1
- import { a as xe, $ as Te, S as Le, b as Me, s as Pe, f as F, c as Se, G, e as L, k as M, m as x, p as Ce, q as Re, l as b, o as w, y as ee, v as R, x as N, P as te, n as D, w as A, r as Ae, R as ne, Z as ze, W as De, B as je, C as Be, D as Ie, E as He, F as We } from "./CashierCarousel-D77wRYrP.js";
1
+ import { a as xe, $ as Te, S as Le, b as Pe, s as Ce, f as F, c as Me, G, e as L, k as P, m as x, p as Se, q as Re, l as b, o as w, y as ee, v as R, x as N, P as te, n as D, w as A, r as Ae, R as ne, Z as ze, W as De, B as Be, C as je, D as Ie, E as He, F as We } from "./CashierCarousel-D77wRYrP.js";
2
2
  function ie(n, e) {
3
3
  xe(n, e);
4
4
  }
@@ -42,7 +42,7 @@ const oe = {
42
42
  }
43
43
  };
44
44
  function Ne(n) {
45
- Se(n, "svelte-1a5juhv", '*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}@container (max-width: 500px){.OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center}}@container (min-width: 500px){.OtpPopupOverlay{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center}}.OtpButton{text-transform:uppercase;font-weight:var(--emw--font-weight-medium, 500);color:var(--emw--color-typography-button, #000000);text-align:center;font-size:var(--emw--font-size-medium, 16px);font-style:normal;font-family:inherit;height:46px;line-height:normal;border:none;background:var(--emw--color-primary, #f9c408);border-radius:10px;width:100%;margin:var(--emw--spacing-small, 12px) 0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--emw--spacing-2x-small-plus, 5px);transition:all 0.2s linear}.OtpButton:active{box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-active, #fecd1c)}.OtpButton[disabled]{filter:saturate(50%);opacity:0.5;cursor:auto;pointer-events:none}.OtpButton:hover{box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-hover, #dbac03)}.OtpDescription{display:flex;color:var(--emw--color-typography, #fff);flex-direction:column;gap:12px;font-size:var(--emw--font-size-small, 12px)}.OtpDescription .Title{font-size:var(--emw--font-size-big, 20px);font-weight:var(--emw--font-weight-medium, 600)}@container (max-width: 500px){.OtpPopupContent{width:100%;height:100%;justify-content:flex-start}}@container (min-width: 500px){.OtpPopupContent{justify-content:center}}.OtpPopupContent{background:var(--emw--color-cashier-bg);display:flex;flex-direction:column;gap:var(--emw--spacing-large, 20px);position:relative;padding:var(--emw--spacing-medium, 20px);border-radius:var(--mmw--border-radius-large-plus, 10px);z-index:1;box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.3);animation:modalSlideScaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94)}.OtpPopupContent::before{content:"";position:absolute;inset:0;opacity:0.2;z-index:-1;pointer-events:none;border-radius:10px;background:linear-gradient(140deg, var(--emw--color-primary, #f9c405) 5%, var(--emw--color-black, #12191f) 65%)}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:space-between;margin:10px}.OtpField input{width:45px;font-size:32px;padding:5px;text-align:center;border-radius:5px;margin:6px;font-weight:bold;outline:none;background:var(--emw--color-background);border:0;transition:all 0.1s;box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.3);color:var(--emw--color-typography, #fff)}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{box-shadow:0 0 1px 1px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between;gap:40px}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.OtpTimer{color:var(--emw--color-typography, #fff);font-size:var(--emw--font-size-small, 12px);opacity:0.8}');
45
+ Me(n, "svelte-1nsut98", '*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}@container (max-width: 500px){.OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center}}@container (min-width: 500px){.OtpPopupOverlay{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center}}.OtpButton{text-transform:uppercase;font-weight:var(--emw--font-weight-medium, 500);color:var(--emw--color-typography-button, #000000);text-align:center;font-size:var(--emw--font-size-medium, 16px);font-style:normal;font-family:inherit;height:46px;line-height:normal;border:none;background:var(--emw--color-primary, #f9c408);border-radius:10px;width:100%;margin:var(--emw--spacing-small, 12px) 0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--emw--spacing-2x-small-plus, 5px);transition:all 0.2s linear}.OtpButton:active{box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-active, #fecd1c)}.OtpButton[disabled]{filter:saturate(50%);opacity:0.5;cursor:auto;pointer-events:none}.OtpButton:hover{box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-hover, #dbac03)}.OtpDescription{display:flex;color:var(--emw--color-typography, #fff);flex-direction:column;gap:12px;font-size:var(--emw--font-size-small, 12px)}.OtpDescription .Title{font-size:var(--emw--font-size-big, 20px);font-weight:var(--emw--font-weight-medium, 600)}@container (max-width: 500px){.OtpPopupContent{width:100%;height:100%;justify-content:flex-start}}@container (min-width: 500px){.OtpPopupContent{justify-content:center;border-radius:10px;box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2)}.OtpPopupContent::before{border-radius:10px;background:linear-gradient(140deg, var(--emw--color-primary, #f9c405) 5%, var(--emw--color-black, #12191f) 65%)}}.OtpPopupContent{background:var(--emw--color-cashier-bg);display:flex;flex-direction:column;gap:var(--emw--spacing-large, 20px);position:relative;padding:var(--emw--spacing-medium, 20px);z-index:1;animation:modalSlideScaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94)}.OtpPopupContent::before{content:"";position:absolute;inset:0;opacity:0.2;z-index:-1;pointer-events:none}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:space-between;margin:10px}.OtpField input{width:45px;font-size:32px;padding:5px;text-align:center;border-radius:5px;margin:6px;font-weight:bold;outline:none;background:var(--emw--color-background);border:0;transition:all 0.1s;box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.3);color:var(--emw--color-typography, #fff)}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{box-shadow:0 0 1px 1px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between;gap:40px}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.OtpTimer{color:var(--emw--color-typography, #fff);font-size:var(--emw--font-size-small, 12px);opacity:0.8}');
46
46
  }
47
47
  function se(n, e, t) {
48
48
  const i = n.slice();
@@ -62,7 +62,7 @@ function re(n) {
62
62
  e = x("div"), t = x("div"), p.c(), w(t, "class", "OtpPopupContent"), w(e, "class", "OtpPopupOverlay");
63
63
  },
64
64
  m(l, r) {
65
- M(l, e, r), b(e, t), p.m(t, null);
65
+ P(l, e, r), b(e, t), p.m(t, null);
66
66
  },
67
67
  p(l, r) {
68
68
  s === (s = i(l)) && p ? p.p(l, r) : (p.d(1), p = s(l), p && (p.c(), p.m(t, null)));
@@ -80,14 +80,14 @@ function Ue(n) {
80
80
  /*$_*/
81
81
  n[13]("close") + ""
82
82
  ), y, k, u;
83
- function g(m, C) {
83
+ function g(m, S) {
84
84
  return (
85
85
  /*showResendOtp*/
86
86
  m[9] ? Ke : qe
87
87
  );
88
88
  }
89
89
  let T = g(n), d = T(n);
90
- function E(m, C) {
90
+ function E(m, S) {
91
91
  if (
92
92
  /*isLoading*/
93
93
  m[3]
@@ -99,8 +99,8 @@ function Ue(n) {
99
99
  )
100
100
  return Ye;
101
101
  }
102
- let P = E(n), O = P && P(n);
103
- function H(m, C) {
102
+ let C = E(n), O = C && C(n);
103
+ function H(m, S) {
104
104
  if (
105
105
  /*showResendOtp*/
106
106
  m[9]
@@ -112,28 +112,28 @@ function Ue(n) {
112
112
  )
113
113
  return Je;
114
114
  }
115
- let z = H(n), S = z && z(n);
115
+ let z = H(n), M = z && z(n);
116
116
  return {
117
117
  c() {
118
- e = x("div"), t = x("div"), s = A(i), p = D(), d.c(), l = D(), O && O.c(), r = D(), a = x("div"), S && S.c(), f = D(), _ = x("button"), y = A(v), w(t, "class", "Title"), w(e, "class", "OtpDescription"), w(_, "class", "OtpButton"), w(a, "class", "OtpActionButtons");
118
+ e = x("div"), t = x("div"), s = A(i), p = D(), d.c(), l = D(), O && O.c(), r = D(), a = x("div"), M && M.c(), f = D(), _ = x("button"), y = A(v), w(t, "class", "Title"), w(e, "class", "OtpDescription"), w(_, "class", "OtpButton"), w(a, "class", "OtpActionButtons");
119
119
  },
120
- m(m, C) {
121
- M(m, e, C), b(e, t), b(t, s), b(e, p), d.m(e, null), M(m, l, C), O && O.m(m, C), M(m, r, C), M(m, a, C), S && S.m(a, null), b(a, f), b(a, _), b(_, y), k || (u = N(
120
+ m(m, S) {
121
+ P(m, e, S), b(e, t), b(t, s), b(e, p), d.m(e, null), P(m, l, S), O && O.m(m, S), P(m, r, S), P(m, a, S), M && M.m(a, null), b(a, f), b(a, _), b(_, y), k || (u = N(
122
122
  _,
123
123
  "click",
124
124
  /*manualClosePopup*/
125
125
  n[19]
126
126
  ), k = !0);
127
127
  },
128
- p(m, C) {
129
- C[0] & /*$_*/
128
+ p(m, S) {
129
+ S[0] & /*$_*/
130
130
  8192 && i !== (i = /*$_*/
131
- m[13]("otpTitle") + "") && R(s, i), T === (T = g(m)) && d ? d.p(m, C) : (d.d(1), d = T(m), d && (d.c(), d.m(e, null))), P === (P = E(m)) && O ? O.p(m, C) : (O && O.d(1), O = P && P(m), O && (O.c(), O.m(r.parentNode, r))), z === (z = H(m)) && S ? S.p(m, C) : (S && S.d(1), S = z && z(m), S && (S.c(), S.m(a, f))), C[0] & /*$_*/
131
+ m[13]("otpTitle") + "") && R(s, i), T === (T = g(m)) && d ? d.p(m, S) : (d.d(1), d = T(m), d && (d.c(), d.m(e, null))), C === (C = E(m)) && O ? O.p(m, S) : (O && O.d(1), O = C && C(m), O && (O.c(), O.m(r.parentNode, r))), z === (z = H(m)) && M ? M.p(m, S) : (M && M.d(1), M = z && z(m), M && (M.c(), M.m(a, f))), S[0] & /*$_*/
132
132
  8192 && v !== (v = /*$_*/
133
133
  m[13]("close") + "") && R(y, v);
134
134
  },
135
135
  d(m) {
136
- m && (L(e), L(l), L(r), L(a)), d.d(), O && O.d(m), S && S.d(), k = !1, u();
136
+ m && (L(e), L(l), L(r), L(a)), d.d(), O && O.d(m), M && M.d(), k = !1, u();
137
137
  }
138
138
  };
139
139
  }
@@ -152,23 +152,23 @@ function Ve(n) {
152
152
  n[8]
153
153
  ), y = D(), k = x("button"), g = A(u), w(s, "d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"), w(i, "xmlns", "http://www.w3.org/2000/svg"), w(i, "viewBox", "0 0 512 512"), w(t, "class", "OtpErrorHeader"), w(k, "class", "OtpButton error"), w(e, "class", "OtpError");
154
154
  },
155
- m(E, P) {
156
- M(E, e, P), b(e, t), b(t, i), b(i, s), b(t, p), b(t, l), b(l, a), b(e, f), b(e, _), b(_, v), b(e, y), b(e, k), b(k, g), T || (d = N(
155
+ m(E, C) {
156
+ P(E, e, C), b(e, t), b(t, i), b(i, s), b(t, p), b(t, l), b(l, a), b(e, f), b(e, _), b(_, v), b(e, y), b(e, k), b(k, g), T || (d = N(
157
157
  k,
158
158
  "click",
159
159
  /*manualClosePopup*/
160
160
  n[19]
161
161
  ), T = !0);
162
162
  },
163
- p(E, P) {
164
- P[0] & /*$_*/
163
+ p(E, C) {
164
+ C[0] & /*$_*/
165
165
  8192 && r !== (r = /*$_*/
166
- E[13]("errorHeader") + "") && R(a, r), P[0] & /*errorMessage*/
166
+ E[13]("errorHeader") + "") && R(a, r), C[0] & /*errorMessage*/
167
167
  256 && R(
168
168
  v,
169
169
  /*errorMessage*/
170
170
  E[8]
171
- ), P[0] & /*$_*/
171
+ ), C[0] & /*$_*/
172
172
  8192 && u !== (u = /*$_*/
173
173
  E[13]("close") + "") && R(g, u);
174
174
  },
@@ -195,7 +195,7 @@ function qe(n) {
195
195
  n[10] ? "LastWarningMessage" : "");
196
196
  },
197
197
  m(f, _) {
198
- M(f, e, _), r.m(e, null), M(f, i, _), a && a.m(f, _), M(f, s, _);
198
+ P(f, e, _), r.m(e, null), P(f, i, _), a && a.m(f, _), P(f, s, _);
199
199
  },
200
200
  p(f, _) {
201
201
  l === (l = p(f)) && r ? r.p(f, _) : (r.d(1), r = l(f), r && (r.c(), r.m(e, null))), _[0] & /*isLastWarning*/
@@ -218,7 +218,7 @@ function Ke(n) {
218
218
  e = x("p"), i = A(t), w(e, "class", "OtpNoticeMessage"), w(e, "role", "alert");
219
219
  },
220
220
  m(s, p) {
221
- M(s, e, p), b(e, i);
221
+ P(s, e, p), b(e, i);
222
222
  },
223
223
  p(s, p) {
224
224
  p[0] & /*$_*/
@@ -240,7 +240,7 @@ function Ge(n) {
240
240
  t = A(e);
241
241
  },
242
242
  m(i, s) {
243
- M(i, t, s);
243
+ P(i, t, s);
244
244
  },
245
245
  p(i, s) {
246
246
  s[0] & /*$_*/
@@ -262,7 +262,7 @@ function Xe(n) {
262
262
  t = A(e);
263
263
  },
264
264
  m(i, s) {
265
- M(i, t, s);
265
+ P(i, t, s);
266
266
  },
267
267
  p(i, s) {
268
268
  s[0] & /*$_*/
@@ -284,7 +284,7 @@ function le(n) {
284
284
  ), w(e, "class", "OtpErrorMessage"), w(e, "role", "alert");
285
285
  },
286
286
  m(i, s) {
287
- M(i, e, s), b(e, t);
287
+ P(i, e, s), b(e, t);
288
288
  },
289
289
  p(i, s) {
290
290
  s[0] & /*errorMessage*/
@@ -326,7 +326,7 @@ function Ye(n) {
326
326
  w(t, "class", "OtpTimer"), w(y, "class", "OtpField"), w(e, "class", "OtpFieldWrapper");
327
327
  },
328
328
  m(g, T) {
329
- M(g, e, T), b(e, t), b(t, s), b(t, p), b(t, r), b(t, a), b(t, _), b(e, v), b(e, y);
329
+ P(g, e, T), b(e, t), b(t, s), b(t, p), b(t, r), b(t, a), b(t, _), b(e, v), b(e, y);
330
330
  for (let d = 0; d < u.length; d += 1)
331
331
  u[d] && u[d].m(y, null);
332
332
  },
@@ -368,7 +368,7 @@ function Ze(n) {
368
368
  e = x("div"), e.innerHTML = '<span class="OtpLoader"></span>', w(e, "class", "OtpLoaderContainer");
369
369
  },
370
370
  m(t, i) {
371
- M(t, e, i);
371
+ P(t, e, i);
372
372
  },
373
373
  p: G,
374
374
  d(t) {
@@ -419,7 +419,7 @@ function ae(n) {
419
419
  n[11], w(e, "autocomplete", "off");
420
420
  },
421
421
  m(v, y) {
422
- M(v, e, y), r(), p || (l = [
422
+ P(v, e, y), r(), p || (l = [
423
423
  N(e, "input", f),
424
424
  N(e, "keydown", _),
425
425
  N(
@@ -460,7 +460,7 @@ function Je(n) {
460
460
  n[4].inputLength;
461
461
  },
462
462
  m(r, a) {
463
- M(r, e, a), b(e, i), p || (l = N(
463
+ P(r, e, a), b(e, i), p || (l = N(
464
464
  e,
465
465
  "click",
466
466
  /*submitOtp*/
@@ -490,7 +490,7 @@ function Qe(n) {
490
490
  e = x("button"), i = A(t), w(e, "class", "OtpButton");
491
491
  },
492
492
  m(l, r) {
493
- M(l, e, r), b(e, i), s || (p = N(
493
+ P(l, e, r), b(e, i), s || (p = N(
494
494
  e,
495
495
  "click",
496
496
  /*handleResendOtp*/
@@ -517,7 +517,7 @@ function $e(n) {
517
517
  e = x("div"), t && t.c();
518
518
  },
519
519
  m(i, s) {
520
- M(i, e, s), t && t.m(e, null), n[31](e);
520
+ P(i, e, s), t && t.m(e, null), n[31](e);
521
521
  },
522
522
  p(i, s) {
523
523
  /*showPopup*/
@@ -532,8 +532,8 @@ function $e(n) {
532
532
  }
533
533
  function et(n, e, t) {
534
534
  let i;
535
- Ce(n, We, (o) => t(13, i = o));
536
- let { clientstyling: s = "" } = e, { clientstylingurl: p = "" } = e, { mbsource: l } = e, { lang: r = "en" } = e, { endpoint: a } = e, { session: f } = e, { translationurl: _ } = e, v = !1, y = [], k = !0, u = null, g = 0, T = "", d = "", E = !1, P = !1, O = "", H = "", z = "", S = !1, m = !1, C = !1, B, W = [], I = null, q = 0;
535
+ Se(n, We, (o) => t(13, i = o));
536
+ let { clientstyling: s = "" } = e, { clientstylingurl: p = "" } = e, { mbsource: l } = e, { lang: r = "en" } = e, { endpoint: a } = e, { session: f } = e, { translationurl: _ } = e, v = !1, y = [], k = !0, u = null, g = 0, T = "", d = "", E = !1, C = !1, O = "", H = "", z = "", M = !1, m = !1, S = !1, j, W = [], I = null, q = 0;
537
537
  const X = {
538
538
  MAX_ATTEMPTS_EXCEEDED: "gm.twofa.token_max_attempts_exceeded",
539
539
  INTERNAL_SERVER_ERROR: "gm.multifactorauthentication.internal_server_error"
@@ -553,24 +553,24 @@ function et(n, e, t) {
553
553
  });
554
554
  }, Y = async (o) => {
555
555
  if (o.detail?.["x-step-up-required"]) {
556
- if (t(7, P = !1), t(6, E = !1), t(8, O = ""), t(1, v = !0), H = o.detail["x-step-up-token"], z = o.detail.flow, !H || !z) {
557
- t(3, k = !1), t(7, P = !0), t(8, O = i("configError"));
556
+ if (t(7, C = !1), t(6, E = !1), t(8, O = ""), t(1, v = !0), H = o.detail["x-step-up-token"], z = o.detail.flow, !H || !z) {
557
+ t(3, k = !1), t(7, C = !0), t(8, O = i("configError"));
558
558
  return;
559
559
  }
560
560
  await $();
561
561
  }
562
562
  }, U = () => {
563
- I && (clearInterval(I), I = null), t(6, E = !1), t(7, P = !1), t(8, O = ""), t(1, v = !1), t(10, m = !1);
563
+ I && (clearInterval(I), I = null), t(6, E = !1), t(7, C = !1), t(8, O = ""), t(1, v = !1), t(10, m = !1);
564
564
  }, ce = () => {
565
- const o = new Date(T), c = new Date(d), h = /* @__PURE__ */ new Date(), j = c.getTime() - h.getTime();
566
- q = o.getTime() - j;
565
+ const o = new Date(T), c = new Date(d), h = /* @__PURE__ */ new Date(), B = c.getTime() - h.getTime();
566
+ q = o.getTime() - B;
567
567
  const V = Date.now(), Ee = Math.max(0, Math.floor((q - V) / 1e3));
568
568
  t(5, g = Ee);
569
569
  }, fe = () => {
570
570
  I && clearInterval(I), I = setInterval(
571
571
  () => {
572
572
  const o = Date.now(), c = Math.max(0, Math.floor((q - o) / 1e3));
573
- t(5, g = c), t(11, C = c <= 0), c <= 0 && (clearInterval(I), I = null, t(9, S = !0), t(6, E = !1), t(10, m = !1));
573
+ t(5, g = c), t(11, S = c <= 0), c <= 0 && (clearInterval(I), I = null, t(9, M = !0), t(6, E = !1), t(10, m = !1));
574
574
  },
575
575
  1e3
576
576
  );
@@ -585,12 +585,12 @@ function et(n, e, t) {
585
585
  const h = (o.clipboardData?.getData("text")?.trim() || "").slice(0, u.inputLength).split("");
586
586
  t(2, y = [...h, ...Array(u.inputLength - h.length).fill("")]), W[h.length]?.focus(), h.length === u.inputLength && Q();
587
587
  }, Z = (o, c) => {
588
- const h = o.target, j = h.value;
589
- /^[a-z0-9]$/i.test(j) && (K(c, j), W[c + 1]?.focus()), h.value = "";
588
+ const h = o.target, B = h.value;
589
+ /^[a-z0-9]$/i.test(B) && (K(c, B), W[c + 1]?.focus()), h.value = "";
590
590
  }, J = (o, c) => {
591
- const h = o.key, j = o.ctrlKey || o.metaKey;
591
+ const h = o.key, B = o.ctrlKey || o.metaKey;
592
592
  if (/^[a-z0-9]$/i.test(h)) {
593
- if (j && h.toLowerCase() === "v")
593
+ if (B && h.toLowerCase() === "v")
594
594
  return;
595
595
  o.preventDefault(), K(c, h), W[c + 1]?.focus();
596
596
  } else
@@ -618,8 +618,8 @@ function et(n, e, t) {
618
618
  _e();
619
619
  return;
620
620
  }
621
- const j = await h.json();
622
- throw new Error(j.message);
621
+ const B = await h.json();
622
+ throw new Error(B.message);
623
623
  } catch (h) {
624
624
  if (h.message === X.INTERNAL_SERVER_ERROR) {
625
625
  if (u.numberOfValidateAttempts === u.maxValidationAttempts - 1) {
@@ -667,15 +667,15 @@ function et(n, e, t) {
667
667
  t(3, k = !0);
668
668
  const o = new URL(`/api/nwa/api/v1/mfa/challenge/${H}/config`, a), c = await fetch(o.href), h = await c.json();
669
669
  if (c.ok)
670
- t(4, u = h), t(2, y = Array(u.inputLength).fill("")), t(9, S = !1), T = u.expirationTime, d = u.serverTime, u.numberOfValidateAttempts !== 0 && (t(6, E = !0), t(8, O = i("invalidOtp"))), u.numberOfValidateAttempts === u.maxValidationAttempts - 1 && t(10, m = !0), t(3, k = !1), ce(), fe();
670
+ t(4, u = h), t(2, y = Array(u.inputLength).fill("")), t(9, M = !1), T = u.expirationTime, d = u.serverTime, u.numberOfValidateAttempts !== 0 && (t(6, E = !0), t(8, O = i("invalidOtp"))), u.numberOfValidateAttempts === u.maxValidationAttempts - 1 && t(10, m = !0), t(3, k = !1), ce(), fe();
671
671
  else if (h && h.details === X.MAX_ATTEMPTS_EXCEEDED)
672
672
  U();
673
673
  else {
674
- const j = h && h.message || `Failed to load config. Status: ${c.status}`;
675
- throw new Error(j);
674
+ const B = h && h.message || `Failed to load config. Status: ${c.status}`;
675
+ throw new Error(B);
676
676
  }
677
677
  } catch (o) {
678
- t(3, k = !1), t(7, P = !0), t(8, O = i("configError")), console.error("Error loading 2FA config:", o);
678
+ t(3, k = !1), t(7, C = !0), t(8, O = i("configError")), console.error("Error loading 2FA config:", o);
679
679
  }
680
680
  };
681
681
  Re(() => (window.addEventListener("stepUpAuthRequired", Y, !1), window.addEventListener("closePopup", U, !1), () => {
@@ -689,31 +689,31 @@ function et(n, e, t) {
689
689
  const ve = (o, c) => Z(c, o), Oe = (o, c) => J(c, o);
690
690
  function ke(o) {
691
691
  ee[o ? "unshift" : "push"](() => {
692
- B = o, t(0, B);
692
+ j = o, t(0, j);
693
693
  });
694
694
  }
695
695
  return n.$$set = (o) => {
696
696
  "clientstyling" in o && t(21, s = o.clientstyling), "clientstylingurl" in o && t(22, p = o.clientstylingurl), "mbsource" in o && t(23, l = o.mbsource), "lang" in o && t(24, r = o.lang), "endpoint" in o && t(25, a = o.endpoint), "session" in o && t(26, f = o.session), "translationurl" in o && t(27, _ = o.translationurl);
697
697
  }, n.$$.update = () => {
698
698
  n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
699
- 2097153 && s && B && je(B, s), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
700
- 4194305 && p && B && Be(B, p), n.$$.dirty[0] & /*mbsource, customStylingContainer*/
701
- 8388609 && l && B && Ie(B, `${l}.Style`), n.$$.dirty[0] & /*lang*/
699
+ 2097153 && s && j && Be(j, s), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
700
+ 4194305 && p && j && je(j, p), n.$$.dirty[0] & /*mbsource, customStylingContainer*/
701
+ 8388609 && l && j && Ie(j, `${l}.Style`), n.$$.dirty[0] & /*lang*/
702
702
  16777216 && r && pe(), n.$$.dirty[0] & /*lang, translationurl*/
703
703
  150994944 && r && _ && ue();
704
704
  }, [
705
- B,
705
+ j,
706
706
  v,
707
707
  y,
708
708
  k,
709
709
  u,
710
710
  g,
711
711
  E,
712
- P,
712
+ C,
713
713
  O,
714
- S,
714
+ M,
715
715
  m,
716
- C,
716
+ S,
717
717
  W,
718
718
  i,
719
719
  de,
@@ -738,12 +738,12 @@ function et(n, e, t) {
738
738
  }
739
739
  class tt extends Le {
740
740
  constructor(e) {
741
- super(), Me(
741
+ super(), Pe(
742
742
  this,
743
743
  e,
744
744
  et,
745
745
  $e,
746
- Pe,
746
+ Ce,
747
747
  {
748
748
  clientstyling: 21,
749
749
  clientstylingurl: 22,
@@ -0,0 +1 @@
1
+ "use strict";var j=(i,n,t)=>new Promise((r,o)=>{var c=a=>{try{l(t.next(a))}catch(d){o(d)}},p=a=>{try{l(t.throw(a))}catch(d){o(d)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(c,p);l((t=t.apply(i,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./CashierCarousel-BkoYZVP7.cjs");function K(i,n){e.addMessages(i,n)}function me(i){e.$locale.set(i)}const G={en:{otpTitle:"Code verification is required",popupMessage:"Please enter the security code received on your SMS/email address to perform the update.",popupMessageLastWarning:"If the next validation attempt is failed, you will be logged out and blocked temporarily.",minutes:"minutes",errorHeader:"Error",configError:"Unable to load OTP data. Please try again later.",otpHeading:"Enter OTP",resendOtp:"Resent OTP",submit:"Submit",close:"Close",invalidOtp:"The code you've sent is not valid. Please try again.",accountBlocked:"Too many attempts for OTP. Your account has been blocked for one hour.",submissionError:"Something went wrong. Please try again.",otpExpiredMessage:"Validation code has expired, please request a new one to continue.",timeRemaining:"Code expires in:"},tr:{otpTitle:"Kod doğrulaması gereklidir",popupMessage:"Güncellemeyi gerçekleştirmek için SMS/e-posta adresinize gönderilen güvenlik kodunu girin.",popupMessageLastWarning:"Bir sonraki doğrulama denemesi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.",minutes:"dakika",errorHeader:"Hata",configError:"OTP verileri yüklenemedi. Lütfen daha sonra tekrar deneyin.",otpHeading:"OTP Girin",resendOtp:"OTP'yi Yeniden Gönder",submit:"Gönder",close:"Kapat",invalidOtp:"Gönderdiğiniz kod geçerli değil. Lütfen tekrar deneyin.",accountBlocked:"OTP için çok fazla deneme yapıldı. Hesabınız bir saat süreyle engellenmiştir.",submissionError:"Bir şeyler ters gitti. Lütfen tekrar deneyin.",otpExpiredMessage:"Doğrulama kodunun süresi doldu, devam etmek için lütfen yeni bir kod isteyin.",timeRemaining:"Kodun süresi doluyor:"}};function ge(i){e.append_styles(i,"svelte-1nsut98",'*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}@container (max-width: 500px){.OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center}}@container (min-width: 500px){.OtpPopupOverlay{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center}}.OtpButton{text-transform:uppercase;font-weight:var(--emw--font-weight-medium, 500);color:var(--emw--color-typography-button, #000000);text-align:center;font-size:var(--emw--font-size-medium, 16px);font-style:normal;font-family:inherit;height:46px;line-height:normal;border:none;background:var(--emw--color-primary, #f9c408);border-radius:10px;width:100%;margin:var(--emw--spacing-small, 12px) 0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--emw--spacing-2x-small-plus, 5px);transition:all 0.2s linear}.OtpButton:active{box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-active, #fecd1c)}.OtpButton[disabled]{filter:saturate(50%);opacity:0.5;cursor:auto;pointer-events:none}.OtpButton:hover{box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-hover, #dbac03)}.OtpDescription{display:flex;color:var(--emw--color-typography, #fff);flex-direction:column;gap:12px;font-size:var(--emw--font-size-small, 12px)}.OtpDescription .Title{font-size:var(--emw--font-size-big, 20px);font-weight:var(--emw--font-weight-medium, 600)}@container (max-width: 500px){.OtpPopupContent{width:100%;height:100%;justify-content:flex-start}}@container (min-width: 500px){.OtpPopupContent{justify-content:center;border-radius:10px;box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2)}.OtpPopupContent::before{border-radius:10px;background:linear-gradient(140deg, var(--emw--color-primary, #f9c405) 5%, var(--emw--color-black, #12191f) 65%)}}.OtpPopupContent{background:var(--emw--color-cashier-bg);display:flex;flex-direction:column;gap:var(--emw--spacing-large, 20px);position:relative;padding:var(--emw--spacing-medium, 20px);z-index:1;animation:modalSlideScaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94)}.OtpPopupContent::before{content:"";position:absolute;inset:0;opacity:0.2;z-index:-1;pointer-events:none}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:space-between;margin:10px}.OtpField input{width:45px;font-size:32px;padding:5px;text-align:center;border-radius:5px;margin:6px;font-weight:bold;outline:none;background:var(--emw--color-background);border:0;transition:all 0.1s;box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.3);color:var(--emw--color-typography, #fff)}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{box-shadow:0 0 1px 1px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between;gap:40px}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.OtpTimer{color:var(--emw--color-typography, #fff);font-size:var(--emw--font-size-small, 12px);opacity:0.8}')}function X(i,n,t){const r=i.slice();return r[51]=n[t],r[52]=n,r[53]=t,r}function Y(i){let n,t;function r(p,l){return p[7]?_e:he}let o=r(i),c=o(i);return{c(){n=e.element("div"),t=e.element("div"),c.c(),e.attr(t,"class","OtpPopupContent"),e.attr(n,"class","OtpPopupOverlay")},m(p,l){e.insert(p,n,l),e.append(n,t),c.m(t,null)},p(p,l){o===(o=r(p))&&c?c.p(p,l):(c.d(1),c=o(p),c&&(c.c(),c.m(t,null)))},d(p){p&&e.detach(n),c.d()}}}function he(i){let n,t,r=i[13]("otpTitle")+"",o,c,p,l,a,d,b,y=i[13]("close")+"",w,v,u;function h(g,L){return g[9]?we:be}let E=h(i),m=E(i);function k(g,L){if(g[3])return ke;if(g[4])return ve}let x=k(i),O=x&&x(i);function A(g,L){if(g[9])return xe;if(g[4])return Ee}let P=A(i),T=P&&P(i);return{c(){n=e.element("div"),t=e.element("div"),o=e.text(r),c=e.space(),m.c(),p=e.space(),O&&O.c(),l=e.space(),a=e.element("div"),T&&T.c(),d=e.space(),b=e.element("button"),w=e.text(y),e.attr(t,"class","Title"),e.attr(n,"class","OtpDescription"),e.attr(b,"class","OtpButton"),e.attr(a,"class","OtpActionButtons")},m(g,L){e.insert(g,n,L),e.append(n,t),e.append(t,o),e.append(n,c),m.m(n,null),e.insert(g,p,L),O&&O.m(g,L),e.insert(g,l,L),e.insert(g,a,L),T&&T.m(a,null),e.append(a,d),e.append(a,b),e.append(b,w),v||(u=e.listen(b,"click",i[19]),v=!0)},p(g,L){L[0]&8192&&r!==(r=g[13]("otpTitle")+"")&&e.set_data(o,r),E===(E=h(g))&&m?m.p(g,L):(m.d(1),m=E(g),m&&(m.c(),m.m(n,null))),x===(x=k(g))&&O?O.p(g,L):(O&&O.d(1),O=x&&x(g),O&&(O.c(),O.m(l.parentNode,l))),P===(P=A(g))&&T?T.p(g,L):(T&&T.d(1),T=P&&P(g),T&&(T.c(),T.m(a,d))),L[0]&8192&&y!==(y=g[13]("close")+"")&&e.set_data(w,y)},d(g){g&&(e.detach(n),e.detach(p),e.detach(l),e.detach(a)),m.d(),O&&O.d(g),T&&T.d(),v=!1,u()}}}function _e(i){let n,t,r,o,c,p,l=i[13]("errorHeader")+"",a,d,b,y,w,v,u=i[13]("close")+"",h,E,m;return{c(){n=e.element("div"),t=e.element("div"),r=e.svg_element("svg"),o=e.svg_element("path"),c=e.space(),p=e.element("h2"),a=e.text(l),d=e.space(),b=e.element("p"),y=e.text(i[8]),w=e.space(),v=e.element("button"),h=e.text(u),e.attr(o,"d","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"),e.attr(r,"xmlns","http://www.w3.org/2000/svg"),e.attr(r,"viewBox","0 0 512 512"),e.attr(t,"class","OtpErrorHeader"),e.attr(v,"class","OtpButton error"),e.attr(n,"class","OtpError")},m(k,x){e.insert(k,n,x),e.append(n,t),e.append(t,r),e.append(r,o),e.append(t,c),e.append(t,p),e.append(p,a),e.append(n,d),e.append(n,b),e.append(b,y),e.append(n,w),e.append(n,v),e.append(v,h),E||(m=e.listen(v,"click",i[19]),E=!0)},p(k,x){x[0]&8192&&l!==(l=k[13]("errorHeader")+"")&&e.set_data(a,l),x[0]&256&&e.set_data(y,k[8]),x[0]&8192&&u!==(u=k[13]("close")+"")&&e.set_data(h,u)},d(k){k&&e.detach(n),E=!1,m()}}}function be(i){let n,t,r,o;function c(d,b){return d[10]?Oe:ye}let p=c(i),l=p(i),a=i[6]&&J(i);return{c(){n=e.element("p"),l.c(),r=e.space(),a&&a.c(),o=e.empty(),e.attr(n,"class",t=i[10]?"LastWarningMessage":"")},m(d,b){e.insert(d,n,b),l.m(n,null),e.insert(d,r,b),a&&a.m(d,b),e.insert(d,o,b)},p(d,b){p===(p=c(d))&&l?l.p(d,b):(l.d(1),l=p(d),l&&(l.c(),l.m(n,null))),b[0]&1024&&t!==(t=d[10]?"LastWarningMessage":"")&&e.attr(n,"class",t),d[6]?a?a.p(d,b):(a=J(d),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(d){d&&(e.detach(n),e.detach(r),e.detach(o)),l.d(),a&&a.d(d)}}}function we(i){let n,t=i[13]("otpExpiredMessage")+"",r;return{c(){n=e.element("p"),r=e.text(t),e.attr(n,"class","OtpNoticeMessage"),e.attr(n,"role","alert")},m(o,c){e.insert(o,n,c),e.append(n,r)},p(o,c){c[0]&8192&&t!==(t=o[13]("otpExpiredMessage")+"")&&e.set_data(r,t)},d(o){o&&e.detach(n)}}}function ye(i){let n=i[13]("popupMessage")+"",t;return{c(){t=e.text(n)},m(r,o){e.insert(r,t,o)},p(r,o){o[0]&8192&&n!==(n=r[13]("popupMessage")+"")&&e.set_data(t,n)},d(r){r&&e.detach(t)}}}function Oe(i){let n=i[13]("popupMessageLastWarning")+"",t;return{c(){t=e.text(n)},m(r,o){e.insert(r,t,o)},p(r,o){o[0]&8192&&n!==(n=r[13]("popupMessageLastWarning")+"")&&e.set_data(t,n)},d(r){r&&e.detach(t)}}}function J(i){let n,t;return{c(){n=e.element("p"),t=e.text(i[8]),e.attr(n,"class","OtpErrorMessage"),e.attr(n,"role","alert")},m(r,o){e.insert(r,n,o),e.append(n,t)},p(r,o){o[0]&256&&e.set_data(t,r[8])},d(r){r&&e.detach(n)}}}function ve(i){let n,t,r=i[13]("timeRemaining")+"",o,c,p=i[14](i[5])+"",l,a,d=i[13]("minutes")+"",b,y,w,v=e.ensure_array_like(i[2]),u=[];for(let h=0;h<v.length;h+=1)u[h]=Q(X(i,v,h));return{c(){n=e.element("div"),t=e.element("div"),o=e.text(r),c=e.space(),l=e.text(p),a=e.space(),b=e.text(d),y=e.space(),w=e.element("div");for(let h=0;h<u.length;h+=1)u[h].c();e.attr(t,"class","OtpTimer"),e.attr(w,"class","OtpField"),e.attr(n,"class","OtpFieldWrapper")},m(h,E){e.insert(h,n,E),e.append(n,t),e.append(t,o),e.append(t,c),e.append(t,l),e.append(t,a),e.append(t,b),e.append(n,y),e.append(n,w);for(let m=0;m<u.length;m+=1)u[m]&&u[m].m(w,null)},p(h,E){if(E[0]&8192&&r!==(r=h[13]("timeRemaining")+"")&&e.set_data(o,r),E[0]&32&&p!==(p=h[14](h[5])+"")&&e.set_data(l,p),E[0]&8192&&d!==(d=h[13]("minutes")+"")&&e.set_data(b,d),E[0]&235540){v=e.ensure_array_like(h[2]);let m;for(m=0;m<v.length;m+=1){const k=X(h,v,m);u[m]?u[m].p(k,E):(u[m]=Q(k),u[m].c(),u[m].m(w,null))}for(;m<u.length;m+=1)u[m].d(1);u.length=v.length}},d(h){h&&e.detach(n),e.destroy_each(u,h)}}}function ke(i){let n;return{c(){n=e.element("div"),n.innerHTML='<span class="OtpLoader"></span>',e.attr(n,"class","OtpLoaderContainer")},m(t,r){e.insert(t,n,r)},p:e.noop,d(t){t&&e.detach(n)}}}function Q(i){let n,t,r,o=i[53],c,p;const l=()=>i[28](n,o),a=()=>i[28](null,o);function d(...y){return i[29](i[53],...y)}function b(...y){return i[30](i[53],...y)}return{c(){n=e.element("input"),e.attr(n,"id",`otp-input-${i[53]}`),e.attr(n,"type","text"),e.attr(n,"class",t=`otp-box ${i[4].inputLength%2===0&&i[53]===i[4].inputLength/2-1?"space":""}`),e.attr(n,"maxlength",1),n.value=r=i[51],n.disabled=i[11],e.attr(n,"autocomplete","off")},m(y,w){e.insert(y,n,w),l(),c||(p=[e.listen(n,"input",d),e.listen(n,"keydown",b),e.listen(n,"paste",i[15])],c=!0)},p(y,w){i=y,w[0]&16&&t!==(t=`otp-box ${i[4].inputLength%2===0&&i[53]===i[4].inputLength/2-1?"space":""}`)&&e.attr(n,"class",t),w[0]&4&&r!==(r=i[51])&&n.value!==r&&(n.value=r),w[0]&2048&&(n.disabled=i[11]),o!==i[53]&&(a(),o=i[53],l())},d(y){y&&e.detach(n),a(),c=!1,e.run_all(p)}}}function Ee(i){let n,t=i[13]("submit")+"",r,o,c,p;return{c(){n=e.element("button"),r=e.text(t),e.attr(n,"class","OtpButton"),n.disabled=o=i[2].join("").length!==i[4].inputLength},m(l,a){e.insert(l,n,a),e.append(n,r),c||(p=e.listen(n,"click",i[20]),c=!0)},p(l,a){a[0]&8192&&t!==(t=l[13]("submit")+"")&&e.set_data(r,t),a[0]&20&&o!==(o=l[2].join("").length!==l[4].inputLength)&&(n.disabled=o)},d(l){l&&e.detach(n),c=!1,p()}}}function xe(i){let n,t=i[13]("resendOtp")+"",r,o,c;return{c(){n=e.element("button"),r=e.text(t),e.attr(n,"class","OtpButton")},m(p,l){e.insert(p,n,l),e.append(n,r),o||(c=e.listen(n,"click",i[18]),o=!0)},p(p,l){l[0]&8192&&t!==(t=p[13]("resendOtp")+"")&&e.set_data(r,t)},d(p){p&&e.detach(n),o=!1,c()}}}function Te(i){let n,t=i[1]&&Y(i);return{c(){n=e.element("div"),t&&t.c()},m(r,o){e.insert(r,n,o),t&&t.m(n,null),i[31](n)},p(r,o){r[1]?t?t.p(r,o):(t=Y(r),t.c(),t.m(n,null)):t&&(t.d(1),t=null)},i:e.noop,o:e.noop,d(r){r&&e.detach(n),t&&t.d(),i[31](null)}}}function Le(i,n,t){let r;e.component_subscribe(i,e.$format,s=>t(13,r=s));let{clientstyling:o=""}=n,{clientstylingurl:c=""}=n,{mbsource:p}=n,{lang:l="en"}=n,{endpoint:a}=n,{session:d}=n,{translationurl:b}=n,y=!1,w=[],v=!0,u=null,h=0,E="",m="",k=!1,x=!1,O="",A="",P="",T=!1,g=!1,L=!1,S,z=[],R=null,H=0;const U={MAX_ATTEMPTS_EXCEEDED:"gm.twofa.token_max_attempts_exceeded",INTERNAL_SERVER_ERROR:"gm.multifactorauthentication.internal_server_error"};Object.keys(G).forEach(s=>{K(s,G[s])});const $=()=>{me(l)},ee=()=>{fetch(b).then(s=>s.json()).then(s=>{Object.keys(s).forEach(f=>{K(f,s[f])})}).catch(s=>{console.log(s)})},V=s=>j(this,null,function*(){var f;if((f=s.detail)!=null&&f["x-step-up-required"]){if(t(7,x=!1),t(6,k=!1),t(8,O=""),t(1,y=!0),A=s.detail["x-step-up-token"],P=s.detail.flow,!A||!P){t(3,v=!1),t(7,x=!0),t(8,O=r("configError"));return}yield I()}}),D=()=>{R&&(clearInterval(R),R=null),t(6,k=!1),t(7,x=!1),t(8,O=""),t(1,y=!1),t(10,g=!1)},te=()=>{const s=new Date(E),f=new Date(m),_=new Date,M=f.getTime()-_.getTime();H=s.getTime()-M;const C=Date.now(),B=Math.max(0,Math.floor((H-C)/1e3));t(5,h=B)},ne=()=>{R&&clearInterval(R),R=setInterval(()=>{const s=Date.now(),f=Math.max(0,Math.floor((H-s)/1e3));t(5,h=f),t(11,L=f<=0),f<=0&&(clearInterval(R),R=null,t(9,T=!0),t(6,k=!1),t(10,g=!1))},1e3)},ie=s=>{const f=Math.floor(s/60),_=s%60;return`${f.toString().padStart(2,"0")}:${_.toString().padStart(2,"0")}`},N=(s,f)=>{const _=[...w];_[s]=f.toUpperCase(),t(2,w=_)},re=s=>{var M,C,B;s.preventDefault();const _=(((C=(M=s.clipboardData)==null?void 0:M.getData("text"))==null?void 0:C.trim())||"").slice(0,u.inputLength).split("");t(2,w=[..._,...Array(u.inputLength-_.length).fill("")]),(B=z[_.length])==null||B.focus(),_.length===u.inputLength&&q()},W=(s,f)=>{const _=s.target,M=_.value;if(/^[a-z0-9]$/i.test(M)){N(f,M);const C=z[f+1];C==null||C.focus()}_.value=""},F=(s,f)=>{const _=s.key,M=s.ctrlKey||s.metaKey;if(/^[a-z0-9]$/i.test(_)){if(M&&_.toLowerCase()==="v")return;s.preventDefault(),N(f,_);const C=z[f+1];C==null||C.focus()}else if(_==="Backspace"){s.preventDefault(),w[f]!==""&&N(f,"");const C=z[f-1];C==null||C.focus()}},se=()=>{const s=new CustomEvent("otpResendRequested");window.dispatchEvent(s)},oe=s=>{window.dispatchEvent(new CustomEvent("otpSubmitted",{detail:{code:s,maxAttempts:u.maxValidationAttempts,validatedAttempts:u.numberOfValidateAttempts}}))},le=s=>j(this,null,function*(){const f=new URL(`/api/nwa/api/v1/mfa/challenge/${A}/validate`,a);f.searchParams.append("input",s);try{const _=yield fetch(f.href,{method:"POST"});if(_.status===200){ae();return}const M=yield _.json();throw new Error(M.message)}catch(_){if(_.message===U.INTERNAL_SERVER_ERROR){if(u.numberOfValidateAttempts===u.maxValidationAttempts-1){window.dispatchEvent(new CustomEvent("otpSetTimeout")),window.postMessage({type:"WidgetNotification",data:{type:"error",message:r("accountBlocked")}},window.location.href),D();return}t(6,k=!0),t(8,O=r("invalidOtp")),I();return}console.error("OTP submission failed:",_),t(6,k=!0),t(8,O=r("submissionError"))}finally{t(3,v=!1)}}),ae=()=>{window.dispatchEvent(new CustomEvent("otpSuccess",{detail:{message:"User successfully authenticated"}})),D()},pe=()=>{window.dispatchEvent(new CustomEvent("manualClosePopup")),D()},q=()=>j(this,null,function*(){if(w.join("").length!==u.inputLength){t(6,k=!0),t(8,O=r("invalidOtp"));return}t(3,v=!0),t(6,k=!1),t(8,O="");const s=w.join("");P==="stateless"&&oe(s),P==="stateful"&&(yield le(s))}),I=()=>j(this,null,function*(){if(a)try{t(3,v=!0);const s=new URL(`/api/nwa/api/v1/mfa/challenge/${A}/config`,a),f=yield fetch(s.href),_=yield f.json();if(f.ok)t(4,u=_),t(2,w=Array(u.inputLength).fill("")),t(9,T=!1),E=u.expirationTime,m=u.serverTime,u.numberOfValidateAttempts!==0&&(t(6,k=!0),t(8,O=r("invalidOtp"))),u.numberOfValidateAttempts===u.maxValidationAttempts-1&&t(10,g=!0),t(3,v=!1),te(),ne();else if(_&&_.details===U.MAX_ATTEMPTS_EXCEEDED)D();else{const M=_&&_.message||`Failed to load config. Status: ${f.status}`;throw new Error(M)}}catch(s){t(3,v=!1),t(7,x=!0),t(8,O=r("configError")),console.error("Error loading 2FA config:",s)}});e.onMount(()=>(window.addEventListener("stepUpAuthRequired",V,!1),window.addEventListener("closePopup",D,!1),()=>{window.removeEventListener("stepUpAuthRequired",V),window.removeEventListener("closePopup",D,!1)}));function ce(s,f){e.binding_callbacks[s?"unshift":"push"](()=>{z[f]=s,t(12,z)})}const ue=(s,f)=>W(f,s),de=(s,f)=>F(f,s);function fe(s){e.binding_callbacks[s?"unshift":"push"](()=>{S=s,t(0,S)})}return i.$$set=s=>{"clientstyling"in s&&t(21,o=s.clientstyling),"clientstylingurl"in s&&t(22,c=s.clientstylingurl),"mbsource"in s&&t(23,p=s.mbsource),"lang"in s&&t(24,l=s.lang),"endpoint"in s&&t(25,a=s.endpoint),"session"in s&&t(26,d=s.session),"translationurl"in s&&t(27,b=s.translationurl)},i.$$.update=()=>{i.$$.dirty[0]&2097153&&o&&S&&e.setClientStyling(S,o),i.$$.dirty[0]&4194305&&c&&S&&e.setClientStylingURL(S,c),i.$$.dirty[0]&8388609&&p&&S&&e.setStreamStyling(S,`${p}.Style`),i.$$.dirty[0]&16777216&&l&&$(),i.$$.dirty[0]&150994944&&l&&b&&ee()},[S,y,w,v,u,h,k,x,O,T,g,L,z,r,ie,re,W,F,se,pe,q,o,c,p,l,a,d,b,ce,ue,de,fe]}class Z extends e.SvelteComponent{constructor(n){super(),e.init$1(this,n,Le,Te,e.safe_not_equal,{clientstyling:21,clientstylingurl:22,mbsource:23,lang:24,endpoint:25,session:26,translationurl:27},ge,[-1,-1])}get clientstyling(){return this.$$.ctx[21]}set clientstyling(n){this.$$set({clientstyling:n}),e.flush()}get clientstylingurl(){return this.$$.ctx[22]}set clientstylingurl(n){this.$$set({clientstylingurl:n}),e.flush()}get mbsource(){return this.$$.ctx[23]}set mbsource(n){this.$$set({mbsource:n}),e.flush()}get lang(){return this.$$.ctx[24]}set lang(n){this.$$set({lang:n}),e.flush()}get endpoint(){return this.$$.ctx[25]}set endpoint(n){this.$$set({endpoint:n}),e.flush()}get session(){return this.$$.ctx[26]}set session(n){this.$$set({session:n}),e.flush()}get translationurl(){return this.$$.ctx[27]}set translationurl(n){this.$$set({translationurl:n}),e.flush()}}e.create_custom_element(Z,{clientstyling:{},clientstylingurl:{},mbsource:{},lang:{},endpoint:{},session:{},translationurl:{}},[],[],!0);exports.default=Z;