@everymatrix/cashier-page 1.86.0 → 1.86.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/components/{CashierError-BwZRYX5r.js → CashierError-7qg__v0Z.js} +206 -229
  2. package/components/{CashierError-DFQyDQHn.cjs → CashierError-BorUJmCn.cjs} +1 -1
  3. package/components/{CashierError-kVdNczE9.js → CashierError-DZSJKCbW.js} +206 -229
  4. package/components/{CashierMethodDetails--Ebwn4lg.js → CashierMethodDetails-Bxh5WhVb.js} +2225 -2204
  5. package/components/{CashierMethodDetails-E1XQT_gz.js → CashierMethodDetails-BzVSr2on.js} +2349 -2328
  6. package/components/CashierMethodDetails-C1kjc4-Q.cjs +85 -0
  7. package/components/{CashierMethodsList-ByGJLq8_.js → CashierMethodsList-CBnuQYXc.js} +1 -1
  8. package/components/{CashierMethodsList-D5p1ksRs.js → CashierMethodsList-CLQK5Xcn.js} +1 -1
  9. package/components/{CashierMethodsList-BCfPOiPQ.cjs → CashierMethodsList-D9ypDDJW.cjs} +1 -1
  10. package/components/{CashierPage-BOXcdzek.js → CashierPage-BREFnfc1.js} +874 -812
  11. package/components/CashierPage-DcE7E_Wf.cjs +1 -0
  12. package/components/{CashierPage-DSBg3R7m.js → CashierPage-y5YsPxSa.js} +976 -914
  13. package/components/{CashierReceiptPage-DLHbUzv0.js → CashierReceiptPage-BbHKdDra.js} +1 -1
  14. package/components/{CashierReceiptPage-DWJG1k-S.js → CashierReceiptPage-CNwhHWwV.js} +1 -1
  15. package/components/{CashierReceiptPage-DW63yTeU.cjs → CashierReceiptPage-DGAjOoFe.cjs} +1 -1
  16. package/components/{CashierSessionExpirationModal-Di0jBCa7.cjs → CashierSessionExpirationModal-33ygvBxj.cjs} +1 -1
  17. package/components/{CashierSessionExpirationModal-CeesVv0R.js → CashierSessionExpirationModal-BQujD7Vd.js} +2 -2
  18. package/components/{CashierSessionExpirationModal-Dk8_yCxM.js → CashierSessionExpirationModal-D6h6euRq.js} +2 -2
  19. package/components/CashierStepUp-B9H7E8wY.cjs +1 -0
  20. package/components/CashierStepUp-DEb05cBS.js +1068 -0
  21. package/components/CashierStepUp-DnvNxlcq.js +1107 -0
  22. package/components/{CashierTransactionHistory-DAieZJ7I.js → CashierTransactionHistory-ButX2_sB.js} +2 -2
  23. package/components/{CashierTransactionHistory-DZS6p6Wq.js → CashierTransactionHistory-CX3RviXD.js} +2 -2
  24. package/components/{CashierTransactionHistory-dL_Zbx6y.cjs → CashierTransactionHistory-D8cuhIj_.cjs} +1 -1
  25. package/components/{CashierVerifications-B6QC6J6G.js → CashierVerifications-CPUhZGV4.js} +1 -1
  26. package/components/{CashierVerifications-BhbImoKx.cjs → CashierVerifications-DPeQTcCN.cjs} +1 -1
  27. package/components/{CashierVerifications-63wvOw6D.js → CashierVerifications-DVccv6qc.js} +1 -1
  28. package/es2015/cashier-page.cjs +1 -1
  29. package/es2015/cashier-page.js +7 -7
  30. package/esnext/cashier-page.js +1 -1
  31. package/package.json +1 -1
  32. package/components/CashierMethodDetails-D3OcsUSC.cjs +0 -85
  33. package/components/CashierPage-DSwyNlUe.cjs +0 -1
  34. package/components/CashierStepUp-BA2IK4WI.js +0 -1070
  35. package/components/CashierStepUp-CSkfphtu.js +0 -1109
  36. package/components/CashierStepUp-pkLhK-RI.cjs +0 -1
