@tesouro/embedded-components-react 0.4.15 → 0.4.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.
Files changed (125) hide show
  1. package/dist/index.css +39 -2
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -4
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +47 -21
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +22 -77
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +75 -24
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +36 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +63 -43
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +64 -48
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +2 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +10 -2
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +141 -118
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +93 -93
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +83 -67
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +235 -218
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +5 -5
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +19 -12
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +1 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +42 -24
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +17 -17
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +2 -2
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +2 -2
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +39 -39
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +2 -10
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +8 -50
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +52 -2
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +2 -0
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +1 -0
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +7 -7
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +26 -49
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +19 -306
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +154 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +2 -9
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +60 -45
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +251 -1
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -18
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +7 -48
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +49 -2
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -23
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +15 -337
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +50 -2
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -16
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +21 -118
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +340 -2
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +2 -12
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +10 -97
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +99 -2
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -12
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +11 -57
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +58 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +1 -54
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +52 -10
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +10 -179
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +181 -1
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -4
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +2 -39
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +41 -2
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -7
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +5 -90
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +92 -2
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -4
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +2 -14
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +16 -2
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -87
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +83 -291
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +292 -9
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +13 -1
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +1 -8
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +6 -37
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +39 -2
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +2 -39
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +36 -9
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +10 -199
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +201 -3
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +3 -17
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +15 -345
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +345 -8
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +6 -4
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +7 -91
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +93 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -127
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +122 -25
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +26 -87
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +94 -2
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -7
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -28
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +30 -2
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -7
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +5 -32
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +34 -2
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -12
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +10 -104
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +105 -1
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +2 -17
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +15 -123
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +125 -2
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -18
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +14 -6
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +7 -167
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +170 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -14
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +11 -105
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +108 -2
  112. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +8 -8
  113. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +4 -4
  114. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +5 -5
  115. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +19 -19
  116. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +39 -33
  117. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +15 -15
  118. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +9 -9
  119. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +7 -7
  120. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +37 -37
  121. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +15 -15
  122. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +7 -7
  123. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +0 -2
@@ -12,124 +12,135 @@ import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetPr
12
12
  import "../../../shared/feature/dist/index.js";
13
13
  import { usePayableHistoryQuery as ie } from "../../data-access/dist/index9.js";
14
14
  import { useAllPayableLineItemsQuery as ae } from "../../data-access/dist/index10.js";
15
- import { usePayableQuery as oe } from "../../data-access/dist/index15.js";
15
+ import { usePayableQuery as oe } from "../../data-access/dist/index16.js";
16
16
  import "../../data-access/dist/index.js";
17
- import { resolveVendor as se } from "./index7.js";
18
- import { BillCreateScreen as ce } from "../../ui/dist/index48.js";
19
- import { BillDecisionDialog as n } from "../../ui/dist/index54.js";
20
- import { BillDuplicateNotice as le } from "../../ui/dist/index64.js";
21
- import { ExtractionNotice as ue } from "../../ui/dist/index82.js";
22
- import { MarkAsPaidDialog as de } from "../../ui/dist/index91.js";
23
- import { UnsavedBillDialog as fe } from "../../ui/dist/index101.js";
17
+ import { hasUnpaidBalance as se } from "./index6.js";
18
+ import { resolveVendor as ce } from "./index7.js";
19
+ import { BillCreateScreen as le } from "../../ui/dist/index49.js";
20
+ import { BillDecisionDialog as n } from "../../ui/dist/index55.js";
21
+ import { BillDuplicateNotice as ue } from "../../ui/dist/index65.js";
22
+ import { ExtractionNotice as de } from "../../ui/dist/index83.js";
23
+ import { MarkAsPaidDialog as fe } from "../../ui/dist/index92.js";
24
+ import { UnsavedBillDialog as pe } from "../../ui/dist/index102.js";
24
25
  import "../../ui/dist/index.js";
25
- import { usePayableDuplicateReview as pe } from "./index12.js";
26
+ import { usePayableDuplicateReview as me } from "./index12.js";
26
27
  import "./index13.js";
27
- import { resolveAmountDueMinorUnits as me } from "./index19.js";
28
- import { PayBillFlow as he } from "./index25.js";
28
+ import { canReadCounterpartBankAccounts as he } from "./index18.js";
29
+ import { resolveAmountDueMinorUnits as ge } from "./index19.js";
30
+ import { usePayableAchInstructions as _e } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
31
+ import "../../../shared/counterpart-management/feature/dist/index.js";
32
+ import { PayBillFlow as ve } from "./index25.js";
29
33
  import "./index26.js";
