@tesouro/embedded-components-react 0.5.96 → 0.5.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -519,7 +519,7 @@ A self-contained native widget for listing, creating, editing, and acting on cus
519
519
 
520
520
  ### SettingsWidget
521
521
 
522
- A composite settings widget that combines Monite document settings, tags, GL codes, and expense configuration.
522
+ A composite settings widget that combines profile, team, invoice, bill-pay, expense, accounting, tags, legal and help settings in one navigable surface.
523
523
 
524
524
  #### Props
525
525
 
@@ -530,10 +530,10 @@ A composite settings widget that combines Monite document settings, tags, GL cod
530
530
  | `featureLabels` | `Partial<FeatureLabels>` | English labels | Overrides section labels. |
531
531
  | `profileContent` | `ReactNode` | Profile widget | Replaces the profile section content. |
532
532
  | `teamContent` | `ReactNode` | Empty | Supplies the team section content. |
533
- | `invoiceContent` | `ReactNode` | Monite template settings | Replaces invoice settings content. |
534
- | `billPayContent` | `ReactNode` | Monite approval policies | Replaces bill-pay settings content. |
533
+ | `invoiceContent` | `ReactNode` | Invoice settings widget | Replaces invoice settings content. |
534
+ | `billPayContent` | `ReactNode` | Approval policies settings | Replaces bill-pay settings content. |
535
535
  | `accountingContent` | `ReactNode` | Chart of accounts widget | Replaces accounting content. |
536
- | `tagsContent` | `ReactNode` | Monite tags | Replaces tags content. |
536
+ | `tagsContent` | `ReactNode` | Tags widget | Replaces tags content. |
537
537
  | `expenseContent` | `ReactNode` | Expense policies and requirements | Replaces expense content. |
538
538
  | `legalContent` | `ReactNode` | Bank disclosures widget | Replaces the Legal section content. |
539
539
  | `profileContactUrl` | `string` | `undefined` | Forwarded to the Profile section's widget — where its "to change this information, contact your bank" line links. Left unset, the card shows the plain unlinked sentence instead; the bank name comes from widget init. |
@@ -544,7 +544,7 @@ A composite settings widget that combines Monite document settings, tags, GL cod
544
544
  | `helpContactUrl` | `string` | `undefined` | Forwarded to the Help section's widget — where its "Contact Us" line links (a support page URL or a `mailto:`). The line is hidden while unset, since the package has no tenant-agnostic support address to fall back on; the bank name in that line comes from widget init. |
545
545
  | `helpFaq` | `HelpFaqSection[]` | `HELP_FAQ_EN` | Forwarded to the Help section: the FAQ it renders. Extend the exported `HELP_FAQ_EN` and pass the result to answer questions the package cannot (passwords, for example) without replacing the whole section. |
546
546
  | `helpContent` | `ReactNode` | Help widget | Replaces the help section content. |
547
- | `finopsThemeColors` | `FinopsThemeColors` | `undefined` | Optional Monite theme color overrides. |
547
+ | `finopsThemeColors` | `FinopsThemeColors` | `undefined` | Optional Monite theme color overrides. Nothing under this widget renders Monite any more, so it currently changes nothing here; it is still accepted rather than removed in the same release as the section it themed. |
548
548
 
549
549
  ### TransfersWidget
550
550
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo, Ref } from 'react';
2
+ import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
3
3
  import { FallbackProps } from 'react-error-boundary';
4
4
 
5
5
  type AuthToken = string | undefined;
@@ -627,277 +627,6 @@ interface WidgetProviderProps extends WidgetProviderBaseProps {
627
627
  providerLabels?: Partial<WidgetProviderLabels>;
628
628
  }
629
629
 
