@tesouro/embedded-components-react 0.7.15 → 0.7.17
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.
- package/dist/index.css +6 -12
- package/dist/index.d.ts +31 -14
- package/dist/lib/AcceptDisclosuresWidget.d.ts +7 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +4 -2
- package/dist/lib/LinkedAccountsWidget.d.ts +20 -12
- package/dist/lib/WidgetSuite.d.ts +24 -14
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +97 -97
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +441 -433
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/labels.js +11 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/summary.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +182 -162
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index10.js +36 -86
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index12.js +17 -23
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index14.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +14 -17
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index16.js +3 -6
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +168 -35
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index6.js +70 -83
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index7.js +11 -112
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index8.js +6 -12
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index9.js +82 -7
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -948,6 +948,9 @@
|
|
|
948
948
|
.ttw\:max-h-\[80vh\] {
|
|
949
949
|
max-height: 80vh;
|
|
950
950
|
}
|
|
951
|
+
.ttw\:max-h-\[90dvh\] {
|
|
952
|
+
max-height: 90dvh;
|
|
953
|
+
}
|
|
951
954
|
.ttw\:max-h-\[90vh\] {
|
|
952
955
|
max-height: 90vh;
|
|
953
956
|
}
|
|
@@ -960,9 +963,6 @@
|
|
|
960
963
|
.ttw\:max-h-\[300px\] {
|
|
961
964
|
max-height: 300px;
|
|
962
965
|
}
|
|
963
|
-
.ttw\:max-h-\[min\(90vh\,48rem\)\] {
|
|
964
|
-
max-height: min(90vh, 48rem);
|
|
965
|
-
}
|
|
966
966
|
.ttw\:max-h-\[min\(calc\(--spacing\(96\)---spacing\(9\)\)\,calc\(var\(--available-height\)---spacing\(9\)\)\)\] {
|
|
967
967
|
max-height: min(calc(calc(var(--ttw-spacing) * 96) - calc(var(--ttw-spacing) * 9)), calc(var(--available-height) - calc(var(--ttw-spacing) * 9)));
|
|
968
968
|
}
|
|
@@ -3230,6 +3230,9 @@
|
|
|
3230
3230
|
.ttw\:pt-0 {
|
|
3231
3231
|
padding-top: 0px;
|
|
3232
3232
|
}
|
|
3233
|
+
.ttw\:pt-0\.5 {
|
|
3234
|
+
padding-top: calc(var(--ttw-spacing) * 0.5);
|
|
3235
|
+
}
|
|
3233
3236
|
.ttw\:pt-1 {
|
|
3234
3237
|
padding-top: var(--ttw-spacing);
|
|
3235
3238
|
}
|
|
@@ -4754,9 +4757,6 @@
|
|
|
4754
4757
|
.ttw\:hover\:bg-emerald-50:hover {
|
|
4755
4758
|
background-color: var(--ttw-color-emerald-50);
|
|
4756
4759
|
}
|
|
4757
|
-
.ttw\:hover\:bg-emerald-100:hover {
|
|
4758
|
-
background-color: var(--ttw-color-emerald-100);
|
|
4759
|
-
}
|
|
4760
4760
|
.ttw\:hover\:bg-emerald-700:hover {
|
|
4761
4761
|
background-color: var(--ttw-color-emerald-700);
|
|
4762
4762
|
}
|
|
@@ -4908,9 +4908,6 @@
|
|
|
4908
4908
|
.ttw\:hover\:text-destructive:hover {
|
|
4909
4909
|
color: var(--ttw-destructive);
|
|
4910
4910
|
}
|
|
4911
|
-
.ttw\:hover\:text-emerald-700:hover {
|
|
4912
|
-
color: var(--ttw-color-emerald-700);
|
|
4913
|
-
}
|
|
4914
4911
|
.ttw\:hover\:text-foreground:hover {
|
|
4915
4912
|
color: var(--ttw-foreground);
|
|
4916
4913
|
}
|
|
@@ -5610,9 +5607,6 @@
|
|
|
5610
5607
|
.ttw\:data-\[size\=default\]\:h-14[data-size="default"] {
|
|
5611
5608
|
height: calc(var(--ttw-spacing) * 14);
|
|
5612
5609
|
}
|
|
5613
|
-
.ttw\:data-\[size\=default\]\:h-auto[data-size="default"] {
|
|
5614
|
-
height: auto;
|
|
5615
|
-
}
|
|
5616
5610
|
.ttw\:data-\[size\=lg\]\:size-10[data-size="lg"] {
|
|
5617
5611
|
width: calc(var(--ttw-spacing) * 10);
|
|
5618
5612
|
height: calc(var(--ttw-spacing) * 10);
|
package/dist/index.d.ts
CHANGED
|
@@ -1990,10 +1990,12 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
1990
1990
|
personalReviewSubtitle: string;
|
|
1991
1991
|
/** Accessible title for the onboarding modal. */
|
|
1992
1992
|
modalTitle: string;
|
|
1993
|
-
/**
|
|
1993
|
+
/** Shown when submitting the application fails. */
|
|
1994
1994
|
submitFailedError: string;
|
|
1995
|
-
/**
|
|
1995
|
+
/** Shown when saving the application fails. */
|
|
1996
1996
|
genericRetryError: string;
|
|
1997
|
+
/** Shown when deleting the application fails. */
|
|
1998
|
+
deleteFailedError?: string;
|
|
1997
1999
|
/** Shown when the close prompt's "Save changes" has nothing valid to write. */
|
|
1998
2000
|
saveDraftNothingValidError: string;
|
|
1999
2001
|
/** Used when init has no bank name for disclaimers / result branding. */
|
|
@@ -3440,8 +3442,13 @@ interface Labels$1 {
|
|
|
3440
3442
|
accountNumberLabel: string;
|
|
3441
3443
|
routingNumberLabel: string;
|
|
3442
3444
|
routingNumberError: string;
|
|
3445
|
+
nicknamePlaceholder: string;
|
|
3446
|
+
holderTypeLabel: string;
|
|
3447
|
+
personalOption: string;
|
|
3448
|
+
personalOptionDescription: string;
|
|
3449
|
+
businessOption: string;
|
|
3450
|
+
businessOptionDescription: string;
|
|
3443
3451
|
typeLabel: string;
|
|
3444
|
-
accountTypePlaceholder: string;
|
|
3445
3452
|
checkingOption: string;
|
|
3446
3453
|
savingsOption: string;
|
|
3447
3454
|
cancelButton: string;
|
|
@@ -3457,20 +3464,12 @@ interface Labels$1 {
|
|
|
3457
3464
|
teamMembersLoadingLabel: string;
|
|
3458
3465
|
teamMembersErrorTitle: string;
|
|
3459
3466
|
teamMembersEmptyLabel: string;
|
|
3460
|
-
|
|
3467
|
+
summaryTitle: string;
|
|
3468
|
+
summaryAccountAddedTitle: string;
|
|
3461
3469
|
summaryNextStepsHeading: string;
|
|
3462
3470
|
summaryAccountPrefix: string;
|
|
3463
|
-
summaryStep1Title: string;
|
|
3464
|
-
summaryStep1Description: string;
|
|
3465
|
-
summaryStep2Title: string;
|
|
3466
|
-
summaryStep2Description: string;
|
|
3467
|
-
summaryStep3Title: string;
|
|
3468
|
-
summaryStep3Description: string;
|
|
3469
|
-
summaryStep4Title: string;
|
|
3470
|
-
summaryStep4Description: string;
|
|
3471
|
-
statusComplete: string;
|
|
3472
|
-
statusTodo: string;
|
|
3473
3471
|
backToTransfersButton: string;
|
|
3472
|
+
doneButton: string;
|
|
3474
3473
|
saveButton: string;
|
|
3475
3474
|
editButton: string;
|
|
3476
3475
|
verifyButton: string;
|
|
@@ -3504,6 +3503,17 @@ interface FeatureLabels$2 {
|
|
|
3504
3503
|
pendingStatus: string;
|
|
3505
3504
|
editSuccessToast: string;
|
|
3506
3505
|
unlinkSuccessToast: string;
|
|
3506
|
+
personalCheckingType: string;
|
|
3507
|
+
personalSavingsType: string;
|
|
3508
|
+
businessCheckingType: string;
|
|
3509
|
+
businessSavingsType: string;
|
|
3510
|
+
/** `{type}` and `{last4}` are placeholders in the summary copy. */
|
|
3511
|
+
summaryDescription: string;
|
|
3512
|
+
summaryAccountAddedDescription: string;
|
|
3513
|
+
summaryCheckBankTitle: string;
|
|
3514
|
+
summaryCheckBankDescription: string;
|
|
3515
|
+
summaryVerifyTitle: string;
|
|
3516
|
+
summaryVerifyDescription: string;
|
|
3507
3517
|
}
|
|
3508
3518
|
|
|
3509
3519
|
interface LinkedAccountsWidgetProps extends WidgetProviderProps {
|
|
@@ -4149,6 +4159,12 @@ interface AcceptDisclosuresWidgetLabels {
|
|
|
4149
4159
|
agreementCheckboxAriaLabel: string;
|
|
4150
4160
|
/** Fallback when the accept API fails without a usable message. */
|
|
4151
4161
|
acceptErrorFallback: string;
|
|
4162
|
+
/**
|
|
4163
|
+
* Shown when acceptance succeeded but the host could not continue to its
|
|
4164
|
+
* next step. Kept distinct from `acceptErrorFallback` because the disclosure
|
|
4165
|
+
* operation has already completed.
|
|
4166
|
+
*/
|
|
4167
|
+
continuationErrorFallback?: string;
|
|
4152
4168
|
/**
|
|
4153
4169
|
* Use `{bankName}` for the bank display name and `{documents}` for the
|
|
4154
4170
|
* conjunction list of titles the backend returned (same order as the links).
|
|
@@ -4204,6 +4220,7 @@ declare const ACCEPT_DISCLOSURES_WIDGET_LABELS_EN: {
|
|
|
4204
4220
|
acceptButton: string;
|
|
4205
4221
|
agreementCheckboxAriaLabel: string;
|
|
4206
4222
|
acceptErrorFallback: string;
|
|
4223
|
+
continuationErrorFallback: string;
|
|
4207
4224
|
agreementTextTemplate: string;
|
|
4208
4225
|
providerAttributionPrefix: string;
|
|
4209
4226
|
providerAttributionMiddle: string;
|
|
@@ -9,6 +9,12 @@ interface AcceptDisclosuresWidgetLabels {
|
|
|
9
9
|
agreementCheckboxAriaLabel: string;
|
|
10
10
|
/** Fallback when the accept API fails without a usable message. */
|
|
11
11
|
acceptErrorFallback: string;
|
|
12
|
+
/**
|
|
13
|
+
* Shown when acceptance succeeded but the host could not continue to its
|
|
14
|
+
* next step. Kept distinct from `acceptErrorFallback` because the disclosure
|
|
15
|
+
* operation has already completed.
|
|
16
|
+
*/
|
|
17
|
+
continuationErrorFallback?: string;
|
|
12
18
|
/**
|
|
13
19
|
* Use `{bankName}` for the bank display name and `{documents}` for the
|
|
14
20
|
* conjunction list of titles the backend returned (same order as the links).
|
|
@@ -64,6 +70,7 @@ declare const ACCEPT_DISCLOSURES_WIDGET_LABELS_EN: {
|
|
|
64
70
|
acceptButton: string;
|
|
65
71
|
agreementCheckboxAriaLabel: string;
|
|
66
72
|
acceptErrorFallback: string;
|
|
73
|
+
continuationErrorFallback: string;
|
|
67
74
|
agreementTextTemplate: string;
|
|
68
75
|
providerAttributionPrefix: string;
|
|
69
76
|
providerAttributionMiddle: string;
|
|
@@ -1058,10 +1058,12 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
1058
1058
|
personalReviewSubtitle: string;
|
|
1059
1059
|
/** Accessible title for the onboarding modal. */
|
|
1060
1060
|
modalTitle: string;
|
|
1061
|
-
/**
|
|
1061
|
+
/** Shown when submitting the application fails. */
|
|
1062
1062
|
submitFailedError: string;
|
|
1063
|
-
/**
|
|
1063
|
+
/** Shown when saving the application fails. */
|
|
1064
1064
|
genericRetryError: string;
|
|
1065
|
+
/** Shown when deleting the application fails. */
|
|
1066
|
+
deleteFailedError?: string;
|
|
1065
1067
|
/** Shown when the close prompt's "Save changes" has nothing valid to write. */
|
|
1066
1068
|
saveDraftNothingValidError: string;
|
|
1067
1069
|
/** Used when init has no bank name for disclaimers / result branding. */
|
|
@@ -12,8 +12,13 @@ interface Labels {
|
|
|
12
12
|
accountNumberLabel: string;
|
|
13
13
|
routingNumberLabel: string;
|
|
14
14
|
routingNumberError: string;
|
|
15
|
+
nicknamePlaceholder: string;
|
|
16
|
+
holderTypeLabel: string;
|
|
17
|
+
personalOption: string;
|
|
18
|
+
personalOptionDescription: string;
|
|
19
|
+
businessOption: string;
|
|
20
|
+
businessOptionDescription: string;
|
|
15
21
|
typeLabel: string;
|
|
16
|
-
accountTypePlaceholder: string;
|
|
17
22
|
checkingOption: string;
|
|
18
23
|
savingsOption: string;
|
|
19
24
|
cancelButton: string;
|
|
@@ -29,20 +34,12 @@ interface Labels {
|
|
|
29
34
|
teamMembersLoadingLabel: string;
|
|
30
35
|
teamMembersErrorTitle: string;
|
|
31
36
|
teamMembersEmptyLabel: string;
|
|
32
|
-
|
|
37
|
+
summaryTitle: string;
|
|
38
|
+
summaryAccountAddedTitle: string;
|
|
33
39
|
summaryNextStepsHeading: string;
|
|
34
40
|
summaryAccountPrefix: string;
|
|
35
|
-
summaryStep1Title: string;
|
|
36
|
-
summaryStep1Description: string;
|
|
37
|
-
summaryStep2Title: string;
|
|
38
|
-
summaryStep2Description: string;
|
|
39
|
-
summaryStep3Title: string;
|
|
40
|
-
summaryStep3Description: string;
|
|
41
|
-
summaryStep4Title: string;
|
|
42
|
-
summaryStep4Description: string;
|
|
43
|
-
statusComplete: string;
|
|
44
|
-
statusTodo: string;
|
|
45
41
|
backToTransfersButton: string;
|
|
42
|
+
doneButton: string;
|
|
46
43
|
saveButton: string;
|
|
47
44
|
editButton: string;
|
|
48
45
|
verifyButton: string;
|
|
@@ -701,6 +698,17 @@ interface FeatureLabels {
|
|
|
701
698
|
pendingStatus: string;
|
|
702
699
|
editSuccessToast: string;
|
|
703
700
|
unlinkSuccessToast: string;
|
|
701
|
+
personalCheckingType: string;
|
|
702
|
+
personalSavingsType: string;
|
|
703
|
+
businessCheckingType: string;
|
|
704
|
+
businessSavingsType: string;
|
|
705
|
+
/** `{type}` and `{last4}` are placeholders in the summary copy. */
|
|
706
|
+
summaryDescription: string;
|
|
707
|
+
summaryAccountAddedDescription: string;
|
|
708
|
+
summaryCheckBankTitle: string;
|
|
709
|
+
summaryCheckBankDescription: string;
|
|
710
|
+
summaryVerifyTitle: string;
|
|
711
|
+
summaryVerifyDescription: string;
|
|
704
712
|
}
|
|
705
713
|
|
|
706
714
|
interface LinkedAccountsWidgetProps extends WidgetProviderProps {
|
|
@@ -1107,10 +1107,12 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
1107
1107
|
personalReviewSubtitle: string;
|
|
1108
1108
|
/** Accessible title for the onboarding modal. */
|
|
1109
1109
|
modalTitle: string;
|
|
1110
|
-
/**
|
|
1110
|
+
/** Shown when submitting the application fails. */
|
|
1111
1111
|
submitFailedError: string;
|
|
1112
|
-
/**
|
|
1112
|
+
/** Shown when saving the application fails. */
|
|
1113
1113
|
genericRetryError: string;
|
|
1114
|
+
/** Shown when deleting the application fails. */
|
|
1115
|
+
deleteFailedError?: string;
|
|
1114
1116
|
/** Shown when the close prompt's "Save changes" has nothing valid to write. */
|
|
1115
1117
|
saveDraftNothingValidError: string;
|
|
1116
1118
|
/** Used when init has no bank name for disclaimers / result branding. */
|
|
@@ -2488,8 +2490,13 @@ interface Labels$1 {
|
|
|
2488
2490
|
accountNumberLabel: string;
|
|
2489
2491
|
routingNumberLabel: string;
|
|
2490
2492
|
routingNumberError: string;
|
|
2493
|
+
nicknamePlaceholder: string;
|
|
2494
|
+
holderTypeLabel: string;
|
|
2495
|
+
personalOption: string;
|
|
2496
|
+
personalOptionDescription: string;
|
|
2497
|
+
businessOption: string;
|
|
2498
|
+
businessOptionDescription: string;
|
|
2491
2499
|
typeLabel: string;
|
|
2492
|
-
accountTypePlaceholder: string;
|
|
2493
2500
|
checkingOption: string;
|
|
2494
2501
|
savingsOption: string;
|
|
2495
2502
|
cancelButton: string;
|
|
@@ -2505,20 +2512,12 @@ interface Labels$1 {
|
|
|
2505
2512
|
teamMembersLoadingLabel: string;
|
|
2506
2513
|
teamMembersErrorTitle: string;
|
|
2507
2514
|
teamMembersEmptyLabel: string;
|
|
2508
|
-
|
|
2515
|
+
summaryTitle: string;
|
|
2516
|
+
summaryAccountAddedTitle: string;
|
|
2509
2517
|
summaryNextStepsHeading: string;
|
|
2510
2518
|
summaryAccountPrefix: string;
|
|
2511
|
-
summaryStep1Title: string;
|
|
2512
|
-
summaryStep1Description: string;
|
|
2513
|
-
summaryStep2Title: string;
|
|
2514
|
-
summaryStep2Description: string;
|
|
2515
|
-
summaryStep3Title: string;
|
|
2516
|
-
summaryStep3Description: string;
|
|
2517
|
-
summaryStep4Title: string;
|
|
2518
|
-
summaryStep4Description: string;
|
|
2519
|
-
statusComplete: string;
|
|
2520
|
-
statusTodo: string;
|
|
2521
2519
|
backToTransfersButton: string;
|
|
2520
|
+
doneButton: string;
|
|
2522
2521
|
saveButton: string;
|
|
2523
2522
|
editButton: string;
|
|
2524
2523
|
verifyButton: string;
|
|
@@ -2552,6 +2551,17 @@ interface FeatureLabels$2 {
|
|
|
2552
2551
|
pendingStatus: string;
|
|
2553
2552
|
editSuccessToast: string;
|
|
2554
2553
|
unlinkSuccessToast: string;
|
|
2554
|
+
personalCheckingType: string;
|
|
2555
|
+
personalSavingsType: string;
|
|
2556
|
+
businessCheckingType: string;
|
|
2557
|
+
businessSavingsType: string;
|
|
2558
|
+
/** `{type}` and `{last4}` are placeholders in the summary copy. */
|
|
2559
|
+
summaryDescription: string;
|
|
2560
|
+
summaryAccountAddedDescription: string;
|
|
2561
|
+
summaryCheckBankTitle: string;
|
|
2562
|
+
summaryCheckBankDescription: string;
|
|
2563
|
+
summaryVerifyTitle: string;
|
|
2564
|
+
summaryVerifyDescription: string;
|
|
2555
2565
|
}
|
|
2556
2566
|
|
|
2557
2567
|
interface LinkedAccountsWidgetProps extends WidgetProviderProps {
|
|
@@ -2,153 +2,153 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ErrorState as i } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
5
|
+
import { personDisclosure as e } from "../../../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
6
|
+
import { useAcceptWidgetDisclosures as t } from "../../../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
7
|
+
import { useDisclosuresQuery as n } from "../../../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
8
|
+
import { ErrorState as r } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
10
9
|
import "../../../../../shared/ui/dist/index.js";
|
|
11
|
-
import { useAnalyticsTrack as
|
|
12
|
-
import { WidgetProvider as
|
|
13
|
-
import { useRefetchWidget as
|
|
10
|
+
import { useAnalyticsTrack as i } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
11
|
+
import { WidgetProvider as a } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
12
|
+
import { useRefetchWidget as o, useWidgetConfig as s, useWidgetInitStaleForToken as c } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
14
13
|
import "../../../../../shared/feature/dist/index.js";
|
|
15
|
-
import { AcceptDisclosuresWidgetAnalyticsEvent as
|
|
16
|
-
import { mergeAcceptDisclosuresWidgetLabels as
|
|
17
|
-
import { AcceptDisclosuresWidget as
|
|
14
|
+
import { AcceptDisclosuresWidgetAnalyticsEvent as l, WIDGET_NAME as u } from "../analytics/events.js";
|
|
15
|
+
import { mergeAcceptDisclosuresWidgetLabels as d } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/labels.js";
|
|
16
|
+
import { AcceptDisclosuresWidget as f } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
|
|
18
17
|
import "../../../../ui/dist/index.js";
|
|
19
|
-
import { resolveAcceptDisclosuresContent as
|
|
20
|
-
import { acceptDisclosuresWidgetTestIds as
|
|
18
|
+
import { resolveAcceptDisclosuresContent as p } from "./resolveAcceptDisclosuresContent.js";
|
|
19
|
+
import { acceptDisclosuresWidgetTestIds as m } from "./testIds.js";
|
|
21
20
|
import "../../../../data-access/dist/index.js";
|
|
22
|
-
import { useCallback as
|
|
23
|
-
import { Fragment as
|
|
21
|
+
import { useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
|
|
22
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
24
23
|
//#region ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
function S(e, t, n) {
|
|
25
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
27
26
|
n.providerAttributionPrefix,
|
|
28
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ b("strong", { children: e }),
|
|
29
28
|
n.providerAttributionMiddle,
|
|
30
29
|
t,
|
|
31
30
|
n.providerAttributionSuffix
|
|
32
31
|
] });
|
|
33
32
|
}
|
|
34
|
-
function
|
|
35
|
-
let
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
title:
|
|
40
|
-
description:
|
|
41
|
-
retryLabel:
|
|
33
|
+
function C({ labels: t, onAccepted: a }) {
|
|
34
|
+
let o = i(), { initResponse: u } = s(), f = c(), m = d(t), { data: h, isError: _, refetch: v } = n({ userId: u?.userId ?? void 0 });
|
|
35
|
+
if (g(() => {
|
|
36
|
+
o(l.Mounted);
|
|
37
|
+
}, [o]), _) return /* @__PURE__ */ b(r, {
|
|
38
|
+
title: m.loadErrorTitle,
|
|
39
|
+
description: m.loadErrorFallback,
|
|
40
|
+
retryLabel: m.loadErrorRetryLabel,
|
|
42
41
|
onRetry: () => {
|
|
43
|
-
|
|
42
|
+
v();
|
|
44
43
|
},
|
|
45
44
|
testId: "accept-disclosures-load-error"
|
|
46
45
|
});
|
|
47
|
-
let
|
|
48
|
-
documents:
|
|
49
|
-
vspName:
|
|
50
|
-
bankName:
|
|
51
|
-
labels:
|
|
46
|
+
let y = e(h), x = p({
|
|
47
|
+
documents: h ? y?.documents ?? [] : void 0,
|
|
48
|
+
vspName: u?.vspName,
|
|
49
|
+
bankName: u?.bankName,
|
|
50
|
+
labels: t
|
|
52
51
|
});
|
|
53
|
-
if (!
|
|
54
|
-
let
|
|
55
|
-
if (
|
|
56
|
-
let
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
displayedVersion:
|
|
59
|
-
labelOverrides:
|
|
60
|
-
content:
|
|
61
|
-
labels:
|
|
62
|
-
onAccepted:
|
|
63
|
-
onDisclosuresVersionChanged:
|
|
64
|
-
},
|
|
52
|
+
if (!x) return null;
|
|
53
|
+
let S = y?.disclosureId ?? null;
|
|
54
|
+
if (f) return null;
|
|
55
|
+
let C = `${`user:${u?.userId ?? ""}`}:${S}:${x.vspName}:${x.bankName}:${x.agreementText}:${x.disclosureLinks.map((e) => e.href).join("|")}`;
|
|
56
|
+
return /* @__PURE__ */ b(w, {
|
|
57
|
+
displayedVersion: S,
|
|
58
|
+
labelOverrides: t,
|
|
59
|
+
content: x,
|
|
60
|
+
labels: m,
|
|
61
|
+
onAccepted: a,
|
|
62
|
+
onDisclosuresVersionChanged: v
|
|
63
|
+
}, C);
|
|
65
64
|
}
|
|
66
|
-
function
|
|
67
|
-
let [
|
|
68
|
-
|
|
69
|
-
}, []),
|
|
70
|
-
if (!(!
|
|
71
|
-
|
|
65
|
+
function w({ displayedVersion: e, labelOverrides: n, content: r, labels: i, onAccepted: a, onDisclosuresVersionChanged: s }) {
|
|
66
|
+
let [c, l] = v(!1), [u, d] = v(), [p, g] = v(!1), [y, x] = v(!1), C = _(!1), { mutateAsync: w } = t(), T = o(), E = h((e) => {
|
|
67
|
+
d(void 0), l(e);
|
|
68
|
+
}, []), D = h(async () => {
|
|
69
|
+
if (!(!c || p || y)) {
|
|
70
|
+
d(void 0), g(!0);
|
|
72
71
|
try {
|
|
73
|
-
if (!
|
|
74
|
-
await
|
|
75
|
-
} catch (
|
|
76
|
-
if (
|
|
77
|
-
|
|
72
|
+
if (!C.current) try {
|
|
73
|
+
await w({ displayedVersion: e }), C.current = !0;
|
|
74
|
+
} catch (e) {
|
|
75
|
+
if (e instanceof Error && e.name === "DisclosuresVersionChangedError") {
|
|
76
|
+
d(i.disclosuresUpdatedFallback), s();
|
|
78
77
|
return;
|
|
79
78
|
}
|
|
80
|
-
|
|
79
|
+
d(i.acceptErrorFallback);
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
82
|
try {
|
|
84
|
-
await
|
|
85
|
-
} catch
|
|
86
|
-
|
|
83
|
+
await a?.();
|
|
84
|
+
} catch {
|
|
85
|
+
d(i.continuationErrorFallback);
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
|
-
|
|
88
|
+
T(), x(!0);
|
|
90
89
|
} finally {
|
|
91
|
-
|
|
90
|
+
g(!1);
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
}, [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
l,
|
|
99
|
-
m,
|
|
100
|
-
a.acceptErrorFallback,
|
|
101
|
-
a.disclosuresUpdatedFallback,
|
|
102
|
-
o,
|
|
94
|
+
w,
|
|
95
|
+
e,
|
|
96
|
+
y,
|
|
103
97
|
c,
|
|
104
|
-
|
|
98
|
+
p,
|
|
99
|
+
i.acceptErrorFallback,
|
|
100
|
+
i.continuationErrorFallback,
|
|
101
|
+
i.disclosuresUpdatedFallback,
|
|
102
|
+
a,
|
|
103
|
+
s,
|
|
104
|
+
T
|
|
105
105
|
]);
|
|
106
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ b(f, {
|
|
107
107
|
labels: {
|
|
108
|
-
...
|
|
109
|
-
title:
|
|
110
|
-
agreementCheckboxAriaLabel:
|
|
108
|
+
...n,
|
|
109
|
+
title: r.title,
|
|
110
|
+
agreementCheckboxAriaLabel: r.agreementCheckboxAriaLabel
|
|
111
111
|
},
|
|
112
|
-
providerAttribution:
|
|
113
|
-
agreementText:
|
|
114
|
-
disclosureLinks:
|
|
115
|
-
isAgreed:
|
|
116
|
-
onAgreedChange:
|
|
112
|
+
providerAttribution: S(r.vspName, r.bankName, i),
|
|
113
|
+
agreementText: r.agreementText,
|
|
114
|
+
disclosureLinks: r.disclosureLinks,
|
|
115
|
+
isAgreed: c,
|
|
116
|
+
onAgreedChange: E,
|
|
117
117
|
onAccept: () => {
|
|
118
|
-
|
|
118
|
+
D();
|
|
119
119
|
},
|
|
120
|
-
isSubmitting:
|
|
121
|
-
isAccepted:
|
|
122
|
-
errorMessage:
|
|
120
|
+
isSubmitting: p,
|
|
121
|
+
isAccepted: y,
|
|
122
|
+
errorMessage: u,
|
|
123
123
|
testIds: {
|
|
124
|
-
root:
|
|
125
|
-
providerAttribution:
|
|
126
|
-
disclosureLinks:
|
|
127
|
-
agreeCheckbox:
|
|
128
|
-
agreementText:
|
|
129
|
-
acceptButton:
|
|
130
|
-
error:
|
|
124
|
+
root: m.root,
|
|
125
|
+
providerAttribution: m.providerAttribution,
|
|
126
|
+
disclosureLinks: m.disclosureLinks,
|
|
127
|
+
agreeCheckbox: m.agreeCheckbox,
|
|
128
|
+
agreementText: m.agreementText,
|
|
129
|
+
acceptButton: m.acceptButton,
|
|
130
|
+
error: m.error
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
widgetName:
|
|
134
|
+
function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
|
|
135
|
+
return /* @__PURE__ */ b(a, {
|
|
136
|
+
widgetName: u,
|
|
137
137
|
baseUrl: e,
|
|
138
138
|
widgetToken: t,
|
|
139
139
|
organizationId: n,
|
|
140
140
|
configClient: r,
|
|
141
141
|
gatewayRouting: i,
|
|
142
|
-
linkComponent:
|
|
142
|
+
linkComponent: o,
|
|
143
143
|
implementation: s,
|
|
144
144
|
uiFramework: c,
|
|
145
145
|
errorFallback: l,
|
|
146
|
-
onError:
|
|
146
|
+
onError: d,
|
|
147
147
|
analytics: f,
|
|
148
148
|
disclosuresAcceptance: p,
|
|
149
149
|
providerLabels: m,
|
|
150
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ b(C, { ...h })
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
-
export {
|
|
154
|
+
export { T as AcceptDisclosuresWidget };
|
|
@@ -4,6 +4,7 @@ var e = {
|
|
|
4
4
|
acceptButton: "Accept",
|
|
5
5
|
agreementCheckboxAriaLabel: "Agree to banking disclosures",
|
|
6
6
|
acceptErrorFallback: "Failed to accept disclosures",
|
|
7
|
+
continuationErrorFallback: "Disclosures accepted, but we could not continue. Please try again.",
|
|
7
8
|
agreementTextTemplate: "I agree to {bankName}'s {documents}.",
|
|
8
9
|
providerAttributionPrefix: "Banking services for ",
|
|
9
10
|
providerAttributionMiddle: " are provided by ",
|