@everymatrix/cashier-page-nd 1.69.112 → 1.69.113

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 (63) hide show
  1. package/components/{CashierCarousel-D77wRYrP.js → CashierCarousel-2AotVxhB.js} +164 -160
  2. package/components/CashierCarousel-Bmkxhtnm.cjs +23 -0
  3. package/components/{CashierCarousel-8HuPK_WY.js → CashierCarousel-Cm5G9dJd.js} +171 -167
  4. package/components/{CashierError-Dnk0H5ib.js → CashierError-BkWwLoWt.js} +1 -1
  5. package/components/{CashierError-DFOslnwl.js → CashierError-CO7-9OnG.js} +1 -1
  6. package/components/{CashierError-BJv9Ma-S.cjs → CashierError-Cwm9eY8c.cjs} +1 -1
  7. package/components/{CashierHeader-Dr5EUw02.js → CashierHeader-BOEVulz3.js} +1 -1
  8. package/components/{CashierHeader-C4luE8Rt.js → CashierHeader-CTZl2NGQ.js} +1 -1
  9. package/components/{CashierHeader-D_pRK2ix.cjs → CashierHeader-D40gryOj.cjs} +1 -1
  10. package/components/{CashierIframeRedirect-CiTWXkv1.cjs → CashierIframeRedirect-BKExS9o2.cjs} +1 -1
  11. package/components/{CashierIframeRedirect-DAAmzCia.js → CashierIframeRedirect-CFYNnH6I.js} +3 -3
  12. package/components/{CashierIframeRedirect-C2UPjyTE.js → CashierIframeRedirect-DCJH25FN.js} +3 -3
  13. package/components/{CashierMethodDetails-BcL5uTl0.cjs → CashierMethodDetails-B9yThWJd.cjs} +4 -4
  14. package/components/{CashierMethodDetails-CxzHJpNT.js → CashierMethodDetails-BvIuXYaF.js} +541 -537
  15. package/components/{CashierMethodDetails-C_ILvlcp.js → CashierMethodDetails-CrNz38mk.js} +380 -376
  16. package/components/{CashierMethodsList-D1-4p9Fo.js → CashierMethodsList-BE8SmqSJ.js} +2 -2
  17. package/components/{CashierMethodsList-CdZFk5wU.js → CashierMethodsList-BN2dT78W.js} +2 -2
  18. package/components/{CashierMethodsList-CEZVckvw.cjs → CashierMethodsList-DkmiAf3O.cjs} +1 -1
  19. package/components/CashierModal-BE_2P0FX.js +336 -0
  20. package/components/CashierModal-fcLWE2y3.cjs +1 -0
  21. package/components/CashierModal-whn0174R.js +336 -0
  22. package/components/{CashierNotifications-pGgsWSdS.cjs → CashierNotifications-AE1W98Am.cjs} +1 -1
  23. package/components/{CashierNotifications-C4esiIE1.js → CashierNotifications-DvukNd9l.js} +1 -1
  24. package/components/{CashierNotifications-HbBlW919.js → CashierNotifications-h-sC7KWl.js} +1 -1
  25. package/components/{CashierPage-DeUqFt2E.js → CashierPage-B0SFLnbl.js} +525 -533
  26. package/components/{CashierPage-C13YudFK.js → CashierPage-BqLJ1Za1.js} +521 -529
  27. package/components/CashierPage-DIrw7Ur0.cjs +1 -0
  28. package/components/{CashierReceiptPage-C1pvLNPQ.js → CashierReceiptPage-B1GE254E.js} +2 -2
  29. package/components/{CashierReceiptPage-4EMwW_oF.cjs → CashierReceiptPage-BqrdBMp3.cjs} +1 -1
  30. package/components/{CashierReceiptPage-CzCxraC4.js → CashierReceiptPage-OE7gpibk.js} +2 -2
  31. package/components/{CashierSessionExpirationModal-DC3xtfId.cjs → CashierSessionExpirationModal-BAZy0IPX.cjs} +1 -1
  32. package/components/{CashierSessionExpirationModal-DOAn1f7Q.js → CashierSessionExpirationModal-CNBDiaWq.js} +3 -3
  33. package/components/{CashierSessionExpirationModal-wcX6WNwx.js → CashierSessionExpirationModal-D1lAoUuI.js} +3 -3
  34. package/components/{CashierSpinner-1V0fFMq0.js → CashierSpinner-Dc_apDAz.js} +1 -1
  35. package/components/{CashierSpinner-CPWKt5dY.cjs → CashierSpinner-d2hvjlSo.cjs} +1 -1
  36. package/components/{CashierSpinner-Cx52pbwV.js → CashierSpinner-viEKbLWC.js} +1 -1
  37. package/components/CashierStepUp-BLCOLltJ.js +786 -0
  38. package/components/CashierStepUp-B_HWgCcn.cjs +1 -0
  39. package/components/CashierStepUp-CeqsqBhX.js +814 -0
  40. package/components/{CashierTransactionHistory-DnPl2II3.js → CashierTransactionHistory-Bod4CZm1.js} +5 -5
  41. package/components/{CashierTransactionHistory-CfPdd7w-.cjs → CashierTransactionHistory-CicwRm4P.cjs} +1 -1
  42. package/components/{CashierTransactionHistory-BU9zzhMH.js → CashierTransactionHistory-Ck-a7FJf.js} +5 -5
  43. package/components/{CashierVerifications-DBaC7Yq5.js → CashierVerifications-66ej7eXN.js} +2 -2
  44. package/components/{CashierVerifications-Cl0o1vbf.js → CashierVerifications-Cg5TE5jO.js} +2 -2
  45. package/components/{CashierVerifications-CR73ohxW.cjs → CashierVerifications-D5bq7j2I.cjs} +1 -1
  46. package/components/{TxnStatusIcon-CmFT6r06.cjs → TxnStatusIcon-Bs5XHdDd.cjs} +1 -1
  47. package/components/{TxnStatusIcon-C9c7Vat6.js → TxnStatusIcon-CvoyaPHp.js} +1 -1
  48. package/components/{TxnStatusIcon-CuygBt_X.js → TxnStatusIcon-DB7vrGws.js} +1 -1
  49. package/components/{TxnTypeIcons-BubLyQlU.js → TxnTypeIcons-BVU-p7ld.js} +1 -1
  50. package/components/{TxnTypeIcons-CwWZ2MoD.cjs → TxnTypeIcons-CPhGhukx.cjs} +1 -1
  51. package/components/{TxnTypeIcons-Cpt8i9KB.js → TxnTypeIcons-lKOKRAjP.js} +1 -1
  52. package/es2015/cashier-page.cjs +1 -1
  53. package/es2015/cashier-page.js +1 -1
  54. package/esnext/cashier-page.js +1 -1
  55. package/package.json +1 -1
  56. package/components/CashierCarousel-BkoYZVP7.cjs +0 -23
  57. package/components/CashierModal-CJf0aCey.cjs +0 -1
  58. package/components/CashierModal-Cpef67LD.js +0 -239
  59. package/components/CashierModal-VPZkXwtJ.js +0 -239
  60. package/components/CashierPage-8PVbLGah.cjs +0 -1
  61. package/components/CashierStepUp-BNqTmvl4.js +0 -806
  62. package/components/CashierStepUp-BjwtpF-p.cjs +0 -1
  63. package/components/CashierStepUp-DviaUrBF.js +0 -834