630
- /**
631
- * Co-located user-facing strings for this component. It takes a
632
- * `labels?: Partial<…Labels>` prop merged over the `*_LABELS_EN` default.
633
- *
634
- * Flat, deliberately: a nested group would need `PartialDeep` from type-fest
635
- * plus an explicit per-group merge (AGENTS.md), and none of this copy groups
636
- * naturally.
637
- *
638
- * The English strings are ported verbatim from the Monite `templateSettings`
639
- * screen so the native widget reads identically during side-by-side review
640
- * (EMBD-5846). Reword in a separate commit, never inside the port.
641
- */
642
- interface InvoiceSettingsPanelLabels {
643
- submitButton: string;
644
- /**
645
- * Copy for the load-failure state. No Monite counterpart: its screen had no
646
- * error branch at all, so this is new rather than ported.
647
- */
648
- errorTitle: string;
649
- errorDescription: string;
650
- errorRetry: string;
651
- /**
652
- * Accessible name for the loading spinner. The shared `Spinner` takes no
653
- * `labels` prop — its English default is an attribute on the element it
654
- * renders, overridable only through `aria-label` — so without this the panel
655
- * would announce English to a screen reader on an otherwise localized page.
656
- */
657
- loading: string;
658
- }
659
-
660
- /**
661
- * Co-located user-facing strings for this component. It takes a
662
- * `labels?: Partial<…Labels>` prop merged over the `*_LABELS_EN` default.
663
- *
664
- * Flat, deliberately: a nested group would need `PartialDeep` from type-fest
665
- * plus an explicit per-group merge (AGENTS.md), and none of this copy groups
666
- * naturally.
667
- *
668
- * The English strings are ported verbatim from the Monite `templateSettings`
669
- * screen so the native widget reads identically during side-by-side review
670
- * (EMBD-5846). Reword in a separate commit, never inside the port.
671
- */
672
- interface InvoiceNumberingSectionLabels {
673
- title: string;
674
- description: string;
675
- previewLabel: string;
676
- invoicePrefixLabel: string;
677
- startingNumberLabel: string;
678
- digitCountLabel: string;
679
- includeDateLabel: string;
680
- }
681
-
682
- /**
683
- * Co-located user-facing strings for this component. It takes a
684
- * `labels?: Partial<…Labels>` prop merged over the `*_LABELS_EN` default.
685
- *
686
- * Flat, deliberately: a nested group would need `PartialDeep` from type-fest
687
- * plus an explicit per-group merge (AGENTS.md), and none of this copy groups
688
- * naturally.
689
- *
690
- * The English strings are ported verbatim from the Monite `templateSettings`
691
- * screen so the native widget reads identically during side-by-side review
692
- * (EMBD-5846). Reword in a separate commit, never inside the port.
693
- */
694
- interface PdfSettingsSectionLabels {
695
- title: string;
696
- description: string;
697
- bankDetailsTitle: string;
698
- bankDetailsDescription: string;
699
- /** Accessible name for the bank-details switch. */
700
- bankDetailsToggle: string;
701
- paidInvoicesTitle: string;
702
- paidInvoicesDescription: string;
703
- /** Emphasised second line under the paid-invoices description. */
704
- paidInvoicesWarning: string;
705
- /** Accessible name for the paid-invoices switch. */
706
- paidInvoicesToggle: string;
707
- }
708
-
709
- /**
710
- * Co-located user-facing strings for this component. It takes a
711
- * `labels?: Partial<…Labels>` prop merged over the `*_LABELS_EN` default.
712
- *
713
- * Flat, deliberately: a nested group would need `PartialDeep` from type-fest
714
- * plus an explicit per-group merge (AGENTS.md), and none of this copy groups
715
- * naturally.
716
- *
717
- * The English strings are ported verbatim from the Monite `templateSettings`
718
- * screen so the native widget reads identically during side-by-side review
719
- * (EMBD-5846). Reword in a separate commit, never inside the port.
720
- */
721
- interface DiscardChangesDialogLabels {
722
- title: string;
723
- /** First paragraph of the body. */
724
- message: string;
725
- /** Second paragraph of the body. */
726
- question: string;
727
- confirmButton: string;
728
- cancelButton: string;
729
- }
730
-
731
- /**
732
- * Co-located user-facing strings for the logo dropzone. Ported from Monite's
733
- * `DragAndDropBox`, with the accessibility copy its markup never had.
734
- */
735
- interface LogoDropzoneLabels {
736
- dropPrefix: string;
737
- browseAction: string;
738
- /**
739
- * The accepted formats and the size cap, already formatted. The component is
740
- * presentational, so it never turns a numeric limit into copy: the owner
741
- * holds the cap and the units, and overrides this label from its own
742
- * constant.
743
- */
744
- fileTypesHint: string;
745
- /** Shown when `status` is `'error'` and the owner supplied no message. */
746
- genericError: string;
747
- /** Accessible name for the progress bar, while an upload is in flight. */
748
- uploadProgress: string;
749
- /** Announced once an upload finishes, where the bar carries no meaning. */
750
- uploadComplete: string;
751
- /** Accessible name for the button that clears a failed upload. */
752
- dismissError: string;
753
- }
754
-
755
- /**
756
- * Co-located user-facing strings for the branding section. Ported from Monite's
757
- * `LogoSection`, plus the accessible names its icon buttons carried inline.
758
- */
759
- interface LogoSectionLabels {
760
- title: string;
761
- description: string;
762
- uploadTitle: string;
763
- uploadDescription: string;
764
- /** Alt text for the current logo. */
765
- logoAlt: string;
766
- /** Shown over the current logo while a file is dragged across it. */
767
- dropToReplace: string;
768
- /** Accessible name for the icon button that replaces the logo. */
769
- editLogo: string;
770
- /** Accessible name for the icon button that removes the logo. */
771
- deleteLogo: string;
772
- }
773
-
774
- /**
775
- * Validation copy for the invoice-settings form.
776
- *
777
- * It lives in the feature layer rather than beside the controls it appears
778
- * under, because the messages are produced by the schema, not by a component:
779
- * the UI takes already-resolved strings through its `errors` prop and has no
780
- * idea a rule exists. Passing them into the schema keeps the validators pure —
781
- * they format a message, they do not look one up — and keeps every string a
782
- * consumer can see in one overridable place.
783
- *
784
- * Exposed on the widget as `messageLabels`, matching the channel the chart of
785
- * accounts and tags widgets use for the same job.
786
- */
787
- interface InvoiceSettingsMessageLabels {
788
- invoicePrefixRequired: string;
789
- invoicePrefixTooLong: string;
790
- customPrefixTooLong: string;
791
- digitCountTooLow: string;
792
- digitCountTooHigh: string;
793
- /**
794
- * The four document prefixes this screen does not render. A user cannot
795
- * reach this message through the UI; it exists so a value that arrives empty
796
- * from the API fails loudly in tests rather than silently patching a blank
797
- * prefix over a good one.
798
- */
799
- documentPrefixRequired: string;
800
- /**
801
- * `nextNumber` is the number the API will issue next for that document type,
802
- * which is the floor it will accept.
803
- */
804
- numberBelowNext: (nextNumber: number) => string;
805
- /**
806
- * Logo rejections. The first two are decided here rather than by the API, so
807
- * the user hears about a bad file before uploading it; the third stands in
808
- * for an API failure whose own message is not written for an end user.
809
- */
810
- logoWrongFormat: string;
811
- logoTooLarge: (maxSizeMb: number) => string;
812
- logoUploadFailed: string;
813
- /**
814
- * The dropzone's format-and-size hint. It lives here, beside the rejection
815
- * copy, because both are formatted from the one cap this widget enforces —
816
- * the UI lib ships its own default, and a hint that advertised a different
817
- * number from the one being enforced is exactly the drift this prevents.
818
- */
819
- logoFileTypesHint: (maxSizeMb: number) => string;
820
- /**
821
- * Toast copy, ported verbatim from the Monite hooks these replace
822
- * (`usePatchEntitySettings`, `useDeleteEntityLogo`) so the native widget
823
- * reads identically during side-by-side review. Reword in a separate commit,
824
- * never inside the port.
825
- *
826
- * `settingsSaveFailed` has no Monite counterpart — that mutation toasted only
827
- * on success, so a failed save said nothing at all. There is no inline
828
- * surface for it on this screen, unlike a rejected logo.
829
- */
830
- settingsSaved: string;
831
- settingsSaveFailed: string;
832
- logoDeleted: string;
833
- logoDeleteFailed: string;
834
- }
835
-
836
- /**
837
- * Label override channels, one per surface the widget mounts, matching the
838
- * chart-of-accounts and tags widgets. A single `labels` bag would collide the
839
- * moment two of these components named a key the same way.
840
- */
841
- interface InvoiceSettingsLabelProps {
842
- panelLabels?: Partial<InvoiceSettingsPanelLabels>;
843
- numberingLabels?: Partial<InvoiceNumberingSectionLabels>;
844
- pdfLabels?: Partial<PdfSettingsSectionLabels>;
845
- logoLabels?: Partial<LogoSectionLabels>;
846
- dropzoneLabels?: Partial<LogoDropzoneLabels>;
847
- discardLabels?: Partial<DiscardChangesDialogLabels>;
848
- /** Validation and upload-rejection copy. */
849
- messageLabels?: Partial<InvoiceSettingsMessageLabels>;
850
- }
851
- /**
852
- * What a host can ask this widget before navigating away from it.
853
- *
854
- * Widgets never touch the host's router, so the widget cannot stop a navigation
855
- * itself — it can only answer whether one is safe. The host asks, the user
856
- * answers the discard dialog, and the host proceeds or does not.
857
- *
858
- * ```tsx
859
- * const invoiceSettings = useRef<InvoiceSettingsHandle>(null);
860
- * // ...before switching away from the Invoices section:
861
- * if (await invoiceSettings.current?.confirmLeave()) setSection(next);
862
- * ```
863
- *
864
- * **Nothing calls this yet — the Settings shell wires it in EMBD-5849**, and
865
- * until it does the discard dialog cannot appear. That is not a regression from
866
- * the screen this replaces: Monite opened the same dialog from exactly one
867
- * place, its side sheet's close handler, and no caller in this repo has ever
868
- * passed the `isDialog` prop that renders the sheet. The dialog has been
869
- * unreachable in both mounts of `TemplateSettings` for as long as they have
870
- * existed.
871
- *
872
- * The bug that makes wiring it worth doing is real and predates this port: the
873
- * shell's `TabsContent` has no `forceMount`, so switching sections unmounts
874
- * this widget and throws away unsaved edits with no warning. An unmount cannot
875
- * be blocked from inside, so `onSectionChange` is the only place to intervene —
876
- * which is why this is a question the host asks rather than something the
877
- * widget enforces.
878
- */
879
- interface InvoiceSettingsHandle {
880
- /** `true` when there is nothing unsaved, or the user chose to discard. */
881
- confirmLeave: () => Promise<boolean>;
882
- }
883
- type InvoiceSettingsProps = WidgetProviderProps & InvoiceSettingsLabelProps & {
884
- ref?: Ref<InvoiceSettingsHandle>;
885
- };
886
- /**
887
- * Entity invoice settings: document numbering, PDF options and the logo.
888
- *
889
- * Native throughout as of EMBD-5848 — it was a thin wrapper over Monite's
890
- * `TemplateSettings` from EMBD-5846 until the presentational layer (EMBD-5845,
891
- * EMBD-5847) and the REST hooks (EMBD-5844) were both in place. The Settings
892
- * widget's Invoices tab still mounts the Monite screen until EMBD-5849 cuts it
893
- * over; that screen goes in EMBD-5850.
894
- *
895
- * `WidgetProvider` rather than `MoniteRegionProvider`: nothing here renders
896
- * Monite any more, so the Monite wrapper and its `finopsThemeColors` prop have
897
- * both gone from this widget's public surface.
898
- */
899
- declare function InvoiceSettings({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, analytics, disclosuresAcceptance, providerLabels, errorFallback, onError, ref, ...labelProps }: InvoiceSettingsProps): React.JSX.Element;
900
-
901
630
  interface CheckAmountAndDetailScreenLabels {
902
631
  title: string;
903
632
  backButton: string;
@@ -1008,5 +737,5 @@ interface RemoteCheckCaptureWidgetProps extends WidgetProviderProps {
1008
737
  }
1009
738
  declare function RemoteCheckCaptureWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, labels, onDepositComplete, }: RemoteCheckCaptureWidgetProps): React.JSX.Element;
