@tesouro/embedded-components-react 0.5.45 → 0.5.46

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 (36) hide show
  1. package/README.md +7 -5
  2. package/dist/index.d.ts +54 -24
  3. package/dist/lib/BankAccountOnboardingWidget.d.ts +15 -1
  4. package/dist/lib/BillPayWidget.d.ts +16 -1
  5. package/dist/lib/SettingsWidget.d.ts +1 -0
  6. package/dist/lib/WidgetSuite.d.ts +1 -0
  7. package/dist/lib/monite-sdk.d.ts +2 -0
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +12 -8
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +233 -211
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -7
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +3 -3
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +7 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +387 -387
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +1 -0
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +119 -113
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +1 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +55 -70
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +9 -7
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -2
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +163 -151
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +77 -77
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +17 -10
  25. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js +2 -1
  26. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index382.js +10 -4
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index394.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +23 -23
  30. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index3.js +1 -0
  31. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +13 -4
  32. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +27 -29
  33. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +29 -28
  34. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +13 -13
  35. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  36. package/package.json +1 -1
@@ -11,13 +11,13 @@ import { ErrorState as i } from "../../../shared/ui/dist/lib/ErrorState/ErrorSta
11
11
  import "../../../shared/ui/dist/index.js";
12
12
  import { useAnalyticsTrack as a } from "../../../shared/feature/dist/lib/analytics/hooks.js";
13
13
  import { WidgetProvider as o } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
14
- import { useWidgetConfig as s } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
14
+ import { useWidgetConfig as s, useWidgetLoading as c } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
15
15
  import "../../../shared/feature/dist/index.js";
16
- import { ApproverOptionLabels as c, PermissionErrorLabels as l, ValidationErrorLabels as u } from "./index4.js";
17
- import { ExpenseApprovalPoliciesAnalyticsEvent as d, WIDGET_NAME as f } from "./index2.js";
18
- import { AmountConditionType as p, ApprovalOutcomeType as m } from "../../ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/types.js";
19
- import { ApprovalRuleToastLabels as h } from "../../ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js";
20
- import { ExpenseApprovalsPage as g } from "../../ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js";
16
+ import { ApproverOptionLabels as l, PermissionErrorLabels as u, ValidationErrorLabels as d } from "./index4.js";
17
+ import { ExpenseApprovalPoliciesAnalyticsEvent as f, WIDGET_NAME as p } from "./index2.js";
18
+ import { AmountConditionType as m, ApprovalOutcomeType as h } from "../../ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/types.js";
19
+ import { ApprovalRuleToastLabels as g } from "../../ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js";
20
+ import { ExpenseApprovalsPage as ee } from "../../ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js";
21
21
  import "../../ui/dist/index.js";
22
22
  import { useApprovalPolicies as _ } from "./index3.js";
23
23
  import { expenseApprovalPoliciesTestIds as v } from "./index5.js";
@@ -27,7 +27,7 @@ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
27
27
  var T = {
28
28
  minAmount: "",
29
29
  maxAmount: "",
30
- outcome: m.AutoApprove,
30
+ outcome: h.AutoApprove,
31
31
  approvers: []
32
32
  };
