@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
@@ -1,98 +1,3 @@
1
- import { TAG_MESSAGE_LABELS_EN as e } from "./index4.js";
2
- //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js
3
- var t = [
4
- "document_type",
5
- "department",
6
- "project",
7
- "cost_center",
8
- "vendor_type",
9
- "payment_method",
10
- "approval_status"
11
- ], n = {
12
- document_type: "Document Type",
13
- department: "Department",
14
- project: "Project",
15
- cost_center: "Cost Center",
16
- vendor_type: "Vendor Type",
17
- payment_method: "Payment Method",
18
- approval_status: "Approval Status"
19
- };
20
- function r(e) {
21
- return e ? n[e] ?? "" : "";
22
- }
23
- function i() {
24
- return t.map((e) => ({
25
- value: e,
26
- label: n[e]
27
- }));
28
- }
29
- var a = {
30
- createdAtLabel: "created_at",
31
- updatedAtLabel: "updated_at"
32
- };
33
- function o(e) {
34
- return e && a[e] || "created_at";
35
- }
36
- var s = new Intl.DateTimeFormat(void 0, {
37
- year: "numeric",
38
- month: "short",
39
- day: "numeric"
40
- });
41
- function c(e) {
42
- if (!e) return "";
43
- let t = new Date(e);
44
- return Number.isNaN(t.getTime()) ? "" : s.format(t);
45
- }
46
- function l() {
47
- let e = globalThis.getSelection?.();
48
- return !!(e && e.toString().length > 0);
49
- }
50
- function u(e) {
51
- let t = {};
52
- for (let n of e ?? []) t[n.tag_id] = n.keywords;
53
- return t;
54
- }
55
- function d(e) {
56
- let t = {};
57
- for (let n of e ?? []) t[n.id] = `${n.first_name ?? ""} ${n.last_name ?? ""}`.trim();
58
- return t;
59
- }
60
- function f({ tags: e, keywordsByTagId: t, userNamesById: n }) {
61
- return e.map((e) => ({
62
- id: e.id,
63
- name: e.name,
64
- categoryLabel: r(e.category),
65
- keywords: (t[e.id] ?? []).join(", "),
66
- createdAtLabel: c(e.created_at),
67
- updatedAtLabel: c(e.updated_at),
68
- createdByLabel: e.created_by_entity_user_id ? n[e.created_by_entity_user_id] ?? "" : ""
69
- }));
70
- }
71
- function p(t, n = e) {
72
- let r = {}, i = t.name.trim();
73
- i.length === 0 ? r.name = n.nameRequired : i.length > 255 && (r.name = n.nameTooLong);
74
- let a = t.keywords.some((e) => e.length < 2), o = t.keywords.some((e) => e.length > 25);
75
- return a ? r.keywords = n.keywordTooShort : o && (r.keywords = n.keywordTooLong), r;
76
- }
77
- function m(e) {
78
- return !!(e.name || e.keywords);
79
- }
80
- function h(e, t, n) {
81
- let r = e ?? [], i = r.filter((e) => e.tag_id !== t), a = Array.from(new Set(n));
82
- return i.length === r.length && a.length === 0 ? {
83
- changed: !1,
84
- next: r
85
- } : {
86
- changed: !0,
87
- next: a.length ? [...i, {
88
- tag_id: t,
89
- keywords: a,
90
- enabled: !0
91
- }] : i
92
- };
93
- }
94
- function g(e) {
95
- return e === "This tag already exists.";
96
- }
97
- //#endregion
98
- export { t as TAG_CATEGORIES, u as buildKeywordsByTagId, f as buildTagRows, d as buildUserNamesById, h as computeNextOcrAutoTagging, c as formatTagDate, i as getCategoryOptions, r as getTagCategoryLabel, m as hasFormErrors, l as hasSelectedText, g as isDuplicateTagNameError, o as sortFieldForColumn, p as validateTagForm };
1
+ import { TAG_MESSAGE_LABELS_EN as e } from "../../../../shared/tag-selection/feature/dist/lib/labels.js";
2
+ import "../../../../shared/tag-selection/feature/dist/index.js";
3
+ export { e as TAG_MESSAGE_LABELS_EN };
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildKeywordsByTagId as e, buildUserNamesById as t } from "./index5.js";
5
+ import { buildKeywordsByTagId as e, buildUserNamesById as t } from "./index4.js";
6
6
  import { useMyEntityQuery as n } from "../../data-access/dist/index2.js";
