@tesouro/embedded-components-react 0.5.124 → 0.5.126

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 (68) hide show
  1. package/dist/index.css +6 -0
  2. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +2 -2
  3. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index7.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +3 -3
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +3 -3
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index3.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index4.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +3 -3
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index396.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index465.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +2 -2
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index90.js +6 -6
  33. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index4.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index10.js +3 -2
  36. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js +9 -9
  37. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js +58 -7
  38. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js +3 -98
  39. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index6.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js +8 -8
  41. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js +62 -62
  42. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js +7 -7
  43. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApproverOptions.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/widgetInitChannel.js +2 -2
  50. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/traceId.js +1 -1
  52. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index.js +4 -3
  53. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js +5 -9
  54. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js +7 -31
  55. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js +7 -8
  56. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index6.js +7 -5
  57. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index7.js +33 -0
  58. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/index.js +5 -0
  59. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/TagSelectorField.js +11 -0
  60. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js +38 -0
  61. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js +19 -0
  62. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/permissions.js +4 -0
  63. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/useTagCreateForm.js +6 -0
  64. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index.js +1 -0
  65. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index3.js +30 -30
  66. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index4.js +4 -0
  67. package/dist/packages/shared-ui-shadcn/dist/index.js +1304 -1219
  68. package/package.json +12 -12
package/dist/index.css CHANGED
@@ -1179,6 +1179,9 @@
1179
1179
  .ttw\:w-96 {
1180
1180
  width: calc(var(--ttw-spacing) * 96);
1181
1181
  }
1182
+ .ttw\:w-105 {
1183
+ width: calc(var(--ttw-spacing) * 105);
1184
+ }
1182
1185
  .ttw\:w-110 {
1183
1186
  width: calc(var(--ttw-spacing) * 110);
1184
1187
  }
@@ -1260,6 +1263,9 @@
1260
1263
  .ttw\:w-\[400px\] {
1261
1264
  width: 400px;
1262
1265
  }
1266
+ .ttw\:w-\[420px\] {
1267
+ width: 420px;
1268
+ }
1263
1269
  .ttw\:w-\[423px\] {
1264
1270
  width: 423px;
1265
1271
  }