33
33
  function E(e, t) {
@@ -51,18 +51,18 @@ function k(e) {
51
51
  return [
52
52
  ...t ? [{
53
53
  id: t.id,
54
- label: c.AdminLabel,
55
- sublabel: c.AdminSublabel
54
+ label: l.AdminLabel,
55
+ sublabel: l.AdminSublabel
56
56
  }] : [],
57
57
  {
58
58
  id: "reporting_manager",
59
- label: c.ReportingManagerLabel,
60
- sublabel: c.ReportingManagerSublabel
59
+ label: l.ReportingManagerLabel,
60
+ sublabel: l.ReportingManagerSublabel
61
61
  },
62
62
  ...n ? [{
63
63
  id: n.id,
64
- label: c.CfoLabel,
65
- sublabel: c.CfoSublabel
64
+ label: l.CfoLabel,
65
+ sublabel: l.CfoSublabel
66
66
  }] : [],
67
67
  ...r,
68
68
  ...i
@@ -70,12 +70,12 @@ function k(e) {
70
70
  }
71
71
  function A(e) {
72
72
  let t = e.minAmount.trim() !== "", n = e.maxAmount.trim() !== "";
73
- return t && n ? p.InRange : t ? p.GreaterThanOrEqual : n ? p.LessThan : p.All;
73
+ return t && n ? m.InRange : t ? m.GreaterThanOrEqual : n ? m.LessThan : m.All;
74
74
  }
75
75
  function j(e) {
76
- return [e.conditionType === p.LessThan || e.conditionType === p.All ? 0 : e.minAmount ?? 0, e.conditionType === p.GreaterThanOrEqual || e.conditionType === p.All ? Infinity : e.maxAmount ?? 0];
76
+ return [e.conditionType === m.LessThan || e.conditionType === m.All ? 0 : e.minAmount ?? 0, e.conditionType === m.GreaterThanOrEqual || e.conditionType === m.All ? Infinity : e.maxAmount ?? 0];
77
77
  }
78
- function M(e) {
78
+ function te(e) {
79
79
  if (e.length === 0) return !1;
80
80
  let t = e.map(j).sort((e, t) => e[0] - t[0]);
81
81
  if (t[0][0] > 0) return !1;
@@ -86,7 +86,7 @@ function M(e) {
86
86
  }
87
87
  return n === Infinity;
88
88
  }
89
- function N(e) {
89
+ function M(e) {
90
90
  if (e.length === 0) return [];
91
91
  let t = e.map(j).sort((e, t) => e[0] - t[0]), n = [], r = 0;
92
92
  for (let [e, i] of t) e > r && n.push({
@@ -98,33 +98,33 @@ function N(e) {
98
98
  to: null
99
99
  }), n;
100
100
  }
101
- function P(e) {
101
+ function N(e) {
102
102
  let t = Number(e.minAmount) || 0, n = Number(e.maxAmount) || 0, r = A(e);
103
- return [r === p.LessThan || r === p.All ? 0 : t, r === p.GreaterThanOrEqual || r === p.All ? Infinity : n];
103
+ return [r === m.LessThan || r === m.All ? 0 : t, r === m.GreaterThanOrEqual || r === m.All ? Infinity : n];
104
104
  }
105
- function F(e, t, n) {
106
- let [r, i] = P(e);
105
+ function P(e, t, n) {
106
+ let [r, i] = N(e);
107
107
  return t.filter((e) => e.id !== n).some((e) => {
108
108
  let [t, n] = j(e);
109
109
  return r < n && t < i;
110
110
  });
111
111
  }
112
- function I(e, t, n) {
112
+ function F(e, t, n) {
113
113
  let r = {}, i = e.minAmount.trim() !== "", a = e.maxAmount.trim() !== "", o = Number(e.minAmount.trim()), s = Number(e.maxAmount.trim());
114
- return i && (!Number.isFinite(o) || o < 0) && (r.minAmount = u.InvalidMinAmount), a && (!Number.isFinite(s) || s <= 0) && (r.maxAmount = u.InvalidMaxAmount), i && a && !r.minAmount && !r.maxAmount && o >= s && (r.maxAmount = u.MaxLessThanOrEqualToMin), e.outcome === m.RequireApproval && e.approvers.length === 0 && (r.approvers = u.ApproversRequired), !r.minAmount && !r.maxAmount && F(e, t, n) && (a ? r.maxAmount = u.ConflictsWithAnotherRule : r.minAmount = u.ConflictsWithAnotherRule), r;
114
+ return i && (!Number.isFinite(o) || o < 0) && (r.minAmount = d.InvalidMinAmount), a && (!Number.isFinite(s) || s <= 0) && (r.maxAmount = d.InvalidMaxAmount), i && a && !r.minAmount && !r.maxAmount && o >= s && (r.maxAmount = d.MaxLessThanOrEqualToMin), e.outcome === h.RequireApproval && e.approvers.length === 0 && (r.approvers = d.ApproversRequired), !r.minAmount && !r.maxAmount && P(e, t, n) && (a ? r.maxAmount = d.ConflictsWithAnotherRule : r.minAmount = d.ConflictsWithAnotherRule), r;
115
115
  }
116
- function L(e, t) {
116
+ function I(e, t) {
117
117
  let n = A(t);
118
118
  return {
119
119
  id: e,
120
120
  conditionType: n,
121
- minAmount: n === p.InRange || n === p.GreaterThanOrEqual ? Number(t.minAmount) : void 0,
122
- maxAmount: n === p.LessThan || n === p.InRange ? Number(t.maxAmount) : void 0,
121
+ minAmount: n === m.InRange || n === m.GreaterThanOrEqual ? Number(t.minAmount) : void 0,
122
+ maxAmount: n === m.LessThan || n === m.InRange ? Number(t.maxAmount) : void 0,
123
123
  outcome: t.outcome,
124
- approvers: t.outcome === m.RequireApproval ? t.approvers : []
124
+ approvers: t.outcome === h.RequireApproval ? t.approvers : []
125
125
  };
126
126
  }
127
- function R(e) {
127
+ function L(e) {
128
128
  return {
129
129
  minAmount: e.minAmount == null ? "" : String(e.minAmount),
130
130
  maxAmount: e.maxAmount == null ? "" : String(e.maxAmount),
@@ -132,73 +132,73 @@ function R(e) {
132
132
  approvers: e.approvers
133
133
  };
134
134
  }
135
- function z() {
135
+ function R() {
136
136
  let o = a();
137
137
  y(() => {
138
- o(d.Mounted);
138
+ o(f.Mounted);
139
139
  }, [o]);
140
- let { initResponse: u } = s(), f = u?.scopes?.includes(t.RoleReadOrg) ?? !1, { data: p, isResolving: m, isError: D } = n({ enabled: f }), A = b(() => k(p?.data ?? []), [p]), j = b(() => {
141
- let e = p?.data ?? [], t = e.find((e) => e.isSystemRole === !0 && E(e.key, "admin")), n = e.find((e) => e.isSystemRole === !0 && O(e.key)), r = { reporting_manager: c.ReportingManagerLabel };
142
- t && (r[t.id] = c.AdminLabel), n && (r[n.id] = c.CfoLabel);
140
+ let { initResponse: d } = s(), p = c(), m = d?.scopes?.includes(t.RoleReadOrg) ?? !1, { data: h, isResolving: D, isError: A } = n({ enabled: m }), j = b(() => k(h?.data ?? []), [h]), N = b(() => {
141
+ let e = h?.data ?? [], t = e.find((e) => e.isSystemRole === !0 && E(e.key, "admin")), n = e.find((e) => e.isSystemRole === !0 && O(e.key)), r = { reporting_manager: l.ReportingManagerLabel };
142
+ t && (r[t.id] = l.AdminLabel), n && (r[n.id] = l.CfoLabel);
143
143
  for (let t of e) r[t.id] || (r[t.id] = t.name);
144
144
  return r;
145
- }, [p]), { rules: P, isLoading: F, saveStatus: z, createRule: B, updateRule: V, deleteRule: H } = _(j), [U, W] = x(!1), [G, K] = x(T), [q, J] = x(null), [Y, X] = x(null);
145
+ }, [h]), { rules: P, isLoading: R, saveStatus: z, createRule: B, updateRule: V, deleteRule: H } = _(N), [U, W] = x(!1), [G, K] = x(T), [q, J] = x(null), [Y, X] = x(null);
146
146
  y(() => {
147
- z === "success" && e.success(h.Saved), z === "error" && e.error(h.FailedToSave);
147
+ z === "success" && e.success(g.Saved), z === "error" && e.error(g.FailedToSave);
148
148
  }, [z]);
149
- let Z = M(P), Q = N(P), $ = F || m || z === "saving", ee = U ? I(G, P) : {}, te = Y && q ? I(Y, P, q) : {}, ne = () => {
149
+ let Z = R || p && !d, ne = te(P), re = M(P), Q = Z || D || z === "saving", $ = U ? F(G, P) : {}, ie = Y && q ? F(Y, P, q) : {}, ae = () => {
150
150
  W(!0), K(T);
151
- }, re = () => {
151
+ }, oe = () => {
152
152
  W(!1);
153
- }, ie = async () => {
154
- let e = I(G, P);
153
+ }, se = async () => {
154
+ let e = F(G, P);
155
155
  if (Object.keys(e).length > 0) return;
156
156
  let t = crypto.randomUUID();
157
- await B(L(t, G)) && (W(!1), K(T));
158
- }, ae = (e) => {
157
+ await B(I(t, G)) && (W(!1), K(T));
158
+ }, ce = (e) => {
159
159
  K(e);
160
- }, oe = (e) => {
160
+ }, le = (e) => {
161
161
  let t = P.find((t) => t.id === e);
162
- t && (W(!1), K(T), J(e), X(R(t)));
163
- }, se = () => {
162
+ t && (W(!1), K(T), J(e), X(L(t)));
163
+ }, ue = () => {
164
164
  J(null), X(null);
165
- }, ce = async () => {
165
+ }, de = async () => {
166
166
  if (!q || !Y) return;
167
- let e = I(Y, P, q);
168
- Object.keys(e).length > 0 || await V(q, L(q, Y)) && (J(null), X(null));
169
- }, le = (e) => {
167
+ let e = F(Y, P, q);
168
+ Object.keys(e).length > 0 || await V(q, I(q, Y)) && (J(null), X(null));
169
+ }, fe = (e) => {
170
170
  X(e);
171
- }, ue = async (e) => {
171
+ }, pe = async (e) => {
172
172
  await H(e), q === e && (J(null), X(null));
173
173
  };
174
- return u !== void 0 && !f ? /* @__PURE__ */ C(i, {
175
- title: l.MissingRolePermissionTitle,
176
- description: l.MissingRolePermissionDescription
177
- }) : D ? /* @__PURE__ */ C(i, {
178
- title: l.RolesUnavailableTitle,
179
- description: l.RolesUnavailableDescription
180
- }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(r, {}), /* @__PURE__ */ C(g, {
174
+ return d !== void 0 && !m ? /* @__PURE__ */ C(i, {
175
+ title: u.MissingRolePermissionTitle,
176
+ description: u.MissingRolePermissionDescription
177
+ }) : A ? /* @__PURE__ */ C(i, {
178
+ title: u.RolesUnavailableTitle,
179
+ description: u.RolesUnavailableDescription
180
+ }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(r, {}), /* @__PURE__ */ C(ee, {
181
181
  rules: P,
182
- isBusy: $,
183
- isLoading: F,
182
+ isBusy: Q,
183
+ isLoading: Z,
184
184
  isAddingRule: U,
185
185
  newRuleFormValues: G,
186
- newRuleValidationErrors: ee,
186
+ newRuleValidationErrors: $,
187
187
  editingRuleId: q,
188
188
  editingRuleFormValues: Y,
189
- editingRuleValidationErrors: te,
190
- approverOptions: $ ? [] : A,
191
- allExpensesAreCovered: Z,
192
- gapIntervals: Q,
193
- onAddRuleClick: ne,
194
- onCancelAddRule: re,
195
- onSaveNewRule: () => void ie(),
196
- onNewRuleFormChange: ae,
197
- onEditRule: oe,
198
- onCancelEditRule: se,
199
- onSaveEditRule: () => void ce(),
200
- onEditRuleFormChange: le,
201
- onDeleteRule: (e) => void ue(e),
189
+ editingRuleValidationErrors: ie,
190
+ approverOptions: Q ? [] : j,
191
+ allExpensesAreCovered: ne,
192
+ gapIntervals: re,
193
+ onAddRuleClick: ae,
194
+ onCancelAddRule: oe,
195
+ onSaveNewRule: () => void se(),
196
+ onNewRuleFormChange: ce,
197
+ onEditRule: le,
198
+ onCancelEditRule: ue,
199
+ onSaveEditRule: () => void de(),
200
+ onEditRuleFormChange: fe,
201
+ onDeleteRule: (e) => void pe(e),
202
202
  testIds: {
203
203
  ruleCard: { root: v.ruleCard },
204
204
  ruleForm: {
@@ -210,9 +210,9 @@ function z() {
210
210
  }
211
211
  })] });
212
212
  }
213
- function B({ token: e, orgId: t, widgetToken: n, organizationId: r, baseUrl: i, configClient: a, gatewayRouting: s, linkComponent: c, implementation: l, uiFramework: u, errorFallback: d, onError: p, disclosuresAcceptance: m, providerLabels: h } = {}) {
213
+ function z({ token: e, orgId: t, widgetToken: n, organizationId: r, baseUrl: i, configClient: a, gatewayRouting: s, linkComponent: c, implementation: l, uiFramework: u, errorFallback: d, onError: f, disclosuresAcceptance: m, providerLabels: h } = {}) {
214
214
  return /* @__PURE__ */ C(o, {
215
- widgetName: f,
215
+ widgetName: p,
216
216
  baseUrl: i,
217
217
  widgetToken: n ?? e,
218
218
  organizationId: r ?? t,
@@ -222,11 +222,11 @@ function B({ token: e, orgId: t, widgetToken: n, organizationId: r, baseUrl: i,
222
222
  implementation: l,
223
223
  uiFramework: u,
224
224
  errorFallback: d,
225
- onError: p,
225
+ onError: f,
226
226
  disclosuresAcceptance: m,
227
227
  providerLabels: h,
228
- children: /* @__PURE__ */ C(z, {})
228
+ children: /* @__PURE__ */ C(R, {})
229
229
  });
230
230
  }
231
231
  //#endregion
232
- export { B as ExpenseApprovalPoliciesWidget, B as default, k as buildApproverOptions, E as isEmbeddedSystemRoleKey, D as roleKeyHasSegment };
232
+ export { z as ExpenseApprovalPoliciesWidget, z as default, k as buildApproverOptions, E as isEmbeddedSystemRoleKey, D as roleKeyHasSegment };
@@ -14,16 +14,23 @@ var h = ({ rules: i, isBusy: h, isLoading: g, isAddingRule: _, newRuleFormValues
14
14
  let L = i.length > 0, R = !w && !_ && !b;
15
15
  return /* @__PURE__ */ l("div", {
16
16
  className: "ttw:flex ttw:flex-col ttw:gap-3",
17
- children: g && !L && !_ && !b ? /* @__PURE__ */ l(c, { children: Array.from({ length: 2 }).map((e, n) => /* @__PURE__ */ u("div", {
18
- className: "ttw:border ttw:border-border ttw:rounded-lg ttw:p-4 ttw:flex ttw:flex-col ttw:gap-3",
19
- children: [/* @__PURE__ */ u("div", {
20
- className: "ttw:flex ttw:items-center ttw:justify-between",
21
- children: [/* @__PURE__ */ l(t, { className: "ttw:h-4 ttw:w-64" }), /* @__PURE__ */ u("div", {
22
- className: "ttw:flex ttw:gap-1",
23
- children: [/* @__PURE__ */ l(t, { className: "ttw:h-8 ttw:w-8" }), /* @__PURE__ */ l(t, { className: "ttw:h-8 ttw:w-8" })]
24
- })]
25
- }), /* @__PURE__ */ l(t, { className: "ttw:h-6 ttw:w-32" })]
26
- }, n)) }) : !L && !_ ? /* @__PURE__ */ l(a, {
17
+ children: g && !L && !_ && !b ? /* @__PURE__ */ u("div", {
18
+ role: "status",
19
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
20
+ children: [/* @__PURE__ */ l("span", {
21
+ className: "ttw:sr-only",
22
+ children: n.LoadingRules
23
+ }), Array.from({ length: 2 }).map((e, n) => /* @__PURE__ */ u("div", {
24
+ className: "ttw:border ttw:border-border ttw:rounded-lg ttw:p-4 ttw:flex ttw:flex-col ttw:gap-3",
25
+ children: [/* @__PURE__ */ u("div", {
26
+ className: "ttw:flex ttw:items-center ttw:justify-between",
27
+ children: [/* @__PURE__ */ l(t, { className: "ttw:h-4 ttw:w-64" }), /* @__PURE__ */ u("div", {
28
+ className: "ttw:flex ttw:gap-1",
29
+ children: [/* @__PURE__ */ l(t, { className: "ttw:h-8 ttw:w-8" }), /* @__PURE__ */ l(t, { className: "ttw:h-8 ttw:w-8" })]
30
+ })]
31
+ }), /* @__PURE__ */ l(t, { className: "ttw:h-6 ttw:w-32" })]
32
+ }, n))]
33
+ }) : !L && !_ ? /* @__PURE__ */ l(a, {
27
34
  onAddRule: E,
28
35
  onLearnMore: F
29
36
  }) : /* @__PURE__ */ u(c, { children: [
@@ -7,7 +7,8 @@ var e = {
7
7
  AllExpensesCoveredTitle: "All expense amounts are covered",
8
8
  AllExpensesCoveredBody: "Edit one of your previously configured rules first if you need to make room for a new rule.",
9
9
  AddRule: "Add rule",
10
- CreateAnotherRule: "Create another rule"
10
+ CreateAnotherRule: "Create another rule",
11
+ LoadingRules: "Loading approval rules"
11
12
  }, t = {
12
13
  ForExpenses: "For",
13
14
  ExpensesBold: "expenses",
@@ -281,4 +281,4 @@ function p({ labels: t, featureLabels: l }) {
281
281
  };
282
282
  }
283
283
  //#endregion
284
- export { p as useLinkedAccountsWidget };
284
+ export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, p as useLinkedAccountsWidget };
@@ -50,7 +50,7 @@ var u = (e) => o(e, "yyyy-MM-dd"), d = (e, t, n, r) => {
50
50
  ledger_account_id: t.ledger_account_id
51
51
  }))
52
52
  };
53
- }, f = ({ discount: e, invoiceNumber: t, counterpart: n, counterpartBankAccount: r, invoiceDate: i, dueDate: a, currency: o, tags: s, counterpartAddressId: c }, l) => ({
53
+ }, f = ({ discount: e, invoiceNumber: t, counterpart: n, counterpartBankAccount: r, invoiceDate: i, dueDate: a, currency: o, tags: s, counterpartAddressId: c }, l, d) => ({
54
54
  document_id: t,
55
55
  discount: e && o ? l(e, o) ?? 0 : 0,
56
56
  counterpart_id: n || void 0,
@@ -59,7 +59,10 @@ var u = (e) => o(e, "yyyy-MM-dd"), d = (e, t, n, r) => {
59
59
  due_date: a instanceof Date ? u(a) : void 0,
60
60
  currency: o,
61
61
  tag_ids: s.map((e) => e.id),
62
- counterpart_address_id: c
62
+ counterpart_address_id: c,
63
+ subtotal: o ? l(d.subtotal, o) ?? 0 : void 0,
64
+ tax_amount: o ? l(d.taxes, o) ?? 0 : void 0,
65
+ total_amount: o ? l(d.total + (e ?? 0), o) ?? 0 : void 0
63
66
  }), p = (e, t) => {
64
67
  let n = e * t;
65
68
  return parseFloat(n.toFixed(2));
@@ -88,13 +91,16 @@ var u = (e) => o(e, "yyyy-MM-dd"), d = (e, t, n, r) => {
88
91
  total: i - (t ?? 0)
89
92
  };
90
93
  }, _ = (e, t, n, r) => {
91
- let { name: i, quantity: o, price: s, tax: c, ledger_account_id: l } = t, u = r?.allowLedgerUpdate ? a(l, r?.previous) : l, d = {
94
+ let { name: i, quantity: o, price: s, tax: c, ledger_account_id: l } = t, u = r?.allowLedgerUpdate ? a(l, r?.previous) : l, d = p(s, o), f = m(d, c || 0), h = f - d, g = {
92
95
  name: i,
93
96
  quantity: o,
94
97
  tax: v(c),
98
+ subtotal: n(d, e) ?? 0,
99
+ tax_amount: n(h, e) ?? 0,
100
+ total: n(f, e) ?? 0,
95
101
  unit_price: n(s, e) ?? 0
96
102
  };
97
- return u !== void 0 && (d.ledger_account_id = u), d;
103
+ return u !== void 0 && (g.ledger_account_id = u), g;
98
104
  };
99
105
  function v(e) {
100
106
  return t(e);
@@ -122,7 +122,7 @@ var S = ({ ref: e, ...t }) => /* @__PURE__ */ l(r, { children: /* @__PURE__ */ l
122
122
  ...e,
123
123
  currency: e.currency,
124
124
  counterpartAddressId: me(tt.data?.data, $, e.counterpart)
125
- }, n = pe(t, j);
125
+ }, n = pe(t, j, K);
126
126
  r ? S && S(r.id, n, e.lineItems, Xe) : C && C(n, e.lineItems);
127
127
  }),
128
128
  children: /* @__PURE__ */ u(p, {
@@ -16,54 +16,54 @@ import { useState as _ } from "react";
16
16
  import { Fragment as v, jsx as y, jsxs as b } from "@emotion/react/jsx-runtime";
17
17
  import { useLingui as x } from "@lingui/react";
18
18
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js
19
- var S = (e) => /* @__PURE__ */ y(u, { children: /* @__PURE__ */ y(C, { ...e }) }), C = ({ isDialog: u, isOpen: S, handleCloseDialog: C }) => {
20
- let w = c(), { shouldShowChangesModal: T, handleShowModal: E } = d(), { i18n: D } = x(), [O, k] = _(!1), A = w.has(e.OrganizationSettingsWriteOrg), { data: j } = t(), M = j?.id ?? "", { data: N, isLoading: P } = f(M, A), { data: F, isLoading: I } = p(M, A), L = P || I;
21
- if (!A) return null;
22
- let R = () => {
23
- T ? k(!0) : C?.();
24
- }, z = /* @__PURE__ */ b("div", {
19
+ var S = (e) => /* @__PURE__ */ y(u, { children: /* @__PURE__ */ y(C, { ...e }) }), C = ({ isDialog: u, showHeader: S = !0, isOpen: C, handleCloseDialog: w }) => {
20
+ let T = c(), { shouldShowChangesModal: E, handleShowModal: D } = d(), { i18n: O } = x(), [k, A] = _(!1), j = T.has(e.OrganizationSettingsWriteOrg), { data: M } = t(), N = M?.id ?? "", { data: P, isLoading: F } = f(N, j), { data: I, isLoading: L } = p(N, j), R = F || L;
21
+ if (!j) return null;
22
+ let z = () => {
23
+ E ? A(!0) : w?.();
24
+ }, B = /* @__PURE__ */ b("div", {
25
25
  className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:w-full ttw:max-w-163",
26
26
  children: [
27
27
  /* @__PURE__ */ y(m, {}),
28
- L && /* @__PURE__ */ y(s, {}),
29
- N && F && /* @__PURE__ */ y(h, {
30
- entityId: M,
31
- entitySettings: N,
32
- nextNumbers: F,
28
+ R && /* @__PURE__ */ y(s, {}),
29
+ P && I && /* @__PURE__ */ y(h, {
30
+ entityId: N,
31
+ entitySettings: P,
32
+ nextNumbers: I,
33
33
  isDialog: u
34
34
  })
35
35
  ]
36
36
  });
37
37
  return /* @__PURE__ */ b(v, { children: [u ? /* @__PURE__ */ y(n, {
38
- open: !!S,
39
- onOpenChange: (e) => !e && R(),
38
+ open: !!C,
39
+ onOpenChange: (e) => !e && z(),
40
40
  children: /* @__PURE__ */ b(r, {
41
41
  className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:p-6 ttw:overflow-auto",
42
42
  children: [/* @__PURE__ */ b(a, {
43
43
  className: "ttw:p-0",
44
44
  children: [/* @__PURE__ */ y(o, {
45
45
  className: "ttw:text-2xl ttw:font-semibold ttw:leading-8 ttw:text-text",
46
- children: D._("Edit invoice settings")
46
+ children: O._("Edit invoice settings")
47
47
  }), /* @__PURE__ */ y(i, {
48
48
  className: "ttw:sr-only",
49
- children: D._("Manage invoice settings including logo, and document configuration")
49
+ children: O._("Manage invoice settings including logo, and document configuration")
50
50
  })]
51
- }), z]
51
+ }), B]
52
52
  })
53
- }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(l, {
53
+ }) : /* @__PURE__ */ b(v, { children: [S ? /* @__PURE__ */ y(l, {
54
54
  className: "-Header",
55
55
  titleVariant: "h3",
56
- title: /* @__PURE__ */ y(v, { children: D._("Invoices") })
57
- }), /* @__PURE__ */ y("div", {
56
+ title: /* @__PURE__ */ y(v, { children: O._("Invoices") })
57
+ }) : null, /* @__PURE__ */ y("div", {
58
58
  className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
59
- children: z
59
+ children: B
60
60
  })] }), /* @__PURE__ */ y(g, {
61
- open: O,
61
+ open: k,
62
62
  onClose: () => {
63
- k(!1);
63
+ A(!1);
64
64
  },
65
65
  onContinue: () => {
66
- k(!1), E(!1), u && C && C();
66
+ A(!1), D(!1), u && w && w();
67
67
  }
68
68
  })] });
69
69
  };
@@ -4,6 +4,7 @@ var e = {
4
4
  teamSection: "Team",
5
5
  invoiceSection: "Invoices",
6
6
  billPaySection: "Bill pay",
7
+ billPayDescription: "Set who needs to approve bills before payment.",
7
8
  accountingSection: "Chart of accounts",
8
9
  tagsSection: "Tags",
9
10
  expenseSection: "Expenses",
@@ -8,7 +8,8 @@ import "../../../shared/data-access/dist/index.js";
8
8
  import { useAnalyticsTrack as n } from "../../../shared/feature/dist/lib/analytics/hooks.js";
9
9
  import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
10
  import "../../../shared/feature/dist/index.js";
11
- import { ApprovalPolicies as i } from "../../../monite-sdk/dist/index340.js";
11
+ import { ApprovalPoliciesSettings as i } from "../../../shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js";
12
+ import "../../../shared/approval-policy/feature/dist/index.js";
12
13
  import { TemplateSettings as a } from "../../../monite-sdk/dist/index616.js";
13
14
  import "../../../monite-sdk/dist/index.js";
14
15
  import { MoniteRegionProvider as o } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
@@ -39,7 +40,12 @@ var C = {
39
40
  [c.Profile]: [],
40
41
  [c.Team]: [t.UserReadOrg],
41
42
  [c.Invoice]: [t.OrganizationSettingsWriteOrg],
42
- [c.BillPay]: [t.ApprovalPolicyWriteOrg, t.PayableWriteOrg],
43
+ [c.BillPay]: [
44
+ t.ApprovalPolicyWriteOrg,
45
+ t.PayableWriteOrg,
46
+ t.RoleReadOrg,
47
+ t.UserReadOrg
48
+ ],
43
49
  [c.Accounting]: [t.AccountingConfigReadOrg],
44
50
  [c.Tags]: [t.AccountingConfigReadOrg],
45
51
  [c.Expense]: [t.ApprovalPolicyWriteOrg, t.ExpenseWriteOrg],
@@ -68,7 +74,7 @@ function w({ labels: t, featureLabels: o, acceptInviteRedirectUri: d, helpContac
68
74
  {
69
75
  id: c.Invoice,
70
76
  label: B.invoiceSection,
71
- content: R ?? /* @__PURE__ */ x(a, {})
77
+ content: R ?? /* @__PURE__ */ x(a, { showHeader: !1 })
72
78
  },
73
79
  {
74
80
  id: c.Expense,
@@ -81,7 +87,10 @@ function w({ labels: t, featureLabels: o, acceptInviteRedirectUri: d, helpContac
81
87
  {
82
88
  id: c.BillPay,
83
89
  label: B.billPaySection,
84
- content: N ?? /* @__PURE__ */ x(i, {})
90
+ content: N ?? /* @__PURE__ */ x(i, {
91
+ showHeaderTitle: !1,
92
+ componentLabels: { header: { Description: B.billPayDescription } }
93
+ })
85
94
  },
86
95
  {
87
96
  id: c.Accounting,
@@ -1,55 +1,53 @@
1
1
  import { Accordion as e, AccordionContent as t, AccordionItem as n, AccordionTrigger as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { SectionHeading as i } from "../../../../../shared/ui/dist/lib/SectionHeading/SectionHeading.js";
3
- import "../../../../../shared/ui/dist/index.js";
4
- import { HELP_WIDGET_LABELS_EN as a } from "../../contract/dist/index2.js";
2
+ import { HELP_WIDGET_LABELS_EN as i } from "../../contract/dist/index2.js";
5
3
  import "../../contract/dist/index.js";
6
- import { AnswerBlocks as o } from "./index2.js";
7
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
+ import { AnswerBlocks as a } from "./index2.js";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
6
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js
9
- var u = "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6";
10
- function d({ faq: d, bankName: f, contactUrl: p, labels: m }) {
11
- let h = {
12
- ...a,
13
- ...m
7
+ var c = "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6";
8
+ function l({ faq: l, bankName: u, contactUrl: d, labels: f }) {
9
+ let p = {
10
+ ...i,
11
+ ...f
14
12
  };
15
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(i, { children: h.title }), /* @__PURE__ */ c("div", {
16
- className: u,
17
- children: /* @__PURE__ */ l("div", {
13
+ return /* @__PURE__ */ o("div", {
14
+ className: c,
15
+ children: /* @__PURE__ */ s("div", {
18
16
  className: "ttw:space-y-8",
19
- children: [d.map((i) => /* @__PURE__ */ l("section", { children: [/* @__PURE__ */ c("h3", {
17
+ children: [l.map((i) => /* @__PURE__ */ s("section", { children: [/* @__PURE__ */ o("h3", {
20
18
  className: "ttw:mb-2 ttw:text-lg ttw:font-semibold ttw:text-primary",
21
19
  children: i.title
22
- }), /* @__PURE__ */ c(e, {
20
+ }), /* @__PURE__ */ o(e, {
23
21
  type: "single",
24
22
  collapsible: !0,
25
23
  className: "ttw:w-full ttw:space-y-3",
26
- children: i.items.map((e, a) => /* @__PURE__ */ l(n, {
27
- value: `${i.title}-${a}`,
24
+ children: i.items.map((e, c) => /* @__PURE__ */ s(n, {
25
+ value: `${i.title}-${c}`,
28
26
  className: "ttw:rounded-lg ttw:border ttw:border-border ttw:px-4 ttw:last:border-b",
29
- children: [/* @__PURE__ */ c(r, { children: e.question }), /* @__PURE__ */ c(t, { children: /* @__PURE__ */ c(o, { answers: e.answers }) })]
30
- }, `${i.title}-${a}`))
31
- })] }, i.title)), p && f && /* @__PURE__ */ l("section", { children: [/* @__PURE__ */ c("h3", {
27
+ children: [/* @__PURE__ */ o(r, { children: e.question }), /* @__PURE__ */ o(t, { children: /* @__PURE__ */ o(a, { answers: e.answers }) })]
28
+ }, `${i.title}-${c}`))
29
+ })] }, i.title)), d && u && /* @__PURE__ */ s("section", { children: [/* @__PURE__ */ o("h3", {
32
30
  className: "ttw:mb-1 ttw:text-lg ttw:font-semibold ttw:text-primary",
33
- children: h.contactUsTitle
34
- }), /* @__PURE__ */ l("p", {
31
+ children: p.contactUsTitle
32
+ }), /* @__PURE__ */ s("p", {
35
33
  className: "ttw:text-sm ttw:text-muted-foreground",
36
34
  children: [
37
- h.contactUsBody,
35
+ p.contactUsBody,
38
36
  " ",
39
- f,
37
+ u,
40
38
  " ",
41
- /* @__PURE__ */ c("a", {
42
- href: p,
39
+ /* @__PURE__ */ o("a", {
40
+ href: d,
43
41
  target: "_blank",
44
42
  rel: "noopener noreferrer",
45
43
  className: "ttw:font-medium ttw:text-primary ttw:underline",
46
- children: h.contactUsLinkText
44
+ children: p.contactUsLinkText
47
45
  }),
48
46
  "."
49
47
  ]
50
48
  })] })]
51
49
  })
52
- })] });
50
+ });
53
51
  }
54
52
  //#endregion
55
- export { d as HelpWidgetShadcn, d as default };
53
+ export { l as HelpWidgetShadcn, l as default };