7
7
  import { useEntitySettingsQuery as r } from "../../data-access/dist/index3.js";
8
8
  import { useEntityUsersQuery as i } from "../../data-access/dist/index6.js";
@@ -2,15 +2,15 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { computeNextOcrAutoTagging as e } from "./index5.js";
6
- import { useUpdateEntitySettingsMutation as t } from "../../data-access/dist/index5.js";
7
- import "../../data-access/dist/index.js";
8
- import { useDeleteTagMutation as n } from "../../../../shared/tag-selection/data-access/dist/index6.js";
5
+ import { useDeleteTagMutation as e } from "../../../../shared/tag-selection/data-access/dist/index7.js";
9
6
  import "../../../../shared/tag-selection/data-access/dist/index.js";
7
+ import { computeNextOcrAutoTagging as t } from "./index4.js";
8
+ import { useUpdateEntitySettingsMutation as n } from "../../data-access/dist/index5.js";
9
+ import "../../data-access/dist/index.js";
10
10
  import { useCallback as r, useState as i } from "react";
11
11
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js
12
12
  function a({ selectedTag: a, setSelectedTag: o, settings: s }) {
13
- let { entityId: c, requireFreshSettings: l } = s, u = n(), d = t(), [f, p] = i(!1), m = r((e) => {
13
+ let { entityId: c, requireFreshSettings: l } = s, u = e(), d = n(), [f, p] = i(!1), m = r((e) => {
14
14
  o(e), p(!0);
15
15
  }, [o]), h = r((e) => {
16
16
  e || p(!1);
@@ -21,9 +21,9 @@ function a({ selectedTag: a, setSelectedTag: o, settings: s }) {
21
21
  onOpenChange: h,
22
22
  confirm: r(async () => {
23
23
  if (a) try {
24
- let t = c ? await l() : void 0;
25
- if (await u.mutateAsync({ path: { tag_id: a.id } }), c && t) {
26
- let { changed: n, next: r } = e(t.payables_ocr_auto_tagging, a.id, []);
24
+ let e = c ? await l() : void 0;
25
+ if (await u.mutateAsync({ path: { tag_id: a.id } }), c && e) {
26
+ let { changed: n, next: r } = t(e.payables_ocr_auto_tagging, a.id, []);
27
27
  n && await d.mutateAsync({
28
28
  path: { entity_id: c },
29
29
  body: { payables_ocr_auto_tagging: r }
@@ -2,103 +2,103 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { extractApiErrorMessage as e } from "../../../../shared/util/dist/lib/apiErrors.js";
6
- import { EMPTY_FORM_VALUES as t } from "./index3.js";
7
- import { buildKeywordsByTagId as n, computeNextOcrAutoTagging as r, getCategoryOptions as i, hasFormErrors as a, isDuplicateTagNameError as o, validateTagForm as s } from "./index5.js";
8
- import { useUpdateEntitySettingsMutation as c } from "../../data-access/dist/index5.js";
9
- import "../../data-access/dist/index.js";
10
- import { useCreateTagMutation as l } from "../../../../shared/tag-selection/data-access/dist/index4.js";
11
- import { useUpdateTagMutation as u } from "../../../../shared/tag-selection/data-access/dist/index5.js";
5
+ import { EMPTY_FORM_VALUES as e } from "./index3.js";
6
+ import { getCategoryOptions as t, hasFormErrors as n, resolveTagSubmitError as r, validateTagForm as i } from "../../../../shared/tag-selection/feature/dist/lib/helpers.js";
7
+ import { useCreateTagMutation as a } from "../../../../shared/tag-selection/data-access/dist/index5.js";
8
+ import { useUpdateTagMutation as o } from "../../../../shared/tag-selection/data-access/dist/index6.js";
12
9
  import "../../../../shared/tag-selection/data-access/dist/index.js";
13
- import { useCallback as d, useMemo as f, useState as p } from "react";
10
+ import "../../../../shared/tag-selection/feature/dist/index.js";
11
+ import { buildKeywordsByTagId as s, computeNextOcrAutoTagging as c } from "./index4.js";
12
+ import { useUpdateEntitySettingsMutation as l } from "../../data-access/dist/index5.js";
13
+ import "../../data-access/dist/index.js";
14
+ import { useCallback as u, useMemo as d, useState as f } from "react";
14
15
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js
15
- function m({ selectedTag: m, setSelectedTag: h, settings: g, messages: _ }) {
16
- let { entityId: v, settingsData: y, refetchSettings: b, requireFreshSettings: x } = g, S = l(), C = u(), w = c(), [T, E] = p(!1), [D, O] = p("create"), [k, A] = p(t), [j, M] = p({});
16
+ function p({ selectedTag: p, setSelectedTag: m, settings: h, messages: g }) {
17
+ let { entityId: _, settingsData: v, refetchSettings: y, requireFreshSettings: b } = h, x = a(), S = o(), C = l(), [w, T] = f(!1), [E, D] = f("create"), [O, k] = f(e), [A, j] = f({});
17
18
  return {
18
- open: T,
19
- mode: D,
20
- values: k,
21
- errors: j,
22
- categoryOptions: f(() => i(), []),
23
- isSubmitting: S.isPending || C.isPending || w.isPending,
24
- openCreate: d(() => {
25
- O("create"), h(void 0), A(t), M({}), E(!0);
26
- }, [h]),
27
- openEdit: d((e) => {
19
+ open: w,
20
+ mode: E,
21
+ values: O,
22
+ errors: A,
23
+ categoryOptions: d(() => t(), []),
24
+ isSubmitting: x.isPending || S.isPending || C.isPending,
25
+ openCreate: u(() => {
26
+ D("create"), m(void 0), k(e), j({}), T(!0);
27
+ }, [m]),
28
+ openEdit: u((e) => {
28
29
  (async () => {
29
- let t = y ?? await b(), r = n(t?.payables_ocr_auto_tagging);
30
- h(e), O("edit"), A({
30
+ let t = v ?? await y(), n = s(t?.payables_ocr_auto_tagging);
31
+ m(e), D("edit"), k({
31
32
  name: e.name,
32
33
  category: e.category ?? "",
33
- keywords: r[e.id] ?? [],
34
+ keywords: n[e.id] ?? [],
34
35
  keywordsInput: ""
35
- }), M({}), E(!0);
36
+ }), j({}), T(!0);
36
37
  })();
37
38
  }, [
39
+ v,
38
40
  y,
39
- b,
40
- h
41
+ m
41
42
  ]),
42
- onOpenChange: d((e) => {
43
- e || E(!1);
43
+ onOpenChange: u((e) => {
44
+ e || T(!1);
44
45
  }, []),
45
- close: d(() => E(!1), []),
46
- onNameChange: d((e) => A((t) => ({
46
+ close: u(() => T(!1), []),
47
+ onNameChange: u((e) => k((t) => ({
47
48
  ...t,
48
49
  name: e
49
50
  })), []),
50
- onCategoryChange: d((e) => A((t) => ({
51
+ onCategoryChange: u((e) => k((t) => ({
51
52
  ...t,
52
53
  category: e
53
54
  })), []),
54
- onKeywordsChange: d((e) => A((t) => ({
55
+ onKeywordsChange: u((e) => k((t) => ({
55
56
  ...t,
56
57
  keywords: e
57
58
  })), []),
58
- onKeywordsInputChange: d((e) => A((t) => ({
59
+ onKeywordsInputChange: u((e) => k((t) => ({
59
60
  ...t,
60
61
  keywordsInput: e
61
62
  })), []),
62
- submit: d(async () => {
63
- let t = s(k, _);
64
- if (a(t)) {
65
- M(t);
63
+ submit: u(async () => {
64
+ let e = i(O, g);
65
+ if (n(e)) {
66
+ j(e);
66
67
  return;
67
68
  }
68
- M({});
69
- let n = k.name.trim(), i = k.category === "" ? void 0 : k.category, c = {
70
- name: n,
71
- ...i ? { category: i } : {}
69
+ j({});
70
+ let t = O.name.trim(), a = O.category === "" ? void 0 : O.category, o = {
71
+ name: t,
72
+ ...a ? { category: a } : {}
72
73
  };
73
74
  try {
74
- let e = k.keywords.length > 0 || D === "edit", t = v && e ? await x() : void 0, n = D === "edit" && m ? await C.mutateAsync({
75
- path: { tag_id: m.id },
76
- body: c
77
- }) : await S.mutateAsync({ body: c });
78
- if (v && t) {
79
- let { changed: e, next: i } = r(t.payables_ocr_auto_tagging, n.id, k.keywords);
80
- e && await w.mutateAsync({
81
- path: { entity_id: v },
82
- body: { payables_ocr_auto_tagging: i }
75
+ let e = O.keywords.length > 0 || E === "edit", t = _ && e ? await b() : void 0, n = E === "edit" && p ? await S.mutateAsync({
76
+ path: { tag_id: p.id },
77
+ body: o
78
+ }) : await x.mutateAsync({ body: o });
79
+ if (_ && t) {
80
+ let { changed: e, next: r } = c(t.payables_ocr_auto_tagging, n.id, O.keywords);
81
+ e && await C.mutateAsync({
82
+ path: { entity_id: _ },
83
+ body: { payables_ocr_auto_tagging: r }
83
84
  });
84
85
  }
85
- E(!1);
86
- } catch (t) {
87
- let n = e(t);
88
- o(n) ? M({ name: n }) : M({ form: n ?? _.genericError });
86
+ T(!1);
87
+ } catch (e) {
88
+ j(r(e, g));
89
89
  }
90
90
  }, [
91
- k,
92
- D,
93
- m,
94
- v,
91
+ O,
92
+ E,
93
+ p,
94
+ _,
95
+ x,
95
96
  S,
96
97
  C,
97
- w,
98
- _,
99
- x
98
+ g,
99
+ b
100
100
  ])
101
101
  };
102
102
  }
103
103
  //#endregion
104
- export { m as useTagForm };
104
+ export { p as useTagForm };
@@ -2,21 +2,21 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildTagRows as e, sortFieldForColumn as t } from "./index5.js";
6
- import { useTagsQuery as n } from "../../../../shared/tag-selection/data-access/dist/index2.js";
5
+ import { useTagsQuery as e } from "../../../../shared/tag-selection/data-access/dist/index2.js";
7
6
  import "../../../../shared/tag-selection/data-access/dist/index.js";
7
+ import { buildTagRows as t, sortFieldForColumn as n } from "./index4.js";
8
8
  import { useCallback as r, useMemo as i, useState as a } from "react";
9
9
  //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js
10
10
  function o({ keywordsByTagId: o, userNamesById: s }) {
11
11
  let [c, l] = a([{
12
12
  id: "createdAtLabel",
13
13
  desc: !0
14
- }]), [u, d] = a(10), [f, p] = a(), m = t(c[0]?.id), h = c[0]?.desc ? "desc" : "asc", g = n({
14
+ }]), [u, d] = a(10), [f, p] = a(), m = n(c[0]?.id), h = c[0]?.desc ? "desc" : "asc", g = e({
15
15
  sort: m,
16
16
  order: h,
17
17
  limit: u,
18
18
  pagination_token: f
19
- }), _ = i(() => e({
19
+ }), _ = i(() => t({
20
20
  tags: g.data?.data ?? [],
21
21
  keywordsByTagId: o,
22
22
  userNamesById: s
@@ -25,9 +25,9 @@ function o({ keywordsByTagId: o, userNamesById: s }) {
25
25
  o,
26
26
  s
27
27
  ]), v = r((e) => (g.data?.data ?? []).find((t) => t.id === e), [g.data]), y = r((e) => {
28
- let n = typeof e == "function" ? e(c) : e;
29
- l(n);
30
- let r = t(n[0]?.id), i = n[0]?.desc ? "desc" : "asc";
28
+ let t = typeof e == "function" ? e(c) : e;
29
+ l(t);
30
+ let r = n(t[0]?.id), i = t[0]?.desc ? "desc" : "asc";
31
31
  (r !== m || i !== h) && p(void 0);
32
32
  }, [
33
33
  c,
@@ -63,7 +63,7 @@ function d({ canDeactivate: a, canResendInvite: c, members: l, featureLabels: d,
63
63
  openResendConfirmation: v.open,
64
64
  onResendOpenChange: v.onOpenChange,
65
65
  onResendConfirm: () => {
66
- !c || !v.member || h.mutate({
66
+ c && v.member && h.mutate({
67
67
  name: v.member.name,
68
68
  email: v.member.email,
69
69
  redirectUri: s(f)
@@ -8,7 +8,7 @@ import { useEffect as n, useRef as r, useState as i } from "react";
8
8
  function a(a) {
9
9
  let { canRead: o, canWrite: s, directory: c, directoryReady: l, assignedAvatarsByGroupId: u, useListQuery: d, useEditMembers: f, useMutations: p, panelLabels: m, drawerLabels: h, countLabels: g, saveFailedMessage: _, deleteFailedMessage: v } = a, y = d(), b = p(), [x, S] = i("closed"), [C, w] = i(), [T, E] = i(""), [D, O] = i(""), [k, A] = i([]), [j, M] = i(), [N, P] = i(), [F, I] = i(), L = f(x === "edit" ? C : void 0), R = (L.data?.members?.data ?? []).map((e) => e.id), z = o ? y.data?.data ?? [] : [], B = l && (x !== "edit" || !!L.data), V = r(void 0);
10
10
  n(() => {
11
- x !== "edit" || !C || V.current !== C && (!L.data || !l || (V.current = C, A(R.map((e) => c.idToOption.get(e)).filter((e) => !!e))));
11
+ x === "edit" && C && V.current !== C && L.data && l && (V.current = C, A(R.map((e) => c.idToOption.get(e)).filter((e) => !!e)));
12
12
  }, [
13
13
  x,
14
14
  C,
@@ -41,7 +41,7 @@ function s() {
41
41
  kind: "user"
42
42
  });
43
43
  let a = i.get(r.role?.trim().toLowerCase() ?? "");
44
- !a || !n(a.id) || e.push({
44
+ a && n(a.id) && e.push({
45
45
  id: r.id,
46
46
  label: r.name,
47
47
  sublabel: a.name,
@@ -19,7 +19,7 @@ function S({ option: e, isSelected: n, isDisabled: r, reason: i, onToggle: s })
19
19
  /* @__PURE__ */ g(t, {
20
20
  checked: n,
21
21
  onCheckedChange: () => {
22
- r && !n || s();
22
+ (!r || n) && s();
23
23
  }
24
24
  }),
25
25
  /* @__PURE__ */ g("span", {
@@ -11,7 +11,7 @@ import { useMemo as a } from "react";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js
12
12
  function o({ selectedId: o, enabled: s = !0 }) {
13
13
  let c = s ? o : void 0, l = e(c), u = l.data, d = u?.type === "organization", f = c ?? null, p = n(f), m = t(f), h = p.data?.data, g = a(() => {
14
- if (!(!h || h.length === 0)) {
14
+ if (h && h.length !== 0) {
15
15
  if (u?.default_billing_address_id) {
16
16
  let e = h.find((e) => e.id === u.default_billing_address_id);
17
17
  if (e) return e;
@@ -12,7 +12,7 @@ function i({ selectedId: i, setSelectedId: a, detailsView: o, messages: s }) {
12
12
  return {
13
13
  target: u,
14
14
  requestDeleteCounterpart: n(() => {
15
- !i || !o || d({
15
+ i && o && d({
16
16
  kind: "counterpart",
17
17
  id: i,
18
18
  label: o.name
@@ -18,8 +18,8 @@ function l() {
18
18
  c(r, e) || (r = e, n.forEach((t) => t(e)));
19
19
  }
20
20
  function u(e) {
21
- if (!(i || !e)) {
22
- for (let n of t.values()) if (!(!n.widgetToken || n.widgetToken === e)) {
21
+ if (!i && e) {
22
+ for (let n of t.values()) if (n.widgetToken && n.widgetToken !== e) {
23
23
  i = !0, console.warn("[tesouro-embedded] Two top-level widget providers are mounted with different `widgetToken`s. getGlobalWidgetInitState() reports the earliest-mounted one only. Read the other subtree inside React with useWidgetConfig(), which resolves per provider level.");
24
24
  return;
25
25
  }
@@ -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.124", n = "02feefabf2c21972814adc66f109f8a70b35b66e", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.126", n = "351a9209eea8cd0856a6804bb3f29134109e3b42", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -24,7 +24,7 @@ function o(t) {
24
24
  }
25
25
  }
26
26
  function s(e) {
27
- if (!(typeof e != "object" || !e)) try {
27
+ if (typeof e == "object" && e) try {
28
28
  let t = Object.getOwnPropertyDescriptor(e, "traceId");
29
29
  return !t || !("value" in t) ? void 0 : i(t.value);
30
30
  } catch {
@@ -1,6 +1,7 @@
1
1
  import { useTagsQuery as e } from "./index2.js";
2
2
  import "./index3.js";
3
- import { useCreateTagMutation as t } from "./index4.js";
4
- import { useUpdateTagMutation as n } from "./index5.js";
5
- import { useDeleteTagMutation as r } from "./index6.js";
3
+ import "./index4.js";
4
+ import { useCreateTagMutation as t } from "./index5.js";
5
+ import { useUpdateTagMutation as n } from "./index6.js";
6
+ import { useDeleteTagMutation as r } from "./index7.js";
6
7
  export { t as useCreateTagMutation, r as useDeleteTagMutation, e as useTagsQuery, n as useUpdateTagMutation };
@@ -1,10 +1,6 @@
1
- import { getTagsQueryKey as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
2
- import { organizationHeaders as t } from "../../../data-access/dist/lib/organizationHeaders.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
3
5
  import "../../../data-access/dist/index.js";
4
- //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js
5
- var n = ({ client: n, organizationId: r }) => e({
6
- client: n,
7
- headers: t(r)
8
- });
9
- //#endregion
10
- export { n as tagsInvalidationKey };
6
+ import "@tanstack/react-query";
@@ -1,34 +1,10 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { postTags as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
- import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
- import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
1
+ import { getTagsQueryKey as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
2
+ import { organizationHeaders as t } from "../../../data-access/dist/lib/organizationHeaders.js";
9
3
  import "../../../data-access/dist/index.js";
10
- import { tagsInvalidationKey as i } from "./index3.js";
11
- import { useMutation as a } from "@tanstack/react-query";
12
4
  //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js
13
- function o() {
14
- let { client: o, organizationId: s } = n();
15
- return a({
16
- mutationFn: async ({ body: t }) => {
17
- let { data: n } = await e({
18
- client: o,
19
- headers: r(s),
20
- body: t,
21
- throwOnError: !0
22
- });
23
- return n;
24
- },
25
- onSuccess: async () => {
26
- await t(i({
27
- client: o,
28
- organizationId: s
29
- }));
30
- }
31
- });
32
- }
5
+ var n = ({ client: n, organizationId: r }) => e({
6
+ client: n,
7
+ headers: t(r)
8
+ });
33
9
  //#endregion
34
- export { o as useCreateTagMutation };
10
+ export { n as tagsInvalidationKey };
@@ -2,26 +2,25 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { patchTagsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
5
+ import { postTags as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { tagsInvalidationKey as i } from "./index3.js";
10
+ import { tagsInvalidationKey as i } from "./index4.js";
11
11
  import { useMutation as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js
13
13
  function o() {
14
14
  let { client: o, organizationId: s } = n();
15
15
  return a({
16
- mutationFn: async ({ path: t, body: n }) => {
17
- let { data: i } = await e({
16
+ mutationFn: async ({ body: t }) => {
17
+ let { data: n } = await e({
18
18
  client: o,
19
19
  headers: r(s),
20
- path: t,
21
- body: n,
20
+ body: t,
22
21
  throwOnError: !0
23
22
  });
24
- return i;
23
+ return n;
25
24
  },
26
25
  onSuccess: async () => {
27
26
  await t(i({
@@ -32,4 +31,4 @@ function o() {
32
31
  });
33
32
  }
34
33
  //#endregion
35
- export { o as useUpdateTagMutation };
34
+ export { o as useCreateTagMutation };
@@ -2,24 +2,26 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { deleteTagsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
5
+ import { patchTagsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { tagsInvalidationKey as i } from "./index3.js";
10
+ import { tagsInvalidationKey as i } from "./index4.js";
11
11
  import { useMutation as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index6.js
13
13
  function o() {
14
14
  let { client: o, organizationId: s } = n();
15
15
  return a({
16
- mutationFn: async ({ path: t }) => {
17
- await e({
16
+ mutationFn: async ({ path: t, body: n }) => {
17
+ let { data: i } = await e({
18
18
  client: o,
19
19
  headers: r(s),
20
20
  path: t,
21
+ body: n,
21
22
  throwOnError: !0
22
23
  });
24
+ return i;
23
25
  },
24
26
  onSuccess: async () => {
25
27
  await t(i({
@@ -30,4 +32,4 @@ function o() {
30
32
  });
31
33
  }
32
34
  //#endregion
33
- export { o as useDeleteTagMutation };
35
+ export { o as useUpdateTagMutation };
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { deleteTagsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
+ import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
+ import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
+ import "../../../data-access/dist/index.js";
10
+ import { tagsInvalidationKey as i } from "./index4.js";
11
+ import { useMutation as a } from "@tanstack/react-query";
12
+ //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index7.js
13
+ function o() {
14
+ let { client: o, organizationId: s } = n();
15
+ return a({
16
+ mutationFn: async ({ path: t }) => {
17
+ await e({
18
+ client: o,
19
+ headers: r(s),
20
+ path: t,
21
+ throwOnError: !0
22
+ });
23
+ },
24
+ onSuccess: async () => {
25
+ await t(i({
26
+ client: o,
27
+ organizationId: s
28
+ }));
29
+ }
30
+ });
31
+ }
32
+ //#endregion
33
+ export { o as useDeleteTagMutation };
@@ -0,0 +1,5 @@
1
+ import "./lib/permissions.js";
2
+ import { TAG_MESSAGE_LABELS_EN as e } from "./lib/labels.js";
3
+ import { getCategoryOptions as t, getTagCategoryLabel as n, hasFormErrors as r, resolveTagSubmitError as i, validateTagForm as a } from "./lib/helpers.js";
4
+ import "./lib/TagSelectorField.js";
5
+ export { e as TAG_MESSAGE_LABELS_EN, t as getCategoryOptions, n as getTagCategoryLabel, r as hasFormErrors, i as resolveTagSubmitError, a as validateTagForm };