1010
739
 
1011
- export { InvoiceSettings, RemoteCheckCaptureWidget };
1012
- export type { InvoiceSettingsHandle, InvoiceSettingsProps, RemoteCheckCaptureWidgetProps };
740
+ export { RemoteCheckCaptureWidget };
741
+ export type { RemoteCheckCaptureWidgetProps };
@@ -1,5 +1,3 @@
1
- import { InvoiceSettings as e } from "../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js";
2
- import "./InvoiceSettings.js";
3
- import { RemoteCheckCaptureWidget as t } from "../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js";
1
+ import { RemoteCheckCaptureWidget as e } from "../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js";
4
2
  import "./RemoteCheckCapture.js";
5
- export { e as InvoiceSettings, t as RemoteCheckCaptureWidget };
3
+ export { e as RemoteCheckCaptureWidget };
@@ -3,6 +3,4 @@ import { SettingsSection as e } from "./index4.js";
3
3
  import { HELP_FAQ_EN as t } from "../../help/ui/contract/dist/index3.js";
4
4
  import { SettingsWidget as n } from "./index6.js";
5
5
  import "./index7.js";
6
- import { InvoiceSettings as r } from "../../invoice-settings/feature/dist/index10.js";
7
- import "../../invoice-settings/feature/dist/index.js";
8
- export { t as HELP_FAQ_EN, r as InvoiceSettings, e as SettingsSection, n as SettingsWidget };
6
+ export { t as HELP_FAQ_EN, e as SettingsSection, n as SettingsWidget };
@@ -10,14 +10,14 @@ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetPro
10
10
  import "../../../shared/feature/dist/index.js";
