@tesouro/embedded-components-react 0.11.235 → 0.11.237

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 (77) hide show
  1. package/README.md +2 -2
  2. package/dist/index.css +12 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/lib/ReceivablesWidget.d.ts +24 -0
  5. package/dist/lib/WidgetSuite.d.ts +24 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +6 -6
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +198 -118
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +76 -194
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +67 -75
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +111 -69
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +459 -108
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +101 -449
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +9 -117
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +85 -8
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +67 -73
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +246 -71
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +40 -251
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +237 -38
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +21 -244
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +529 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +4 -530
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +44 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +242 -41
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +3 -245
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +5 -3
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +63 -4
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +1 -64
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/billPay.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +386 -354
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +260 -258
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +219 -179
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -25
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +15 -0
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +31 -40
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -17
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +40 -8
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +30 -63
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +463 -27
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +15 -29
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +8 -18
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +18 -18
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +19 -30
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +15 -66
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +66 -391
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +148 -2
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +173 -43
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +3 -71
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +37 -432
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +66 -188
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +455 -22
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +191 -5
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +23 -0
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +5 -265
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +261 -125
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +2 -27
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +122 -230
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +27 -3
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +216 -224
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +3 -30
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +228 -168
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +29 -21
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +152 -109
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +22 -2
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +140 -43
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +2 -0
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index65.js +47 -0
  72. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/document-preview.js +1 -0
  73. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/document/documentPreview.js +122 -0
  75. package/package.json +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +0 -1
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +0 -2
package/README.md CHANGED
@@ -812,7 +812,7 @@ Lists, creates, edits and acts on an organization's invoices, including sending
812
812
  | `initialCounterpartId` | `string` | `undefined` | With `initialView: 'create'`, preselects this customer in that first create form only. Otherwise, opens the invoice list filtered to this customer, with a chip naming them. Clear all removes it. |
