@tesouro/embedded-components-react 0.11.274 → 0.11.276

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 (27) hide show
  1. package/dist/index.css +61 -7
  2. package/dist/index.d.ts +1 -13
  3. package/dist/lib/RecentActivityWidget.d.ts +1 -13
  4. package/dist/lib/WidgetSuite.d.ts +1 -13
  5. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/lib/BalanceHistoryCard/BalanceHistoryCard.js +114 -111
  6. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/CreateAccountDialog.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index23.js +69 -69
  8. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index4.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/RecentActivityWidgetFeature.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/labels.js +1 -4
  13. package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/recentActivityView/buildRecentActivityRows.js +12 -19
  14. package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/ui/dist/lib/RecentActivityCard/RecentActivityCard.js +0 -1
  15. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index15.js +2 -2
  16. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +3 -2
  17. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +106 -106
  18. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +142 -146
  19. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useOwnedQueryClient.js +31 -0
  20. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +16 -14
  25. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +17 -14
  26. package/dist/packages/shared-ui-shadcn/dist/index.js +448 -417
  27. package/package.json +1 -1
@@ -1,126 +1,126 @@
1
- import { Badge as e, Command as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a, CommandSeparator as o, FieldDescription as s, FieldRequirement as c, Label as l, Popover as u, PopoverContent as d, PopoverTrigger as f, Skeleton as p, cn as m } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { mergeVendorSearchComboboxLabels as h } from "./index22.js";
3
- import { useId as g, useState as _ } from "react";
4
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
5
- import { ChevronDown as x, Plus as S } from "lucide-react";
1
+ import { Badge as e, Command as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a, FieldDescription as o, FieldRequirement as s, Label as c, Popover as l, PopoverContent as u, PopoverTrigger as d, Skeleton as f, cn as p } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { mergeVendorSearchComboboxLabels as m } from "./index22.js";
3
+ import { useId as h, useState as g } from "react";
4
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
5
+ import { ChevronDown as b, Plus as x } from "lucide-react";
6
6
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index23.js
7
- var C = 5, w = "ttw:min-h-44";
8
- function T({ query: T, onQueryChange: E, results: D, isLoading: O, onAddVendor: k, selectedLabel: A, badge: j, helperText: M, resultsHeading: N, addVendorDescription: P, testId: F, labels: I }) {
9
- let L = h(I), R = g(), z = g(), [B, V] = _(!1);
10
- return /* @__PURE__ */ b("div", {
7
+ var S = 5, C = "ttw:min-h-44";
8
+ function w({ query: w, onQueryChange: T, results: E, isLoading: D, onAddVendor: O, selectedLabel: k, badge: A, helperText: j, resultsHeading: M, addVendorDescription: N, testId: P, labels: F }) {
9
+ let I = m(F), L = h(), R = h(), [z, B] = g(!1);
10
+ return /* @__PURE__ */ y("div", {
11
11
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
12
- "data-testid": F,
12
+ "data-testid": P,
13
13
  children: [
14
- /* @__PURE__ */ y(l, {
15
- htmlFor: R,
16
- requirement: c.Required,
17
- labels: L.fieldMarkers,
18
- children: L.fieldLabel
14
+ /* @__PURE__ */ v(c, {
15
+ htmlFor: L,
16
+ requirement: s.Required,
17
+ labels: I.fieldMarkers,
18
+ children: I.fieldLabel
19
19
  }),
20
- /* @__PURE__ */ b(u, {
20
+ /* @__PURE__ */ y(l, {
21
21
  modal: !0,
22
- open: B,
23
- onOpenChange: V,
24
- children: [/* @__PURE__ */ y(f, {
22
+ open: z,
23
+ onOpenChange: B,
24
+ children: [/* @__PURE__ */ v(d, {
25
25
  asChild: !0,
26
- children: /* @__PURE__ */ b("button", {
26
+ children: /* @__PURE__ */ y("button", {
27
27
  type: "button",
28
- id: R,
28
+ id: L,
29
29
  role: "combobox",
30
- "aria-expanded": B,
31
- "aria-controls": B ? `${R}-options` : void 0,
30
+ "aria-expanded": z,
31
+ "aria-controls": z ? `${L}-options` : void 0,
32
32
  "aria-required": !0,
33
- "aria-describedby": M ? z : void 0,
33
+ "aria-describedby": j ? R : void 0,
34
34
  className: "ttw:flex ttw:h-10 ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:text-left ttw:text-sm ttw:shadow-xs ttw:outline-none ttw:focus-visible:border-ring ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50",
35
35
  children: [
36
- /* @__PURE__ */ y("span", {
37
- className: m("ttw:min-w-0 ttw:flex-1 ttw:truncate", A ? "ttw:text-foreground" : "ttw:text-muted-foreground"),
38
- children: A || L.triggerPlaceholder
36
+ /* @__PURE__ */ v("span", {
37
+ className: p("ttw:min-w-0 ttw:flex-1 ttw:truncate", k ? "ttw:text-foreground" : "ttw:text-muted-foreground"),
38
+ children: k || I.triggerPlaceholder
39
39
  }),
40
- j ? /* @__PURE__ */ y(e, {
40
+ A ? /* @__PURE__ */ v(e, {
41
41
  variant: "secondary",
42
- children: j
42
+ children: A
43
43
  }) : null,
44
- /* @__PURE__ */ y(x, {
44
+ /* @__PURE__ */ v(b, {
45
45
  "aria-hidden": !0,
46
46
  className: "ttw:size-4 ttw:shrink-0 ttw:opacity-50"
47
47
  })
48
48
  ]
49
49
  })
50
- }), /* @__PURE__ */ y(d, {
51
- id: `${R}-options`,
50
+ }), /* @__PURE__ */ v(u, {
51
+ id: `${L}-options`,
52
52
  align: "start",
53
53
  className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:p-0",
54
- children: /* @__PURE__ */ b(t, {
54
+ children: /* @__PURE__ */ y(t, {
55
55
  shouldFilter: !1,
56
- children: [/* @__PURE__ */ y(r, {
57
- value: T,
58
- onValueChange: E,
59
- placeholder: L.placeholder,
60
- "aria-label": L.placeholder
61
- }), /* @__PURE__ */ b(a, {
62
- className: m("ttw:max-h-72", w),
63
- children: [O ? /* @__PURE__ */ b("div", {
56
+ children: [/* @__PURE__ */ v(r, {
57
+ value: w,
58
+ onValueChange: T,
59
+ placeholder: I.placeholder,
60
+ "aria-label": I.placeholder
61
+ }), /* @__PURE__ */ y(a, {
62
+ className: p("ttw:max-h-72", C),
63
+ "aria-busy": D || void 0,
64
+ children: [D ? /* @__PURE__ */ y("div", {
64
65
  className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:p-2",
65
- "aria-busy": "true",
66
- children: [/* @__PURE__ */ y("span", {
66
+ children: [/* @__PURE__ */ v("span", {
67
67
  className: "ttw:sr-only",
68
- children: L.loading
69
- }), Array.from({ length: C }).map((e, t) => /* @__PURE__ */ b("div", {
68
+ children: I.loading
69
+ }), Array.from({ length: S }).map((e, t) => /* @__PURE__ */ y("div", {
70
70
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:px-2 ttw:py-1.5",
71
- children: [/* @__PURE__ */ y(p, {
71
+ children: [/* @__PURE__ */ v(f, {
72
72
  height: 14,
73
73
  width: "55%"
74
- }), /* @__PURE__ */ y(p, {
74
+ }), /* @__PURE__ */ v(f, {
75
75
  height: 14,
76
76
  width: "30%"
77
77
  })]
78
78
  }, t))]
79
- }) : D.length === 0 ? /* @__PURE__ */ y("div", {
80
- className: m("ttw:flex ttw:items-center ttw:justify-center ttw:py-6 ttw:text-center ttw:text-sm", w),
81
- children: L.emptyResults
82
- }) : /* @__PURE__ */ y(n, {
83
- heading: N,
84
- children: D.map((e, t) => /* @__PURE__ */ y(i, {
79
+ }) : E.length === 0 ? /* @__PURE__ */ v("div", {
80
+ className: p("ttw:flex ttw:items-center ttw:justify-center ttw:py-6 ttw:text-center ttw:text-sm", C),
81
+ children: I.emptyResults
82
+ }) : /* @__PURE__ */ v(n, {
83
+ heading: M,
84
+ children: E.map((e, t) => /* @__PURE__ */ v(i, {
85
85
  value: `${e.name} ${e.email} ${t}`,
86
86
  onSelect: () => e.onSelect(),
87
- children: /* @__PURE__ */ b("div", {
87
+ children: /* @__PURE__ */ y("div", {
88
88
  className: "ttw:flex ttw:min-w-0 ttw:flex-col",
89
- children: [/* @__PURE__ */ y("span", {
89
+ children: [/* @__PURE__ */ v("span", {
90
90
  className: "ttw:truncate ttw:text-foreground",
91
91
  children: e.name
92
- }), e.email ? /* @__PURE__ */ y("span", {
92
+ }), e.email ? /* @__PURE__ */ v("span", {
93
93
  className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
94
94
  children: e.email
95
95
  }) : null]
96
96
  })
97
97
  }, `${e.name}:${e.email}:${t}`))
98
- }), k ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(o, {}), /* @__PURE__ */ b(i, {
98
+ }), O ? /* @__PURE__ */ v(_, { children: /* @__PURE__ */ y(i, {
99
99
  value: "__add_vendor__",
100
100
  onSelect: () => {
101
- V(!1), k();
101
+ B(!1), O();
102
102
  },
103
- className: "ttw:sticky ttw:bottom-0 ttw:bg-popover ttw:text-primary",
104
- children: [/* @__PURE__ */ y(S, { className: "ttw:size-4 ttw:text-primary" }), /* @__PURE__ */ b("div", {
103
+ className: "ttw:sticky ttw:bottom-0 ttw:border-t ttw:border-border ttw:bg-popover ttw:text-primary",
104
+ children: [/* @__PURE__ */ v(x, { className: "ttw:size-4 ttw:text-primary" }), /* @__PURE__ */ y("div", {
105
105
  className: "ttw:flex ttw:min-w-0 ttw:flex-col",
106
- children: [/* @__PURE__ */ y("span", {
106
+ children: [/* @__PURE__ */ v("span", {
107
107
  className: "ttw:truncate",
108
- children: L.addVendorAction
109
- }), P ? /* @__PURE__ */ y("span", {
108
+ children: I.addVendorAction
109
+ }), N ? /* @__PURE__ */ v("span", {
110
110
  className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
111
- children: P
111
+ children: N
112
112
  }) : null]
113
113
  })]
114
- })] }) : null]
114
+ }) }) : null]
115
115
  })]
116
116
  })
117
117
  })]
118
118
  }),
119
- M ? /* @__PURE__ */ y(s, {
120
- id: z,
121
- children: M
119
+ j ? /* @__PURE__ */ v(o, {
120
+ id: R,
121
+ children: j
122
122
  }) : null
123
123
  ]
124
124
  });
125
125
  }
126
- export { T as VendorSearchCombobox, T as default };
126
+ export { w as VendorSearchCombobox, w as default };
@@ -9,7 +9,7 @@ function g({ notice: n }) {
9
9
  if (!n) return null;
10
10
  let r = n.variant === "warning";
11
11
  return /* @__PURE__ */ p(e, {
12
- className: r ? "ttw:border-destructive/30 ttw:bg-destructive/5 ttw:text-destructive" : "ttw:border-border ttw:bg-muted ttw:text-foreground",
12
+ className: r ? "ttw:border-destructive/30 ttw:bg-destructive/5 ttw:text-destructive-subtle-foreground" : "ttw:border-border ttw:bg-muted ttw:text-foreground",
13
13
  children: [/* @__PURE__ */ f(r ? h : m, { "aria-hidden": !0 }), /* @__PURE__ */ f(t, {
14
14
  className: "ttw:text-current",
15
15
  children: /* @__PURE__ */ p("p", { children: [n.title ? /* @__PURE__ */ p("span", {
@@ -84,7 +84,7 @@ function m({ view: m, isDragging: h, disabled: g, inputRef: _, onBrowseClick: v,
84
84
  }) : /* @__PURE__ */ s(r, {
85
85
  variant: "caption",
86
86
  role: "alert",
87
- className: "ttw:text-destructive",
87
+ className: "ttw:text-destructive-subtle-foreground",
88
88
  children: t.message
89
89
  })]
90
90
  }),
@@ -31,7 +31,7 @@ function u({ id: t, label: n, value: u, options: d, disabled: f, error: p, onVal
31
31
  let n = `${t}-${e.value}`, i = u === e.value;
32
32
  return /* @__PURE__ */ c(r, {
33
33
  htmlFor: n,
34
- className: o("ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:font-normal", _ && "ttw:h-full ttw:rounded-lg ttw:border ttw:p-4", _ && (p ? "ttw:border-destructive ttw:bg-card" : i ? "ttw:border-primary ttw:bg-primary/10" : "ttw:border-border ttw:bg-card")),
34
+ className: o("ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:font-normal", _ && "ttw:h-full ttw:rounded-lg ttw:border ttw:p-4", _ && (p ? "ttw:border-destructive ttw:bg-card" : i ? "ttw:border-primary ttw:bg-primary/5" : "ttw:border-border ttw:bg-card")),
35
35
  children: [/* @__PURE__ */ s(a, {
36
36
  id: n,
37
37
  value: e.value,
@@ -36,7 +36,7 @@ function C({ labels: a, onTransactionClick: m, className: C, style: w }) {
36
36
  B,
37
37
  F,
38
38
  j
39
- ]), H = x(() => h(L ?? [], T, g(/* @__PURE__ */ new Date())), [L, T]), U = y((e) => {
39
+ ]), H = x(() => h(L ?? [], g(/* @__PURE__ */ new Date())), [L]), U = y((e) => {
40
40
  let t = L?.[Number(e)]?.bankAccount.id;
41
41
  t && m && (E(p.TransactionClicked), m(t));
42
42
  }, [
@@ -1,8 +1,5 @@
1
1
  import { RECENT_ACTIVITY_CARD_LABELS_EN as e } from "../../../../ui/dist/lib/RecentActivityCard/labels.js";
2
2
  import "../../../../ui/dist/index.js";
3
3
  // ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/labels.js
4
- var t = {
5
- ...e,
6
- rowAriaLabel: ({ description: e, nickname: t, last4: n, date: r, amount: i }) => `${e}, ${t} ending ${n}, ${r}, ${i}`
7
- };
4
+ var t = { ...e };
8
5
  export { t as RECENT_ACTIVITY_WIDGET_LABELS_EN };
@@ -39,26 +39,19 @@ function s(i) {
39
39
  });
40
40
  return `${i.direction === "CREDIT" ? "+" : r}${s}`;
41
41
  }
42
- function c(e, t, n) {
43
- return e.map((r, a) => {
44
- let c = i(r.date), l = a === 0 ? n : e[a - 1].date, u = s(r), { nickname: d, accountNumberLast4: f } = r.bankAccount;
42
+ function c(e, t) {
43
+ return e.map((n, r) => {
44
+ let a = i(n.date), c = r === 0 ? t : e[r - 1].date, l = s(n), { nickname: u, accountNumberLast4: d } = n.bankAccount;
45
45
  return {
46
- id: String(a),
47
- month: c.month,
48
- day: c.day,
49
- ...o(r.date, l) ? { year: c.year } : {},
50
- date: c.spoken,
51
- title: r.description,
52
- accountName: d,
53
- accountLast4: f,
54
- amount: u,
55
- ariaLabel: t.rowAriaLabel({
56
- description: r.description,
57
- nickname: d,
58
- last4: f,
59
- date: c.spoken,
60
- amount: u
61
- })
46
+ id: String(r),
47
+ month: a.month,
48
+ day: a.day,
49
+ ...o(n.date, c) ? { year: a.year } : {},
50
+ date: a.spoken,
51
+ title: n.description,
52
+ accountName: u,
53
+ accountLast4: d,
54
+ amount: l
62
55
  };
63
56
  });
64
57
  }
@@ -107,7 +107,6 @@ function _({ rows: s, onRowClick: u, isLoading: _ = !1, isError: v = !1, onRetry
107
107
  "data-testid": x?.row,
108
108
  children: [r > 0 && /* @__PURE__ */ d(e, {}), u ? /* @__PURE__ */ d("button", {
109
109
  type: "button",
110
- "aria-label": t.ariaLabel,
111
110
  onClick: () => u(t.id),
112
111
  className: n(g, "ttw:cursor-pointer ttw:outline-none ttw:hover:bg-muted ttw:focus-visible:outline-2 ttw:focus-visible:outline-offset-2 ttw:focus-visible:outline-ring ttw:focus-visible:outline-solid"),
113
112
  children: /* @__PURE__ */ d(h, {
@@ -123,9 +123,9 @@ function p({ rows: p, isLoading: m = !1, isError: h = !1, showPagination: g = !1
123
123
  onRowClick: (e) => e.onSelect(),
124
124
  rowAriaLabel: A,
125
125
  isRowActionable: (e) => !e.isInactive,
126
- rowClassName: (e) => e.isInactive ? "ttw:cursor-default ttw:opacity-50 ttw:hover:bg-transparent" : void 0,
126
+ rowClassName: (e) => e.isInactive ? "ttw:cursor-default ttw:text-muted-foreground ttw:hover:bg-transparent" : void 0,
127
127
  renderCard: !h && p.length > 0 ? (t) => /* @__PURE__ */ d("div", {
128
- className: r("ttw:flex ttw:flex-col ttw:gap-2", t.isInactive && "ttw:opacity-50"),
128
+ className: r("ttw:flex ttw:flex-col ttw:gap-2", t.isInactive && "ttw:text-muted-foreground"),
129
129
  children: [
130
130
  M(t),
131
131
  /* @__PURE__ */ d("div", {
@@ -12,11 +12,12 @@ function b({ id: e, label: t }) {
12
12
  function x({ option: t, isSelected: n, isDisabled: r, reason: o, onToggle: c }) {
13
13
  let l = r && !n, u = /* @__PURE__ */ g("label", {
14
14
  "data-testid": `approver-option-${t.id}`,
15
- className: `ttw:flex ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-sm ttw:px-2 ttw:py-1.5 ttw:text-sm ${r ? "ttw:cursor-not-allowed ttw:opacity-50" : "ttw:cursor-pointer ttw:hover:bg-accent ttw:hover:text-accent-foreground"}`,
15
+ className: `ttw:flex ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-sm ttw:px-2 ttw:py-1.5 ttw:text-sm ${r ? "ttw:cursor-not-allowed ttw:text-muted-foreground" : "ttw:cursor-pointer ttw:hover:bg-accent ttw:hover:text-accent-foreground"}`,
16
16
  children: [
17
17
  /* @__PURE__ */ h(e, {
18
18
  checked: n,
19
19
  "aria-disabled": l,
20
+ className: r ? "ttw:opacity-50" : void 0,
20
21
  onCheckedChange: () => {
21
22
  l || c();
22
23
  }
@@ -66,7 +67,7 @@ var S = ({ value: e, options: S, onChange: C, lockedSections: w, lockedOptions:
66
67
  asChild: !0,
67
68
  children: /* @__PURE__ */ g("div", {
68
69
  ref: L,
69
- className: `ttw:flex ttw:min-h-9 ttw:w-full ttw:cursor-text ttw:flex-wrap ttw:items-center ttw:gap-1.5 ttw:rounded-md ttw:border ttw:bg-transparent ttw:px-2.5 ttw:py-1.5 ttw:has-[:disabled]:cursor-not-allowed ttw:has-[:disabled]:opacity-60 ${D ? "ttw:border-destructive" : "ttw:border-input"}`,
70
+ className: `ttw:flex ttw:min-h-9 ttw:w-full ttw:cursor-text ttw:flex-wrap ttw:items-center ttw:gap-1.5 ttw:rounded-md ttw:border ttw:bg-transparent ttw:px-2.5 ttw:py-1.5 ttw:has-[:disabled]:cursor-not-allowed ttw:has-[:disabled]:bg-muted ${D ? "ttw:border-destructive" : "ttw:border-input"}`,
70
71
  children: [
71
72
  e.map((e, t) => /* @__PURE__ */ g(l, { children: [t > 0 ? /* @__PURE__ */ h("span", {
72
73
  className: "ttw:text-xs ttw:text-muted-foreground",
@@ -3,179 +3,179 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { createClientSecretInstaller as e } from "../../../../data-access/dist/lib/scopedClientSecret.js";
6
- import { registerQueryClient as t, unregisterQueryClient as n } from "../../../../data-access/dist/lib/clientRegistry.js";
7
- import { createEmbeddedClient as r } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
8
- import { EmbedApiProvider as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
6
+ import { createEmbeddedClient as t } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
+ import { EmbedApiProvider as n } from "../../../../data-access/dist/lib/EmbedApiContext.js";
9
8
  import "../../../../data-access/dist/index.js";
10
- import { resolveUIFramework as a } from "../../../../ui/dist/lib/UIContext/UIContext.js";
9
+ import { resolveUIFramework as r } from "../../../../ui/dist/lib/UIContext/UIContext.js";
11
10
  import { UIProvider as ee } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
12
11
  import { useDesignSystemEnsurer as te } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
13
12
  import "../../../../ui/dist/index.js";
14
- import { getGlobalSnapshot as o, subscribeToGlobal as ne } from "./globalStore.js";
13
+ import { getGlobalSnapshot as i, subscribeToGlobal as ne } from "./globalStore.js";
15
14
  import { configureEmbeddedClient as re } from "../analytics/client.js";
16
- import { generateCorrelationId as ie } from "../analytics/ids.js";
17
- import { WidgetContext as s } from "./WidgetContext.js";
18
- import { resolveOrgId as c, useAuthEpoch as l } from "./utils.js";
19
- import { useWidgetFetch as ae } from "./useWidgetFetch.js";
20
- import { deriveOrganizationStatus as oe } from "./deriveOrganizationStatus.js";
21
- import { deriveWidgetInitState as se, useWidgetInitPublisher as ce } from "./useWidgetInitPublisher.js";
22
- import { useTokenRefreshRef as le } from "./useTokenRefreshRef.js";
23
- import { useEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as ue } from "react";
24
- import { jsx as m } from "react/jsx-runtime";
25
- import { QueryClient as de, QueryClientProvider as fe } from "@tanstack/react-query";
15
+ import { generateCorrelationId as a } from "../analytics/ids.js";
16
+ import { WidgetContext as o } from "./WidgetContext.js";
17
+ import { resolveOrgId as s, useAuthEpoch as c } from "./utils.js";
18
+ import { useWidgetFetch as l } from "./useWidgetFetch.js";
19
+ import { deriveOrganizationStatus as u } from "./deriveOrganizationStatus.js";
20
+ import { deriveWidgetInitState as ie, useWidgetInitPublisher as ae } from "./useWidgetInitPublisher.js";
21
+ import { useTokenRefreshRef as oe } from "./useTokenRefreshRef.js";
22
+ import { useOwnedQueryClient as se } from "./useOwnedQueryClient.js";
23
+ import { useEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
24
+ import { jsx as g } from "react/jsx-runtime";
25
+ import { QueryClient as ce, QueryClientProvider as le } from "@tanstack/react-query";
26
26
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
27
- function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configClient: y, gatewayRouting: b, linkComponent: x, uiFramework: S, analytics: C, unstable_initResponseOverride: w, disclosuresAcceptance: T, providerLabels: E }) {
28
- let D = ue(ne, o, o), O = g ?? D.baseUrl, k = _ === void 0 ? D.widgetToken : _, A = v === void 0 ? D.organizationId : v, j = y ?? D.configClient, M = b ?? D.gatewayRouting, N = x ?? D.linkComponent, P = S ?? D.uiFramework, F = C !== !1, [I] = p(ie), L = f({
29
- enabled: F,
30
- organizationId: A,
31
- rootCorrelationId: I
32
- }), [R] = p(() => new de({ defaultOptions: {
27
+ function _({ children: _, baseUrl: v, widgetToken: y, organizationId: b, configClient: x, gatewayRouting: S, linkComponent: C, uiFramework: w, analytics: ue, unstable_initResponseOverride: T, disclosuresAcceptance: E, providerLabels: D }) {
28
+ let O = h(ne, i, i), k = v ?? O.baseUrl, A = y === void 0 ? O.widgetToken : y, j = b === void 0 ? O.organizationId : b, M = x ?? O.configClient, N = S ?? O.gatewayRouting, P = C ?? O.linkComponent, F = w ?? O.uiFramework, I = ue !== !1, [L] = m(a), R = p({
29
+ enabled: I,
30
+ organizationId: j,
31
+ rootCorrelationId: L
32
+ }), [z] = m(() => new ce({ defaultOptions: {
33
33
  queries: {
34
34
  retry: !1,
35
35
  refetchOnWindowFocus: !1
36
36
  },
37
37
  mutations: { retry: !1 }
38
38
  } }));
39
- u(() => (t(R), () => n(R)), [R]);
40
- let z = f(k);
41
- z.current = k;
42
- let B = le(), V = f(null), pe = d(() => e(V), []), me = l(k), H = d(() => {
43
- let e = re(r(O), {
44
- tokenRef: z,
45
- analyticsContextRef: L,
46
- clientSecretRef: V,
47
- gatewayRouting: M,
48
- refreshTokenRef: B
39
+ se(z);
40
+ let B = p(A);
41
+ B.current = A;
42
+ let V = oe(), H = p(null), de = f(() => e(H), []), fe = c(A), U = f(() => {
43
+ let e = re(t(k), {
44
+ tokenRef: B,
45
+ analyticsContextRef: R,
46
+ clientSecretRef: H,
47
+ gatewayRouting: N,
48
+ refreshTokenRef: V
49
49
  });
50
- return j ? j(e) : e;
50
+ return M ? M(e) : e;
51
51
  }, [
52
- O,
53
- j,
52
+ k,
54
53
  M,
55
- B
54
+ N,
55
+ V
56
56
  ]);
57
- u(() => {
58
- if (!F || !("window" in globalThis)) return;
57
+ d(() => {
58
+ if (!I || !("window" in globalThis)) return;
59
59
  let e = !1;
60
60
  return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
61
61
  e || t();
62
62
  }), () => {
63
63
  e = !0;
64
64
  };
65
- }, [F]);
66
- let U = te(a(P));
67
- u(() => {
68
- U && U().catch(() => {});
69
- }, [U]);
70
- let { result: he, loading: W, error: G, initStaleForToken: K, initReplacementPending: ge, refetch: q } = ae(w ? null : H, k, L), J = k ? w ?? he ?? void 0 : void 0, Y = !w && K, X = c(A, Y ? void 0 : J?.organizationId), _e = oe({
65
+ }, [I]);
66
+ let W = te(r(F));
67
+ d(() => {
68
+ W && W().catch(() => {});
69
+ }, [W]);
70
+ let { result: pe, loading: G, error: K, initStaleForToken: me, initReplacementPending: he, refetch: q } = l(T ? null : U, A, R), J = A ? T ?? pe ?? void 0 : void 0, Y = !T && me, X = s(j, Y ? void 0 : J?.organizationId), ge = u({
71
71
  organizationId: X,
72
- cascadeOrgId: A,
72
+ cascadeOrgId: j,
73
73
  ownsFetch: !0,
74
74
  parentStatus: "none",
75
- hasToken: !!k,
76
- loading: W,
77
- error: G,
75
+ hasToken: !!A,
76
+ loading: G,
77
+ error: K,
78
78
  hasResult: !!J,
79
- initReplacementPending: ge
80
- }), ve = d(() => se({
81
- hasToken: !!k,
82
- loading: W,
83
- error: G,
79
+ initReplacementPending: he
80
+ }), _e = f(() => ie({
81
+ hasToken: !!A,
82
+ loading: G,
83
+ error: K,
84
84
  initResponse: J,
85
85
  initStaleForToken: Y
86
86
  }), [
87
- k,
88
- W,
87
+ A,
89
88
  G,
89
+ K,
90
90
  J,
91
91
  Y
92
92
  ]);
93
- ce(ve, k);
94
- let Z = d(() => ({
95
- enabled: F,
93
+ ae(_e, A);
94
+ let Z = f(() => ({
95
+ enabled: I,
96
96
  organizationId: X,
97
- rootCorrelationId: I
97
+ rootCorrelationId: L
98
98
  }), [
99
- F,
99
+ I,
100
100
  X,
101
- I
101
+ L
102
102
  ]);
103
- L.current = Z;
104
- let Q = d(() => ({
105
- baseUrl: g,
106
- widgetToken: _,
107
- organizationId: v,
108
- configClient: y,
109
- gatewayRouting: b,
110
- linkComponent: x,
111
- uiFramework: S
103
+ R.current = Z;
104
+ let Q = f(() => ({
105
+ baseUrl: v,
106
+ widgetToken: y,
107
+ organizationId: b,
108
+ configClient: x,
109
+ gatewayRouting: S,
110
+ linkComponent: C,
111
+ uiFramework: w
112
112
  }), [
113
- g,
114
- _,
115
113
  v,
116
114
  y,
117
115
  b,
118
116
  x,
119
- S
120
- ]), $ = d(() => ({
121
- baseUrl: O,
122
- widgetToken: k,
117
+ S,
118
+ C,
119
+ w
120
+ ]), $ = f(() => ({
121
+ baseUrl: k,
122
+ widgetToken: A,
123
123
  organizationId: X,
124
- configClient: j,
125
- gatewayRouting: M,
126
- linkComponent: N,
127
- uiFramework: P,
124
+ configClient: M,
125
+ gatewayRouting: N,
126
+ linkComponent: P,
127
+ uiFramework: F,
128
128
  initResponse: J
129
129
  }), [
130
- O,
131
130
  k,
131
+ A,
132
132
  X,
133
- j,
134
133
  M,
135
134
  N,
136
135
  P,
136
+ F,
137
137
  J
138
- ]), ye = d(() => ({
138
+ ]), ve = f(() => ({
139
139
  resolved: $,
140
140
  own: Q,
141
141
  refetch: q,
142
- loading: W,
143
- error: G,
142
+ loading: G,
143
+ error: K,
144
144
  analytics: Z,
145
- cascadeOrgId: A,
145
+ cascadeOrgId: j,
146
146
  initResponseStaleForToken: Y,
147
- disclosuresAcceptance: T,
148
- providerLabels: E
147
+ disclosuresAcceptance: E,
148
+ providerLabels: D
149
149
  }), [
150
150
  $,
151
151
  Q,
152
152
  q,
153
- W,
154
153
  G,
154
+ K,
155
155
  Z,
156
- A,
156
+ j,
157
157
  Y,
158
- T,
159
- E
158
+ E,
159
+ D
160
160
  ]);
161
- return /* @__PURE__ */ m(fe, {
162
- client: R,
163
- children: /* @__PURE__ */ m(i, {
164
- client: H,
161
+ return /* @__PURE__ */ g(le, {
162
+ client: z,
163
+ children: /* @__PURE__ */ g(n, {
164
+ client: U,
165
165
  organizationId: X,
166
- widgetToken: k,
167
- installClientSecret: pe,
168
- authEpoch: me,
169
- organizationStatus: _e,
170
- children: /* @__PURE__ */ m(s.Provider, {
171
- value: ye,
172
- children: /* @__PURE__ */ m(ee, {
173
- linkComponent: N,
174
- uiFramework: P,
175
- children: h
166
+ widgetToken: A,
167
+ installClientSecret: de,
168
+ authEpoch: fe,
169
+ organizationStatus: ge,
170
+ children: /* @__PURE__ */ g(o.Provider, {
171
+ value: ve,
172
+ children: /* @__PURE__ */ g(ee, {
173
+ linkComponent: P,
174
+ uiFramework: F,
175
+ children: _
176
176
  })
177
177
  })
178
178
  })
179
179
  });
180
180
  }
181
- export { h as RootWidgetProvider };
181
+ export { _ as RootWidgetProvider };