11
11
  import { ApprovalPoliciesSettings as i } from "../../../shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js";
12
12
  import "../../../shared/approval-policy/feature/dist/index.js";
13
- import { TemplateSettings as a } from "../../../monite-sdk/dist/index617.js";
14
- import "../../../monite-sdk/dist/index.js";
15
- import { MoniteRegionProvider as o } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
13
+ import { MoniteRegionProvider as a } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
16
14
  import "../../../shared/monite-wrapper/feature/dist/index.js";
17
- import { DEFAULT_FEATURE_LABELS as s } from "./index3.js";
18
- import { SettingsSection as c, mergeAdditionalSections as l } from "./index4.js";
19
- import { SettingsWidgetAnalyticsEvent as u, WIDGET_NAME as d } from "./index2.js";
20
- import { ExpenseSettingsTabs as f } from "./index5.js";
15
+ import { DEFAULT_FEATURE_LABELS as o } from "./index3.js";
16
+ import { SettingsSection as s, mergeAdditionalSections as c } from "./index4.js";
17
+ import { SettingsWidgetAnalyticsEvent as l, WIDGET_NAME as u } from "./index2.js";
18
+ import { ExpenseSettingsTabs as d } from "./index5.js";
19
+ import { InvoiceSettings as f } from "../../invoice-settings/feature/dist/index10.js";
20
+ import "../../invoice-settings/feature/dist/index.js";
21
21
  import { TagsWidget as p } from "../../tags/feature/dist/index11.js";