30
- import { useMarkAsPaidFlow as ge } from "./index16.js";
34
+ import { useMarkAsPaidFlow as ye } from "./index16.js";
31
35
  import "./index17.js";
32
- import { BILL_CREATE_MESSAGE_LABELS_EN as _e, mergeBillCreateScreenCopy as ve } from "./index43.js";
33
- import { useBillCreateController as ye } from "./index52.js";
34
- import { useBillForm as be } from "./index54.js";
35
- import { buildPaymentHistory as xe } from "./index3.js";
36
- import { useApprovalPolicyCardView as Se } from "./index32.js";
37
- import { useCurrentApprovalRequestId as Ce } from "./index33.js";
38
- import { usePayableDetailActions as we } from "./index34.js";
39
- import { useScheduledPayment as Te } from "./index35.js";
40
- import { isEditablePayableStatus as Ee } from "./index36.js";
41
- import { useDraftDelete as De } from "./index37.js";
42
- import { buildBillDetailView as Oe } from "./index39.js";
43
- import { buildBillHistory as ke } from "./index40.js";
44
- import { SourceDocumentContainer as Ae } from "./index44.js";
45
- import { useVendorSectionProps as je } from "./index47.js";
46
- import { usePaymentInstructionsForm as Me } from "./index48.js";
36
+ import { BILL_CREATE_MESSAGE_LABELS_EN as be, mergeBillCreateScreenCopy as xe } from "./index43.js";
37
+ import { useBillCreateController as Se } from "./index52.js";
38
+ import { useBillForm as Ce } from "./index54.js";
39
+ import { buildPaymentHistory as we } from "./index3.js";
40
+ import { useApprovalPolicyCardView as Te } from "./index32.js";
41
+ import { useCurrentApprovalRequestId as Ee } from "./index33.js";
42
+ import { usePayableDetailActions as De } from "./index34.js";
43
+ import { useScheduledPayment as Oe } from "./index35.js";
44
+ import { isEditablePayableStatus as ke } from "./index36.js";
45
+ import { useDraftDelete as Ae } from "./index37.js";
46
+ import { buildBillDetailView as je } from "./index39.js";
47
+ import { buildBillHistory as Me } from "./index40.js";
48
+ import { SourceDocumentContainer as Ne } from "./index44.js";
49
+ import { useVendorSectionProps as Pe } from "./index47.js";
50
+ import { usePaymentInstructionsForm as Fe } from "./index48.js";
47
51
  import { billCreateTestIds as r } from "./index55.js";
