everest-npm-features 0.0.50 → 0.0.51

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,503 +0,0 @@
1
- import { jsxs as S, Fragment as te, jsx as e } from "react/jsx-runtime";
2
- import { useState as r, useEffect as F, useRef as ge } from "react";
3
- import { AuthContainer as Ce } from "./components/Wallet/Shared/Container/index.js";
4
- import ye from "./components/Shared/Incode/index.js";
5
- import Se from "./hoc/withThemeProvider.js";
6
- import ce from "./components/Wallet/Shared/Input/index.js";
7
- import de from "./components/Wallet/Shared/appButton.js";
8
- import "./index-DlQqWbXG.js";
9
- import "./components/Wallet/Shared/Auth/otpForm.js";
10
- import { d as v, f as be } from "./constants-t7n9qCW3.js";
11
- import { b as ve, c as xe } from "./kyc-D9xahfH9.js";
12
- import { useSnackBarContext as ue } from "./context/snackBarContext.js";
13
- import pe from "./hooks/useEverestDispatch.js";
14
- import "./util/conversions.js";
15
- import "./index-CAoLi5Qq.js";
16
- import me from "./components/Wallet/Shared/step.js";
17
- import "./react-webcam-B3cXh1XT.js";
18
- import "./components/Shared/transition.js";
19
- import "./tooltip-3UvETWtS.js";
20
- import "./components/Wallet/Shared/pin.js";
21
- import "./moment-h96o7c8I.js";
22
- import "./index.esm-BsMAMhYW.js";
23
- import { c as De } from "./countries-BVn1FubK.js";
24
- import "./web3-u4qDZYpo.js";
25
- import "./index-ceeCtFuh.js";
26
- import { useDialogContext as _e } from "./context/dialogContext.js";
27
- import re from "./components/Shared/FullKyc/countryList.js";
28
- import { B as w } from "./Box-B0YSYLco.js";
29
- import { T as j } from "./Typography-pAaje37G.js";
30
- import Ne from "./components/Shared/FullKyc/pep.js";
31
- import { u as J } from "./react-redux-C7I9-1M6.js";
32
- import Pe from "./components/Shared/FullKyc/edd.js";
33
- import { F as Oe } from "./FormControl-RtZDQMdA.js";
34
- import { I as Re } from "./TextField-DPpRUQe3.js";
35
- import { S as Ae } from "./Select-CB5yWmyn.js";
36
- import { M as Q } from "./MenuItem-DUdYOJr4.js";
37
- import { G as V } from "./Grid-CFe3amXO.js";
38
- const Be = ({
39
- inputComponent: f,
40
- buttonComponent: R,
41
- setUserInfo: x,
42
- userInfo: i,
43
- docData: n,
44
- setScreen: h,
45
- userEmail: g,
46
- kycFlow: p
47
- }) => {
48
- const l = pe();
49
- _e();
50
- const { showAlertMessage: c } = ue(), a = f ?? ce, D = R ?? de, [d, _] = r(i.gender || ""), [m, N] = r(!1), [P, C] = r(i.email || ""), [Y, Z] = r(!1), [K, q] = r(""), [u, z] = r(i.address || ""), [t, O] = r(i.city || ""), [y, I] = r(i.state || ""), [b, A] = r(i.zipCode || ""), [B, M] = r(
51
- i.country || null
52
- ), [s, X] = r(!1);
53
- F(() => {
54
- g && (C(g), Z(!0));
55
- }, [g]), F(() => {
56
- var o;
57
- if (n != null && n.issuingCountry) {
58
- n.gender && (_(n.gender), N(!0));
59
- const L = De.find(
60
- (E) => E.alpha3 === n.issuingCountry
61
- );
62
- x({ ...i, country: L, nationality: L });
63
- const T = new Date(n.birthDate), $ = T.getTimezoneOffset() * 6e4, W = new Date(
64
- T.getTime() + $
65
- );
66
- if (q(W.toLocaleDateString("en-US")), (o = n.checkedAddressBean) != null && o.street) {
67
- const E = n.checkedAddressBean;
68
- X(!0), z(E.street), O(E.city), I(E.state), A(E.postalCode);
69
- }
70
- } else
71
- U();
72
- }, []);
73
- const U = () => {
74
- l(ve());
75
- };
76
- return /* @__PURE__ */ S(te, { children: [
77
- p !== v && /* @__PURE__ */ e(w, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ e(me, { totalSteps: 4, currentStep: 2 }) }),
78
- /* @__PURE__ */ S(w, { pl: 2, mt: 4, children: [
79
- /* @__PURE__ */ e(j, { variant: "h5", sx: { fontWeight: "bold" }, color: "primary", children: "Personal details" }),
80
- p !== v && /* @__PURE__ */ S(te, { children: [
81
- /* @__PURE__ */ e(j, { variant: "caption", children: "Good news! Some of the information will be populated from scanning your document earlier." }),
82
- /* @__PURE__ */ e(
83
- a,
84
- {
85
- sx: { mt: 3 },
86
- label: "Date of Birth",
87
- value: K,
88
- disabled: !0,
89
- required: !0
90
- }
91
- ),
92
- /* @__PURE__ */ S(Oe, { sx: { mt: 3 }, fullWidth: !0, children: [
93
- /* @__PURE__ */ e(Re, { children: "Gender" }),
94
- /* @__PURE__ */ S(
95
- Ae,
96
- {
97
- value: d,
98
- label: "Gender",
99
- onChange: (o) => _(o.target.value),
100
- disabled: !!(m && d),
101
- required: !0,
102
- children: [
103
- /* @__PURE__ */ e(Q, { value: "M", children: "Male" }, "M"),
104
- /* @__PURE__ */ e(Q, { value: "F", children: "Female" }, "F"),
105
- /* @__PURE__ */ e(Q, { value: "X", children: "Another" }, "X")
106
- ]
107
- }
108
- )
109
- ] }),
110
- /* @__PURE__ */ e(
111
- a,
112
- {
113
- sx: { mt: 3 },
114
- label: "Email",
115
- value: P,
116
- onChange: (o) => C(o.target.value),
117
- disabled: Y,
118
- required: !0
119
- }
120
- )
121
- ] }),
122
- /* @__PURE__ */ e(
123
- a,
124
- {
125
- sx: { mt: 3 },
126
- label: "Home Address",
127
- value: u,
128
- onChange: (o) => z(o.target.value),
129
- disabled: !!(s && u),
130
- required: !0
131
- }
132
- ),
133
- /* @__PURE__ */ S(V, { container: !0, spacing: 2, sx: { mt: 3 }, children: [
134
- /* @__PURE__ */ e(V, { size: 6, children: /* @__PURE__ */ e(
135
- a,
136
- {
137
- label: "City",
138
- value: t,
139
- onChange: (o) => O(o.target.value),
140
- disabled: !!(s && t),
141
- required: !0
142
- }
143
- ) }),
144
- /* @__PURE__ */ e(V, { size: 6, children: /* @__PURE__ */ e(
145
- a,
146
- {
147
- label: "State/Province",
148
- value: y,
149
- onChange: (o) => I(o.target.value),
150
- required: !0
151
- }
152
- ) })
153
- ] }),
154
- /* @__PURE__ */ e(
155
- a,
156
- {
157
- sx: { mt: 3 },
158
- label: "Zipcode",
159
- value: b,
160
- onChange: (o) => A(o.target.value),
161
- disabled: !!(s && b),
162
- required: !0
163
- }
164
- ),
165
- /* @__PURE__ */ e(
166
- re,
167
- {
168
- value: B,
169
- onChange: M,
170
- label: "Country of residence"
171
- }
172
- )
173
- ] }),
174
- /* @__PURE__ */ e(
175
- D,
176
- {
177
- sx: { mt: 3 },
178
- variant: "contained",
179
- onClick: () => {
180
- if (p !== v) {
181
- if (!K)
182
- return c({ message: "Please provide date of birth" });
183
- if (!d)
184
- return c({ message: "Please provide gender" });
185
- }
186
- if (!u)
187
- return c({ message: "Please provide address" });
188
- if (!t) return c({ message: "Please provide city" });
189
- if (!y) return c({ message: "Please provide state" });
190
- if (!b)
191
- return c({ message: "Please provide zip code" });
192
- if (!B)
193
- return c({
194
- message: "Please select country of residency"
195
- });
196
- x({
197
- ...i,
198
- gender: d,
199
- email: P,
200
- address: u,
201
- city: t,
202
- state: y,
203
- zipCode: b,
204
- country: B
205
- }), h(
206
- p !== v ? se : oe
207
- );
208
- },
209
- disabled: p !== v && !P || p !== v && !d || !u || !B,
210
- fullWidth: !0,
211
- children: /* @__PURE__ */ e("strong", { children: "Next" })
212
- }
213
- )
214
- ] });
215
- }, Le = ({
216
- userInfo: f,
217
- setUserInfo: R,
218
- setScreen: x,
219
- inputComponent: i,
220
- buttonComponent: n
221
- }) => {
222
- const { showAlertMessage: h } = ue(), g = i ?? ce, p = n ?? de, [l, c] = r(
223
- f.placeOfBirth || null
224
- ), [a, D] = r(
225
- f.nationality || null
226
- ), [d, _] = r(f.occupation || ""), [m, N] = r(f.employer || "");
227
- return /* @__PURE__ */ S(te, { children: [
228
- /* @__PURE__ */ e(w, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ e(me, { totalSteps: 4, currentStep: 3 }) }),
229
- /* @__PURE__ */ S(w, { pl: 2, mt: 4, children: [
230
- /* @__PURE__ */ e(j, { variant: "h5", sx: { fontWeight: "bold" }, color: "primary", children: "More Personal details" }),
231
- /* @__PURE__ */ e(j, { variant: "caption", children: "Good news! Some of the information will be populated from scanning your document earlier." }),
232
- /* @__PURE__ */ e(
233
- re,
234
- {
235
- value: l,
236
- onChange: c,
237
- label: "Place Of Birth"
238
- }
239
- ),
240
- /* @__PURE__ */ e(
241
- re,
242
- {
243
- value: a,
244
- onChange: D,
245
- label: "Country of citizenship"
246
- }
247
- ),
248
- /* @__PURE__ */ e(
249
- g,
250
- {
251
- sx: { mt: 3 },
252
- label: "Occupation",
253
- value: d,
254
- onChange: (C) => _(C.target.value)
255
- }
256
- ),
257
- /* @__PURE__ */ e(
258
- g,
259
- {
260
- sx: { mt: 3 },
261
- label: "Employer",
262
- value: m,
263
- onChange: (C) => N(C.target.value)
264
- }
265
- )
266
- ] }),
267
- /* @__PURE__ */ e(
268
- p,
269
- {
270
- sx: { mt: 3 },
271
- variant: "contained",
272
- onClick: () => {
273
- if (!l) {
274
- h({ message: "Please select place of birth" });
275
- return;
276
- }
277
- if (!a) {
278
- h({ message: "Please provide address" });
279
- return;
280
- }
281
- if (!d) {
282
- h({ message: "Please provide city" });
283
- return;
284
- }
285
- R({
286
- ...f,
287
- placeOfBirth: l,
288
- nationality: a,
289
- occupation: d,
290
- employer: m
291
- }), x(oe);
292
- },
293
- disabled: !l || !a || !d || !m,
294
- fullWidth: !0,
295
- children: /* @__PURE__ */ e("strong", { children: "Next" })
296
- }
297
- )
298
- ] });
299
- }, ee = "INCODE_SCREEN", k = "USER_INFO_SCREEN", se = "PERSONAL_DETAILS_SCREEN", oe = "PEP_SCREEN", Te = "EDD_SCREEN", Fe = {
300
- BANK_STATEMENT: {
301
- text: "",
302
- file: [],
303
- preview: []
304
- },
305
- PROOF_OF_INCOME: {
306
- text: "",
307
- file: [],
308
- preview: []
309
- },
310
- SOURCE_OF_WEALTH: {
311
- text: "",
312
- file: [],
313
- preview: []
314
- }
315
- }, Ke = ({
316
- configurationId: f,
317
- incodeApiKey: R,
318
- incodeApiUrl: x,
319
- incodeOnBoardingUrl: i,
320
- withContainer: n = !1,
321
- successHandler: h,
322
- updateScreen: g,
323
- isModalView: p = !1,
324
- kycFlow: l
325
- }) => {
326
- const c = ge(!0), a = pe(), D = J((s) => s.user), d = J((s) => s.user.kyc), _ = J((s) => s.session.uuid), m = D.kyc, N = m.processComplete, P = {}, [C, Y] = r(P), [Z, K] = r({ token: "" }), [q, u] = r(
327
- l === v ? k : ee
328
- );
329
- F(() => {
330
- if (c.current) {
331
- c.current = !1;
332
- return;
333
- }
334
- let s;
335
- switch (q) {
336
- case k:
337
- s = ee;
338
- break;
339
- case se:
340
- s = k;
341
- break;
342
- case oe:
343
- s = se;
344
- break;
345
- default:
346
- s = ee;
347
- }
348
- u(s);
349
- }, [g]), F(() => {
350
- h && N && h();
351
- }, [h, N]);
352
- const z = {
353
- gender: "",
354
- email: "",
355
- address: "",
356
- city: "",
357
- state: "",
358
- zipCode: "",
359
- placeOfBirth: "",
360
- country: "",
361
- nationality: "",
362
- occupation: "",
363
- employer: "",
364
- isPoliticalExpose: !1,
365
- politicalExpose: "",
366
- origin: "",
367
- frequency: "",
368
- reason: "",
369
- source: ""
370
- }, [t, O] = r(z), [y, I] = r(Fe);
371
- F(() => {
372
- y.BANK_STATEMENT.file.length > 0 && b(y);
373
- }, [y]);
374
- const b = (s) => {
375
- A(
376
- t.isPoliticalExpose,
377
- t.politicalExpose,
378
- t.frequency,
379
- t.reason,
380
- t.source,
381
- t.origin,
382
- s,
383
- !0
384
- );
385
- }, A = (s, X, U, H, o, L, T, $ = !1) => {
386
- var W, E, ie;
387
- if (l !== be && !$) {
388
- u(Te);
389
- return;
390
- }
391
- if (!m.loader) {
392
- const fe = {
393
- street: t.address,
394
- city: t.city,
395
- postcode: t.zipCode,
396
- state: t.state,
397
- country: (W = t.country) == null ? void 0 : W.alpha3
398
- }, he = {
399
- isExposed: s,
400
- exposed: X,
401
- frequency: U,
402
- reason: H,
403
- source: o,
404
- originFunds: L
405
- }, Ee = {
406
- frequency: U,
407
- reason: H,
408
- source: o,
409
- originFunds: L
410
- }, ne = {
411
- kycFlow: l,
412
- email: t.email,
413
- gender: t.gender,
414
- birthPlace: (E = t.placeOfBirth) == null ? void 0 : E.alpha3,
415
- nationality: (ie = t.nationality) == null ? void 0 : ie.alpha3,
416
- occupation: t.occupation,
417
- employer: t.employer,
418
- residentialAddress: fe,
419
- politicalExposure: he,
420
- customerDueDiligence: Ee,
421
- workflow: {
422
- token: Z.token
423
- }
424
- };
425
- if (T) {
426
- const ae = Object.entries(T).filter(([le, G]) => G.file && G.file.length > 0).map(([le, G]) => ({
427
- file: G.file[0],
428
- type: le
429
- }));
430
- ae.length > 0 && (ne.eddDocuments = ae);
431
- }
432
- a(xe(ne));
433
- }
434
- }, M = {
435
- INCODE_SCREEN: /* @__PURE__ */ e(
436
- ye,
437
- {
438
- uuid: _,
439
- successHandler: () => {
440
- u(k);
441
- },
442
- configurationId: f,
443
- apiKey: R,
444
- apiUrl: x,
445
- onBoardingUrl: i,
446
- setDocumentsData: Y,
447
- setIncodeSessionData: K,
448
- isModalView: p
449
- }
450
- ),
451
- USER_INFO_SCREEN: /* @__PURE__ */ e(
452
- Be,
453
- {
454
- docData: C,
455
- setScreen: u,
456
- setUserInfo: O,
457
- userInfo: t,
458
- userEmail: D.profile.email,
459
- kycFlow: l
460
- }
461
- ),
462
- PERSONAL_DETAILS_SCREEN: /* @__PURE__ */ e(
463
- Le,
464
- {
465
- setScreen: u,
466
- setUserInfo: O,
467
- userInfo: t
468
- }
469
- ),
470
- PEP_SCREEN: /* @__PURE__ */ e(
471
- Ne,
472
- {
473
- setScreen: u,
474
- setUserInfo: O,
475
- userInfo: t,
476
- processKyc: A,
477
- processLoader: m.loader,
478
- kycFlow: l
479
- }
480
- ),
481
- EDD_SCREEN: /* @__PURE__ */ e(
482
- Pe,
483
- {
484
- kycStoreData: d,
485
- eddData: y,
486
- setEddData: I,
487
- processKyc: b,
488
- processLoader: m.loader
489
- }
490
- )
491
- }[q];
492
- return n ? /* @__PURE__ */ e(Ce, { addPadding: !1, children: M }) : M;
493
- }, yt = Se(Ke);
494
- export {
495
- Te as E,
496
- yt as F,
497
- ee as I,
498
- Le as P,
499
- Be as U,
500
- k as a,
501
- se as b,
502
- oe as c
503
- };