22
22
  import "../../tags/feature/dist/index.js";
23
23
  import { BankDisclosuresWidget as m } from "../../../shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/BankDisclosuresWidget.js";
@@ -32,121 +32,130 @@ import { HelpWidget as v } from "../../help/feature/dist/index3.js";
32
32
  import "../../help/feature/dist/index.js";
33
33
  import { ProfileWidget as y } from "../../profile/feature/dist/index4.js";
34
34
  import "../../profile/feature/dist/index.js";
35
- import { useEffect as b } from "react";
36
- import { jsx as x } from "react/jsx-runtime";
37
- import { useControllableState as S } from "@radix-ui/react-use-controllable-state";
35
+ import { useCallback as b, useEffect as x, useRef as S } from "react";
36
+ import { jsx as C } from "react/jsx-runtime";
37
+ import { useControllableState as w } from "@radix-ui/react-use-controllable-state";
38
38
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js
39
- var C = {
40
- [c.Profile]: [],
41
- [c.Team]: [t.UserReadOrg],
42
- [c.Invoice]: [t.OrganizationSettingsWriteOrg],
43
- [c.BillPay]: [
39
+ var T = {
40
+ [s.Profile]: [],
41
+ [s.Team]: [t.UserReadOrg],
42
+ [s.Invoice]: [t.OrganizationSettingsWriteOrg],
43
+ [s.BillPay]: [
44
44
  t.ApprovalPolicyWriteOrg,
45
45
  t.PayableWriteOrg,
46
46
  t.RoleReadOrg,
47
47
  t.UserReadOrg
48
48
  ],
49
- [c.Accounting]: [t.AccountingConfigReadOrg],
50
- [c.Tags]: [t.AccountingConfigReadOrg],
51
- [c.Expense]: [t.ApprovalPolicyWriteOrg, t.ExpenseWriteOrg],
52
- [c.Legal]: [],
53
- [c.Help]: []
49
+ [s.Accounting]: [t.AccountingConfigReadOrg],
50
+ [s.Tags]: [t.AccountingConfigReadOrg],
51
+ [s.Expense]: [t.ApprovalPolicyWriteOrg, t.ExpenseWriteOrg],
52
+ [s.Legal]: [],
53
+ [s.Help]: []
54
54
  };
55
- function w({ labels: t, featureLabels: o, acceptInviteRedirectUri: d, helpContactUrl: w, helpFaq: T, profileContactUrl: E, selectedSection: D, defaultSelectedSection: O, onSelectedSectionChange: k, additionalSections: A, profileContent: j, teamContent: M, billPayContent: N, helpContent: P, expenseContent: F, accountingContent: I, tagsContent: L, invoiceContent: R, legalContent: z }) {
56
- let B = {
57
- ...s,
58
- ...o
59
- }, V = n();
60
- b(() => {
61
- V(u.Mounted);
62
- }, [V]);
63
- let { initResponse: H } = r(), U = H?.scopes, W = [
55
+ function E({ labels: t, featureLabels: a, acceptInviteRedirectUri: u, helpContactUrl: E, helpFaq: D, profileContactUrl: O, selectedSection: k, defaultSelectedSection: A, onSelectedSectionChange: j, additionalSections: M, profileContent: N, teamContent: P, billPayContent: F, helpContent: I, expenseContent: L, accountingContent: R, tagsContent: z, invoiceContent: B, legalContent: V }) {
56
+ let H = {
57
+ ...o,
58
+ ...a
59
+ }, U = S(null), W = n();
60
+ x(() => {
61
+ W(l.Mounted);
62
+ }, [W]);
63
+ let { initResponse: G } = r(), K = G?.scopes, q = [
64
64
  {
65
- id: c.Profile,
66
- label: B.profileSection,
67
- content: j ?? /* @__PURE__ */ x(y, { contactUrl: E })
65
+ id: s.Profile,
66
+ label: H.profileSection,
67
+ content: N ?? /* @__PURE__ */ C(y, { contactUrl: O })
68
68
  },
69
69
  {
70
- id: c.Team,
71
- label: B.teamSection,
72
- content: M ?? /* @__PURE__ */ x(h, { acceptInviteRedirectUri: d })
70
+ id: s.Team,
71
+ label: H.teamSection,
72
+ content: P ?? /* @__PURE__ */ C(h, { acceptInviteRedirectUri: u })
73
73
  },
74
74
  {
75
- id: c.Invoice,
76
- label: B.invoiceSection,
77
- content: R ?? /* @__PURE__ */ x(a, { showHeader: !1 })
75
+ id: s.Invoice,
76
+ label: H.invoiceSection,
77
+ content: B ?? /* @__PURE__ */ C(f, { ref: U })
78
78
  },
79
79
  {
80
- id: c.Expense,
81
- label: B.expenseSection,
82
- content: F ?? /* @__PURE__ */ x(f, {
83
- approvalsLabel: B.expenseApprovalsTab,
84
- requirementsLabel: B.expenseRequirementsTab
80
+ id: s.Expense,
81
+ label: H.expenseSection,
82
+ content: L ?? /* @__PURE__ */ C(d, {
83
+ approvalsLabel: H.expenseApprovalsTab,
84
+ requirementsLabel: H.expenseRequirementsTab
85
85
  })
86
86
  },
87
87
  {
88
- id: c.BillPay,
89
- label: B.billPaySection,
90
- content: N ?? /* @__PURE__ */ x(i, {
88
+ id: s.BillPay,
89
+ label: H.billPaySection,
90
+ content: F ?? /* @__PURE__ */ C(i, {
91
91
  showHeaderTitle: !1,
92
- componentLabels: { header: { Description: B.billPayDescription } }
92
+ componentLabels: { header: { Description: H.billPayDescription } }
93
93
  })
94
94
  },
95
95
  {
96
- id: c.Accounting,
97
- label: B.accountingSection,
98
- content: I ?? /* @__PURE__ */ x(_, {})
96
+ id: s.Accounting,
97
+ label: H.accountingSection,
98
+ content: R ?? /* @__PURE__ */ C(_, {})
99
99
  },
100
100
  {
101
- id: c.Tags,
102
- label: B.tagsSection,
103
- content: L ?? /* @__PURE__ */ x(p, {})
101
+ id: s.Tags,
102
+ label: H.tagsSection,
103
+ content: z ?? /* @__PURE__ */ C(p, {})
104
104
  },
105
105
  {
106
- id: c.Legal,
107
- label: B.legalSection,
108
- content: z ?? /* @__PURE__ */ x(m, {})
106
+ id: s.Legal,
107
+ label: H.legalSection,
108
+ content: V ?? /* @__PURE__ */ C(m, {})
109
109
  },
110
110
  {
111
- id: c.Help,
112
- label: B.helpSection,
113
- content: P ?? /* @__PURE__ */ x(v, {
114
- contactUrl: w,
115
- faq: T
111
+ id: s.Help,
112
+ label: H.helpSection,
113
+ content: I ?? /* @__PURE__ */ C(v, {
114
+ contactUrl: E,
115
+ faq: D
116
116
  })
117
117
  }
118
- ], G = l(W.filter((t) => C[t.id].every((t) => e(U, [t]))), A ?? []), K = G[0]?.id ?? "", [q, J] = S({
119
- prop: D,
120
- defaultProp: O ?? K,
121
- onChange: k,
118
+ ], J = c(q.filter((t) => T[t.id].every((t) => e(K, [t]))), M ?? []), Y = J[0]?.id ?? "", [X, Z] = w({
119
+ prop: k,
120
+ defaultProp: A ?? Y,
121
+ onChange: j,
122
122
  caller: "SettingsWidget"
123
- }), Y = G.some((e) => e.id === q) ? q : K;
124
- return /* @__PURE__ */ x(g, {
123
+ }), Q = J.some((e) => e.id === X) ? X : Y, $ = b((e) => {
124
+ let t = U.current;
125
+ if (Q !== s.Invoice || !t) {
126
+ Z(e);
127
+ return;
128
+ }
129
+ t.confirmLeave().then((t) => {
130
+ t && Z(e);
131
+ });
132
+ }, [Q, Z]);
133
+ return /* @__PURE__ */ C(g, {
125
134
  labels: t,
126
- sections: G,
127
- selectedSectionId: Y,
128
- onSectionChange: J
135
+ sections: J,
136
+ selectedSectionId: Q,
137
+ onSectionChange: $
129
138
  });
130
139
  }
131
- function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: s, uiFramework: c, errorFallback: l, onError: u, finopsThemeColors: f, analytics: p, disclosuresAcceptance: m, providerLabels: h, ...g }) {
132
- return /* @__PURE__ */ x(o, {
133
- widgetName: d,
140
+ function D({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: d, finopsThemeColors: f, analytics: p, disclosuresAcceptance: m, providerLabels: h, ...g }) {
141
+ return /* @__PURE__ */ C(a, {
142
+ widgetName: u,
134
143
  baseUrl: e,
135
144
  widgetToken: t,
136
145
  organizationId: n,
137
146
  configClient: r,
138
147
  gatewayRouting: i,
139
- linkComponent: a,
148
+ linkComponent: o,
140
149
  implementation: s,
141
150
  uiFramework: c,
142
151
  errorFallback: l,
143
- onError: u,
152
+ onError: d,
144
153
  finopsThemeColors: f,
145
154
  analytics: p,
146
155
  disclosuresAcceptance: m,
147
156
  providerLabels: h,
148
- children: /* @__PURE__ */ x(w, { ...g })
157
+ children: /* @__PURE__ */ C(E, { ...g })
149
158
  });
150
159
  }
151
160
  //#endregion
152
- export { T as SettingsWidget, T as default };
161
+ export { D as SettingsWidget, D as default };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.96", n = "94071d7c62372bd2690881a9f5ef0ae931a32c70", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.98", n = "14878cc8268df0a5fe08087bb30f45196474ba05", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n