@@ -122,7 +122,7 @@ function Ee({ onEmbeddedOnboardingCompletedSuccessfully: u, onNavigateToDashboar
122
122
  S(() => () => it.current?.abort(), []);
123
123
  let at = C(() => ee(P.businessDetails.naicsTitles), [P.businessDetails.naicsTitles]), ot = C(() => d(P.businessDetails.stateTitles), [P.businessDetails.stateTitles]), st = C(() => d(P.personalDetails.stateTitles), [P.personalDetails.stateTitles]), ct = C(() => d(P.additionalOwners.stateTitles), [P.additionalOwners.stateTitles]), X = q || Ye !== null, lt = F?.status === "ACTIVE" || F?.status === "INACTIVE", ut = F?.status === "INVITED", Z = !!F && !X && (lt || ut || rt.isSuppressed), Q = Z ? lt ? o.UserAlreadyOnboarded : ut ? o.UserInvitedToOrganization : rt.reason : null;
124
124
  S(() => {
125
- !Z || !Q || (M(se.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
125
+ Z && Q && (M(se.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
126
126
  }, [
127
127
  Z,
128
128
  Q,
@@ -380,7 +380,7 @@ var A = { canRender: !1 };
380
380
  function j(e) {
381
381
  let { authEpoch: t } = r(), { applicationId: n, clientSecret: i, isResolved: a } = x(), { application: o, isResolved: s, isUnavailable: c } = _e(n, i), [l, u] = w(null);
382
382
  if (S(() => {
383
- if (!(l?.canRender === !0 || !a || !s)) {
383
+ if (l?.canRender !== !0 && a && s) {
384
384
  if (c) {
385
385
  u(A);
386
386
  return;
@@ -10,7 +10,7 @@ function r(e, t) {
10
10
  var i = "SOLE_PROPRIETORSHIP";
11
11
  function a(e) {
12
12
  let { companyStructure: t, taxIdOnFileLast4: n, taxIdOnFileStructure: r } = e;
13
- if (!(!n || !r)) return r === i == (t === i) ? n : void 0;
13
+ if (n && r) return r === i == (t === i) ? n : void 0;
14
14
  }
15
15
  function o(t, n) {
16
16
  return t ? {
@@ -50,7 +50,7 @@ function u(l, u, d) {
50
50
  }
51
51
  });
52
52
  a(() => {
53
- !u || !v.hasNextPage || v.isFetchingNextPage || v.isError || v.fetchNextPage();
53
+ u && v.hasNextPage && !v.isFetchingNextPage && !v.isError && v.fetchNextPage();
54
54
  }, [
55
55
  u,
56
56
  v.hasNextPage,
@@ -142,7 +142,7 @@ function f({ labels: t, featureLabels: a, isBankingTaglineVisible: o = !0, bankL
142
142
  }, Xe = (e, t) => {
143
143
  q.find((t) => t.id === e)?.locked || N((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
144
144
  }, Ze = (e) => {
145
- e && !X || (e && (j(u), N([]), I(void 0), P(!1), V.reset(), H.reset()), k(e));
145
+ (!e || X) && (e && (j(u), N([]), I(void 0), P(!1), V.reset(), H.reset()), k(e));
146
146
  }, $ = V.isPending || H.isPending, Qe = ie(q, {
147
147
  selectedUserIds: M,
148
148
  disabled: $ || !y.canWrite,
@@ -185,7 +185,7 @@ function A() {
185
185
  organizationId: t,
186
186
  payableId: a,
187
187
  includeApprovalRequests: !0
188
- }), !(!o || !i) && b({
188
+ }), o && i && b({
189
189
  client: e,
190
190
  organizationId: t,
191
191
  payableId: a,
@@ -138,7 +138,7 @@ async function z({ client: e, organizationId: n, payableId: r, watch: i }) {
138
138
  headers: s(n),
139
139
  path: { payable_id: r }
140
140
  });
141
- c = !!(i?.status && !D.has(i.status));
141
+ c = !(!i?.status || D.has(i.status));
142
142
  } catch {}
143
143
  if (!c) {
144
144
  let t = await i.poll();
@@ -93,7 +93,7 @@ function g() {
93
93
  });
94
94
  },
95
95
  onError: async (e) => {
96
- !(e instanceof m) || !h(e.applied) || await o({
96
+ e instanceof m && h(e.applied) && await o({
97
97
  client: c,
98
98
  organizationId: l,
99
99
  payableIds: e.applied.payableIds,
@@ -37,7 +37,7 @@ async function m({ client: e, organizationId: t, payableId: n, requestStatus: r
37
37
  client: e,
38
38
  organizationId: t,
39
39
  payableId: n
40
- }), !(!n || !i) && u({
40
+ }), n && i && u({
41
41
  client: e,
42
42
  organizationId: t,
43
43
  payableId: n,
@@ -15,7 +15,7 @@ function l({ payable: l, canManage: u = !0, onRemoved: d, labels: f }) {
15
15
  ...t,
16
16
  ...f
17
17
  }), [f]), m = r(l), [h] = m, g = l?.id, _ = i(), [v, y] = c(!1), b = a(l?.status), x = o(async (t, n, r) => {
18
- if (!(!m.length || !g)) try {
18
+ if (m.length && g) try {
19
19
  await _.mutateAsync({
20
20
  verdict: t,
21
21
  targets: m.map((e) => ({
@@ -37,7 +37,7 @@ function d({ payableId: d, amountDueMinorUnits: f, amountToPayMinorUnits: p, cur
37
37
  onDateChange: w,
38
38
  onCommentChange: E,
39
39
  onConfirm: () => {
40
- !d || !C || b.isPending || g || b.mutate({
40
+ d && C && !b.isPending && !g && b.mutate({
41
41
  path: { payable_id: d },
42
42
  body: {
43
43
  paid_at: `${a(C)}T12:00:00.000Z`,
@@ -52,7 +52,7 @@ function p({ payableId: d, status: f, currentApprovalRequestId: p, arePendingApp
52
52
  isPending: F.isPending,
53
53
  run: () => {
54
54
  let e = H?.scheduledPaymentIntentId;
55
- !d || !e || F.mutate({
55
+ d && e && F.mutate({
56
56
  path: { payment_intent_id: e },
57
57
  payableId: d
58
58
  }, W("cancelScheduledPayment"));
@@ -75,7 +75,7 @@ function p({ payableId: d, status: f, currentApprovalRequestId: p, arePendingApp
75
75
  disabled: z,
76
76
  loading: e.id === "markAsPaid" ? C : G[e.id]?.isPending ?? !1,
77
77
  onSelect: () => {
78
- if (!(z || !d)) {
78
+ if (!z && d) {
79
79
  if (e.id === "payBill") {
80
80
  D();
81
81
  return;
@@ -118,7 +118,7 @@ function p({ payableId: d, status: f, currentApprovalRequestId: p, arePendingApp
118
118
  z || V(void 0);
119
119
  },
120
120
  onConfirm: (e) => {
121
- !H || z || (G[H.id]?.run(e), V(void 0));
121
+ H && !z && (G[H.id]?.run(e), V(void 0));
122
122
  }
123
123
  }
124
124
  };
@@ -30,7 +30,7 @@ function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }
30
30
  f.isPending || m(!1);
31
31
  },
32
32
  onConfirm: () => {
33
- !g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
33
+ g && o && !f.isPending && f.mutate({ path: { payable_id: o } }, {
34
34
  onError: () => e.error(l.error),
35
35
  onSuccess: () => {
36
36
  m(!1), u();
@@ -8,7 +8,7 @@ function t(t) {
8
8
  }
9
9
  function n(t) {
10
10
  let n = e(t.bank_account?.routing_number), r = e(t.bank_account?.account_number);
11
- if (!(!n && !r)) return {
11
+ if (n || r) return {
12
12
  accountHolderName: e(t.bank_account?.account_holder_name) || e(t.name),
13
13
  routingNumber: n,
14
14
  accountNumber: r
@@ -87,11 +87,11 @@ function S({ rows: S, isLoading: C, isError: w, sorting: Se, onSortingChange: Ce
87
87
  ...W?.dueDate
88
88
  }
89
89
  }), [W]), [Pe, J] = le(!1), Y = !!L, X = (e) => Array.from(e.dataTransfer.types).includes("Files"), Z = (e) => {
90
- !Y || !X(e) || (e.preventDefault(), J(!0));
90
+ Y && X(e) && (e.preventDefault(), J(!0));
91
91
  }, Fe = (e) => {
92
- !Y || !X(e) || (e.preventDefault(), e.dataTransfer.dropEffect = "copy", J(!0));
92
+ Y && X(e) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy", J(!0));
93
93
  }, Ie = (e) => {
94
- e.currentTarget.contains(e.relatedTarget) || !Y || J(!1);
94
+ !e.currentTarget.contains(e.relatedTarget) && Y && J(!1);
95
95
  }, Le = (e) => {
96
96
  if (!Y) return;
97
97
  e.preventDefault(), J(!1);
@@ -17,7 +17,7 @@ function g({ open: g, onOpenChange: _, groups: v, isLoading: y, isError: b, expa
17
17
  return /* @__PURE__ */ p(i, {
18
18
  open: g,
19
19
  onOpenChange: (e) => {
20
- C && !e || _(e);
20
+ (!C || e) && _(e);
21
21
  },
22
22
  children: /* @__PURE__ */ m(a, {
23
23
  className: "ttw:flex ttw:flex-col ttw:gap-8 ttw:overflow-hidden ttw:max-h-[90vh] ttw:sm:max-w-240",
@@ -128,7 +128,7 @@ function C({ cardId: r, cardProgram: d, onClose: C, labels: w, activateLabels: h
128
128
  w,
129
129
  N.revealNotPermittedDescription
130
130
  ]), $ = y(() => {
131
- if (!(W !== "revealed" || !U.data)) return {
131
+ if (W === "revealed" && U.data) return {
132
132
  cardNumber: p(U.data.pan),
133
133
  expirationDate: m(U.data.expirationDate),
134
134
  securityCode: U.data.cvv
@@ -38,7 +38,7 @@ function o(e) {
38
38
  function s(e) {
39
39
  if (!e) return;
40
40
  let t = e.address1?.trim() || void 0, n = o([e.address2, e.address3]).join(" ") || void 0, r = o([e.city, e.state]).join(", ") || void 0, i = e.postalCode?.trim() || void 0;
41
- if (!(!t && !n && !r && !i)) return {
41
+ if (t || n || r || i) return {
42
42
  addressLine1: t,
43
43
  addressLine2: n,
44
44
  cityState: r,
@@ -46,7 +46,7 @@ function v({ cardId: v, cardProgram: y, card: b, scopes: x, currentUserId: S, co
46
46
  }));
47
47
  }, []);
48
48
  h(() => {
49
- !w || z || O !== "succeeded" && O !== "submitting" && (e.error(C), W());
49
+ w && !z && O !== "succeeded" && O !== "submitting" && (e.error(C), W());
50
50
  }, [
51
51
  z,
52
52
  W,
@@ -23,7 +23,7 @@ function i(e) {
23
23
  };
24
24
  }
25
25
  function a(e) {
26
- if (!(!e.street.trim() || !e.city.trim() || !e.state.trim() || !e.zip.trim())) return {
26
+ if (e.street.trim() && e.city.trim() && e.state.trim() && e.zip.trim()) return {
27
27
  address1: e.street.trim(),
28
28
  city: e.city.trim(),
29
29
  state: e.state.trim(),
@@ -13,7 +13,7 @@ function i(t) {
13
13
  }
14
14
  function a({ cardId: e, amount: t, period: n, id: a, name: o }) {
15
15
  let s = i(t);
16
- if (!(!s || !r(n))) return {
16
+ if (s && r(n)) return {
17
17
  id: a,
18
18
  name: o,
19
19
  amountLimit: s,
@@ -31,7 +31,7 @@ function T({ counterpartType: T, detailsLabels: E, messageLabels: D }) {
31
31
  }), [D]), N = C(() => ({
32
32
  ...oe,
33
33
  ...E
34
- }), [E]), P = T === "customer", F = C(() => e(), []), I = C(() => ie(O?.scopes), [O?.scopes]), L = !!(k && !O && !j) || A && !O, [R, z] = w(), [B, V] = w("none"), H = I.canRead ? R : void 0;
34
+ }), [E]), P = T === "customer", F = C(() => e(), []), I = C(() => ie(O?.scopes), [O?.scopes]), L = !(!k || O || j) || A && !O, [R, z] = w(), [B, V] = w("none"), H = I.canRead ? R : void 0;
35
35
  S(() => {
36
36
  I.canRead || (z(void 0), V("none"));
37
37
  }, [I.canRead]);
@@ -152,7 +152,7 @@ function T({ counterpartType: T, detailsLabels: E, messageLabels: D }) {
152
152
  address: le,
153
153
  del: ue,
154
154
  handleRowClick: x((e) => {
155
- !I.canRead || s() || (z(e.id), V("none"));
155
+ I.canRead && !s() && (z(e.id), V("none"));
156
156
  }, [I.canRead]),
157
157
  closeDetails: x(() => z(void 0), [])
158
158
  };
@@ -108,7 +108,7 @@ function _({ counterpartType: t, pageSizeOptions: s = c, onViewAllDocuments: _,
108
108
  counterpart: M,
109
109
  isLoading: j.isLoading,
110
110
  isError: j.isError,
111
- canEdit: N.canUpdate && !(t === "vendor" && (j.isBankAccountsLoading || j.isBankAccountsError)),
111
+ canEdit: N.canUpdate && (t !== "vendor" || !j.isBankAccountsLoading && !j.isBankAccountsError),
112
112
  canDelete: N.canDelete,
113
113
  onEdit: F.openEdit,
114
114
  onDelete: R.requestDeleteCounterpart,
@@ -130,7 +130,7 @@ function S({ mode: n, counterparts: r, isLoading: i, isError: a, sorting: o, onS
130
130
  isLoading: e.original.isDueOrOwedAmountLoading
131
131
  })
132
132
  }
133
- ], W = B ? z.customersEmptyTitle : z.vendorsEmptyTitle, G = B ? z.customersEmptyDescription : z.vendorsEmptyDescription, K = B ? z.customersEmptyAction : z.vendorsEmptyAction, q = B ? z.customersFilterEmptyTitle : z.vendorsFilterEmptyTitle, J = !A && !E && !r.length && !i, Y = !!(j && !M), X = !!(!A && Y), Z = B ? z.createButton : z.vendorsCreateButton;
133
+ ], W = B ? z.customersEmptyTitle : z.vendorsEmptyTitle, G = B ? z.customersEmptyDescription : z.vendorsEmptyDescription, K = B ? z.customersEmptyAction : z.vendorsEmptyAction, q = B ? z.customersFilterEmptyTitle : z.vendorsFilterEmptyTitle, J = !A && !E && !r.length && !i, Y = !(!j || M), X = !(A || !Y), Z = B ? z.createButton : z.vendorsCreateButton;
134
134
  return /* @__PURE__ */ f("div", {
135
135
  className: "ttw:flex ttw:flex-col ttw:gap-4",
136
136
  children: M ? /* @__PURE__ */ f(u, {
@@ -28,7 +28,7 @@ var g = u({
28
28
  let { initResponse: b } = r(), x = a(), S = i(), C = n(), w = p(() => c(b?.scopes), [b?.scopes]), { canReadBankAccounts: T, canReadExternalBankAccounts: E } = p(() => l(b?.scopes), [b?.scopes]), D = p(() => ({
29
29
  ...o,
30
30
  ...y
31
- }), [y]), [O, k] = m("active"), [A, j] = m(!1), M = _ !== void 0, N = M ? f : A, P = M ? _ : j, { dismissedIds: F, isLoading: I, refetch: L, dismissInsight: R } = s(), { data: z, isLoading: B, isError: V, refetch: H } = e({ enabled: T }), { data: U, isLoading: W, isError: G, refetch: K } = t({ enabled: E }), q = z?.data, J = U?.data, Y = x || B || W || I || !((!T || q !== void 0 || V) && (!E || J !== void 0 || G)) && !S, X = !!S || (T || E) && !(T && !V) && !(E && !G), Z = d(() => (C(), Promise.all([
31
+ }), [y]), [O, k] = m("active"), [A, j] = m(!1), M = _ !== void 0, N = M ? f : A, P = M ? _ : j, { dismissedIds: F, isLoading: I, refetch: L, dismissInsight: R } = s(), { data: z, isLoading: B, isError: V, refetch: H } = e({ enabled: T }), { data: U, isLoading: W, isError: G, refetch: K } = t({ enabled: E }), q = z?.data, J = U?.data, Y = x || B || W || I || (!!T && q === void 0 && !V || !!E && J === void 0 && !G) && !S, X = !!S || (T || E) && !(T && !V) && !(E && !G), Z = d(() => (C(), Promise.all([
32
32
  T ? H() : void 0,
33
33
  E ? K() : void 0,
34
34
  L()
@@ -335,7 +335,7 @@ function E({ values: e, originalLineItems: t }) {
335
335
  }
336
336
  }];
337
337
  }), o = t.filter((e) => !r.has(e.id)).map((e) => e.id);
338
- if (!(!i.length && !a.length && !o.length)) return {
338
+ if (i.length || a.length || o.length) return {
339
339
  ...i.length ? { add: i } : {},
340
340
  ...a.length ? { replace: a } : {},
341
341
  ...o.length ? { remove: o } : {}
@@ -147,13 +147,13 @@ function p({ labels: t, featureLabels: l }) {
147
147
  }, lt = (e, t) => {
148
148
  X.find((t) => t.id === e)?.locked || w((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
149
149
  }, ut = (e) => {
150
- e && !_ || e && !v.canWrite || (e && (S(1), F(de), w([]), E(void 0), D(void 0), V.reset(), H.reset(), G.reset()), Ue(e));
150
+ (!e || _) && (!e || v.canWrite) && (e && (S(1), F(de), w([]), E(void 0), D(void 0), V.reset(), H.reset(), G.reset()), Ue(e));
151
151
  }, dt = (e) => {
152
152
  if (!_ || !v.canWrite) return;
153
153
  let t = Z.find((t) => t.id === e);
154
154
  Ve(e), L(ve(t)), k(!0);
155
155
  }, ft = (e) => {
156
- e && !_ || e && !v.canWrite || k(e);
156
+ (!e || _) && (!e || v.canWrite) && k(e);
157
157
  }, pt = () => {
158
158
  if (!_ || !v.canWrite || !b) return;
159
159
  let t = Z.find((e) => e.id === b), n = ye(I, t);
@@ -166,7 +166,7 @@ function p({ labels: t, featureLabels: l }) {
166
166
  }, mt = (e) => {
167
167
  _ && v.canWrite && (Ve(e), z(pe), j(!1), A(!1), Je(!0));
168
168
  }, ht = (e) => {
169
- e && !_ || e && !v.canWrite || (e || (j(!1), A(!1)), Je(e));
169
+ (!e || _) && (!e || v.canWrite) && (e || (j(!1), A(!1)), Je(e));
170
170
  }, gt = (e) => {
171
171
  K.reset(), j(!1), z(e);
172
172
  }, _t = () => {
@@ -57,7 +57,7 @@ var f = ({ defaultCurrency: f, isInclusivePricing: p }) => {
57
57
  T.current && (E.current = !1);
58
58
  });
59
59
  }, [S.length, T]), o(() => {
60
- !T.current || D || !_("line_items")?.length && !E.current && (x({
60
+ T.current && !D && !_("line_items")?.length && !E.current && (x({
61
61
  ..._(),
62
62
  line_items: [H()]
63
63
  }), O(!0));
@@ -69,7 +69,7 @@ var S = ({ ref: e, ...t }) => /* @__PURE__ */ l(r, { children: /* @__PURE__ */ l
69
69
  U,
70
70
  z
71
71
  ]), c(() => {
72
- !Q || !Z || V("counterpart").isTouched || z("counterpart", Z.id);
72
+ Q && Z && (V("counterpart").isTouched || z("counterpart", Z.id));
73
73
  }, [
74
74
  Z,
75
75
  V,
@@ -63,7 +63,7 @@ var D = ({ disabled: D, canCreateCounterpart: O, isEditCustomerOpen: k, handleOp
63
63
  let e = Q.current;
64
64
  e !== Z && (Q.current = Z, e && $());
65
65
  }, [Z, $]), _(() => {
66
- if (B?.data?.length && !(!j || j.id !== I)) {
66
+ if (B?.data?.length && j && j.id === I) {
67
67
  if (!R) {
68
68
  let e = j.default_billing_address_id || (B.data.length === 1 ? B.data[0].id : "");
69
69
  P("default_billing_address_id", e);
@@ -77,7 +77,7 @@ var D = (e) => /* @__PURE__ */ w(l, { children: /* @__PURE__ */ w(O, { ...e }, e
77
77
  counterpart_country: ct?.country,
78
78
  counterpart_id: F,
79
79
  counterpart_type: L?.id === F && L?.type || void 0
80
- }), ht = ft?.entity?.tax_id?.required, gt = !!(P?.type === "invoice" && (P.payment_reminder_id || P.overdue_reminder_id)), B = !!F && R || dt || ut || mt || pt, { data: _t } = Se(l, P?.type === "invoice"), vt = _t?.file_url, { data: V, isLoading: yt } = Ce(P?.type === "invoice" ? P?.recurrence_id : void 0), { data: bt, isLoading: xt } = xe(P?.id), { data: St } = me(P?.type === "invoice" ? P?.payment_reminder_id : void 0), { data: Ct } = he(P?.type === "invoice" ? P?.overdue_reminder_id : void 0), { bankAccounts: wt, isIncomplete: Tt } = pe(M), H = P?.type === "invoice" ? P.bank_account_id : void 0, Et = x(() => M ? {
80
+ }), ht = ft?.entity?.tax_id?.required, gt = !(P?.type !== "invoice" || !P.payment_reminder_id && !P.overdue_reminder_id), B = !!F && R || dt || ut || mt || pt, { data: _t } = Se(l, P?.type === "invoice"), vt = _t?.file_url, { data: V, isLoading: yt } = Ce(P?.type === "invoice" ? P?.recurrence_id : void 0), { data: bt, isLoading: xt } = xe(P?.id), { data: St } = me(P?.type === "invoice" ? P?.payment_reminder_id : void 0), { data: Ct } = he(P?.type === "invoice" ? P?.overdue_reminder_id : void 0), { bankAccounts: wt, isIncomplete: Tt } = pe(M), H = P?.type === "invoice" ? P.bank_account_id : void 0, Et = x(() => M ? {
81
81
  account: wt.find((e) => e.id === H),
82
82
  isListIncomplete: Tt
83
83
  } : void 0, [
@@ -86,7 +86,7 @@ var D = (e) => /* @__PURE__ */ w(l, { children: /* @__PURE__ */ w(O, { ...e }, e
86
86
  H,
87
87
  Tt
88
88
  ]), [Dt, Ot] = S(["attachments"]), [U, W] = S(!1), [kt, G] = S("edit"), [K, q] = S(null), [At, jt] = S(!1), [Mt, Nt] = S(!1), [Pt, Ft] = S(!1), [It, Lt] = S(!1), [Rt, zt] = S(!1), J = fe(), Bt = J.has(e.InvoiceReadOrg), Vt = J.has(e.InvoiceWriteOrg), Ht = J.has(e.CounterpartReadOrg), Ut = J.has(e.CounterpartWriteOrg), { mutateAsync: Y, isPending: Wt } = Ae(), { mutate: Gt, isPending: Kt } = be(nt), { mutate: qt, isPending: Jt } = Ie(V?.id ?? "", l), { mutate: Yt, isPending: Xt } = Le(V?.id ?? "", l), Zt = D && !U, Qt = Bt && !ot && !yt && !!P && P.type === "invoice", X = x(() => {
89
- if (!(!P || P.type !== "invoice")) return ge(P, V, bt?.data ?? [], {
89
+ if (P && P.type === "invoice") return ge(P, V, bt?.data ?? [], {
90
90
  i18n: A,
91
91
  formatCurrencyToDisplay: N,
92
92
  locale: j
@@ -32,7 +32,7 @@ var p = ({ hasExistingBankAccount: p, isLoading: m, isStandalone: h, handleCance
32
32
  name: "accountHolderName",
33
33
  control: v,
34
34
  render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ s(r, {
35
- "data-invalid": !!(!e.value && p),
35
+ "data-invalid": !(e.value || !p),
36
36
  children: /* @__PURE__ */ c(i, { children: [
37
37
  /* @__PURE__ */ s(o, {
38
38
  htmlFor: e.name,
@@ -43,7 +43,7 @@ var p = ({ hasExistingBankAccount: p, isLoading: m, isStandalone: h, handleCance
43
43
  ...e,
44
44
  className: "ttw:bg-white",
45
45
  disabled: m,
46
- "aria-invalid": !!(!e.value && p) || !!n || void 0
46
+ "aria-invalid": !(e.value || !p) || !!n || void 0
47
47
  }),
48
48
  /* @__PURE__ */ s(a, { errors: [n] })
49
49
  ] })
@@ -55,7 +55,7 @@ var p = ({ hasExistingBankAccount: p, isLoading: m, isStandalone: h, handleCance
55
55
  name: "routingNumber",
56
56
  control: v,
57
57
  render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ s(r, {
58
- "data-invalid": !!(!e.value && p),
58
+ "data-invalid": !(e.value || !p),
59
59
  children: /* @__PURE__ */ c(i, { children: [
60
60
  /* @__PURE__ */ s(o, {
61
61
  htmlFor: e.name,
@@ -67,7 +67,7 @@ var p = ({ hasExistingBankAccount: p, isLoading: m, isStandalone: h, handleCance
67
67
  placeholder: _._("e.g., 123456789"),
68
68
  className: "ttw:bg-white",
69
69
  disabled: m,
70
- "aria-invalid": !!(!e.value && p) || !!n || void 0
70
+ "aria-invalid": !(e.value || !p) || !!n || void 0
71
71
  }),
72
72
  /* @__PURE__ */ s(a, { errors: [n] })
73
73
  ] })
@@ -76,7 +76,7 @@ var p = ({ hasExistingBankAccount: p, isLoading: m, isStandalone: h, handleCance
76
76
  name: "accountNumber",
77
77
  control: v,
78
78
  render: ({ field: e, fieldState: { error: n } }) => /* @__PURE__ */ s(r, {
79
- "data-invalid": !!(!e.value && p),
79
+ "data-invalid": !(e.value || !p),
80
80
  children: /* @__PURE__ */ c(i, { children: [
81
81
  /* @__PURE__ */ s(o, {
82
82
  htmlFor: e.name,
@@ -88,7 +88,7 @@ var p = ({ hasExistingBankAccount: p, isLoading: m, isStandalone: h, handleCance
88
88
  placeholder: _._("e.g., 12345678"),
89
89
  className: "ttw:bg-white",
90
90
  disabled: m,
91
- "aria-invalid": !!(!e.value && p) || !!n || void 0
91
+ "aria-invalid": !(e.value || !p) || !!n || void 0
92
92
  }),
93
93
  /* @__PURE__ */ s(a, { errors: [n] })
94
94
  ] })
@@ -133,7 +133,7 @@ function me({ labels: n, onDepositComplete: r } = {}) {
133
133
  } : null, Z = () => {
134
134
  x(m.Details), C(u.Front), T(""), D(""), k(null), j(null), N(null), F(""), L(null), W.reset();
135
135
  }, Q = (e) => {
136
- !e && W.isPending || (he(e), e || Z());
136
+ (e || !W.isPending) && (he(e), e || Z());
137
137
  }, Se = () => {
138
138
  h(c.CollectPaymentClicked), Z(), he(!0);
139
139
  }, Ce = () => {
@@ -21,7 +21,7 @@ function C({ labels: C, testIds: w, customerOptions: T, selectedCustomerIndex: E
21
21
  e.preventDefault(), !G && W();
22
22
  }, Q = m(null), $ = m(null);
23
23
  return p(() => {
24
- $.current === null || !Q.current || (Q.current.setSelectionRange($.current, $.current), $.current = null);
24
+ $.current !== null && Q.current && (Q.current.setSelectionRange($.current, $.current), $.current = null);
25
25
  }, [z]), /* @__PURE__ */ g("section", {
26
26
  className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:bg-background ttw:p-6",
27
27
  children: [/* @__PURE__ */ g("header", {
@@ -2,8 +2,9 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { TAG_MESSAGE_LABELS_EN as e } from "./index4.js";
6
- import { hasSelectedText as t } from "./index5.js";
5
+ import { TAG_MESSAGE_LABELS_EN as e } from "../../../../shared/tag-selection/feature/dist/lib/labels.js";
6
+ import { hasSelectedText as t } from "./index4.js";
7
+ import "./index5.js";
7
8
  import { useEntitySettings as n } from "./index6.js";
8
9
  import { useTagDelete as r } from "./index7.js";
9
10
  import { useTagForm as i } from "./index8.js";
@@ -7,12 +7,12 @@ import { WidgetProvider as t } from "../../../../shared/feature/dist/lib/WidgetP
7
7
  import "../../../../shared/feature/dist/index.js";
8
8
  import { TagsWidgetAnalyticsEvent as n, WIDGET_NAME as r } from "./index2.js";
9
9
  import { PAGE_SIZE_OPTIONS as i } from "./index3.js";
10
- import { useTagsWidget as a } from "./index10.js";
11
- import { TagsScreen as o } from "../../ui/dist/index3.js";
12
- import { TagDeleteDialog as s } from "../../ui/dist/index4.js";
13
- import "../../ui/dist/index.js";
14
- import { TagFormSheet as c } from "../../../../shared/tag-selection/ui/dist/index3.js";
10
+ import { TagFormSheet as a } from "../../../../shared/tag-selection/ui/dist/index3.js";
15
11
  import "../../../../shared/tag-selection/ui/dist/index.js";
12
+ import { useTagsWidget as o } from "./index10.js";
13
+ import { TagsScreen as s } from "../../ui/dist/index3.js";
14
+ import { TagDeleteDialog as c } from "../../ui/dist/index4.js";
15
+ import "../../ui/dist/index.js";
16
16
  import { useEffect as l } from "react";
17
17
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
18
18
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js
@@ -21,9 +21,9 @@ function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabel
21
21
  l(() => {
22
22
  g(n.Mounted);
23
23
  }, [g]);
24
- let { selectedTag: _, table: v, form: y, del: b, handleRowClick: x, handleDeleteClick: S, handleFormDelete: C } = a({ messageLabels: h });
24
+ let { selectedTag: _, table: v, form: y, del: b, handleRowClick: x, handleDeleteClick: S, handleFormDelete: C } = o({ messageLabels: h });
25
25
  return /* @__PURE__ */ f(u, { children: [
26
- /* @__PURE__ */ d(o, {
26
+ /* @__PURE__ */ d(s, {
27
27
  tags: v.rows,
28
28
  isLoading: v.isLoading,
29
29
  isError: v.isError,
@@ -43,7 +43,7 @@ function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabel
43
43
  labels: r,
44
44
  emptyStateTestId: "tags-widget-empty-state"
45
45
  }),
46
- /* @__PURE__ */ d(c, {
46
+ /* @__PURE__ */ d(a, {
47
47
  open: y.open,
48
48
  onOpenChange: y.onOpenChange,
49
49
  mode: y.mode,
@@ -62,7 +62,7 @@ function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabel
62
62
  onDelete: C,
63
63
  labels: p
64
64
  }),
65
- /* @__PURE__ */ d(s, {
65
+ /* @__PURE__ */ d(c, {
66
66
  open: b.open,
67
67
  onOpenChange: b.onOpenChange,
68
68
  tagName: _?.name ?? "",
@@ -1,10 +1,61 @@
1
+ import { getTagCategoryLabel as e } from "../../../../shared/tag-selection/feature/dist/lib/helpers.js";
2
+ import "../../../../shared/tag-selection/feature/dist/index.js";
1
3
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js
2
- var e = {
3
- nameRequired: "Required",
4
- nameTooLong: "Value must be at most '255' characters",
5
- keywordTooShort: "Keyword should be at least 2 characters long",
6
- keywordTooLong: "Keyword should be at most 25 characters long",
7
- genericError: "Something went wrong. Please try again."
4
+ var t = {
5
+ createdAtLabel: "created_at",
6
+ updatedAtLabel: "updated_at"
8
7
  };
8
+ function n(e) {
9
+ return e && t[e] || "created_at";
10
+ }
11
+ var r = new Intl.DateTimeFormat(void 0, {
12
+ year: "numeric",
13
+ month: "short",
14
+ day: "numeric"
15
+ });
16
+ function i(e) {
17
+ if (!e) return "";
18
+ let t = new Date(e);
19
+ return Number.isNaN(t.getTime()) ? "" : r.format(t);
20
+ }
21
+ function a() {
22
+ let e = globalThis.getSelection?.();
23
+ return !!(e && e.toString().length > 0);
24
+ }
25
+ function o(e) {
26
+ let t = {};
27
+ for (let n of e ?? []) t[n.tag_id] = n.keywords;
28
+ return t;
29
+ }
30
+ function s(e) {
31
+ let t = {};
32
+ for (let n of e ?? []) t[n.id] = `${n.first_name ?? ""} ${n.last_name ?? ""}`.trim();
33
+ return t;
34
+ }
35
+ function c({ tags: t, keywordsByTagId: n, userNamesById: r }) {
36
+ return t.map((t) => ({
37
+ id: t.id,
38
+ name: t.name,
39
+ categoryLabel: e(t.category),
40
+ keywords: (n[t.id] ?? []).join(", "),
41
+ createdAtLabel: i(t.created_at),
42
+ updatedAtLabel: i(t.updated_at),
43
+ createdByLabel: t.created_by_entity_user_id ? r[t.created_by_entity_user_id] ?? "" : ""
44
+ }));
45
+ }
46
+ function l(e, t, n) {
47
+ let r = e ?? [], i = r.filter((e) => e.tag_id !== t), a = Array.from(new Set(n));
48
+ return i.length === r.length && a.length === 0 ? {
49
+ changed: !1,
50
+ next: r
51
+ } : {
52
+ changed: !0,
53
+ next: a.length ? [...i, {
54
+ tag_id: t,
55
+ keywords: a,
56
+ enabled: !0
57
+ }] : i
58
+ };
59
+ }
9
60
  //#endregion
10
- export { e as TAG_MESSAGE_LABELS_EN };
61
+ export { o as buildKeywordsByTagId, c as buildTagRows, s as buildUserNamesById, l as computeNextOcrAutoTagging, i as formatTagDate, a as hasSelectedText, n as sortFieldForColumn };