48
- import { useCallback as i, useEffect as Ne, useMemo as a, useRef as Pe, useState as o } from "react";
49
- import { Fragment as Fe, jsx as s, jsxs as Ie } from "react/jsx-runtime";
50
- import { Trash2Icon as Le } from "lucide-react";
52
+ import { useCallback as i, useEffect as Ie, useMemo as a, useRef as Le, useState as o } from "react";
53
+ import { Fragment as Re, jsx as s, jsxs as c } from "react/jsx-runtime";
54
+ import { Trash2Icon as ze } from "lucide-react";
51
55
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js
52
- function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: Re, poweredByBankName: ze }) {
53
- let p = a(() => ve(f), [f]), [m, h] = o(), [g, _] = o(!1), [Be, Ve] = o(!1), [He, v] = o(!1), [Ue, y] = o(), b = u ?? Ue, x = oe(b, { pollWhileOcrProcessing: !0 }), S = ae(b), { initResponse: C } = re(), w = !!C, T = e(C?.scopes, [t.AccountingConfigReadOrg]), E = ee({ enabled: T }), D = x.data, O = !b || !!D, k = !d && O && !!b && D?.status !== "draft", We = !d && !!D && !Ee(D?.status), A = d || We, j = be({
54
- payable: D,
55
- lineItems: S.lineItems
56
- }), M = D?.counterpart_id;
57
- Ne(() => {
58
- g || M && (h(M), _(!0));
59
- }, [g, M]);
60
- let Ge = i((e) => {
61
- _(!0), h(e);
62
- }, []), N = je({
63
- payableId: d ? void 0 : b,
56
+ function l({ open: l, onOpenChange: u, payableId: Be, readOnly: d = !1, copy: f, onCollapse: Ve, poweredByBankName: He }) {
57
+ let p = a(() => xe(f), [f]), [m, Ue] = o(), [h, g] = o(!1), [We, Ge] = o(!1), [Ke, _] = o(!1), [qe, v] = o(), y = Be ?? qe, b = oe(y, { pollWhileOcrProcessing: !0 }), x = ae(y), { initResponse: S } = re(), Je = !!S, C = e(S?.scopes, [t.AccountingConfigReadOrg]), w = ee({ enabled: C }), T = b.data, E = !y || !!T, D = !d && E && !!y && T?.status !== "draft", Ye = !d && !!T && !ke(T?.status), O = d || Ye, k = Ce({
58
+ payable: T,
59
+ lineItems: x.lineItems
60
+ }), A = T?.counterpart_id;
61
+ Ie(() => {
62
+ h || A && (Ue(A), g(!0));
63
+ }, [h, A]);
64
+ let Xe = i((e) => {
65
+ g(!0), Ue(e);
66
+ }, []), j = Pe({
67
+ payableId: d ? void 0 : y,
64
68
  counterpartId: d ? void 0 : m,
65
- payableCounterpartId: M,
66
- onCounterpartChange: Ge,
67
- requiredError: j.errors?.vendor,
68
- payableCounterpartBankAccountId: D?.counterpart_bank_account_id ?? void 0,
69
- extractedVendor: D?.counterpart_raw_data ?? void 0
70
- }), Ke = !!(b && g) && !m, qe = a(() => k ? { saveDraftButton: p.submittedSaveButton } : void 0, [p.submittedSaveButton, k]), Je = a(() => k ? { draftSaved: _e.submittedSaved } : void 0, [k]), P = x.refetch, Ye = i(async () => {
71
- let { data: e } = await P();
69
+ payableCounterpartId: A,
70
+ onCounterpartChange: Xe,
71
+ requiredError: k.errors?.vendor,
72
+ payableCounterpartBankAccountId: T?.counterpart_bank_account_id ?? void 0,
73
+ extractedVendor: T?.counterpart_raw_data ?? void 0
74
+ }), Ze = !!(y && h) && !m, Qe = a(() => D ? { saveDraftButton: p.submittedSaveButton } : void 0, [p.submittedSaveButton, D]), $e = a(() => D ? { draftSaved: be.submittedSaved } : void 0, [D]), et = b.refetch, tt = i(async () => {
75
+ let { data: e } = await et();
72
76
  return e?.status ?? void 0;
73
- }, [P]), F = ye({
74
- payableId: u,
75
- form: j,
76
- labels: Je,
77
+ }, [et]), M = Se({
78
+ payableId: Be,
79
+ form: k,
80
+ labels: $e,
77
81
  counterpartId: m,
78
- clearCounterpart: Ke,
79
- prepareVendorForSave: N.savePaymentInstructions,
80
- onPayableCreated: y,
81
- onSaved: y,
82
- onDraftSaved: () => l(!1),
83
- onFinalized: () => l(!1),
84
- readSavedStatus: k ? Ye : void 0
85
- }), Xe = !!(F.isSavingDraft || F.isFinalizing), I = d ? b : void 0, L = Ce({
86
- payableId: I,
87
- status: D?.status
88
- }), Ze = Pe(null), R = Te({
89
- payableId: b,
90
- scheduledPaymentDate: D?.scheduled_payment_date,
91
- enabled: d || k
92
- }), Qe = se(D), z = Me({
93
- payableId: I,
94
- counterpartId: d ? M : void 0,
82
+ clearCounterpart: Ze,
83
+ prepareVendorForSave: j.savePaymentInstructions,
84
+ onPayableCreated: v,
85
+ onSaved: v,
86
+ onDraftSaved: () => u(!1),
87
+ onFinalized: () => u(!1),
88
+ readSavedStatus: D ? tt : void 0
89
+ }), nt = !!(M.isSavingDraft || M.isFinalizing), N = d ? y : void 0, P = Ee({
90
+ payableId: N,
91
+ status: T?.status
92
+ }), F = Le(null), I = Oe({
93
+ payableId: y,
94
+ scheduledPaymentDate: T?.scheduled_payment_date,
95
+ enabled: d || D
96
+ }), rt = ce(T), L = he(S?.scopes), R = _e({
97
+ counterpartId: d ? A : void 0,
98
+ currency: T?.currency,
99
+ currentBankAccountId: d ? T?.counterpart_bank_account_id ?? void 0 : void 0,
100
+ enabled: L && d
101
+ }), z = Fe({
102
+ payableId: N,
103
+ counterpartId: d ? A : void 0,
104
+ currentBankAccountId: T?.counterpart_bank_account_id ?? void 0,
105
+ canReadCounterpartBankAccounts: L,
95
106
  saveErrorMessage: p.detail.paymentInstructionsSaveError,
96
107
  linkErrorMessage: p.detail.paymentInstructionsLinkError
97
- }), $e = e(C?.scopes, [t.PayableWriteOrg]), et = e(C?.scopes, [t.CounterpartWriteOrg]) && $e, B = ge({
98
- payableId: I,
99
- amountDueMinorUnits: me(D) ?? 0,
100
- amountToPayMinorUnits: D?.amount_to_pay ?? void 0,
101
- currencyCode: D?.currency ?? void 0,
102
- dueDate: D?.due_date,
103
- hasScheduledPayment: R.hasScheduledPayment,
108
+ }), it = e(S?.scopes, [t.PayableWriteOrg]), at = e(S?.scopes, [t.CounterpartWriteOrg]) && it, ot = at && se(T?.status) && !I.hasScheduledPayment && !I.isResolving, B = ye({
109
+ payableId: N,
110
+ amountDueMinorUnits: ge(T) ?? 0,
111
+ amountToPayMinorUnits: T?.amount_to_pay ?? void 0,
112
+ currencyCode: T?.currency ?? void 0,
113
+ dueDate: T?.due_date,
114
+ hasScheduledPayment: I.hasScheduledPayment,
104
115
  labels: p.markAsPaid
105
- }), V = Se({
106
- payableId: I,
107
- approvalPolicyId: D?.approval_policy_id,
116
+ }), V = Te({
117
+ payableId: N,
118
+ approvalPolicyId: T?.approval_policy_id,
108
119
  enabled: d,
109
120
  copy: p.approvalPolicyCopy
110
- }), { actions: H, decisionDialog: tt, isActionPending: nt } = we({
111
- payableId: d || k ? b : void 0,
112
- status: D?.status,
113
- currentApprovalRequestId: L.id,
114
- isPolicyApprover: L.isPolicyApprover,
115
- hasWaitingRequest: L.hasWaitingRequest,
121
+ }), { actions: H, decisionDialog: st, isActionPending: ct } = De({
122
+ payableId: d || D ? y : void 0,
123
+ status: T?.status,
124
+ currentApprovalRequestId: P.id,
125
+ isPolicyApprover: P.isPolicyApprover,
126
+ hasWaitingRequest: P.hasWaitingRequest,
116
127
  arePendingApproversUnknown: V.isLoading,
117
- hasScheduledPayment: R.hasScheduledPayment,
118
- scheduledPaymentIntentId: R.scheduledPaymentIntentId,
119
- isScheduledPaymentUnknown: R.isResolving,
128
+ hasScheduledPayment: I.hasScheduledPayment,
129
+ scheduledPaymentIntentId: I.scheduledPaymentIntentId,
130
+ isScheduledPaymentUnknown: I.isResolving,
120
131
  pendingApprovers: V.pendingApprovers,
121
132
  labels: p.actions,
122
133
  isMarkAsPaidPending: B.isPending,
123
134
  onMarkAsPaidSelect: B.open,
124
- onPayBillSelect: () => Ze.current?.open(),
125
- onActionSucceeded: k ? () => l(!1) : void 0
126
- }), U = De({
127
- payableId: b,
128
- status: D?.status,
135
+ onPayBillSelect: () => F.current?.open(),
136
+ onActionSucceeded: D ? () => u(!1) : void 0
137
+ }), U = Ae({
138
+ payableId: y,
139
+ status: T?.status,
129
140
  enabled: !d,
130
141
  labels: p.deleteDraft,
131
- onDeleted: () => l(!1)
132
- }), W = Xe || nt, G = x.isLoading || S.isResolving || E.isResolving, K = x.isError || S.isError || E.isError, rt = a(() => [...U.menuItems, ...k || d && !G && !K ? H.menu.map((e) => ({
142
+ onDeleted: () => u(!1)
143
+ }), W = nt || ct, G = b.isLoading || x.isResolving || w.isResolving || R.isLoading, K = b.isError || x.isError || w.isError, lt = a(() => [...U.menuItems, ...D || d && !G && !K ? H.menu.map((e) => ({
133
144
  id: e.id,
134
145
  label: e.label,
135
146
  onSelect: e.onSelect,
@@ -139,153 +150,159 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
139
150
  })) : []], [
140
151
  H.menu,
141
152
  U.menuItems,
142
- k,
153
+ D,
143
154
  d,
144
155
  G,
145
156
  K
146
- ]), q = a(() => (E.data?.data ?? []).map((e) => ({
157
+ ]), q = a(() => (w.data?.data ?? []).map((e) => ({
147
158
  value: e.id,
148
159
  label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
149
- })), [E.data]), J;
150
- w && (T ? E.isError ? J = p.lineItemsGlCodeUnavailable.loadError : !E.isResolving && q.length === 0 && (J = p.lineItemsGlCodeUnavailable.empty) : J = p.lineItemsGlCodeUnavailable.noAccess);
151
- let it = !w || !!J || E.isResolving, at = T && !E.isResolving && !E.isError, Y = ie(I), ot = e(C?.scopes, [t.UserReadOrg]), st = te({ enabled: d && ot }), ct = a(() => ke(Y.data?.data ?? [], st.data?.data ?? [], p.history), [
160
+ })), [w.data]), J;
161
+ Je && (C ? w.isError ? J = p.lineItemsGlCodeUnavailable.loadError : !w.isResolving && q.length === 0 && (J = p.lineItemsGlCodeUnavailable.empty) : J = p.lineItemsGlCodeUnavailable.noAccess);
162
+ let ut = !Je || !!J || w.isResolving, dt = C && !w.isResolving && !w.isError, Y = ie(N), ft = e(S?.scopes, [t.UserReadOrg]), pt = te({ enabled: d && ft }), mt = a(() => Me(Y.data?.data ?? [], pt.data?.data ?? [], p.history), [
152
163
  Y.data,
153
- st.data,
164
+ pt.data,
154
165
  p.history
155
- ]), lt = a(() => xe({
156
- records: R.paymentRecords,
166
+ ]), ht = a(() => we({
167
+ records: I.paymentRecords,
157
168
  events: Y.data?.data ?? [],
158
- currencyCode: D?.currency,
169
+ currencyCode: T?.currency,
159
170
  labels: p.detail
160
171
  }), [
161
- R.paymentRecords,
172
+ I.paymentRecords,
162
173
  Y.data,
163
- D?.currency,
174
+ T?.currency,
164
175
  p.detail
165
- ]), ut = a(() => d && D ? Oe({
166
- payable: D,
167
- lineItems: S.lineItems,
176
+ ]), gt = a(() => d && T ? je({
177
+ payable: T,
178
+ lineItems: x.lineItems,
168
179
  glCodeOptions: q,
169
- glCodeRosterAvailable: at,
170
- history: ct,
171
- paymentHistory: lt,
180
+ glCodeRosterAvailable: dt,
181
+ history: mt,
182
+ paymentHistory: ht,
172
183
  approvalPolicy: V.view,
173
184
  labels: p.detail,
174
- hasScheduledPayment: R.hasScheduledPayment
185
+ hasScheduledPayment: I.hasScheduledPayment,
186
+ payableAchInstructions: R.achInstructions,
187
+ payableAchInstructionsReadable: L && !R.isError
175
188
  }) : void 0, [
176
- R.hasScheduledPayment,
189
+ I.hasScheduledPayment,
177
190
  V.view,
191
+ L,
178
192
  p.detail,
179
193
  q,
180
- at,
181
- ct,
182
- S.lineItems,
183
- D,
184
- lt,
194
+ dt,
195
+ mt,
196
+ x.lineItems,
197
+ T,
198
+ R.achInstructions,
199
+ R.isError,
200
+ ht,
185
201
  d
186
- ]), dt = D?.source_of_payable_data === "ocr", X = Qe?.name, ft = d ? X ? p.viewTitle(X) : p.readOnlyTitle : X && (dt || k) ? p.extractedTitle(X) : p.newTitle, pt = d && D?.created_at ? p.addedOn(ne(D.created_at.slice(0, 10))) : void 0, Z = i(() => {
187
- let e = j.isDirty || N.hasUnsavedVendorChanges || !!F.stagedFile || F.isFileDeletionPending;
188
- if (!A && e) {
189
- v(!0);
202
+ ]), _t = T?.source_of_payable_data === "ocr", X = rt?.name, vt = d ? X ? p.viewTitle(X) : p.readOnlyTitle : X && (_t || D) ? p.extractedTitle(X) : p.newTitle, yt = d && T?.created_at ? p.addedOn(ne(T.created_at.slice(0, 10))) : void 0, Z = i(() => {
203
+ let e = k.isDirty || j.hasUnsavedVendorChanges || !!M.stagedFile || M.isFileDeletionPending;
204
+ if (!O && e) {
205
+ _(!0);
190
206
  return;
191
207
  }
192
- l(!1);
208
+ u(!1);
193
209
  }, [
194
- F.isFileDeletionPending,
195
- F.stagedFile,
196
- j.isDirty,
197
- A,
198
- l,
199
- N.hasUnsavedVendorChanges
200
- ]), mt = i(() => {
201
- v(!1), l(!1);
202
- }, [l]), Q = S.isResolving || N.mode === "creating", ht = i(async () => {
210
+ M.isFileDeletionPending,
211
+ M.stagedFile,
212
+ k.isDirty,
213
+ O,
214
+ u,
215
+ j.hasUnsavedVendorChanges
216
+ ]), bt = i(() => {
217
+ _(!1), u(!1);
218
+ }, [u]), Q = x.isResolving || j.mode === "creating", xt = i(async () => {
203
219
  if (Q) return;
204
- let e = await F.saveDraft();
205
- v(!1), e && l(!1);
220
+ let e = await M.saveDraft();
221
+ _(!1), e && u(!1);
206
222
  }, [
207
- F,
223
+ M,
208
224
  Q,
209
- l
210
- ]), $ = pe({
211
- payable: D,
212
- onRemoved: () => l(!1),
213
- canManage: $e
214
- }), gt = i((e) => {
215
- if (!(W || $.isBusy)) return e ? l(!0) : Z();
225
+ u
226
+ ]), $ = me({
227
+ payable: T,
228
+ onRemoved: () => u(!1),
229
+ canManage: it
230
+ }), St = i((e) => {
231
+ if (!(W || $.isBusy)) return e ? u(!0) : Z();
216
232
  }, [
217
233
  $.isBusy,
218
234
  W,
219
235
  Z,
220
- l
221
- ]), _t = $.isPossibleDuplicate, vt = !d && dt && !Be, yt = _t || vt ? /* @__PURE__ */ Ie(Fe, { children: [_t ? /* @__PURE__ */ s(le, {
236
+ u
237
+ ]), Ct = $.isPossibleDuplicate, wt = !d && _t && !We, Tt = Ct || wt ? /* @__PURE__ */ c(Re, { children: [Ct ? /* @__PURE__ */ s(ue, {
222
238
  onNotADuplicate: $.onNotADuplicate,
223
239
  onRemoveBill: $.onRemoveBill,
224
240
  isActionDisabled: $.isBusy,
225
241
  labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
226
242
  testId: r.duplicateNotice
227
- }) : null, vt ? /* @__PURE__ */ s(ue, { onDismiss: () => Ve(!0) }) : null] }) : void 0;
228
- return /* @__PURE__ */ Ie(Fe, { children: [
229
- /* @__PURE__ */ s(ce, {
230
- open: c,
231
- onOpenChange: gt,
232
- title: ft,
233
- subtitle: pt,
234
- notice: yt,
243
+ }) : null, wt ? /* @__PURE__ */ s(de, { onDismiss: () => Ge(!0) }) : null] }) : void 0;
244
+ return /* @__PURE__ */ c(Re, { children: [
245
+ /* @__PURE__ */ s(le, {
246
+ open: l,
247
+ onOpenChange: St,
248
+ title: vt,
249
+ subtitle: yt,
250
+ notice: Tt,
235
251
  vendor: {
236
- ...N,
252
+ ...j,
237
253
  testId: r.vendorSection
238
254
  },
239
- values: j.values,
240
- errors: j.errors,
241
- onChange: j.onChange,
255
+ values: k.values,
256
+ errors: k.errors,
257
+ onChange: k.onChange,
242
258
  lineItems: {
243
- items: j.lineItemRows,
259
+ items: k.lineItemRows,
244
260
  glCodeOptions: q,
245
- glCodeDisabled: it,
261
+ glCodeDisabled: ut,
246
262
  glCodeUnavailableMessage: J,
247
- discount: j.discount,
248
- onDiscountChange: j.onDiscountChange,
249
- tax: j.tax,
250
- onTaxChange: j.onTaxChange,
251
- total: j.total,
252
- onTotalChange: j.onTotalChange,
253
- onAddLineItem: j.onAddLineItem,
254
- errors: j.lineItemErrors,
255
- totalsErrors: j.totalsErrors,
263
+ discount: k.discount,
264
+ onDiscountChange: k.onDiscountChange,
265
+ tax: k.tax,
266
+ onTaxChange: k.onTaxChange,
267
+ total: k.total,
268
+ onTotalChange: k.onTotalChange,
269
+ onAddLineItem: k.onAddLineItem,
270
+ errors: k.lineItemErrors,
271
+ totalsErrors: k.totalsErrors,
256
272
  testId: r.lineItems
257
273
  },
258
- documentPanel: /* @__PURE__ */ s(Ae, {
259
- payableId: b,
260
- readOnly: A,
261
- isDocumentPending: !!b && !D?.file && (x.isLoading || D?.ocr_status === "processing"),
262
- file: D?.file ? {
263
- id: D.file.id,
264
- name: D.file.name,
265
- url: D.file.url,
266
- mimetype: D.file.mimetype
274
+ documentPanel: /* @__PURE__ */ s(Ne, {
275
+ payableId: y,
276
+ readOnly: O,
277
+ isDocumentPending: !!y && !T?.file && (b.isLoading || T?.ocr_status === "processing"),
278
+ file: T?.file ? {
279
+ id: T.file.id,
280
+ name: T.file.name,
281
+ url: T.file.url,
282
+ mimetype: T.file.mimetype
267
283
  } : void 0,
268
284
  staging: {
269
- stagedFile: F.stagedFile,
270
- onFileStaged: F.stageFile,
271
- onClearStagedFile: F.clearStagedFile,
272
- isSaving: Xe
285
+ stagedFile: M.stagedFile,
286
+ onFileStaged: M.stageFile,
287
+ onClearStagedFile: M.clearStagedFile,
288
+ isSaving: nt
273
289
  },
274
290
  deletion: {
275
- isPending: F.isFileDeletionPending,
276
- onRequest: F.requestFileDeletion,
277
- onDetachNow: F.detachFileNow,
278
- isDeleting: F.isDeletingFile,
279
- hasFailed: F.hasFileDeletionFailed
291
+ isPending: M.isFileDeletionPending,
292
+ onRequest: M.requestFileDeletion,
293
+ onDetachNow: M.detachFileNow,
294
+ isDeleting: M.isDeletingFile,
295
+ hasFailed: M.hasFileDeletionFailed
280
296
  }
281
297
  }),
282
- menuItems: rt,
283
- readOnly: A,
298
+ menuItems: lt,
299
+ readOnly: O,
284
300
  detail: d ? {
285
- view: ut,
301
+ view: gt,
286
302
  actions: H,
287
- scheduledSummary: R.hasScheduledPayment && R.scheduledDateLabel ? p.scheduledSummary(R.scheduledDateLabel) : void 0,
288
- paymentInstructionsForm: M && et ? {
303
+ scheduledSummary: I.hasScheduledPayment && I.scheduledDateLabel ? p.scheduledSummary(I.scheduledDateLabel) : void 0,
304
+ onEditPaymentInstructions: A && ot ? z.open : void 0,
305
+ paymentInstructionsForm: A && ot ? {
289
306
  isOpen: z.isOpen,
290
307
  values: z.values,
291
308
  errors: z.errors,
@@ -297,28 +314,28 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
297
314
  } : void 0,
298
315
  isLoading: G,
299
316
  isError: K,
300
- paymentHistoryError: R.isError || Y.isError,
301
- paymentHistoryLoading: R.isResolving || Y.isLoading
317
+ paymentHistoryError: I.isError || Y.isError,
318
+ paymentHistoryLoading: I.isResolving || Y.isLoading
302
319
  } : void 0,
303
- isLineItemsLoading: S.isResolving,
320
+ isLineItemsLoading: x.isResolving,
304
321
  isSaving: W,
305
- isSavingDraft: F.isSavingDraft,
306
- isFinalizing: F.isFinalizing,
322
+ isSavingDraft: M.isSavingDraft,
323
+ isFinalizing: M.isFinalizing,
307
324
  onCancel: Z,
308
- onCollapse: d ? Re : void 0,
309
- onSaveDraft: F.saveDraft,
310
- onFinalize: F.finalize,
311
- scrollToErrorToken: F.scrollToErrorToken,
312
- showFinalize: !k && O,
313
- labels: qe,
325
+ onCollapse: d ? Ve : void 0,
326
+ onSaveDraft: M.saveDraft,
327
+ onFinalize: M.finalize,
328
+ scrollToErrorToken: M.scrollToErrorToken,
329
+ showFinalize: !D && E,
330
+ labels: Qe,
314
331
  testId: r.dialog
315
332
  }),
316
- /* @__PURE__ */ s(fe, {
317
- open: He,
318
- onSaveDraft: ht,
319
- onDiscard: mt,
320
- onCancel: () => v(!1),
321
- isSaving: F.isSavingDraft,
333
+ /* @__PURE__ */ s(pe, {
334
+ open: Ke,
335
+ onSaveDraft: xt,
336
+ onDiscard: bt,
337
+ onCancel: () => _(!1),
338
+ isSaving: M.isSavingDraft,
322
339
  isSaveDraftDisabled: Q,
323
340
  labels: p.unsavedChanges,
324
341
  testId: r.unsavedDialog,
@@ -327,7 +344,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
327
344
  closeTestId: r.unsavedClose
328
345
  }),
329
346
  /* @__PURE__ */ s(n, {
330
- ...tt,
347
+ ...st,
331
348
  labels: { cancelButton: p.actions.decisionDialog.cancelButton },
332
349
  testId: r.decisionDialog,
333
350
  confirmTestId: r.decisionConfirm,
@@ -345,20 +362,20 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
345
362
  onConfirm: $.removeConfirmation.onConfirm,
346
363
  onCancel: $.removeConfirmation.onCancel,
347
364
  isPending: $.removeConfirmation.isPending,
348
- confirmIcon: /* @__PURE__ */ s(Le, {}),
365
+ confirmIcon: /* @__PURE__ */ s(ze, {}),
349
366
  labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
350
367
  testId: r.duplicateRemoveDialog,
351
368
  confirmTestId: r.duplicateRemoveConfirm
352
369
  }),
353
- /* @__PURE__ */ s(de, { ...B.dialogProps }),
354
- d && D ? /* @__PURE__ */ s(he, {
355
- ref: Ze,
356
- payable: D,
357
- onMissingAchInstructions: et ? z.open : void 0,
358
- poweredByBankName: ze,
370
+ /* @__PURE__ */ s(fe, { ...B.dialogProps }),
371
+ d && T ? /* @__PURE__ */ s(ve, {
372
+ ref: F,
373
+ payable: T,
374
+ onMissingAchInstructions: at ? z.open : void 0,
375
+ poweredByBankName: He,
359
376
  labels: p.payBill
360
377
  }) : null
361
378
  ] });
362
379
  }
363
380
  //#endregion
364
- export { c as BillCreateDialog, c as default };
381
+ export { l as BillCreateDialog, l as default };
@@ -1,4 +1,4 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index59.js";
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index60.js";
2
2
  import "../../ui/dist/index.js";
3
3
  import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index14.js";
4
4
  import "./index17.js";
@@ -10,12 +10,12 @@ import { useWidgetConfig as ee } from "../../../shared/feature/dist/lib/WidgetPr
10
10
  import "../../../shared/feature/dist/index.js";
11
11
  import { usePayableHistoryQuery as r } from "../../data-access/dist/index9.js";
12
12
  import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index10.js";
13
- import { usePayableQuery as a } from "../../data-access/dist/index15.js";
13
+ import { usePayableQuery as a } from "../../data-access/dist/index16.js";
14
14
  import "../../data-access/dist/index.js";
15
- import { BillDecisionDialog as o } from "../../ui/dist/index54.js";
16
- import { BillDetailsSheet as s } from "../../ui/dist/index60.js";
17
- import { BillDuplicateNotice as c } from "../../ui/dist/index64.js";
18
- import { MarkAsPaidDialog as l } from "../../ui/dist/index91.js";
15
+ import { BillDecisionDialog as o } from "../../ui/dist/index55.js";
16
+ import { BillDetailsSheet as s } from "../../ui/dist/index61.js";
17
+ import { BillDuplicateNotice as c } from "../../ui/dist/index65.js";
18
+ import { MarkAsPaidDialog as l } from "../../ui/dist/index92.js";
19
19
  import "../../ui/dist/index.js";
20
20
  import { usePayableDuplicateReview as u } from "./index12.js";
21
21
  import "./index13.js";