@@ -1,806 +0,0 @@
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
- function ie(n, e) {
3
- xe(n, e);
4
- }
5
- function Fe(n) {
6
- Te.set(n);
7
- }
8
- const oe = {
9
- en: {
10
- otpTitle: "Code verification is required",
11
- popupMessage: "Please enter the security code received on your SMS/email address to perform the update.",
12
- popupMessageLastWarning: "If the next validation attempt is failed, you will be logged out and blocked temporarily.",
13
- minutes: "minutes",
14
- errorHeader: "Error",
15
- configError: "Unable to load OTP data. Please try again later.",
16
- otpHeading: "Enter OTP",
17
- resendOtp: "Resent OTP",
18
- submit: "Submit",
19
- close: "Close",
20
- invalidOtp: "The code you've sent is not valid. Please try again.",
21
- accountBlocked: "Too many attempts for OTP. Your account has been blocked for one hour.",
22
- submissionError: "Something went wrong. Please try again.",
23
- otpExpiredMessage: "Validation code has expired, please request a new one to continue.",
24
- timeRemaining: "Code expires in:"
25
- },
26
- tr: {
27
- otpTitle: "Kod doğrulaması gereklidir",
28
- popupMessage: "Güncellemeyi gerçekleştirmek için SMS/e-posta adresinize gönderilen güvenlik kodunu girin.",
29
- popupMessageLastWarning: "Bir sonraki doğrulama denemesi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.",
30
- minutes: "dakika",
31
- errorHeader: "Hata",
32
- configError: "OTP verileri yüklenemedi. Lütfen daha sonra tekrar deneyin.",
33
- otpHeading: "OTP Girin",
34
- resendOtp: "OTP'yi Yeniden Gönder",
35
- submit: "Gönder",
36
- close: "Kapat",
37
- invalidOtp: "Gönderdiğiniz kod geçerli değil. Lütfen tekrar deneyin.",
38
- accountBlocked: "OTP için çok fazla deneme yapıldı. Hesabınız bir saat süreyle engellenmiştir.",
39
- submissionError: "Bir şeyler ters gitti. Lütfen tekrar deneyin.",
40
- otpExpiredMessage: "Doğrulama kodunun süresi doldu, devam etmek için lütfen yeni bir kod isteyin.",
41
- timeRemaining: "Kodun süresi doluyor:"
42
- }
43
- };
44
- function Ne(n) {
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
- }
47
- function se(n, e, t) {
48
- const i = n.slice();
49
- return i[51] = e[t], i[52] = e, i[53] = t, i;
50
- }
51
- function re(n) {
52
- let e, t;
53
- function i(l, r) {
54
- return (
55
- /*hasConfigErrors*/
56
- l[7] ? Ve : Ue
57
- );
58
- }
59
- let s = i(n), p = s(n);
60
- return {
61
- c() {
62
- e = x("div"), t = x("div"), p.c(), w(t, "class", "OtpPopupContent"), w(e, "class", "OtpPopupOverlay");
63
- },
64
- m(l, r) {
65
- P(l, e, r), b(e, t), p.m(t, null);
66
- },
67
- p(l, r) {
68
- s === (s = i(l)) && p ? p.p(l, r) : (p.d(1), p = s(l), p && (p.c(), p.m(t, null)));
69
- },
70
- d(l) {
71
- l && L(e), p.d();
72
- }
73
- };
74
- }
75
- function Ue(n) {
76
- let e, t, i = (
77
- /*$_*/
78
- n[13]("otpTitle") + ""
79
- ), s, p, l, r, a, f, _, v = (
80
- /*$_*/
81
- n[13]("close") + ""
82
- ), y, k, u;
83
- function g(m, S) {
84
- return (
85
- /*showResendOtp*/
86
- m[9] ? Ke : qe
87
- );
88
- }
89
- let T = g(n), d = T(n);
90
- function E(m, S) {
91
- if (
92
- /*isLoading*/
93
- m[3]
94
- )
95
- return Ze;
96
- if (
97
- /*config*/
98
- m[4]
99
- )
100
- return Ye;
101
- }
102
- let C = E(n), O = C && C(n);
103
- function H(m, S) {
104
- if (
105
- /*showResendOtp*/
106
- m[9]
107
- )
108
- return Qe;
109
- if (
110
- /*config*/
111
- m[4]
112
- )
113
- return Je;
114
- }
115
- let z = H(n), M = z && z(n);
116
- return {
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"), 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
- },
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
- _,
123
- "click",
124
- /*manualClosePopup*/
125
- n[19]
126
- ), k = !0);
127
- },
128
- p(m, S) {
129
- S[0] & /*$_*/
130
- 8192 && i !== (i = /*$_*/
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
- 8192 && v !== (v = /*$_*/
133
- m[13]("close") + "") && R(y, v);
134
- },
135
- d(m) {
136
- m && (L(e), L(l), L(r), L(a)), d.d(), O && O.d(m), M && M.d(), k = !1, u();
137
- }
138
- };
139
- }
140
- function Ve(n) {
141
- let e, t, i, s, p, l, r = (
142
- /*$_*/
143
- n[13]("errorHeader") + ""
144
- ), a, f, _, v, y, k, u = (
145
- /*$_*/
146
- n[13]("close") + ""
147
- ), g, T, d;
148
- return {
149
- c() {
150
- e = x("div"), t = x("div"), i = te("svg"), s = te("path"), p = D(), l = x("h2"), a = A(r), f = D(), _ = x("p"), v = A(
151
- /*errorMessage*/
152
- n[8]
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
- },
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
- k,
158
- "click",
159
- /*manualClosePopup*/
160
- n[19]
161
- ), T = !0);
162
- },
163
- p(E, C) {
164
- C[0] & /*$_*/
165
- 8192 && r !== (r = /*$_*/
166
- E[13]("errorHeader") + "") && R(a, r), C[0] & /*errorMessage*/
167
- 256 && R(
168
- v,
169
- /*errorMessage*/
170
- E[8]
171
- ), C[0] & /*$_*/
172
- 8192 && u !== (u = /*$_*/
173
- E[13]("close") + "") && R(g, u);
174
- },
175
- d(E) {
176
- E && L(e), T = !1, d();
177
- }
178
- };
179
- }
180
- function qe(n) {
181
- let e, t, i, s;
182
- function p(f, _) {
183
- return (
184
- /*isLastWarning*/
185
- f[10] ? Xe : Ge
186
- );
187
- }
188
- let l = p(n), r = l(n), a = (
189
- /*hasErrors*/
190
- n[6] && le(n)
191
- );
192
- return {
193
- c() {
194
- e = x("p"), r.c(), i = D(), a && a.c(), s = Ae(), w(e, "class", t = /*isLastWarning*/
195
- n[10] ? "LastWarningMessage" : "");
196
- },
197
- m(f, _) {
198
- P(f, e, _), r.m(e, null), P(f, i, _), a && a.m(f, _), P(f, s, _);
199
- },
200
- p(f, _) {
201
- l === (l = p(f)) && r ? r.p(f, _) : (r.d(1), r = l(f), r && (r.c(), r.m(e, null))), _[0] & /*isLastWarning*/
202
- 1024 && t !== (t = /*isLastWarning*/
203
- f[10] ? "LastWarningMessage" : "") && w(e, "class", t), /*hasErrors*/
204
- f[6] ? a ? a.p(f, _) : (a = le(f), a.c(), a.m(s.parentNode, s)) : a && (a.d(1), a = null);
205
- },
206
- d(f) {
207
- f && (L(e), L(i), L(s)), r.d(), a && a.d(f);
208
- }
209
- };
210
- }
211
- function Ke(n) {
212
- let e, t = (
213
- /*$_*/
214
- n[13]("otpExpiredMessage") + ""
215
- ), i;
216
- return {
217
- c() {
218
- e = x("p"), i = A(t), w(e, "class", "OtpNoticeMessage"), w(e, "role", "alert");
219
- },
220
- m(s, p) {
221
- P(s, e, p), b(e, i);
222
- },
223
- p(s, p) {
224
- p[0] & /*$_*/
225
- 8192 && t !== (t = /*$_*/
226
- s[13]("otpExpiredMessage") + "") && R(i, t);
227
- },
228
- d(s) {
229
- s && L(e);
230
- }
231
- };
232
- }
233
- function Ge(n) {
234
- let e = (
235
- /*$_*/
236
- n[13]("popupMessage") + ""
237
- ), t;
238
- return {
239
- c() {
240
- t = A(e);
241
- },
242
- m(i, s) {
243
- P(i, t, s);
244
- },
245
- p(i, s) {
246
- s[0] & /*$_*/
247
- 8192 && e !== (e = /*$_*/
248
- i[13]("popupMessage") + "") && R(t, e);
249
- },
250
- d(i) {
251
- i && L(t);
252
- }
253
- };
254
- }
255
- function Xe(n) {
256
- let e = (
257
- /*$_*/
258
- n[13]("popupMessageLastWarning") + ""
259
- ), t;
260
- return {
261
- c() {
262
- t = A(e);
263
- },
264
- m(i, s) {
265
- P(i, t, s);
266
- },
267
- p(i, s) {
268
- s[0] & /*$_*/
269
- 8192 && e !== (e = /*$_*/
270
- i[13]("popupMessageLastWarning") + "") && R(t, e);
271
- },
272
- d(i) {
273
- i && L(t);
274
- }
275
- };
276
- }
277
- function le(n) {
278
- let e, t;
279
- return {
280
- c() {
281
- e = x("p"), t = A(
282
- /*errorMessage*/
283
- n[8]
284
- ), w(e, "class", "OtpErrorMessage"), w(e, "role", "alert");
285
- },
286
- m(i, s) {
287
- P(i, e, s), b(e, t);
288
- },
289
- p(i, s) {
290
- s[0] & /*errorMessage*/
291
- 256 && R(
292
- t,
293
- /*errorMessage*/
294
- i[8]
295
- );
296
- },
297
- d(i) {
298
- i && L(e);
299
- }
300
- };
301
- }
302
- function Ye(n) {
303
- let e, t, i = (
304
- /*$_*/
305
- n[13]("timeRemaining") + ""
306
- ), s, p, l = (
307
- /*formatTime*/
308
- n[14](
309
- /*timeLeft*/
310
- n[5]
311
- ) + ""
312
- ), r, a, f = (
313
- /*$_*/
314
- n[13]("minutes") + ""
315
- ), _, v, y, k = ne(
316
- /*otp*/
317
- n[2]
318
- ), u = [];
319
- for (let g = 0; g < k.length; g += 1)
320
- u[g] = ae(se(n, k, g));
321
- return {
322
- c() {
323
- e = x("div"), t = x("div"), s = A(i), p = D(), r = A(l), a = D(), _ = A(f), v = D(), y = x("div");
324
- for (let g = 0; g < u.length; g += 1)
325
- u[g].c();
326
- w(t, "class", "OtpTimer"), w(y, "class", "OtpField"), w(e, "class", "OtpFieldWrapper");
327
- },
328
- m(g, T) {
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
- for (let d = 0; d < u.length; d += 1)
331
- u[d] && u[d].m(y, null);
332
- },
333
- p(g, T) {
334
- if (T[0] & /*$_*/
335
- 8192 && i !== (i = /*$_*/
336
- g[13]("timeRemaining") + "") && R(s, i), T[0] & /*timeLeft*/
337
- 32 && l !== (l = /*formatTime*/
338
- g[14](
339
- /*timeLeft*/
340
- g[5]
341
- ) + "") && R(r, l), T[0] & /*$_*/
342
- 8192 && f !== (f = /*$_*/
343
- g[13]("minutes") + "") && R(_, f), T[0] & /*config, otp, inputDisabled, otpInputs, handleOtpInput, handleKeyDown, handleOnPasteOtp*/
344
- 235540) {
345
- k = ne(
346
- /*otp*/
347
- g[2]
348
- );
349
- let d;
350
- for (d = 0; d < k.length; d += 1) {
351
- const E = se(g, k, d);
352
- u[d] ? u[d].p(E, T) : (u[d] = ae(E), u[d].c(), u[d].m(y, null));
353
- }
354
- for (; d < u.length; d += 1)
355
- u[d].d(1);
356
- u.length = k.length;
357
- }
358
- },
359
- d(g) {
360
- g && L(e), ze(u, g);
361
- }
362
- };
363
- }
364
- function Ze(n) {
365
- let e;
366
- return {
367
- c() {
368
- e = x("div"), e.innerHTML = '<span class="OtpLoader"></span>', w(e, "class", "OtpLoaderContainer");
369
- },
370
- m(t, i) {
371
- P(t, e, i);
372
- },
373
- p: G,
374
- d(t) {
375
- t && L(e);
376
- }
377
- };
378
- }
379
- function ae(n) {
380
- let e, t, i, s = (
381
- /*index*/
382
- n[53]
383
- ), p, l;
384
- const r = () => (
385
- /*input_binding*/
386
- n[28](e, s)
387
- ), a = () => (
388
- /*input_binding*/
389
- n[28](null, s)
390
- );
391
- function f(...v) {
392
- return (
393
- /*input_handler*/
394
- n[29](
395
- /*index*/
396
- n[53],
397
- ...v
398
- )
399
- );
400
- }
401
- function _(...v) {
402
- return (
403
- /*keydown_handler*/
404
- n[30](
405
- /*index*/
406
- n[53],
407
- ...v
408
- )
409
- );
410
- }
411
- return {
412
- c() {
413
- e = x("input"), w(e, "id", `otp-input-${/*index*/
414
- n[53]}`), w(e, "type", "text"), w(e, "class", t = `otp-box ${/*config*/
415
- n[4].inputLength % 2 === 0 && /*index*/
416
- n[53] === /*config*/
417
- n[4].inputLength / 2 - 1 ? "space" : ""}`), w(e, "maxlength", 1), e.value = i = /*char*/
418
- n[51], e.disabled = /*inputDisabled*/
419
- n[11], w(e, "autocomplete", "off");
420
- },
421
- m(v, y) {
422
- P(v, e, y), r(), p || (l = [
423
- N(e, "input", f),
424
- N(e, "keydown", _),
425
- N(
426
- e,
427
- "paste",
428
- /*handleOnPasteOtp*/
429
- n[15]
430
- )
431
- ], p = !0);
432
- },
433
- p(v, y) {
434
- n = v, y[0] & /*config*/
435
- 16 && t !== (t = `otp-box ${/*config*/
436
- n[4].inputLength % 2 === 0 && /*index*/
437
- n[53] === /*config*/
438
- n[4].inputLength / 2 - 1 ? "space" : ""}`) && w(e, "class", t), y[0] & /*otp*/
439
- 4 && i !== (i = /*char*/
440
- n[51]) && e.value !== i && (e.value = i), y[0] & /*inputDisabled*/
441
- 2048 && (e.disabled = /*inputDisabled*/
442
- n[11]), s !== /*index*/
443
- n[53] && (a(), s = /*index*/
444
- n[53], r());
445
- },
446
- d(v) {
447
- v && L(e), a(), p = !1, De(l);
448
- }
449
- };
450
- }
451
- function Je(n) {
452
- let e, t = (
453
- /*$_*/
454
- n[13]("submit") + ""
455
- ), i, s, p, l;
456
- return {
457
- c() {
458
- e = x("button"), i = A(t), w(e, "class", "OtpButton"), e.disabled = s = /*otp*/
459
- n[2].join("").length !== /*config*/
460
- n[4].inputLength;
461
- },
462
- m(r, a) {
463
- P(r, e, a), b(e, i), p || (l = N(
464
- e,
465
- "click",
466
- /*submitOtp*/
467
- n[20]
468
- ), p = !0);
469
- },
470
- p(r, a) {
471
- a[0] & /*$_*/
472
- 8192 && t !== (t = /*$_*/
473
- r[13]("submit") + "") && R(i, t), a[0] & /*otp, config*/
474
- 20 && s !== (s = /*otp*/
475
- r[2].join("").length !== /*config*/
476
- r[4].inputLength) && (e.disabled = s);
477
- },
478
- d(r) {
479
- r && L(e), p = !1, l();
480
- }
481
- };
482
- }
483
- function Qe(n) {
484
- let e, t = (
485
- /*$_*/
486
- n[13]("resendOtp") + ""
487
- ), i, s, p;
488
- return {
489
- c() {
490
- e = x("button"), i = A(t), w(e, "class", "OtpButton");
491
- },
492
- m(l, r) {
493
- P(l, e, r), b(e, i), s || (p = N(
494
- e,
495
- "click",
496
- /*handleResendOtp*/
497
- n[18]
498
- ), s = !0);
499
- },
500
- p(l, r) {
501
- r[0] & /*$_*/
502
- 8192 && t !== (t = /*$_*/
503
- l[13]("resendOtp") + "") && R(i, t);
504
- },
505
- d(l) {
506
- l && L(e), s = !1, p();
507
- }
508
- };
509
- }
510
- function $e(n) {
511
- let e, t = (
512
- /*showPopup*/
513
- n[1] && re(n)
514
- );
515
- return {
516
- c() {
517
- e = x("div"), t && t.c();
518
- },
519
- m(i, s) {
520
- P(i, e, s), t && t.m(e, null), n[31](e);
521
- },
522
- p(i, s) {
523
- /*showPopup*/
524
- i[1] ? t ? t.p(i, s) : (t = re(i), t.c(), t.m(e, null)) : t && (t.d(1), t = null);
525
- },
526
- i: G,
527
- o: G,
528
- d(i) {
529
- i && L(e), t && t.d(), n[31](null);
530
- }
531
- };
532
- }
533
- function et(n, e, t) {
534
- let i;
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
- const X = {
538
- MAX_ATTEMPTS_EXCEEDED: "gm.twofa.token_max_attempts_exceeded",
539
- INTERNAL_SERVER_ERROR: "gm.multifactorauthentication.internal_server_error"
540
- };
541
- Object.keys(oe).forEach((o) => {
542
- ie(o, oe[o]);
543
- });
544
- const pe = () => {
545
- Fe(r);
546
- }, ue = () => {
547
- fetch(_).then((o) => o.json()).then((o) => {
548
- Object.keys(o).forEach((c) => {
549
- ie(c, o[c]);
550
- });
551
- }).catch((o) => {
552
- console.log(o);
553
- });
554
- }, Y = async (o) => {
555
- if (o.detail?.["x-step-up-required"]) {
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
- return;
559
- }
560
- await $();
561
- }
562
- }, U = () => {
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
- }, ce = () => {
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
- const V = Date.now(), Ee = Math.max(0, Math.floor((q - V) / 1e3));
568
- t(5, g = Ee);
569
- }, fe = () => {
570
- I && clearInterval(I), I = setInterval(
571
- () => {
572
- const o = Date.now(), c = Math.max(0, Math.floor((q - o) / 1e3));
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
- },
575
- 1e3
576
- );
577
- }, de = (o) => {
578
- const c = Math.floor(o / 60), h = o % 60;
579
- return `${c.toString().padStart(2, "0")}:${h.toString().padStart(2, "0")}`;
580
- }, K = (o, c) => {
581
- const h = [...y];
582
- h[o] = c.toUpperCase(), t(2, y = h);
583
- }, me = (o) => {
584
- o.preventDefault();
585
- const h = (o.clipboardData?.getData("text")?.trim() || "").slice(0, u.inputLength).split("");
586
- t(2, y = [...h, ...Array(u.inputLength - h.length).fill("")]), W[h.length]?.focus(), h.length === u.inputLength && Q();
587
- }, Z = (o, c) => {
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
- }, J = (o, c) => {
591
- const h = o.key, B = o.ctrlKey || o.metaKey;
592
- if (/^[a-z0-9]$/i.test(h)) {
593
- if (B && h.toLowerCase() === "v")
594
- return;
595
- o.preventDefault(), K(c, h), W[c + 1]?.focus();
596
- } else
597
- h === "Backspace" && (o.preventDefault(), y[c] !== "" && K(c, ""), W[c - 1]?.focus());
598
- }, ge = () => {
599
- const o = new CustomEvent("otpResendRequested");
600
- window.dispatchEvent(o);
601
- }, he = (o) => {
602
- window.dispatchEvent(new CustomEvent(
603
- "otpSubmitted",
604
- {
605
- detail: {
606
- code: o,
607
- maxAttempts: u.maxValidationAttempts,
608
- validatedAttempts: u.numberOfValidateAttempts
609
- }
610
- }
611
- ));
612
- }, be = async (o) => {
613
- const c = new URL(`/api/nwa/api/v1/mfa/challenge/${H}/validate`, a);
614
- c.searchParams.append("input", o);
615
- try {
616
- const h = await fetch(c.href, { method: "POST" });
617
- if (h.status === 200) {
618
- _e();
619
- return;
620
- }
621
- const B = await h.json();
622
- throw new Error(B.message);
623
- } catch (h) {
624
- if (h.message === X.INTERNAL_SERVER_ERROR) {
625
- if (u.numberOfValidateAttempts === u.maxValidationAttempts - 1) {
626
- window.dispatchEvent(new CustomEvent("otpSetTimeout")), window.postMessage(
627
- {
628
- type: "WidgetNotification",
629
- data: {
630
- type: "error",
631
- message: i("accountBlocked")
632
- }
633
- },
634
- window.location.href
635
- ), U();
636
- return;
637
- }
638
- t(6, E = !0), t(8, O = i("invalidOtp")), $();
639
- return;
640
- }
641
- console.error("OTP submission failed:", h), t(6, E = !0), t(8, O = i("submissionError"));
642
- } finally {
643
- t(3, k = !1);
644
- }
645
- }, _e = () => {
646
- window.dispatchEvent(new CustomEvent(
647
- "otpSuccess",
648
- {
649
- detail: {
650
- message: "User successfully authenticated"
651
- }
652
- }
653
- )), U();
654
- }, we = () => {
655
- window.dispatchEvent(new CustomEvent("manualClosePopup")), U();
656
- }, Q = async () => {
657
- if (y.join("").length !== u.inputLength) {
658
- t(6, E = !0), t(8, O = i("invalidOtp"));
659
- return;
660
- }
661
- t(3, k = !0), t(6, E = !1), t(8, O = "");
662
- const o = y.join("");
663
- z === "stateless" && he(o), z === "stateful" && await be(o);
664
- }, $ = async () => {
665
- if (a)
666
- try {
667
- t(3, k = !0);
668
- const o = new URL(`/api/nwa/api/v1/mfa/challenge/${H}/config`, a), c = await fetch(o.href), h = await c.json();
669
- if (c.ok)
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
- else if (h && h.details === X.MAX_ATTEMPTS_EXCEEDED)
672
- U();
673
- else {
674
- const B = h && h.message || `Failed to load config. Status: ${c.status}`;
675
- throw new Error(B);
676
- }
677
- } catch (o) {
678
- t(3, k = !1), t(7, C = !0), t(8, O = i("configError")), console.error("Error loading 2FA config:", o);
679
- }
680
- };
681
- Re(() => (window.addEventListener("stepUpAuthRequired", Y, !1), window.addEventListener("closePopup", U, !1), () => {
682
- window.removeEventListener("stepUpAuthRequired", Y), window.removeEventListener("closePopup", U, !1);
683
- }));
684
- function ye(o, c) {
685
- ee[o ? "unshift" : "push"](() => {
686
- W[c] = o, t(12, W);
687
- });
688
- }
689
- const ve = (o, c) => Z(c, o), Oe = (o, c) => J(c, o);
690
- function ke(o) {
691
- ee[o ? "unshift" : "push"](() => {
692
- j = o, t(0, j);
693
- });
694
- }
695
- return n.$$set = (o) => {
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
- }, n.$$.update = () => {
698
- n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
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
- 16777216 && r && pe(), n.$$.dirty[0] & /*lang, translationurl*/
703
- 150994944 && r && _ && ue();
704
- }, [
705
- j,
706
- v,
707
- y,
708
- k,
709
- u,
710
- g,
711
- E,
712
- C,
713
- O,
714
- M,
715
- m,
716
- S,
717
- W,
718
- i,
719
- de,
720
- me,
721
- Z,
722
- J,
723
- ge,
724
- we,
725
- Q,
726
- s,
727
- p,
728
- l,
729
- r,
730
- a,
731
- f,
732
- _,
733
- ye,
734
- ve,
735
- Oe,
736
- ke
737
- ];
738
- }
739
- class tt extends Le {
740
- constructor(e) {
741
- super(), Pe(
742
- this,
743
- e,
744
- et,
745
- $e,
746
- Ce,
747
- {
748
- clientstyling: 21,
749
- clientstylingurl: 22,
750
- mbsource: 23,
751
- lang: 24,
752
- endpoint: 25,
753
- session: 26,
754
- translationurl: 27
755
- },
756
- Ne,
757
- [-1, -1]
758
- );
759
- }
760
- get clientstyling() {
761
- return this.$$.ctx[21];
762
- }
763
- set clientstyling(e) {
764
- this.$$set({ clientstyling: e }), F();
765
- }
766
- get clientstylingurl() {
767
- return this.$$.ctx[22];
768
- }
769
- set clientstylingurl(e) {
770
- this.$$set({ clientstylingurl: e }), F();
771
- }
772
- get mbsource() {
773
- return this.$$.ctx[23];
774
- }
775
- set mbsource(e) {
776
- this.$$set({ mbsource: e }), F();
777
- }
778
- get lang() {
779
- return this.$$.ctx[24];
780
- }
781
- set lang(e) {
782
- this.$$set({ lang: e }), F();
783
- }
784
- get endpoint() {
785
- return this.$$.ctx[25];
786
- }
787
- set endpoint(e) {
788
- this.$$set({ endpoint: e }), F();
789
- }
790
- get session() {
791
- return this.$$.ctx[26];
792
- }
793
- set session(e) {
794
- this.$$set({ session: e }), F();
795
- }
796
- get translationurl() {
797
- return this.$$.ctx[27];
798
- }
799
- set translationurl(e) {
800
- this.$$set({ translationurl: e }), F();
801
- }
802
- }
803
- He(tt, { clientstyling: {}, clientstylingurl: {}, mbsource: {}, lang: {}, endpoint: {}, session: {}, translationurl: {} }, [], [], !0);
804
- export {
805
- tt as default
806
- };