@@ -1,1109 +0,0 @@
1
- var Ye = Object.defineProperty, Je = Object.defineProperties;
2
- var Ze = Object.getOwnPropertyDescriptors;
3
- var Me = Object.getOwnPropertySymbols;
4
- var Qe = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable;
5
- var Le = (n, e, t) => e in n ? Ye(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ke = (n, e) => {
6
- for (var t in e || (e = {}))
7
- Qe.call(e, t) && Le(n, t, e[t]);
8
- if (Me)
9
- for (var t of Me(e))
10
- $e.call(e, t) && Le(n, t, e[t]);
11
- return n;
12
- }, Te = (n, e) => Je(n, Ze(e));
13
- var we = (n, e, t) => new Promise((l, s) => {
14
- var f = (a) => {
15
- try {
16
- r(t.next(a));
17
- } catch (d) {
18
- s(d);
19
- }
20
- }, u = (a) => {
21
- try {
22
- r(t.throw(a));
23
- } catch (d) {
24
- s(d);
25
- }
26
- }, r = (a) => a.done ? l(a.value) : Promise.resolve(a.value).then(f, u);
27
- r((t = t.apply(n, e)).next());
28
- });
29
- import { a as et, $ as tt, S as nt, b as lt, s as ot, f as ae, c as it, G as Ce, e as E, k as S, l as c, x as te, m as v, X as G, n as I, o as i, p as st, q as rt, y as Ae, v as z, w as T, a0 as je, W as ee, r as at, Y as Ie, a4 as ct, B as pt, C as ut, D as dt, E as ft, F as mt } from "./CashierCarousel-D8MiOwuE.js";
30
- function Re(n, e) {
31
- et(n, e);
32
- }
33
- function ht(n) {
34
- tt.set(n);
35
- }
36
- const ze = {
37
- en: {
38
- otpTitle: "Code verification is required",
39
- popupMessage: "Please enter the security code received on your SMS/email address to perform the update.",
40
- popupMessageLastWarning: "If the next validation attempt is failed, you will be logged out and blocked temporarily.",
41
- minutes: "minutes",
42
- errorHeader: "Error",
43
- configError: "Unable to load OTP data. Please try again later.",
44
- otpHeading: "Enter OTP",
45
- resendOtp: "Resent OTP",
46
- submit: "Submit",
47
- close: "Close",
48
- invalidOtp: "The code you've sent is not valid. Please try again.",
49
- accountBlocked: "Too many attempts for OTP. Your account has been blocked for one hour.",
50
- submissionError: "Something went wrong. Please try again.",
51
- otpExpiredMessage: "Validation code has expired, please request a new one to continue.",
52
- timeRemaining: "Code expires in:",
53
- selectChannelTitle: "Select verification method",
54
- selectChannelMessage: "Choose how you would like to receive your verification code",
55
- channelSMS: "SMS",
56
- channelEmail: "Email",
57
- sendCode: "Send code",
58
- waitSeconds: "Please wait for before resending:"
59
- },
60
- tr: {
61
- otpTitle: "Kod doğrulaması gereklidir",
62
- popupMessage: "Güncellemeyi gerçekleştirmek için SMS/e-posta adresinize gönderilen güvenlik kodunu girin.",
63
- popupMessageLastWarning: "Bir sonraki doğrulama denemesi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.",
64
- minutes: "dakika",
65
- errorHeader: "Hata",
66
- configError: "OTP verileri yüklenemedi. Lütfen daha sonra tekrar deneyin.",
67
- otpHeading: "OTP Girin",
68
- resendOtp: "OTP'yi Yeniden Gönder",
69
- submit: "Gönder",
70
- close: "Kapat",
71
- invalidOtp: "Gönderdiğiniz kod geçerli değil. Lütfen tekrar deneyin.",
72
- accountBlocked: "OTP için çok fazla deneme yapıldı. Hesabınız bir saat süreyle engellenmiştir.",
73
- submissionError: "Bir şeyler ters gitti. Lütfen tekrar deneyin.",
74
- otpExpiredMessage: "Doğrulama kodunun süresi doldu, devam etmek için lütfen yeni bir kod isteyin.",
75
- timeRemaining: "Kodun süresi doluyor:",
76
- selectChannelTitle: "Select verification method",
77
- selectChannelMessage: "Choose how you would like to receive your verification code",
78
- channelSMS: "SMS kodu",
79
- channelEmail: "E-posta kodu",
80
- sendCode: "Kodu gönder",
81
- waitSeconds: "Tekrar göndermeden önce lütfen bekleyin:"
82
- }
83
- };
84
- function gt(n) {
85
- it(n, "svelte-gpy3mu", '*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}.RadioIndicator{width:20px;height:20px;border-radius:50%;border:2px solid var(--emw--color-typography, #fff);position:relative;flex-shrink:0;margin-right:8px;transition:all 0.2s ease;opacity:0.7}.RadioIndicator.checked::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:10px;height:10px;border-radius:50%;opacity:1;background:var(--emw--color-primary, #fff)}.RadioIndicator.checked{border:2px solid var(--emw--color-primary, #fff)}.ModalCloseIcon{padding:0px;position:absolute;right:0;top:0;margin:15px 20px;z-index:20;transition:all 0.3s ease}.ModalCloseIcon svg{width:11px;height:11px;fill:var(--emw--color-primary, red);cursor:pointer}.ModalCloseIcon:hover{transform:rotate(90deg)}.OtpContent{width:100%;display:flex;flex-direction:column;gap:var(--emw--spacing-large, 20px)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.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],.OtpButton.disabled{filter:saturate(50%);opacity:0.5;cursor:not-allowed;pointer-events:none}.OtpButton:hover:not([disabled]):not(.disabled){box-shadow:inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2);background-color:var(--emw--color-hover, #dbac03)}@container (max-width: 500px){.OtpDescription{font-size:var(--emw--font-size-small, 12px)}.OtpDescription .Title{font-size:var(--emw--font-size-big, 20px)}}.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-medium, 16px);font-weight:var(--emw--font-weight-medium, 600)}.OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px;align-items:center}.OtpError h2{margin:0;color:var(--emw--color-typography, #fff)}.OtpError p{color:var(--emw--color-typography, #fff);text-align:center;font-size:var(--emw--font-size-small, 12px)}.OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.ChannelSelection{display:flex;flex-direction:row;justify-content:space-between}.ChannelCheckbox{display:flex;align-items:center;padding:var(--emw--spacing-medium, 16px);cursor:pointer;transition:all 0.2s ease}.ChannelCheckbox input[type=radio]{display:none}.ChannelCheckbox .ChannelContent{display:flex;align-items:center;gap:3px;width:100%;color:var(--emw--color-typography, #fff);font-size:var(--emw--font-size-medium, 16px);font-weight:var(--emw--font-weight-medium, 500)}.ChannelCheckbox .ChannelContent svg{flex-shrink:0;opacity:0.7;width:20px;height:20px}.ChannelCheckbox .ChannelContent span{text-transform:uppercase}.ChannelCheckbox.selected .ChannelContent{color:var(--emw--color-primary, #000000)}.ChannelCheckbox.selected .ChannelContent svg{stroke:var(--emw--color-primary, #000000);opacity:1}.ChannelCheckbox:hover:not(.selected){color:var(--emw--color-active, #fff)}.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}.OtpNoticeMessage{color:var(--emw--color-primary, #f9c408);font-weight:bold}.LastWarningMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;display:flex;justify-content:center;align-items:center;padding:20px 0}.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}@container (max-width: 500px){.OtpContent{padding:var(--emw--spacing-small, 10px)}.OtpField input{width:40px;font-size:28px;margin:4px}}');
86
- }
87
- function xe(n, e, t) {
88
- const l = n.slice();
89
- return l[67] = e[t], l[68] = e, l[69] = t, l;
90
- }
91
- function wt(n) {
92
- let e, t, l = (
93
- /*$_*/
94
- n[17]("otpTitle") + ""
95
- ), s, f, u, r, a, d, g, w, C, L, _, m, y, k, A, V, F, ne, x = (
96
- /*$_*/
97
- n[17]("channelSMS") + ""
98
- ), le, ie, W, J, be, M, j, U, Y, P, Z, X, Q, q, se = (
99
- /*$_*/
100
- n[17]("channelEmail") + ""
101
- ), ce, pe, ue, de, oe, _e, ye;
102
- function ve(p, O) {
103
- return (
104
- /*showResendOtp*/
105
- p[9] ? vt : (
106
- /*showOtpInput*/
107
- p[12] ? _t : yt
108
- )
109
- );
110
- }
111
- let fe = ve(n), K = fe(n), H = (
112
- /*selectedChannel*/
113
- n[0] && De(n)
114
- );
115
- function me(p, O) {
116
- if (
117
- /*isLoading*/
118
- p[3] && /*showOtpInput*/
119
- p[12]
120
- )
121
- return Mt;
122
- if (
123
- /*showOtpInput*/
124
- p[12] && /*config*/
125
- p[4]
126
- )
127
- return St;
128
- }
129
- let $ = me(n), N = $ && $(n);
130
- function he(p, O) {
131
- if (
132
- /*showResendOtp*/
133
- p[9]
134
- )
135
- return Tt;
136
- if (
137
- /*showOtpInput*/
138
- p[12] && /*config*/
139
- p[4]
140
- )
141
- return Lt;
142
- }
143
- let re = he(n), D = re && re(n);
144
- return {
145
- c() {
146
- e = v("div"), t = v("div"), s = T(l), f = I(), K.c(), u = I(), r = v("div"), a = v("label"), d = v("div"), g = I(), w = v("input"), L = I(), _ = v("div"), m = G("svg"), y = G("path"), k = G("circle"), A = G("circle"), V = G("circle"), F = I(), ne = v("span"), le = T(x), ie = I(), W = v("label"), J = v("div"), be = I(), M = v("input"), U = I(), Y = v("div"), P = G("svg"), Z = G("rect"), X = G("path"), Q = I(), q = v("span"), ce = T(se), pe = I(), H && H.c(), ue = I(), N && N.c(), de = I(), oe = v("div"), D && D.c(), i(t, "class", "Title"), i(e, "class", "OtpDescription"), i(d, "class", "RadioIndicator"), ee(
147
- d,
148
- "checked",
149
- /*selectedChannel*/
150
- n[0] === /*channels*/
151
- n[18].SMS
152
- ), i(w, "type", "radio"), i(w, "name", "channel"), w.value = /*channels*/
153
- n[18].SMS, w.checked = C = /*selectedChannel*/
154
- n[0] === /*channels*/
155
- n[18].SMS, i(y, "d", "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"), i(k, "cx", "9"), i(k, "cy", "11"), i(k, "r", "0.5"), i(k, "fill", "currentColor"), i(A, "cx", "12"), i(A, "cy", "11"), i(A, "r", "0.5"), i(A, "fill", "currentColor"), i(V, "cx", "15"), i(V, "cy", "11"), i(V, "r", "0.5"), i(V, "fill", "currentColor"), i(m, "xmlns", "http://www.w3.org/2000/svg"), i(m, "width", "24"), i(m, "height", "24"), i(m, "viewBox", "0 0 24 24"), i(m, "fill", "none"), i(m, "stroke", "currentColor"), i(m, "stroke-width", "2"), i(m, "stroke-linecap", "round"), i(m, "stroke-linejoin", "round"), i(_, "class", "ChannelContent"), i(a, "class", "ChannelCheckbox"), ee(
156
- a,
157
- "selected",
158
- /*selectedChannel*/
159
- n[0] === /*channels*/
160
- n[18].SMS
161
- ), i(J, "class", "RadioIndicator"), ee(
162
- J,
163
- "checked",
164
- /*selectedChannel*/
165
- n[0] === /*channels*/
166
- n[18].EMAIL
167
- ), i(M, "type", "radio"), i(M, "name", "channel"), M.value = /*channels*/
168
- n[18].EMAIL, M.checked = j = /*selectedChannel*/
169
- n[0] === /*channels*/
170
- n[18].EMAIL, i(Z, "x", "2"), i(Z, "y", "4"), i(Z, "width", "20"), i(Z, "height", "16"), i(Z, "rx", "2"), i(X, "d", "m2 7 10 6 10-6"), i(P, "xmlns", "http://www.w3.org/2000/svg"), i(P, "width", "24"), i(P, "height", "24"), i(P, "viewBox", "0 0 24 24"), i(P, "fill", "none"), i(P, "stroke", "currentColor"), i(P, "stroke-width", "2"), i(P, "stroke-linecap", "round"), i(P, "stroke-linejoin", "round"), i(Y, "class", "ChannelContent"), i(W, "class", "ChannelCheckbox"), ee(
171
- W,
172
- "selected",
173
- /*selectedChannel*/
174
- n[0] === /*channels*/
175
- n[18].EMAIL
176
- ), i(r, "class", "ChannelSelection"), i(oe, "class", "OtpActionButtons");
177
- },
178
- m(p, O) {
179
- S(p, e, O), c(e, t), c(t, s), c(e, f), K.m(e, null), S(p, u, O), S(p, r, O), c(r, a), c(a, d), c(a, g), c(a, w), c(a, L), c(a, _), c(_, m), c(m, y), c(m, k), c(m, A), c(m, V), c(_, F), c(_, ne), c(ne, le), c(r, ie), c(r, W), c(W, J), c(W, be), c(W, M), c(W, U), c(W, Y), c(Y, P), c(P, Z), c(P, X), c(Y, Q), c(Y, q), c(q, ce), S(p, pe, O), H && H.m(p, O), S(p, ue, O), N && N.m(p, O), S(p, de, O), S(p, oe, O), D && D.m(oe, null), _e || (ye = [
180
- te(
181
- w,
182
- "change",
183
- /*change_handler*/
184
- n[37]
185
- ),
186
- te(
187
- M,
188
- "change",
189
- /*change_handler_1*/
190
- n[38]
191
- )
192
- ], _e = !0);
193
- },
194
- p(p, O) {
195
- O[0] & /*$_*/
196
- 131072 && l !== (l = /*$_*/
197
- p[17]("otpTitle") + "") && z(s, l), fe === (fe = ve(p)) && K ? K.p(p, O) : (K.d(1), K = fe(p), K && (K.c(), K.m(e, null))), O[0] & /*selectedChannel, channels*/
198
- 262145 && ee(
199
- d,
200
- "checked",
201
- /*selectedChannel*/
202
- p[0] === /*channels*/
203
- p[18].SMS
204
- ), O[0] & /*selectedChannel*/
205
- 1 && C !== (C = /*selectedChannel*/
206
- p[0] === /*channels*/
207
- p[18].SMS) && (w.checked = C), O[0] & /*$_*/
208
- 131072 && x !== (x = /*$_*/
209
- p[17]("channelSMS") + "") && z(le, x), O[0] & /*selectedChannel, channels*/
210
- 262145 && ee(
211
- a,
212
- "selected",
213
- /*selectedChannel*/
214
- p[0] === /*channels*/
215
- p[18].SMS
216
- ), O[0] & /*selectedChannel, channels*/
217
- 262145 && ee(
218
- J,
219
- "checked",
220
- /*selectedChannel*/
221
- p[0] === /*channels*/
222
- p[18].EMAIL
223
- ), O[0] & /*selectedChannel*/
224
- 1 && j !== (j = /*selectedChannel*/
225
- p[0] === /*channels*/
226
- p[18].EMAIL) && (M.checked = j), O[0] & /*$_*/
227
- 131072 && se !== (se = /*$_*/
228
- p[17]("channelEmail") + "") && z(ce, se), O[0] & /*selectedChannel, channels*/
229
- 262145 && ee(
230
- W,
231
- "selected",
232
- /*selectedChannel*/
233
- p[0] === /*channels*/
234
- p[18].EMAIL
235
- ), /*selectedChannel*/
236
- p[0] ? H ? H.p(p, O) : (H = De(p), H.c(), H.m(ue.parentNode, ue)) : H && (H.d(1), H = null), $ === ($ = me(p)) && N ? N.p(p, O) : (N && N.d(1), N = $ && $(p), N && (N.c(), N.m(de.parentNode, de))), re === (re = he(p)) && D ? D.p(p, O) : (D && D.d(1), D = re && re(p), D && (D.c(), D.m(oe, null)));
237
- },
238
- d(p) {
239
- p && (E(e), E(u), E(r), E(pe), E(ue), E(de), E(oe)), K.d(), H && H.d(p), N && N.d(p), D && D.d(), _e = !1, je(ye);
240
- }
241
- };
242
- }
243
- function bt(n) {
244
- let e, t, l, s, f, u, r = (
245
- /*$_*/
246
- n[17]("errorHeader") + ""
247
- ), a, d, g, w, C, L, _ = (
248
- /*$_*/
249
- n[17]("close") + ""
250
- ), m, y, k;
251
- return {
252
- c() {
253
- e = v("div"), t = v("div"), l = G("svg"), s = G("path"), f = I(), u = v("h2"), a = T(r), d = I(), g = v("p"), w = T(
254
- /*errorMessage*/
255
- n[8]
256
- ), C = I(), L = v("button"), m = T(_), i(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"), i(l, "xmlns", "http://www.w3.org/2000/svg"), i(l, "viewBox", "0 0 512 512"), i(t, "class", "OtpErrorHeader"), i(L, "class", "OtpButton error"), i(e, "class", "OtpError");
257
- },
258
- m(A, V) {
259
- S(A, e, V), c(e, t), c(t, l), c(l, s), c(t, f), c(t, u), c(u, a), c(e, d), c(e, g), c(g, w), c(e, C), c(e, L), c(L, m), y || (k = te(
260
- L,
261
- "click",
262
- /*manualClosePopup*/
263
- n[26]
264
- ), y = !0);
265
- },
266
- p(A, V) {
267
- V[0] & /*$_*/
268
- 131072 && r !== (r = /*$_*/
269
- A[17]("errorHeader") + "") && z(a, r), V[0] & /*errorMessage*/
270
- 256 && z(
271
- w,
272
- /*errorMessage*/
273
- A[8]
274
- ), V[0] & /*$_*/
275
- 131072 && _ !== (_ = /*$_*/
276
- A[17]("close") + "") && z(m, _);
277
- },
278
- d(A) {
279
- A && E(e), y = !1, k();
280
- }
281
- };
282
- }
283
- function _t(n) {
284
- let e, t, l, s;
285
- function f(d, g) {
286
- return (
287
- /*isLastWarning*/
288
- d[10] ? Ct : kt
289
- );
290
- }
291
- let u = f(n), r = u(n), a = (
292
- /*hasErrors*/
293
- n[6] && Pe(n)
294
- );
295
- return {
296
- c() {
297
- e = v("p"), r.c(), l = I(), a && a.c(), s = at(), i(e, "class", t = /*isLastWarning*/
298
- n[10] ? "LastWarningMessage" : "");
299
- },
300
- m(d, g) {
301
- S(d, e, g), r.m(e, null), S(d, l, g), a && a.m(d, g), S(d, s, g);
302
- },
303
- p(d, g) {
304
- u === (u = f(d)) && r ? r.p(d, g) : (r.d(1), r = u(d), r && (r.c(), r.m(e, null))), g[0] & /*isLastWarning*/
305
- 1024 && t !== (t = /*isLastWarning*/
306
- d[10] ? "LastWarningMessage" : "") && i(e, "class", t), /*hasErrors*/
307
- d[6] ? a ? a.p(d, g) : (a = Pe(d), a.c(), a.m(s.parentNode, s)) : a && (a.d(1), a = null);
308
- },
309
- d(d) {
310
- d && (E(e), E(l), E(s)), r.d(), a && a.d(d);
311
- }
312
- };
313
- }
314
- function yt(n) {
315
- let e, t = (
316
- /*$_*/
317
- (n[17]("selectChannelMessage") || "Selectează metoda prin care vrei să primești codul OTP") + ""
318
- ), l;
319
- return {
320
- c() {
321
- e = v("p"), l = T(t);
322
- },
323
- m(s, f) {
324
- S(s, e, f), c(e, l);
325
- },
326
- p(s, f) {
327
- f[0] & /*$_*/
328
- 131072 && t !== (t = /*$_*/
329
- (s[17]("selectChannelMessage") || "Selectează metoda prin care vrei să primești codul OTP") + "") && z(l, t);
330
- },
331
- d(s) {
332
- s && E(e);
333
- }
334
- };
335
- }
336
- function vt(n) {
337
- let e, t = (
338
- /*$_*/
339
- n[17]("otpExpiredMessage") + ""
340
- ), l;
341
- return {
342
- c() {
343
- e = v("p"), l = T(t), i(e, "class", "OtpNoticeMessage"), i(e, "role", "alert");
344
- },
345
- m(s, f) {
346
- S(s, e, f), c(e, l);
347
- },
348
- p(s, f) {
349
- f[0] & /*$_*/
350
- 131072 && t !== (t = /*$_*/
351
- s[17]("otpExpiredMessage") + "") && z(l, t);
352
- },
353
- d(s) {
354
- s && E(e);
355
- }
356
- };
357
- }
358
- function kt(n) {
359
- let e = (
360
- /*$_*/
361
- n[17]("popupMessage") + ""
362
- ), t;
363
- return {
364
- c() {
365
- t = T(e);
366
- },
367
- m(l, s) {
368
- S(l, t, s);
369
- },
370
- p(l, s) {
371
- s[0] & /*$_*/
372
- 131072 && e !== (e = /*$_*/
373
- l[17]("popupMessage") + "") && z(t, e);
374
- },
375
- d(l) {
376
- l && E(t);
377
- }
378
- };
379
- }
380
- function Ct(n) {
381
- let e = (
382
- /*$_*/
383
- n[17]("popupMessageLastWarning") + ""
384
- ), t;
385
- return {
386
- c() {
387
- t = T(e);
388
- },
389
- m(l, s) {
390
- S(l, t, s);
391
- },
392
- p(l, s) {
393
- s[0] & /*$_*/
394
- 131072 && e !== (e = /*$_*/
395
- l[17]("popupMessageLastWarning") + "") && z(t, e);
396
- },
397
- d(l) {
398
- l && E(t);
399
- }
400
- };
401
- }
402
- function Pe(n) {
403
- let e, t;
404
- return {
405
- c() {
406
- e = v("p"), t = T(
407
- /*errorMessage*/
408
- n[8]
409
- ), i(e, "class", "OtpErrorMessage"), i(e, "role", "alert");
410
- },
411
- m(l, s) {
412
- S(l, e, s), c(e, t);
413
- },
414
- p(l, s) {
415
- s[0] & /*errorMessage*/
416
- 256 && z(
417
- t,
418
- /*errorMessage*/
419
- l[8]
420
- );
421
- },
422
- d(l) {
423
- l && E(e);
424
- }
425
- };
426
- }
427
- function De(n) {
428
- let e, t, l, s;
429
- function f(a, d) {
430
- return (
431
- /*currentChannelTimer*/
432
- a[15] > 0 ? Et : Ot
433
- );
434
- }
435
- let u = f(n), r = u(n);
436
- return {
437
- c() {
438
- e = v("button"), r.c(), i(e, "class", "OtpButton"), e.disabled = t = !/*canSubmitChannel*/
439
- n[16], ee(e, "disabled", !/*canSubmitChannel*/
440
- n[16]);
441
- },
442
- m(a, d) {
443
- S(a, e, d), r.m(e, null), l || (s = te(
444
- e,
445
- "click",
446
- /*handleChannelSubmit*/
447
- n[20]
448
- ), l = !0);
449
- },
450
- p(a, d) {
451
- u === (u = f(a)) && r ? r.p(a, d) : (r.d(1), r = u(a), r && (r.c(), r.m(e, null))), d[0] & /*canSubmitChannel*/
452
- 65536 && t !== (t = !/*canSubmitChannel*/
453
- a[16]) && (e.disabled = t), d[0] & /*canSubmitChannel*/
454
- 65536 && ee(e, "disabled", !/*canSubmitChannel*/
455
- a[16]);
456
- },
457
- d(a) {
458
- a && E(e), r.d(), l = !1, s();
459
- }
460
- };
461
- }
462
- function Ot(n) {
463
- let e = (
464
- /*$_*/
465
- n[17]("sendCode") + ""
466
- ), t;
467
- return {
468
- c() {
469
- t = T(e);
470
- },
471
- m(l, s) {
472
- S(l, t, s);
473
- },
474
- p(l, s) {
475
- s[0] & /*$_*/
476
- 131072 && e !== (e = /*$_*/
477
- l[17]("sendCode") + "") && z(t, e);
478
- },
479
- d(l) {
480
- l && E(t);
481
- }
482
- };
483
- }
484
- function Et(n) {
485
- let e = (
486
- /*$_*/
487
- n[17]("waitSeconds") + ""
488
- ), t, l, s, f;
489
- return {
490
- c() {
491
- t = T(e), l = T(" ("), s = T(
492
- /*currentChannelTimer*/
493
- n[15]
494
- ), f = T("s)");
495
- },
496
- m(u, r) {
497
- S(u, t, r), S(u, l, r), S(u, s, r), S(u, f, r);
498
- },
499
- p(u, r) {
500
- r[0] & /*$_*/
501
- 131072 && e !== (e = /*$_*/
502
- u[17]("waitSeconds") + "") && z(t, e), r[0] & /*currentChannelTimer*/
503
- 32768 && z(
504
- s,
505
- /*currentChannelTimer*/
506
- u[15]
507
- );
508
- },
509
- d(u) {
510
- u && (E(t), E(l), E(s), E(f));
511
- }
512
- };
513
- }
514
- function St(n) {
515
- let e, t, l = (
516
- /*$_*/
517
- n[17]("timeRemaining") + ""
518
- ), s, f, u = (
519
- /*formatTime*/
520
- n[21](
521
- /*timeLeft*/
522
- n[5]
523
- ) + ""
524
- ), r, a, d = (
525
- /*$_*/
526
- n[17]("minutes") + ""
527
- ), g, w, C, L = Ie(
528
- /*otp*/
529
- n[2]
530
- ), _ = [];
531
- for (let m = 0; m < L.length; m += 1)
532
- _[m] = Be(xe(n, L, m));
533
- return {
534
- c() {
535
- e = v("div"), t = v("div"), s = T(l), f = I(), r = T(u), a = I(), g = T(d), w = I(), C = v("div");
536
- for (let m = 0; m < _.length; m += 1)
537
- _[m].c();
538
- i(t, "class", "OtpTimer"), i(C, "class", "OtpField"), i(e, "class", "OtpFieldWrapper");
539
- },
540
- m(m, y) {
541
- S(m, e, y), c(e, t), c(t, s), c(t, f), c(t, r), c(t, a), c(t, g), c(e, w), c(e, C);
542
- for (let k = 0; k < _.length; k += 1)
543
- _[k] && _[k].m(C, null);
544
- },
545
- p(m, y) {
546
- if (y[0] & /*$_*/
547
- 131072 && l !== (l = /*$_*/
548
- m[17]("timeRemaining") + "") && z(s, l), y[0] & /*timeLeft*/
549
- 32 && u !== (u = /*formatTime*/
550
- m[21](
551
- /*timeLeft*/
552
- m[5]
553
- ) + "") && z(r, u), y[0] & /*$_*/
554
- 131072 && d !== (d = /*$_*/
555
- m[17]("minutes") + "") && z(g, d), y[0] & /*config, otp, inputDisabled, otpInputs, handleOtpInput, handleKeyDown, handleOnPasteOtp*/
556
- 29378580) {
557
- L = Ie(
558
- /*otp*/
559
- m[2]
560
- );
561
- let k;
562
- for (k = 0; k < L.length; k += 1) {
563
- const A = xe(m, L, k);
564
- _[k] ? _[k].p(A, y) : (_[k] = Be(A), _[k].c(), _[k].m(C, null));
565
- }
566
- for (; k < _.length; k += 1)
567
- _[k].d(1);
568
- _.length = L.length;
569
- }
570
- },
571
- d(m) {
572
- m && E(e), ct(_, m);
573
- }
574
- };
575
- }
576
- function Mt(n) {
577
- let e;
578
- return {
579
- c() {
580
- e = v("div"), e.innerHTML = '<span class="OtpLoader"></span>', i(e, "class", "OtpLoaderContainer");
581
- },
582
- m(t, l) {
583
- S(t, e, l);
584
- },
585
- p: Ce,
586
- d(t) {
587
- t && E(e);
588
- }
589
- };
590
- }
591
- function Be(n) {
592
- let e, t, l, s = (
593
- /*index*/
594
- n[69]
595
- ), f, u;
596
- const r = () => (
597
- /*input_binding*/
598
- n[39](e, s)
599
- ), a = () => (
600
- /*input_binding*/
601
- n[39](null, s)
602
- );
603
- function d(...w) {
604
- return (
605
- /*input_handler*/
606
- n[40](
607
- /*index*/
608
- n[69],
609
- ...w
610
- )
611
- );
612
- }
613
- function g(...w) {
614
- return (
615
- /*keydown_handler*/
616
- n[41](
617
- /*index*/
618
- n[69],
619
- ...w
620
- )
621
- );
622
- }
623
- return {
624
- c() {
625
- e = v("input"), i(e, "id", `otp-input-${/*index*/
626
- n[69]}`), i(e, "type", "text"), i(e, "class", t = `otp-box ${/*config*/
627
- n[4].inputLength % 2 === 0 && /*index*/
628
- n[69] === /*config*/
629
- n[4].inputLength / 2 - 1 ? "space" : ""}`), i(e, "maxlength", 1), e.value = l = /*char*/
630
- n[67], i(e, "inputmode", "numeric"), e.disabled = /*inputDisabled*/
631
- n[11], i(e, "autocomplete", "off");
632
- },
633
- m(w, C) {
634
- S(w, e, C), r(), f || (u = [
635
- te(e, "input", d),
636
- te(e, "keydown", g),
637
- te(
638
- e,
639
- "paste",
640
- /*handleOnPasteOtp*/
641
- n[22]
642
- )
643
- ], f = !0);
644
- },
645
- p(w, C) {
646
- n = w, C[0] & /*config*/
647
- 16 && t !== (t = `otp-box ${/*config*/
648
- n[4].inputLength % 2 === 0 && /*index*/
649
- n[69] === /*config*/
650
- n[4].inputLength / 2 - 1 ? "space" : ""}`) && i(e, "class", t), C[0] & /*otp*/
651
- 4 && l !== (l = /*char*/
652
- n[67]) && e.value !== l && (e.value = l), C[0] & /*inputDisabled*/
653
- 2048 && (e.disabled = /*inputDisabled*/
654
- n[11]), s !== /*index*/
655
- n[69] && (a(), s = /*index*/
656
- n[69], r());
657
- },
658
- d(w) {
659
- w && E(e), a(), f = !1, je(u);
660
- }
661
- };
662
- }
663
- function Lt(n) {
664
- let e, t = (
665
- /*$_*/
666
- n[17]("submit") + ""
667
- ), l, s, f, u;
668
- return {
669
- c() {
670
- e = v("button"), l = T(t), i(e, "class", "OtpButton"), e.disabled = s = /*otp*/
671
- n[2].join("").length !== /*config*/
672
- n[4].inputLength || /*isSubmitting*/
673
- n[13];
674
- },
675
- m(r, a) {
676
- S(r, e, a), c(e, l), f || (u = te(
677
- e,
678
- "click",
679
- /*submitOtp*/
680
- n[27]
681
- ), f = !0);
682
- },
683
- p(r, a) {
684
- a[0] & /*$_*/
685
- 131072 && t !== (t = /*$_*/
686
- r[17]("submit") + "") && z(l, t), a[0] & /*otp, config, isSubmitting*/
687
- 8212 && s !== (s = /*otp*/
688
- r[2].join("").length !== /*config*/
689
- r[4].inputLength || /*isSubmitting*/
690
- r[13]) && (e.disabled = s);
691
- },
692
- d(r) {
693
- r && E(e), f = !1, u();
694
- }
695
- };
696
- }
697
- function Tt(n) {
698
- let e, t = (
699
- /*$_*/
700
- n[17]("resendOtp") + ""
701
- ), l, s, f;
702
- return {
703
- c() {
704
- e = v("button"), l = T(t), i(e, "class", "OtpButton");
705
- },
706
- m(u, r) {
707
- S(u, e, r), c(e, l), s || (f = te(
708
- e,
709
- "click",
710
- /*handleResendOtp*/
711
- n[25]
712
- ), s = !0);
713
- },
714
- p(u, r) {
715
- r[0] & /*$_*/
716
- 131072 && t !== (t = /*$_*/
717
- u[17]("resendOtp") + "") && z(l, t);
718
- },
719
- d(u) {
720
- u && E(e), s = !1, f();
721
- }
722
- };
723
- }
724
- function At(n) {
725
- let e, t, l, s, f, u, r;
726
- function a(w, C) {
727
- return (
728
- /*hasConfigErrors*/
729
- w[7] ? bt : wt
730
- );
731
- }
732
- let d = a(n), g = d(n);
733
- return {
734
- c() {
735
- e = v("div"), t = v("div"), l = G("svg"), s = G("path"), f = I(), g.c(), i(s, "d", "M12.7711 0.229435C13.0582 0.517619 13.0755 0.973729 12.8215 1.28141L12.7711 1.33721L7.60685 6.50068L12.7711 11.6641C12.9128 11.8066 12.9944 11.998 12.999 12.1988C13.0035 12.3997 12.9308 12.5946 12.7957 12.7433C12.6606 12.892 12.4735 12.9832 12.2731 12.9979C12.0728 13.0126 11.8744 12.9497 11.7191 12.8223L11.6633 12.7719L6.49958 7.60791L1.3359 12.7719C1.19349 12.9136 1.00207 12.9952 0.801203 12.9998C0.60034 13.0044 0.405398 12.9316 0.256676 12.7965C0.107955 12.6614 0.0168256 12.4744 0.00212786 12.274C-0.0125699 12.0736 0.0502877 11.8753 0.177706 11.7199L0.228086 11.6641L5.3923 6.50068L0.228086 1.33721C0.0863637 1.1948 0.00478102 1.00338 0.000203544 0.802529C-0.00437393 0.601674 0.0684038 0.40674 0.203491 0.258024C0.338579 0.109308 0.525647 0.0181829 0.726024 0.00348576C0.9264 -0.0112114 1.12476 0.0516437 1.28011 0.179057L1.3359 0.229435L6.49958 5.39345L11.6633 0.229435C11.736 0.156695 11.8223 0.0989949 11.9174 0.0596283C12.0124 0.0202617 12.1143 0 12.2172 0C12.32 0 12.4219 0.0202617 12.5169 0.0596283C12.612 0.0989949 12.6983 0.156695 12.7711 0.229435Z"), i(l, "xmlns", "http://www.w3.org/2000/svg"), i(l, "viewBox", "0 0 13 13"), i(l, "fill", "none"), i(l, "class", "CloseButton"), i(t, "class", "ModalCloseIcon"), i(e, "class", "OtpContent");
736
- },
737
- m(w, C) {
738
- S(w, e, C), c(e, t), c(t, l), c(l, s), c(e, f), g.m(e, null), n[42](e), u || (r = te(
739
- l,
740
- "click",
741
- /*manualClosePopup*/
742
- n[26]
743
- ), u = !0);
744
- },
745
- p(w, C) {
746
- d === (d = a(w)) && g ? g.p(w, C) : (g.d(1), g = d(w), g && (g.c(), g.m(e, null)));
747
- },
748
- i: Ce,
749
- o: Ce,
750
- d(w) {
751
- w && E(e), g.d(), n[42](null), u = !1, r();
752
- }
753
- };
754
- }
755
- function It(n, e, t) {
756
- let l, s, f;
757
- st(n, mt, (o) => t(17, f = o));
758
- let { clientstyling: u = "" } = e, { clientstylingurl: r = "" } = e, { mbsource: a } = e, { lang: d = "en" } = e, { endpoint: g } = e, { session: w } = e, { translationurl: C } = e, { templateid: L } = e, _ = [], m = !0, y = null, k = 0, A = "", V = "", F = !1, ne = !1, x = "", le = "", ie = "", W = !1, J = !1, be = !1, M = "", j = {}, U = null, Y = !1, P = !1, Z = "", X, Q = [], q = null, se = 0;
759
- const ce = { SMS: "sms", EMAIL: "email" }, pe = {
760
- MAX_ATTEMPTS_EXCEEDED: "gm.twofa.token_max_attempts_exceeded",
761
- INTERNAL_SERVER_ERROR: "gm.multifactorauthentication.internal_server_error",
762
- MAX_INVALIDATE: "gm.multifactorauthentication.challenge_internal_server_error"
763
- };
764
- Object.keys(ze).forEach((o) => {
765
- Re(o, ze[o]);
766
- });
767
- const ue = () => {
768
- ht(d);
769
- }, de = () => {
770
- fetch(C).then((o) => o.json()).then((o) => {
771
- Object.keys(o).forEach((h) => {
772
- Re(h, o[h]);
773
- });
774
- }).catch((o) => {
775
- console.log(o);
776
- });
777
- }, oe = (o) => we(this, null, function* () {
778
- var h;
779
- if ((h = o.detail) != null && h["x-step-up-required"]) {
780
- if (t(7, ne = !1), t(6, F = !1), t(8, x = ""), le = o.detail["x-step-up-token"], ie = o.detail.flow, !le || !ie) {
781
- t(3, m = !1), t(7, ne = !0), t(8, x = f("configError"));
782
- return;
783
- }
784
- t(12, Y = !1), t(3, m = !1);
785
- }
786
- }), _e = () => {
787
- q && (clearInterval(q), q = null), U && (clearInterval(U), U = null), t(6, F = !1), t(7, ne = !1), t(8, x = ""), t(10, J = !1), t(2, _ = []), t(4, y = null), t(3, m = !0), t(0, M = ""), t(12, Y = !1), t(36, j = {});
788
- }, ye = () => {
789
- _e();
790
- }, ve = () => new Promise((o, h) => {
791
- const b = new URL(`${g}/api/pam/v1/mfa/challenge/${le}`), R = new Headers();
792
- R.append("accept", "application/json"), R.append("Content-Type", "application/json"), R.append("X-SessionId", `${w}`);
793
- const ge = {
794
- method: "PATCH",
795
- headers: R,
796
- body: JSON.stringify({
797
- channel: M,
798
- templateId: L
799
- })
800
- };
801
- fetch(b, ge).then((Se) => Se.json()).then(() => {
802
- me(), $(), o();
803
- }).catch((Se) => {
804
- h();
805
- });
806
- }), fe = () => {
807
- U && clearInterval(U), U = setInterval(
808
- () => {
809
- const o = ke({}, j);
810
- let h = !1;
811
- Object.keys(o).forEach((b) => {
812
- o[b] > 0 && (o[b]--, h = !0);
813
- }), t(36, j = o), !h && U && (clearInterval(U), U = null);
814
- },
815
- 1e3
816
- );
817
- }, K = (o) => {
818
- t(0, M = o);
819
- }, H = () => we(this, null, function* () {
820
- if (!(!M || j[M] && j[M] > 0)) {
821
- t(3, m = !0), L && L.startsWith("2fa-") && t(28, L = `2fa-${M}`);
822
- try {
823
- yield ve(), yield Ee(), t(36, j = Te(ke({}, j), {
824
- [M]: 30
825
- })), fe(), t(12, Y = !0), me(), $();
826
- } catch (o) {
827
- console.error("Error submitting channel:", o), t(6, F = !0), t(8, x = f("submissionError"));
828
- } finally {
829
- t(3, m = !1);
830
- }
831
- }
832
- }), me = () => {
833
- const o = new Date(A), h = new Date(V), b = /* @__PURE__ */ new Date(), R = h.getTime() - b.getTime();
834
- se = o.getTime() - R;
835
- const B = Date.now(), ge = Math.max(0, Math.floor((se - B) / 1e3));
836
- t(5, k = ge);
837
- }, $ = () => {
838
- q && clearInterval(q), q = setInterval(
839
- () => {
840
- const o = Date.now(), h = Math.max(0, Math.floor((se - o) / 1e3));
841
- t(5, k = h), t(11, be = h <= 0), h <= 0 && (clearInterval(q), q = null, t(9, W = !0), t(6, F = !1), t(10, J = !1));
842
- },
843
- 1e3
844
- );
845
- }, N = (o) => {
846
- const h = Math.floor(o / 60), b = o % 60;
847
- return `${h.toString().padStart(2, "0")}:${b.toString().padStart(2, "0")}`;
848
- }, he = (o, h) => {
849
- const b = [..._];
850
- b[o] = h.toUpperCase(), t(2, _ = b), b.join("") !== Z && t(13, P = !1);
851
- }, re = (o) => {
852
- var R, B, ge;
853
- o.preventDefault();
854
- const b = (((B = (R = o.clipboardData) == null ? void 0 : R.getData("text")) == null ? void 0 : B.trim()) || "").slice(0, y.inputLength).split("");
855
- t(2, _ = [...b, ...Array(y.inputLength - b.length).fill("")]), (ge = Q[b.length]) == null || ge.focus(), b.length === y.inputLength && Oe();
856
- }, D = (o, h) => {
857
- const b = o.target, R = b.value;
858
- if (/^[a-z0-9]$/i.test(R)) {
859
- he(h, R);
860
- const B = Q[h + 1];
861
- B == null || B.focus();
862
- }
863
- b.value = "";
864
- }, p = (o, h) => {
865
- const b = o.key, R = o.ctrlKey || o.metaKey;
866
- if (/^[a-z0-9]$/i.test(b)) {
867
- if (R && b.toLowerCase() === "v")
868
- return;
869
- o.preventDefault(), he(h, b);
870
- const B = Q[h + 1];
871
- B == null || B.focus();
872
- } else if (b === "Backspace") {
873
- o.preventDefault(), _[h] !== "" && he(h, "");
874
- const B = Q[h - 1];
875
- B == null || B.focus();
876
- }
877
- }, O = () => {
878
- ie == "stateful" && (ve(), t(9, W = !1));
879
- const o = new CustomEvent("otpResendRequested");
880
- window.dispatchEvent(o);
881
- }, He = (o) => {
882
- window.dispatchEvent(new CustomEvent(
883
- "otpSubmitted",
884
- {
885
- detail: {
886
- code: o,
887
- maxAttempts: y.maxValidationAttempts,
888
- validatedAttempts: y.numberOfValidateAttempts
889
- }
890
- }
891
- ));
892
- }, Ne = (o) => we(this, null, function* () {
893
- const h = new URL(`/api/nwa/api/v1/mfa/challenge/${le}/validate`, g);
894
- h.searchParams.append("input", o);
895
- try {
896
- const b = yield fetch(h.href, { method: "POST" });
897
- if (b.status === 200) {
898
- Ve();
899
- return;
900
- }
901
- const R = yield b.json();
902
- throw new Error(R.message);
903
- } catch (b) {
904
- if (b.message === pe.INTERNAL_SERVER_ERROR) {
905
- if (y.numberOfValidateAttempts === y.maxValidationAttempts - 1) {
906
- window.dispatchEvent(new CustomEvent("otpSetTimeout")), window.postMessage(
907
- {
908
- type: "WidgetNotification",
909
- data: {
910
- type: "error",
911
- message: f("accountBlocked")
912
- }
913
- },
914
- window.location.href
915
- ), window.dispatchEvent(new CustomEvent("manualClosePopup"));
916
- return;
917
- }
918
- t(6, F = !0), t(8, x = f("invalidOtp")), Ee();
919
- return;
920
- }
921
- b.message === pe.MAX_INVALIDATE && (t(6, F = !0), t(8, x = f("invalidOtp"))), console.error("OTP submission failed:", b), t(6, F = !0), t(8, x = f("submissionError"));
922
- } finally {
923
- t(3, m = !1);
924
- }
925
- }), Ve = () => {
926
- window.dispatchEvent(new CustomEvent(
927
- "otpSuccess",
928
- {
929
- detail: {
930
- message: "User successfully authenticated"
931
- }
932
- }
933
- ));
934
- }, We = () => {
935
- window.dispatchEvent(new CustomEvent("manualClosePopup"));
936
- }, Oe = () => we(this, null, function* () {
937
- if (_.join("").length !== y.inputLength) {
938
- t(6, F = !0), t(8, x = f("invalidOtp"));
939
- return;
940
- }
941
- const o = _.join("");
942
- t(13, P = !0), Z = o, t(3, m = !0), t(6, F = !1), t(8, x = ""), ie === "stateless" && He(o), ie === "stateful" && (yield Ne(o));
943
- }), Ee = () => we(this, null, function* () {
944
- if (g)
945
- try {
946
- t(3, m = !0);
947
- const o = new URL(`/api/nwa/api/v1/mfa/challenge/${le}/config`, g), h = yield fetch(o.href), b = yield h.json();
948
- if (h.ok)
949
- t(4, y = b), t(2, _ = Array(y.inputLength).fill("")), t(9, W = !1), A = y.expirationTime, V = y.serverTime, y.numberOfValidateAttempts !== 0 && (t(6, F = !0), t(8, x = f("invalidOtp"))), y.numberOfValidateAttempts === y.maxValidationAttempts - 1 && t(10, J = !0), t(3, m = !1), me(), $();
950
- else if (b && b.details === pe.MAX_ATTEMPTS_EXCEEDED)
951
- window.dispatchEvent(new CustomEvent("manualClosePopup"));
952
- else {
953
- const R = b && b.message || `Failed to load config. Status: ${h.status}`;
954
- throw new Error(R);
955
- }
956
- } catch (o) {
957
- t(3, m = !1), t(7, ne = !0), t(8, x = f("configError")), window.dispatchEvent(new CustomEvent("2fa-loading", { detail: { isLoading: !1 } })), console.error("Error loading 2FA config:", o);
958
- }
959
- });
960
- rt(() => (window.addEventListener("stepUpAuthRequired", oe, !1), window.addEventListener("closePopup", ye, !1), () => {
961
- window.removeEventListener("stepUpAuthRequired", oe), window.removeEventListener("closePopup", ye, !1), q && clearInterval(q), U && clearInterval(U);
962
- }));
963
- const Fe = () => K(ce.SMS), Ue = () => K(ce.EMAIL);
964
- function qe(o, h) {
965
- Ae[o ? "unshift" : "push"](() => {
966
- Q[h] = o, t(14, Q);
967
- });
968
- }
969
- const Ke = (o, h) => D(h, o), Xe = (o, h) => p(h, o);
970
- function Ge(o) {
971
- Ae[o ? "unshift" : "push"](() => {
972
- X = o, t(1, X);
973
- });
974
- }
975
- return n.$$set = (o) => {
976
- "clientstyling" in o && t(29, u = o.clientstyling), "clientstylingurl" in o && t(30, r = o.clientstylingurl), "mbsource" in o && t(31, a = o.mbsource), "lang" in o && t(32, d = o.lang), "endpoint" in o && t(33, g = o.endpoint), "session" in o && t(34, w = o.session), "translationurl" in o && t(35, C = o.translationurl), "templateid" in o && t(28, L = o.templateid);
977
- }, n.$$.update = () => {
978
- n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
979
- 536870914 && u && X && pt(X, u), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
980
- 1073741826 && r && X && ut(X, r), n.$$.dirty[0] & /*customStylingContainer*/
981
- 2 | n.$$.dirty[1] & /*mbsource*/
982
- 1 && a && X && dt(X, `${a}.Style`), n.$$.dirty[1] & /*lang*/
983
- 2 && d && ue(), n.$$.dirty[1] & /*lang, translationurl*/
984
- 18 && d && C && de(), n.$$.dirty[0] & /*selectedChannel*/
985
- 1 | n.$$.dirty[1] & /*channelSubmitTimers*/
986
- 32 && t(16, l = M && (!j[M] || j[M] === 0)), n.$$.dirty[0] & /*selectedChannel*/
987
- 1 | n.$$.dirty[1] & /*channelSubmitTimers*/
988
- 32 && t(15, s = M && j[M] || 0);
989
- }, [
990
- M,
991
- X,
992
- _,
993
- m,
994
- y,
995
- k,
996
- F,
997
- ne,
998
- x,
999
- W,
1000
- J,
1001
- be,
1002
- Y,
1003
- P,
1004
- Q,
1005
- s,
1006
- l,
1007
- f,
1008
- ce,
1009
- K,
1010
- H,
1011
- N,
1012
- re,
1013
- D,
1014
- p,
1015
- O,
1016
- We,
1017
- Oe,
1018
- L,
1019
- u,
1020
- r,
1021
- a,
1022
- d,
1023
- g,
1024
- w,
1025
- C,
1026
- j,
1027
- Fe,
1028
- Ue,
1029
- qe,
1030
- Ke,
1031
- Xe,
1032
- Ge
1033
- ];
1034
- }
1035
- class Rt extends nt {
1036
- constructor(e) {
1037
- super(), lt(
1038
- this,
1039
- e,
1040
- It,
1041
- At,
1042
- ot,
1043
- {
1044
- clientstyling: 29,
1045
- clientstylingurl: 30,
1046
- mbsource: 31,
1047
- lang: 32,
1048
- endpoint: 33,
1049
- session: 34,
1050
- translationurl: 35,
1051
- templateid: 28
1052
- },
1053
- gt,
1054
- [-1, -1, -1]
1055
- );
1056
- }
1057
- get clientstyling() {
1058
- return this.$$.ctx[29];
1059
- }
1060
- set clientstyling(e) {
1061
- this.$$set({ clientstyling: e }), ae();
1062
- }
1063
- get clientstylingurl() {
1064
- return this.$$.ctx[30];
1065
- }
1066
- set clientstylingurl(e) {
1067
- this.$$set({ clientstylingurl: e }), ae();
1068
- }
1069
- get mbsource() {
1070
- return this.$$.ctx[31];
1071
- }
1072
- set mbsource(e) {
1073
- this.$$set({ mbsource: e }), ae();
1074
- }
1075
- get lang() {
1076
- return this.$$.ctx[32];
1077
- }
1078
- set lang(e) {
1079
- this.$$set({ lang: e }), ae();
1080
- }
1081
- get endpoint() {
1082
- return this.$$.ctx[33];
1083
- }
1084
- set endpoint(e) {
1085
- this.$$set({ endpoint: e }), ae();
1086
- }
1087
- get session() {
1088
- return this.$$.ctx[34];
1089
- }
1090
- set session(e) {
1091
- this.$$set({ session: e }), ae();
1092
- }
1093
- get translationurl() {
1094
- return this.$$.ctx[35];
1095
- }
1096
- set translationurl(e) {
1097
- this.$$set({ translationurl: e }), ae();
1098
- }
1099
- get templateid() {
1100
- return this.$$.ctx[28];
1101
- }
1102
- set templateid(e) {
1103
- this.$$set({ templateid: e }), ae();
1104
- }
1105
- }
1106
- ft(Rt, { clientstyling: {}, clientstylingurl: {}, mbsource: {}, lang: {}, endpoint: {}, session: {}, translationurl: {}, templateid: {} }, [], [], !0);
1107
- export {
1108
- Rt as default
1109
- };