@tesouro/embedded-components-react 0.5.3 → 0.5.5

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 (91) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +13 -13
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +70 -5
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +37 -64
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +110 -38
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +73 -104
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +7 -87
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +21 -7
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +22 -17
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +63 -23
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +2 -66
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +81 -2
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +3 -78
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +4 -5
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +32 -3
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +39 -30
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +166 -37
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +39 -164
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -48
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +50 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +11 -45
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +8 -13
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +14 -8
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +59 -7
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -64
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +24 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +139 -18
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +16 -139
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +4 -24
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +41 -4
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +14 -39
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +8 -16
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +91 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +86 -80
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +3 -97
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +49 -3
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +135 -47
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -135
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +186 -33
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +75 -186
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +21 -75
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +25 -14
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +232 -22
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +210 -223
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +103 -202
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +13 -121
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +47 -12
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +31 -47
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +198 -27
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +31 -198
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +234 -31
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +19 -240
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +24 -25
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +427 -19
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -433
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +38 -4
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +220 -35
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -224
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +10 -6
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +57 -21
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +110 -10
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -112
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +46 -8
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -43
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -58
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +101 -239
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +202 -107
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -209
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +8 -4
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +113 -6
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -115
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +24 -0
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +4 -5
  87. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +1 -0
  88. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  89. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  90. package/package.json +1 -1
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -25
@@ -1,87 +1,7 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import "../../../shared/ui/dist/index.js";
7
- import { DUPLICATE_BILLS_LABELS_EN as t } from "./index6.js";
8
- import { DuplicateVerdict as n, suspectedPayableDuplicates as r, useApplyDuplicateVerdictsMutation as i } from "../../data-access/dist/index7.js";
9
- import "../../data-access/dist/index.js";
10
- import { payableRemoval as a } from "./index10.js";
11
- import { useCallback as o, useMemo as s, useState as c } from "react";
12
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js
13
- function l({ payable: l, canManage: u = !0, onRemoved: d, labels: f }) {
14
- let p = s(() => ({
15
- ...t,
16
- ...f
17
- }), [f]), m = r(l), [h] = m, g = l?.id, _ = i(), [v, y] = c(!1), b = a(l?.status), x = o(async (t, n, r) => {
18
- if (!(!m.length || !g)) try {
19
- await _.mutateAsync({
20
- verdict: t,
21
- targets: m.map((e) => ({
22
- payableId: g,
23
- duplicateId: e.id,
24
- matchedPayableId: e.matched_payable_id,
25
- removeBy: b
26
- }))
27
- }), e.success(n), r?.();
28
- } catch {
29
- e.error(p.verdictFailedToast);
30
- }
31
- }, [
32
- _,
33
- p,
34
- m,
35
- g,
36
- b
37
- ]), S = b === "delete" ? {
38
- button: p.deleteBillButton,
39
- title: p.deleteConfirmTitle,
40
- description: p.deleteConfirmDescription,
41
- confirmButton: p.deleteConfirmButton,
42
- backButton: p.deleteConfirmBackButton,
43
- toast: p.deletedToast
44
- } : b === "confirm" ? {
45
- button: p.confirmBillButton,
46
- title: p.cancelConfirmTitle,
47
- description: p.cancelConfirmDescription,
48
- confirmButton: p.confirmBillButton,
49
- backButton: p.cancelConfirmBackButton,
50
- toast: p.confirmedToast
51
- } : {
52
- button: p.cancelBillButton,
53
- title: p.cancelConfirmTitle,
54
- description: p.cancelConfirmDescription,
55
- confirmButton: p.cancelConfirmButton,
56
- backButton: p.cancelConfirmBackButton,
57
- toast: p.cancelledToast
58
- }, C = o(async () => {
59
- await x(n.Remove, S.toast, d), y(!1);
60
- }, [
61
- x,
62
- d,
63
- S.toast
64
- ]), w = u && !!(h && g), T = w && !!b;
65
- return {
66
- isPossibleDuplicate: !!h,
67
- onNotADuplicate: w ? () => void x(n.Keep, p.dismissedToast) : void 0,
68
- onRemoveBill: T ? b === "delete" ? () => y(!0) : () => void C() : void 0,
69
- removeBillLabel: T ? S.button : void 0,
70
- removeConfirmation: {
71
- open: v,
72
- copy: {
73
- title: S.title,
74
- description: S.description,
75
- confirmButton: S.confirmButton,
76
- presentation: { tone: "destructive" }
77
- },
78
- onConfirm: () => void C(),
79
- onCancel: () => y(!1),
80
- isPending: _.isPending,
81
- cancelButtonLabel: S.backButton
82
- },
83
- isBusy: _.isPending
84
- };
85
- }
86
- //#endregion
87
- export { l as usePayableDuplicateReview };
1
+ import "./index5.js";
2
+ import "./index6.js";
3
+ import "./index9.js";
4
+ import "./index10.js";
5
+ import "./index11.js";
6
+ import "./index12.js";
7
+ import "./index13.js";
@@ -1,7 +1,21 @@
1
- import "./index6.js";
2
- import "./index7.js";
3
- import "./index10.js";
4
- import "./index11.js";
5
- import "./index12.js";
6
- import "./index13.js";
7
- import "./index14.js";
1
+ import { MARK_AS_PAID_DIALOG_LABELS_EN as e } from "../../ui/dist/index95.js";
2
+ import "../../ui/dist/index.js";
3
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js
4
+ var t = {
5
+ dueDateSuffix: (e) => `by ${e}`,
6
+ paidToast: "Bill marked as paid",
7
+ submitError: "Couldn't mark this bill as paid. Try again.",
8
+ dialog: e
9
+ };
10
+ function n(e) {
11
+ return {
12
+ ...t,
13
+ ...e,
14
+ dialog: {
15
+ ...t.dialog,
16
+ ...e?.dialog
17
+ }
18
+ };
19
+ }
20
+ //#endregion
21
+ export { t as MARK_AS_PAID_FLOW_LABELS_EN, n as mergeMarkAsPaidFlowLabels };
@@ -1,21 +1,26 @@
1
- import { MARK_AS_PAID_DIALOG_LABELS_EN as e } from "../../ui/dist/index95.js";
2
- import "../../ui/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js
4
- var t = {
5
- dueDateSuffix: (e) => `by ${e}`,
6
- paidToast: "Bill marked as paid",
7
- submitError: "Couldn't mark this bill as paid. Try again.",
8
- dialog: e
9
- };
2
+ var e = new Intl.DateTimeFormat("en-CA", {
3
+ timeZone: "America/New_York",
4
+ year: "numeric",
5
+ month: "2-digit",
6
+ day: "2-digit"
7
+ });
8
+ function t(t = /* @__PURE__ */ new Date()) {
9
+ let n = e.formatToParts(t), r = Object.fromEntries(n.map((e) => [e.type, e.value]));
10
+ return `${r.year}-${r.month}-${r.day}`;
11
+ }
10
12
  function n(e) {
11
- return {
12
- ...t,
13
- ...e,
14
- dialog: {
15
- ...t.dialog,
16
- ...e?.dialog
17
- }
18
- };
13
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
14
+ }
15
+ function r(e, r = /* @__PURE__ */ new Date()) {
16
+ return n(e) === t(r);
17
+ }
18
+ function i(e = /* @__PURE__ */ new Date()) {
19
+ let [n, r, i] = t(e).split("-").map(Number);
20
+ return new Date(n, r - 1, i);
21
+ }
22
+ function a(e, r = /* @__PURE__ */ new Date()) {
23
+ return n(e) < t(r);
19
24
  }