813
813
  | `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Rows-per-page choices. The first page loads at the first choice, or `10` when the list is empty. |
814
814
  | `onReceivableCreated` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called after a create succeeds. Not called for a duplicate. |
815
- | `onReceivableOpened` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called when the user opens a row's details panel. |
815
+ | `onReceivableOpened` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called when the user opens a row, in its details or, for a draft, in the edit form. |
816
816
  | `onTemplateSettingsClick` | `() => void` | `undefined` | Shows the invoice settings button at the top right, on the `headerStart` line, for users holding `organization_settings:write:org`, and calls this when it is clicked. |
817
817
  | `headerStart` | `ReactNode` | `undefined` | Rendered above the tab row. It stays when an error or the disclosures gate replaces the tabs. The widget renders no heading of its own, so pass your page title here. |
818
818
  | `selectedTab` | `InvoicingTabId` | `undefined` | The active tab: `'invoices'`, `'recurring'`, `'customers'` or `'products'`. Omit to let the widget track it, starting on Invoices. |
@@ -827,7 +827,7 @@ Lists, creates, edits and acts on an organization's invoices, including sending
827
827
  | `filterLabels` | `InvoicesFilterLabelOverrides` | English labels | Invoice filter copy built from state: date presets, status descriptions and chip wording. |
828
828
  | `formLabels` | `Partial<ReceivableFormDialogLabels>` | English labels | Create/edit form copy, including the unsaved-changes prompt; the save and issue buttons are in `messageLabels`. |
829
829
  | `previewLabels` | `Partial<ReceivablePreviewLabels>` | English labels | Copy of the live invoice preview beside the create/edit form. |
830
- | `detailsLabels` | `ReceivableDetailsPanelLabelOverrides` | English labels | Details panel copy. Status badge copy comes from `screenLabels.statusBadge`. |
830
+ | `detailsLabels` | `ReceivableDetailsPanelLabelOverrides` | English labels | Copy of the invoice details, full screen and side panel. Status badge copy comes from `screenLabels.statusBadge`. |
831
831
  | `auditHistoryLabels` | `Partial<ReceivableAuditHistoryLabels>` | English labels | Audit history row copy. Document and status names follow `messageLabels` and `screenLabels.statusBadge` unless overridden here. |
832
832
  | `paymentLabels` | `Partial<ReceivablePaymentDialogLabels>` | English labels | Manual payment dialog copy. |
833
833
  | `actionLabels` | `Partial<ReceivableActionDialogLabels>` | English labels | Confirmation dialog buttons; per-action titles come from `messageLabels`. |
package/dist/index.css CHANGED
@@ -530,6 +530,9 @@
530
530
  .ttw\:mr-auto {
531
531
  margin-right: auto;
532
532
  }
533
+ .ttw\:-mb-4 {
534
+ margin-bottom: calc(var(--ttw-spacing) * -4);
535
+ }
533
536
  .ttw\:-mb-px {
534
537
  margin-bottom: -1px;
535
538
  }
@@ -829,6 +832,9 @@
829
832
  .ttw\:h-\[50px\] {
830
833
  height: 50px;
831
834
  }
835
+ .ttw\:h-\[70vh\] {
836
+ height: 70vh;
837
+ }
832
838
  .ttw\:h-\[190px\] {
833
839
  height: 190px;
834
840
  }
@@ -6482,9 +6488,15 @@
6482
6488
  .ttw\:lg\:grid {
6483
6489
  display: grid;
6484
6490
  }
6491
+ .ttw\:lg\:h-auto {
6492
+ height: auto;
6493
+ }
6485
6494
  .ttw\:lg\:min-h-0 {
6486
6495
  min-height: 0px;
6487
6496
  }
6497
+ .ttw\:lg\:flex-1 {
6498
+ flex: 1;
6499
+ }
6488
6500
  .ttw\:lg\:grid-cols-2 {
6489
6501
  grid-template-columns: repeat(2, minmax(0, 1fr));
6490
6502
  }
package/dist/index.d.ts CHANGED
@@ -4537,6 +4537,10 @@ interface ReceivableFormDialogLabels extends ReceivableBillingSectionLabels, Rec
4537
4537
  editTitle: string;
4538
4538
  editDescription: string;
4539
4539
  closeButton: string;
4540
+ /** The draft editor's header menu and its items. */
4541
+ moreActionsButton: string;
4542
+ duplicateButton: string;
4543
+ deleteButton: string;
4540
4544
  dueDateLabel: string;
4541
4545
  lineItemsHeading: string;
4542
4546
  lineItemsDescription: string;
@@ -4621,6 +4625,24 @@ interface ReceivableDetailsPanelLabels {
4621
4625
  moreActionsLabel: string;
4622
4626
  viewPdfButton: string;
4623
4627
  closeButton: string;
4628
+ /** The side panel's control that opens the full-screen view. */
4629
+ expandButton: string;
4630
+ /** The full-screen view's control that hands back to the side panel. */
4631
+ collapseButton: string;
4632
+ /** Names the full-screen view's scrollable PDF pane. */
4633
+ documentPaneRegion: string;
4634
+ downloadPdfButton: string;
4635
+ /** Shown in the PDF pane while the invoice has no PDF to show. */
4636
+ pdfUnavailable: string;
4637
+ /** Names the scrollable PDF pages inside the pane. */
4638
+ pdfPagesRegion: string;
4639
+ /** Shown, with a link out, when the PDF cannot render in the pane. */
4640
+ pdfPreviewFailed: string;
4641
+ openPdfButton: string;
4642
+ lineItemsDescriptionColumn: string;
4643
+ lineItemsQuantityColumn: string;
4644
+ lineItemsPriceColumn: string;
4645
+ lineItemsAmountColumn: string;
4624
4646
  invoiceDateCaption: string;
4625
4647
  paymentHistoryHeading: string;
4626
4648
  paymentHistoryEmpty: string;
@@ -4964,6 +4986,8 @@ interface ReceivableMessageLabels {
4964
4986
  cancelConfirm: string;
4965
4987
  cancelSucceeded: string;
4966
4988
  cloneSuccess: string;
4989
+ /** Duplicating from the draft editor copies the saved draft, so unsaved edits block it. */
4990
+ cloneUnsavedChanges: string;
4967
4991
  cloneError: string;
4968
4992
  deleteTitle: string;
4969
4993
  /** `{number}` is replaced with the invoice number. */
@@ -1161,6 +1161,10 @@ interface ReceivableFormDialogLabels extends ReceivableBillingSectionLabels, Rec
1161
1161
  editTitle: string;
1162
1162
  editDescription: string;
1163
1163
  closeButton: string;
1164
+ /** The draft editor's header menu and its items. */
1165
+ moreActionsButton: string;
1166
+ duplicateButton: string;
1167
+ deleteButton: string;
1164
1168
  dueDateLabel: string;
1165
1169
  lineItemsHeading: string;
1166
1170
  lineItemsDescription: string;
@@ -1245,6 +1249,24 @@ interface ReceivableDetailsPanelLabels {
1245
1249
  moreActionsLabel: string;
1246
1250
  viewPdfButton: string;
1247
1251
  closeButton: string;
1252
+ /** The side panel's control that opens the full-screen view. */
1253
+ expandButton: string;
1254
+ /** The full-screen view's control that hands back to the side panel. */
1255
+ collapseButton: string;
1256
+ /** Names the full-screen view's scrollable PDF pane. */
1257
+ documentPaneRegion: string;
1258
+ downloadPdfButton: string;
1259
+ /** Shown in the PDF pane while the invoice has no PDF to show. */
1260
+ pdfUnavailable: string;
1261
+ /** Names the scrollable PDF pages inside the pane. */
1262
+ pdfPagesRegion: string;
1263
+ /** Shown, with a link out, when the PDF cannot render in the pane. */
1264
+ pdfPreviewFailed: string;
1265
+ openPdfButton: string;
1266
+ lineItemsDescriptionColumn: string;
1267
+ lineItemsQuantityColumn: string;
1268
+ lineItemsPriceColumn: string;
1269
+ lineItemsAmountColumn: string;
1248
1270
  invoiceDateCaption: string;
1249
1271
  paymentHistoryHeading: string;
1250
1272
  paymentHistoryEmpty: string;
@@ -1588,6 +1610,8 @@ interface ReceivableMessageLabels {
1588
1610
  cancelConfirm: string;
1589
1611
  cancelSucceeded: string;
1590
1612
  cloneSuccess: string;
1613
+ /** Duplicating from the draft editor copies the saved draft, so unsaved edits block it. */
1614
+ cloneUnsavedChanges: string;
1591
1615
  cloneError: string;
1592
1616
  deleteTitle: string;
1593
1617
  /** `{number}` is replaced with the invoice number. */
@@ -3420,6 +3420,10 @@ interface ReceivableFormDialogLabels extends ReceivableBillingSectionLabels, Rec
3420
3420
  editTitle: string;
3421
3421
  editDescription: string;
3422
3422
  closeButton: string;
3423
+ /** The draft editor's header menu and its items. */
3424
+ moreActionsButton: string;
3425
+ duplicateButton: string;
3426
+ deleteButton: string;
3423
3427
  dueDateLabel: string;
3424
3428
  lineItemsHeading: string;
3425
3429
  lineItemsDescription: string;
@@ -3502,6 +3506,24 @@ interface ReceivableDetailsPanelLabels {
3502
3506
  moreActionsLabel: string;
3503
3507
  viewPdfButton: string;
3504
3508
  closeButton: string;
3509
+ /** The side panel's control that opens the full-screen view. */
3510
+ expandButton: string;
3511
+ /** The full-screen view's control that hands back to the side panel. */
3512
+ collapseButton: string;
3513
+ /** Names the full-screen view's scrollable PDF pane. */
3514
+ documentPaneRegion: string;
3515
+ downloadPdfButton: string;
3516
+ /** Shown in the PDF pane while the invoice has no PDF to show. */
3517
+ pdfUnavailable: string;
3518
+ /** Names the scrollable PDF pages inside the pane. */
3519
+ pdfPagesRegion: string;
3520
+ /** Shown, with a link out, when the PDF cannot render in the pane. */
3521
+ pdfPreviewFailed: string;
3522
+ openPdfButton: string;
3523
+ lineItemsDescriptionColumn: string;
3524
+ lineItemsQuantityColumn: string;
3525
+ lineItemsPriceColumn: string;
3526
+ lineItemsAmountColumn: string;
3505
3527
  invoiceDateCaption: string;
3506
3528
  paymentHistoryHeading: string;
3507
3529
  paymentHistoryEmpty: string;
@@ -3845,6 +3867,8 @@ interface ReceivableMessageLabels {
3845
3867
  cancelConfirm: string;
3846
3868
  cancelSucceeded: string;
3847
3869
  cloneSuccess: string;
3870
+ /** Duplicating from the draft editor copies the saved draft, so unsaved edits block it. */
3871
+ cloneUnsavedChanges: string;
3848
3872
  cloneError: string;
3849
3873
  deleteTitle: string;
3850
3874
  /** `{number}` is replaced with the invoice number. */
@@ -1,11 +1,11 @@
1
1
  import "./index27.js";
2
- import "./index32.js";
3
- import "./index41.js";
4
- import "./index43.js";
2
+ import "./index31.js";
3
+ import "./index40.js";
4
+ import "./index42.js";
5
+ import "./index44.js";
5
6
  import "./index45.js";
6
7
  import "./index46.js";
7
8
  import "./index47.js";
8
9
  import "./index48.js";
9
- import "./index49.js";
10
- export { BillDetailsWidget, BillDialogWidget } from "./index51.js";
11
- import "./index52.js";
10
+ export { BillDetailsWidget, BillDialogWidget } from "./index50.js";
11
+ import "./index51.js";
@@ -1,122 +1,202 @@
1
- import { resolvePdfWorkerSrc as e } from "../../../../shared/util/dist/lib/pdfWorkerSrc.js";
2
- import "../../../../shared/util/dist/index.js";
3
- import { useEffect as t, useRef as n, useState as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import "react-pdf/dist/Page/TextLayer.css";
1
+ import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o, mergeBillDetailActionsLabels as s, mergePaymentHistoryMethodLabels as c } from "../../../util/dist/lib/billDetailLabels.js";
2
+ import { BILL_DUE_DATE_LABELS_EN as l } from "../../../util/dist/lib/resolveBillDueDate.js";
3
+ import "../../../util/dist/index.js";
4
+ import { ACH_FIELD_GROUP_LABELS_EN as u } from "../../../../shared/counterpart-management/ui/dist/index2.js";
5
+ import "../../../../shared/counterpart-management/ui/dist/index.js";
6
+ import { APPROVAL_POLICY_RULE_COPY_EN as d } from "./index10.js";
7
+ import { PAYABLE_AUDIT_HISTORY_LABELS_EN as f } from "./index30.js";
8
+ import { BILL_REJECTED_BANNER_LABELS_EN as p } from "../../ui/dist/index39.js";
9
+ import { DISCARD_CHANGES_DIALOG_LABELS_EN as m } from "../../ui/dist/index42.js";
10
+ import { UNSAVED_BILL_DIALOG_LABELS_EN as h } from "../../ui/dist/index51.js";
11
+ import "../../ui/dist/index.js";
12
+ import { DOCUMENT_PREVIEW_LABELS_EN as g } from "../../../../shared/feature/dist/lib/document/documentPreview.js";
13
+ import "../../../../shared/feature/dist/document-preview.js";
6
14
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js
7
- var o = {
8
- previewUnavailable: "Preview not available for this file type.",
9
- openFile: "Open file",
10
- previewRegion: "Attachment preview"
11
- }, s = 720, c = 280, l = 1.3;
12
- function u(e) {
13
- return (e.trim().split(/\s+/)[0] ?? "").split("#")[0] ?? e;
14
- }
15
- function d({ url: e, labels: t }) {
16
- return /* @__PURE__ */ a("div", {
17
- className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:p-4 ttw:text-center",
18
- children: [/* @__PURE__ */ i("p", {
19
- className: "ttw:text-sm ttw:text-muted-foreground",
20
- children: t.previewUnavailable
21
- }), /* @__PURE__ */ i("a", {
22
- href: e,
23
- target: "_blank",
24
- rel: "noreferrer",
25
- className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
26
- children: t.openFile
27
- })]
28
- });
29
- }
30
- function f({ url: a, labels: o }) {
31
- let f = n(null), p = n(/* @__PURE__ */ new Map()), [m, h] = r(0), [g, _] = r(s), [v, y] = r(null), [b, x] = r(!1), [S, C] = r(() => /* @__PURE__ */ new Set([1]));
32
- if (t(() => {
33
- let t = !0;
34
- return import("react-pdf").then(({ Document: n, Page: r, pdfjs: i }) => {
35
- t && (i.GlobalWorkerOptions.workerSrc = e(i.version), y({
36
- Document: n,
37
- Page: r
38
- }));
39
- }).catch(() => {
40
- t && x(!0);
41
- }), () => {
42
- t = !1;
43
- };
44
- }, []), t(() => {
45
- if (!v) return;
46
- let e = f.current;
47
- if (!e) return;
48
- let t = () => {
49
- let t = e.clientWidth;
50
- t && _(Math.max(c, Math.min(t, s)));
51
- };
52
- if (t(), typeof ResizeObserver > "u") return;
53
- let n = new ResizeObserver(t);
54
- return n.observe(e), () => n.disconnect();
55
- }, [v]), t(() => {
56
- C(/* @__PURE__ */ new Set([1]));
57
- }, [a]), t(() => {
58
- let e = f.current;
59
- if (!e || !m || typeof IntersectionObserver > "u") return;
60
- let t = new IntersectionObserver((e) => {
61
- let t = e.filter((e) => e.isIntersecting).map((e) => Number(e.target.getAttribute("data-page-number"))).filter((e) => e >= 1);
62
- t.length && C((e) => {
63
- let n = new Set(e);
64
- return t.forEach((e) => n.add(e)), n.size === e.size ? e : n;
65
- });
66
- }, {
67
- root: e,
68
- rootMargin: "600px 0px"
69
- });
70
- return p.current.forEach((e) => t.observe(e)), () => t.disconnect();
71
- }, [m, g]), b) return /* @__PURE__ */ i(d, {
72
- url: a,
73
- labels: o
74
- });
75
- if (!v) return null;
76
- let { Document: w, Page: T } = v;
77
- return /* @__PURE__ */ i("div", {
78
- ref: f,
79
- role: "region",
80
- "aria-label": o.previewRegion,
81
- tabIndex: 0,
82
- className: "ttw:flex ttw:h-full ttw:w-full ttw:justify-center ttw:overflow-auto ttw:bg-white",
83
- children: /* @__PURE__ */ i(w, {
84
- suspense: !1,
85
- file: u(a),
86
- onLoadSuccess: ({ numPages: e }) => h(e),
87
- children: Array.from({ length: m }, (e, t) => {
88
- let n = t + 1;
89
- return /* @__PURE__ */ i("div", {
90
- ref: (e) => {
91
- e ? p.current.set(n, e) : p.current.delete(n);
92
- },
93
- "data-page-number": n,
94
- style: { minHeight: S.has(n) ? void 0 : Math.round(g * l) },
95
- children: S.has(n) ? /* @__PURE__ */ i(T, {
96
- pageNumber: n,
97
- width: g,
98
- renderAnnotationLayer: !1
99
- }) : null
100
- }, n);
101
- })
102
- })
103
- });
15
+ var _ = {
16
+ unmappedValidationError: (e, t) => `${e}: ${t}`,
17
+ unknownValidationField: "(unknown field)",
18
+ requiredField: "This field is required.",
19
+ saveFailed: "We could not save this bill. Try again.",
20
+ saveRejected: (e) => `We could not save this bill. ${e}`,
21
+ discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
22
+ vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
23
+ finalizeFailed: "We could not submit this bill. Try again.",
24
+ draftSaved: "Bill saved as a draft.",
25
+ submittedSaved: "Bill updated.",
26
+ submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
27
+ billFinalized: "Bill submitted for approval.",
28
+ numbersOnly: "Enter numbers only.",
29
+ unreadableMoney: "Enter a valid amount.",
30
+ unusableQuantity: "Enter a quantity greater than 0.",
31
+ lineItemsNeedAttention: "Check the highlighted line items before saving.",
32
+ unreadableDiscount: "Enter a valid discount amount.",
33
+ unreadableTax: "Enter a valid tax amount.",
34
+ unreadableTotal: "Enter a valid total amount.",
35
+ totalNotGreaterThanZero: "Total amount must be greater than $0.",
36
+ poNumberTooLong: "PO number must be 255 characters or fewer.",
37
+ implausibleInvoiceDate: "Enter an invoice date within the last 10 years, no more than 30 days from today.",
38
+ implausibleDueDate: "Enter a due date within the last 10 years and next 5 years.",
39
+ dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
40
+ }, v = {
41
+ paymentInstructionsValue: (e) => `Account ending in ${e}`,
42
+ noMethod: "No payment method on file",
43
+ paymentMethodLoading: "Loading payment method...",
44
+ paymentMethodUnavailable: "We could not load payment methods. Try again.",
45
+ searchFailed: "We could not load vendors. Try again.",
46
+ vendorDetailsFailed: "We could not load this vendor. Try again.",
47
+ pendingVendorDescription: "Will be created when submitted",
48
+ pendingVendorIncompleteDescription: "Add the missing vendor details before submitting",
49
+ bankAccountSaveFailed: "We could not save these payment instructions. Try again."
50
+ }, y = {
51
+ attachFailed: "We could not attach that file. Try again.",
52
+ deleteFailed: "We could not remove that document. Try again.",
53
+ noDocument: "No document attached to this bill.",
54
+ pendingDeletionNotice: "This document will be removed when you save this bill.",
55
+ preview: g
56
+ }, b = {
57
+ ...r,
58
+ notProvided: "Not provided",
59
+ paymentInstructionsValue: (e) => `Account ending in ${e}`,
60
+ paymentInstructionsNotSet: "Not set",
61
+ invoiceDateRow: "Invoice date",
62
+ dueDateRow: "Due date",
63
+ invoiceNumberRow: "Invoice number",
64
+ glCodeMissing: "GL code not specified",
65
+ glCodeUnavailable: "GL code unavailable",
66
+ qtyPriceValue: (e, t) => `${e} x ${t}`,
67
+ qtyOnlyValue: (e) => e,
68
+ subtotalRow: "Subtotal",
69
+ taxRow: "Tax",
70
+ discountRow: "Discounts",
71
+ totalRow: "Total",
72
+ paidOnLabel: (e) => `Paid on ${e}`,
73
+ paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
74
+ paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
75
+ rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
76
+ rejectedOn: (e) => `Rejected on ${e}`,
77
+ rejectionMessage: (e) => `"${e}"`
78
+ }, x = {
79
+ newTitle: "New bill",
80
+ extractedTitle: (e) => `Bill from ${e}`,
81
+ viewTitle: (e) => `Bill from ${e}`,
82
+ readOnlyTitle: "Bill details",
83
+ addedOn: (e) => `Added on ${e}`,
84
+ unsavedChanges: h,
85
+ discardChanges: m,
86
+ scheduledRelativeDay: i,
87
+ dueDate: l,
88
+ scheduledSummary: o,
89
+ scheduledStatusBadge: a,
90
+ awaitingApprovalNotice: e,
91
+ awaitingApprovalUnknownNotice: t,
92
+ actions: n,
93
+ detail: b,
94
+ history: f,
95
+ approvalPolicyCopy: d,
96
+ deleteDraft: {
97
+ menuItem: "Delete draft",
98
+ dialog: {
99
+ title: "Delete this draft?",
100
+ description: "The draft and anything entered on it are removed. This can't be undone.",
101
+ confirmButton: "Delete draft"
102
+ },
103
+ error: "Couldn't delete this draft. Try again."
104
+ },
105
+ lineItemsGlCodeUnavailable: {
106
+ loadError: "Couldn't load GL codes",
107
+ noAccess: "You don't have access to GL codes",
108
+ empty: "No GL codes set up yet"
109
+ },
110
+ rejectedBanner: p
111
+ };
112
+ function S(e) {
113
+ return {
114
+ ...x,
115
+ ...e,
116
+ actions: s(e?.actions),
117
+ detail: {
118
+ ...x.detail,
119
+ ...e?.detail,
120
+ paymentHistoryMethodLabels: c(e?.detail?.paymentHistoryMethodLabels)
121
+ },
122
+ history: {
123
+ ...x.history,
124
+ ...e?.history
125
+ },
126
+ lineItemsGlCodeUnavailable: {
127
+ ...x.lineItemsGlCodeUnavailable,
128
+ ...e?.lineItemsGlCodeUnavailable
129
+ },
130
+ unsavedChanges: {
131
+ ...x.unsavedChanges,
132
+ ...e?.unsavedChanges
133
+ },
134
+ discardChanges: {
135
+ ...x.discardChanges,
136
+ ...e?.discardChanges
137
+ },
138
+ rejectedBanner: {
139
+ ...x.rejectedBanner,
140
+ ...e?.rejectedBanner
141
+ },
142
+ approvalPolicyCopy: {
143
+ ...x.approvalPolicyCopy,
144
+ ...e?.approvalPolicyCopy
145
+ },
146
+ scheduledRelativeDay: {
147
+ ...x.scheduledRelativeDay,
148
+ ...e?.scheduledRelativeDay
149
+ },
150
+ dueDate: {
151
+ ...x.dueDate,
152
+ ...e?.dueDate
153
+ },
154
+ deleteDraft: {
155
+ ...x.deleteDraft,
156
+ ...e?.deleteDraft,
157
+ dialog: (() => {
158
+ let t = {
159
+ ...x.deleteDraft.dialog,
160
+ ...e?.deleteDraft?.dialog
161
+ };
162
+ return delete t.reason, t;
163
+ })()
164
+ }
165
+ };
104
166
  }
105
- function p(e, t = {}) {
106
- let n = {
107
- ...o,
108
- ...t
167
+ var C = {
168
+ createTitle: "New vendor details",
169
+ editTitle: "Edit vendor",
170
+ switchVendorFieldLabel: "Switch to a different vendor",
171
+ vendorFieldLabel: "Vendor",
172
+ newVendorBadge: "New vendor",
173
+ unmatchedVendorHelper: "We couldn't match this vendor to your list. Search to choose an existing vendor, or finish adding a new one below.",
174
+ resultsHeading: "Your vendors",
175
+ addAsNewVendor: (e) => `Add "${e}" as a new vendor`,
176
+ addAsNewVendorDescription: "Uses the details extracted from this bill",
177
+ fieldsNeedAttention: (e) => `${e} ${e === 1 ? "field needs" : "fields need"} attention`,
178
+ nameLabel: "Business name",
179
+ cancel: "Cancel",
180
+ save: "Save",
181
+ cancelAriaLabel: "Cancel vendor",
182
+ saveAriaLabel: "Save vendor",
183
+ paymentInstructionsHeading: "Payment instructions",
184
+ paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
185
+ paymentInstructionsExtracted: "We read these from the bill. Check them before saving.",
186
+ ach: u
187
+ };
188
+ function w(e) {
189
+ return {
190
+ ...C,
191
+ ...e,
192
+ ach: {
193
+ ...C.ach,
194
+ ...e?.ach,
195
+ fieldMarkers: {
196
+ ...C.ach.fieldMarkers,
197
+ ...e?.ach?.fieldMarkers
198
+ }
199
+ }
109
200
  };
110
- return e.mimetype === "application/pdf" ? /* @__PURE__ */ i(f, {
111
- url: e.url,
112
- labels: n
113
- }) : e.mimetype.startsWith("image/") ? /* @__PURE__ */ i("img", {
114
- src: e.url,
115
- alt: e.name,
116
- className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
117
- }) : /* @__PURE__ */ i(d, {
118
- url: e.url,
119
- labels: n
120
- });
121
201
  }
122
- export { o as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, p as createSourceDocumentPreview };
202
+ export { _ as BILL_CREATE_MESSAGE_LABELS_EN, b as BILL_DETAIL_VIEW_LABELS_EN, x as BILL_DIALOG_COPY_EN, y as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, C as VENDOR_INLINE_FORM_LABELS_EN, v as VENDOR_SECTION_PROPS_LABELS_EN, S as mergeBillDialogCopy, w as mergeVendorInlineFormLabels };