20
25
  //#endregion
21
- export { t as MARK_AS_PAID_FLOW_LABELS_EN, n as mergeMarkAsPaidFlowLabels };
26
+ export { n as dateToCalendarKey, i as getDefaultPaymentDate, t as getEasternDateKey, a as isPastEasternDate, r as isTodayInEastern };
@@ -1,26 +1,66 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../shared/ui/dist/index.js";
7
+ import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
8
+ import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
9
+ import { extractApiErrorMessage as r } from "../../../shared/util/dist/lib/apiErrors.js";
10
+ import { useMarkPayableAsPaidMutation as i } from "../../data-access/dist/index13.js";
11
+ import "../../data-access/dist/index.js";
12
+ import { dateToCalendarKey as a, getDefaultPaymentDate as o, isTodayInEastern as s } from "./index16.js";
13
+ import { mergeMarkAsPaidFlowLabels as c } from "./index15.js";
14
+ import { useEffect as l, useState as u } from "react";
1
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js
2
- var e = new Intl.DateTimeFormat("en-CA", {
3
- timeZone: "America/New_York",
4
- year: "numeric",
5
- month: "2-digit",
6
- day: "2-digit"
7
- });
8
- function t(t = /* @__PURE__ */ new Date()) {
9
- let n = e.formatToParts(t), r = Object.fromEntries(n.map((e) => [e.type, e.value]));
10
- return `${r.year}-${r.month}-${r.day}`;
11
- }
12
- function n(e) {
13
- return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
14
- }
15
- function r(e, r = /* @__PURE__ */ new Date()) {
16
- return n(e) === t(r);
17
- }
18
- function i(e = /* @__PURE__ */ new Date()) {
19
- let [n, r, i] = t(e).split("-").map(Number);
20
- return new Date(n, r - 1, i);
21
- }
22
- function a(e, r = /* @__PURE__ */ new Date()) {
23
- return n(e) < t(r);
16
+ function d({ payableId: d, amountDueMinorUnits: f, amountToPayMinorUnits: p, currencyCode: m, dueDate: h, hasScheduledPayment: g, testId: _, labels: v }) {
17
+ let y = c(v), b = i(), [x, S] = u(!1), [C, w] = u(void 0), [T, E] = u(""), D = x && !g, O = n(f / 100, { currencyCode: m }), k = n((p ?? f) / 100, { currencyCode: m }), A = C ? t(a(C)) : void 0, j = h ? y.dueDateSuffix(t(h)) : void 0, M = () => {
18
+ S(!1), w(void 0), E("");
19
+ };
20
+ return l(() => {
21
+ g && (S(!1), w(void 0), E(""));
22
+ }, [g]), {
23
+ open: () => {
24
+ w(o()), E(""), S(!0);
25
+ },
26
+ isPending: b.isPending,
27
+ dialogProps: {
28
+ open: D,
29
+ amountDue: O,
30
+ dueDateSuffix: j,
31
+ paymentAmount: k,
32
+ selectedDate: C,
33
+ selectedDateLabel: A,
34
+ isToday: C ? s(C) : !1,
35
+ comment: T,
36
+ isSubmitting: b.isPending,
37
+ onDateChange: w,
38
+ onCommentChange: E,
39
+ onConfirm: () => {
40
+ !d || !C || b.isPending || g || b.mutate({
41
+ path: { payable_id: d },
42
+ body: {
43
+ paid_at: `${a(C)}T12:00:00.000Z`,
44
+ is_external: !0,
45
+ ...T.trim() ? { comment: T.trim() } : {}
46
+ }
47
+ }, {
48
+ onSuccess: () => {
49
+ e.success(y.paidToast), M();
50
+ },
51
+ onError: (t) => {
52
+ e.error(r(t) ?? y.submitError);
53
+ }
54
+ });
55
+ },
56
+ onCancel: () => {
57
+ b.isPending || M();
58
+ },
59
+ testId: _ ? `${_}-mark-as-paid-dialog` : void 0,
60
+ confirmTestId: _ ? `${_}-mark-as-paid-confirm` : void 0,
61
+ labels: y.dialog
62
+ }
63
+ };
24
64
  }
25
65
  //#endregion
26
- export { n as dateToCalendarKey, i as getDefaultPaymentDate, t as getEasternDateKey, a as isPastEasternDate, r as isTodayInEastern };
66
+ export { d as useMarkAsPaidFlow };
@@ -1,66 +1,2 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import "../../../shared/ui/dist/index.js";
7
- import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
8
- import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
9
- import { extractApiErrorMessage as r } from "../../../shared/util/dist/lib/apiErrors.js";
10
- import { useMarkPayableAsPaidMutation as i } from "../../data-access/dist/index13.js";
11
- import "../../data-access/dist/index.js";
12
- import { dateToCalendarKey as a, getDefaultPaymentDate as o, isTodayInEastern as s } from "./index17.js";
13
- import { mergeMarkAsPaidFlowLabels as c } from "./index16.js";
14
- import { useEffect as l, useState as u } from "react";
15
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js
16
- function d({ payableId: d, amountDueMinorUnits: f, amountToPayMinorUnits: p, currencyCode: m, dueDate: h, hasScheduledPayment: g, testId: _, labels: v }) {
17
- let y = c(v), b = i(), [x, S] = u(!1), [C, w] = u(void 0), [T, E] = u(""), D = x && !g, O = n(f / 100, { currencyCode: m }), k = n((p ?? f) / 100, { currencyCode: m }), A = C ? t(a(C)) : void 0, j = h ? y.dueDateSuffix(t(h)) : void 0, M = () => {
18
- S(!1), w(void 0), E("");
19
- };
20
- return l(() => {
21
- g && (S(!1), w(void 0), E(""));
22
- }, [g]), {
23
- open: () => {
24
- w(o()), E(""), S(!0);
25
- },
26
- isPending: b.isPending,
27
- dialogProps: {
28
- open: D,
29
- amountDue: O,
30
- dueDateSuffix: j,
31
- paymentAmount: k,
32
- selectedDate: C,
33
- selectedDateLabel: A,
34
- isToday: C ? s(C) : !1,
35
- comment: T,
36
- isSubmitting: b.isPending,
37
- onDateChange: w,
38
- onCommentChange: E,
39
- onConfirm: () => {
40
- !d || !C || b.isPending || g || b.mutate({
41
- path: { payable_id: d },
42
- body: {
43
- paid_at: `${a(C)}T12:00:00.000Z`,
44
- is_external: !0,
45
- ...T.trim() ? { comment: T.trim() } : {}
46
- }
47
- }, {
48
- onSuccess: () => {
49
- e.success(y.paidToast), M();
50
- },
51
- onError: (t) => {
52
- e.error(r(t) ?? y.submitError);
53
- }
54
- });
55
- },
56
- onCancel: () => {
57
- b.isPending || M();
58
- },
59
- testId: _ ? `${_}-mark-as-paid-dialog` : void 0,
60
- confirmTestId: _ ? `${_}-mark-as-paid-confirm` : void 0,
61
- labels: y.dialog
62
- }
63
- };
64
- }
65
- //#endregion
66
- export { d as useMarkAsPaidFlow };
1
+ import "./index15.js";
2
+ import "./index17.js";
@@ -1,2 +1,81 @@
1
- import "./index16.js";
2
- import "./index18.js";
1
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
2
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
3
+ import "../../../shared/data-access/dist/index.js";
4
+ import { BanIcon as n, CalendarXIcon as r, RotateCcwIcon as i, ThumbsDownIcon as a, ThumbsUpIcon as o } from "lucide-react";
5
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js
6
+ function s(n) {
7
+ return e(n, [t.CounterpartReadOrg]);
8
+ }
9
+ function c({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
10
+ let s = e(r, [t.PayableApproveOrg]);
11
+ return !!(n === "approve_in_progress" && s);
12
+ }
13
+ function l({ status: l, scopes: u, canDecideApprovalRequest: d, hasScheduledPayment: f, scheduledPaymentIntentId: p, arePendingApproversUnknown: m, hasApprovalPolicy: h, hasWaitingRequest: g, isPayabilityUnknown: _, labels: v }) {
14
+ let y = e(u, [t.PayablePayOrg]), b = e(u, [t.BankAccountReadOrg]), x = s(u), S = e(u, [t.PaymentRailAch]), C = e(u, [t.PayableWriteOrg]), w = y, T = [];
15
+ if (l === "approve_in_progress" && d && (T.push({
16
+ id: "approve",
17
+ label: v.approve,
18
+ variant: "default",
19
+ surface: "row"
20
+ }), T.push({
21
+ id: "reject",
22
+ label: v.reject,
23
+ variant: "ghost",
24
+ surface: "row"
25
+ })), c({
26
+ status: l,
27
+ scopes: u,
28
+ arePendingApproversUnknown: m,
29
+ hasApprovalPolicy: h,
30
+ hasWaitingRequest: g
31
+ })) {
32
+ let e = h === !1 ? void 0 : v.policyOverridesHeading;
33
+ T.push({
34
+ id: "forceApprove",
35
+ label: v.forceApprove,
36
+ variant: "ghost",
37
+ surface: "menu",
38
+ icon: o,
39
+ sectionHeading: e
40
+ }), T.push({
41
+ id: "forceReject",
42
+ label: v.forceReject,
43
+ variant: "ghost",
44
+ surface: "menu",
45
+ icon: a,
46
+ sectionHeading: e
47
+ });
48
+ }
49
+ let E = l === "waiting_to_be_paid" && y && !f, D = l === "waiting_to_be_paid" && y && b && x && S && !f && !_;
50
+ return E && T.push({
51
+ id: "markAsPaid",
52
+ label: v.markAsPaid,
53
+ variant: "outline",
54
+ surface: "row"
55
+ }), D && T.push({
56
+ id: "payBill",
57
+ label: v.payBill,
58
+ variant: "default",
59
+ surface: "row"
60
+ }), l === "new" && C && T.push({
61
+ id: "cancel",
62
+ label: v.cancel,
63
+ variant: "ghost",
64
+ surface: "menu",
65
+ icon: n
66
+ }), (l === "rejected" || l === "waiting_to_be_paid" && !f) && C && T.push({
67
+ id: "reopen",
68
+ label: v.reopen,
69
+ variant: "ghost",
70
+ surface: "menu",
71
+ icon: i
72
+ }), l === "waiting_to_be_paid" && f && p && w && T.push({
73
+ id: "cancelScheduledPayment",
74
+ label: v.cancelScheduledPayment,
75
+ variant: "ghost",
76
+ surface: "menu",
77
+ icon: r
78
+ }), T;
79
+ }
80
+ //#endregion
81
+ export { c as canOverrideApprovalPolicy, s as canReadCounterpartBankAccounts, l as getBillDetailActions };
@@ -1,81 +1,6 @@
1
- import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
2
- import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
3
- import "../../../shared/data-access/dist/index.js";
4
- import { BanIcon as n, CalendarXIcon as r, RotateCcwIcon as i, ThumbsDownIcon as a, ThumbsUpIcon as o } from "lucide-react";
5
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js
6
- function s(n) {
7
- return e(n, [t.CounterpartReadOrg]);
8
- }
9
- function c({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
10
- let s = e(r, [t.PayableApproveOrg]);
11
- return !!(n === "approve_in_progress" && s && !i && (!a || o));
12
- }
13
- function l({ status: l, scopes: u, canDecideApprovalRequest: d, hasScheduledPayment: f, scheduledPaymentIntentId: p, arePendingApproversUnknown: m, hasApprovalPolicy: h, hasWaitingRequest: g, isPayabilityUnknown: _, labels: v }) {
14
- let y = e(u, [t.PayablePayOrg]), b = e(u, [t.BankAccountReadOrg]), x = s(u), S = e(u, [t.PaymentRailAch]), C = e(u, [t.PayableWriteOrg]), w = y, T = [];
15
- if (l === "approve_in_progress" && d && (T.push({
16
- id: "approve",
17
- label: v.approve,
18
- variant: "default",
19
- surface: "row"
20
- }), T.push({
21
- id: "reject",
22
- label: v.reject,
23
- variant: "ghost",
24
- surface: "row"
25
- })), c({
26
- status: l,
27
- scopes: u,
28
- arePendingApproversUnknown: m,
29
- hasApprovalPolicy: h,
30
- hasWaitingRequest: g
31
- })) {
32
- let e = h === !1 ? void 0 : v.policyOverridesHeading;
33
- T.push({
34
- id: "forceApprove",
35
- label: v.forceApprove,
36
- variant: "ghost",
37
- surface: "menu",
38
- icon: o,
39
- sectionHeading: e
40
- }), T.push({
41
- id: "forceReject",
42
- label: v.forceReject,
43
- variant: "ghost",
44
- surface: "menu",
45
- icon: a,
46
- sectionHeading: e
47
- });
48
- }
49
- let E = l === "waiting_to_be_paid" && y && !f, D = l === "waiting_to_be_paid" && y && b && x && S && !f && !_;
50
- return E && T.push({
51
- id: "markAsPaid",
52
- label: v.markAsPaid,
53
- variant: "outline",
54
- surface: "row"
55
- }), D && T.push({
56
- id: "payBill",
57
- label: v.payBill,
58
- variant: "default",
59
- surface: "row"
60
- }), l === "new" && C && T.push({
61
- id: "cancel",
62
- label: v.cancel,
63
- variant: "ghost",
64
- surface: "menu",
65
- icon: n
66
- }), (l === "rejected" || l === "waiting_to_be_paid" && !f) && C && T.push({
67
- id: "reopen",
68
- label: v.reopen,
69
- variant: "ghost",
70
- surface: "menu",
71
- icon: i
72
- }), l === "waiting_to_be_paid" && f && p && w && T.push({
73
- id: "cancelScheduledPayment",
74
- label: v.cancelScheduledPayment,
75
- variant: "ghost",
76
- surface: "menu",
77
- icon: r
78
- }), T;
2
+ function e(e) {
3
+ return e?.amount_due ?? e?.total_amount ?? void 0;
79
4
  }
80
5
  //#endregion
81
- export { c as canOverrideApprovalPolicy, s as canReadCounterpartBankAccounts, l as getBillDetailActions };
6
+ export { e as resolveAmountDueMinorUnits };
@@ -1,6 +1,7 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js
2
- function e(e) {
3
- return e?.amount_due ?? e?.total_amount ?? void 0;
4
- }
2
+ var e = {
3
+ scheduleDialog: "pay-bill-schedule-dialog",
4
+ reviewDialog: "pay-bill-review-dialog"
5
+ };
5
6
  //#endregion
6
- export { e as resolveAmountDueMinorUnits };
7
+ export { e as payBillFlowTestIds };
@@ -1,7 +1,6 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
2
- var e = {
3
- scheduleDialog: "pay-bill-schedule-dialog",
4
- reviewDialog: "pay-bill-review-dialog"
5
- };
2
+ function e(e) {
3
+ return e ? `••••${e.slice(-4)}` : void 0;
4
+ }
6
5
  //#endregion
7
- export { e as payBillFlowTestIds };
6
+ export { e as maskAccountNumber };
@@ -1,6 +1,35 @@
1
+ import { coerceAmountValueToMinorUnits as e } from "../../../shared/util/dist/lib/coerceAmountValueToMinorUnits.js";
2
+ import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
1
3
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js
2
- function e(e) {
3
- return e ? `••••${e.slice(-4)}` : void 0;
4
+ var n = {
5
+ unnamedSourceAccount: "Bank account",
6
+ availableBalancePrefix: (e) => `Available balance: ${e}`,
7
+ futureInsufficientFunds: "Not enough funds right now. Add funds before the payment date.",
8
+ todayInsufficientFunds: "Not enough funds to pay today. Choose a different account or a later date."
9
+ };
10
+ function r(e) {
11
+ return e.slice(-4);
12
+ }
13
+ function i(i, a = n) {
14
+ return i.filter((e) => e.status === "ACTIVE").map((n) => {
15
+ let i = e(n.balance.value), o = n.balance.currencyCode;
16
+ return {
17
+ id: n.id,
18
+ primaryLabel: `${n.nickname || a.unnamedSourceAccount} - ${r(n.accountNumber)}`,
19
+ secondaryLabel: a.availableBalancePrefix(t(i / 100, { currencyCode: o })),
20
+ balanceMinorUnits: i
21
+ };
22
+ });
23
+ }
24
+ function a({ selectedAccount: e, amountDueMinorUnits: t, isToday: r, labels: i = n }) {
25
+ let a = e?.balanceMinorUnits;
26
+ return a === void 0 ? { state: "warning" } : a >= t ? { state: "sufficient" } : r ? {
27
+ state: "error",
28
+ message: i.todayInsufficientFunds
29
+ } : {
30
+ state: "warning",
31
+ message: i.futureInsufficientFunds
32
+ };
4
33
  }
5
34
  //#endregion
6
- export { e as maskAccountNumber };
35
+ export { n as SOURCE_ACCOUNT_LABELS_EN, a as deriveSourceAccountFunds, i as mapSourceAccountOptions };
@@ -1,35 +1,44 @@
1
- import { coerceAmountValueToMinorUnits as e } from "../../../shared/util/dist/lib/coerceAmountValueToMinorUnits.js";
2
- import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
1
+ import { REVIEW_TRANSACTION_DIALOG_LABELS_EN as e } from "../../ui/dist/index92.js";
2
+ import { SCHEDULE_PAYMENT_DIALOG_LABELS_EN as t } from "../../ui/dist/index98.js";
3
+ import "../../ui/dist/index.js";
4
+ import { SOURCE_ACCOUNT_LABELS_EN as n } from "./index23.js";
3
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
4
- var n = {
5
- unnamedSourceAccount: "Bank account",
6
- availableBalancePrefix: (e) => `Available balance: ${e}`,
7
- futureInsufficientFunds: "Not enough funds right now. Add funds before the payment date.",
8
- todayInsufficientFunds: "Not enough funds to pay today. Choose a different account or a later date."
6
+ var r = {
7
+ amountDue: "Amount due",
8
+ paymentAmount: "Payment amount",
9
+ dueDateSuffix: (e) => `by ${e}`,
10
+ paymentDate: "Payment date",
11
+ sourceAccount: "Pay from",
12
+ accountHolder: "Account holder name",
13
+ routingNumber: "Routing number",
14
+ accountNumber: "Account number",
15
+ achMethod: "Pay by ACH bank transfer",
16
+ scheduledToast: "Payment scheduled",
17
+ submitError: "Couldn't schedule this payment. Try again.",
18
+ selectAccountError: "Select a source account.",
19
+ selectDateError: "Select a payment date.",
20
+ staleDateError: "That date has passed. Choose a new payment date.",
21
+ missingPaymentInstructionsError: "This vendor does not have ACH payment instructions on file.",
22
+ checkingPaymentInstructionsError: "Still checking this vendor's payment instructions. Try again in a moment.",
23
+ paymentInstructionsUnavailableError: "Couldn't check this vendor's payment instructions. Try again.",
24
+ missingVendorName: "Not provided",
25
+ ...n,
26
+ scheduleDialog: t,
27
+ reviewDialog: e
9
28
  };
10
- function r(e) {
11
- return e.slice(-4);
12
- }
13
- function i(i, a = n) {
14
- return i.filter((e) => e.status === "ACTIVE").map((n) => {
15
- let i = e(n.balance.value), o = n.balance.currencyCode;
16
- return {
17
- id: n.id,
18
- primaryLabel: `${n.nickname || a.unnamedSourceAccount} - ${r(n.accountNumber)}`,
19
- secondaryLabel: a.availableBalancePrefix(t(i / 100, { currencyCode: o })),
20
- balanceMinorUnits: i
21
- };
22
- });
23
- }
24
- function a({ selectedAccount: e, amountDueMinorUnits: t, isToday: r, labels: i = n }) {
25
- let a = e?.balanceMinorUnits;
26
- return a === void 0 ? { state: "warning" } : a >= t ? { state: "sufficient" } : r ? {
27
- state: "error",
28
- message: i.todayInsufficientFunds
29
- } : {
30
- state: "warning",
31
- message: i.futureInsufficientFunds
29
+ function i(e) {
30
+ return {
31
+ ...r,
32
+ ...e,
33
+ scheduleDialog: {
34
+ ...r.scheduleDialog,
35
+ ...e?.scheduleDialog
36
+ },
37
+ reviewDialog: {
38
+ ...r.reviewDialog,
39
+ ...e?.reviewDialog
40
+ }
32
41
  };
33
42
  }
34
43
  //#endregion
35
- export { n as SOURCE_ACCOUNT_LABELS_EN, a as deriveSourceAccountFunds, i as mapSourceAccountOptions };
44
+ export { r as PAY_BILL_FLOW_LABELS_EN, i as mergePayBillFlowLabels };