@tesouro/embedded-components-react 0.5.148 → 0.5.150

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 (64) hide show
  1. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js +11 -8
  2. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index2.js +5 -2
  3. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +5 -2
  4. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +5 -2
  5. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +21 -18
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +14 -11
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +17 -14
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +6 -3
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +43 -28
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js +9 -6
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +6 -3
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +6 -3
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +52 -49
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +7 -4
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +10 -7
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +7 -4
  17. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +5 -2
  18. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index2.js +5 -2
  19. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +5 -2
  20. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +12 -6
  21. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +12 -6
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js +6 -3
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +6 -3
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +30 -15
  25. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index4.js +5 -2
  26. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +6 -3
  27. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +6 -3
  28. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index4.js +6 -3
  29. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +7 -4
  30. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index10.js +6 -3
  31. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index2.js +6 -3
  32. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index7.js +6 -3
  33. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index8.js +6 -3
  34. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index12.js +7 -4
  35. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +5 -2
  36. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +16 -13
  37. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +12 -6
  38. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +6 -3
  39. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +12 -6
  40. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +9 -6
  41. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +4 -1
  42. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +14 -14
  43. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +15 -12
  44. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +17 -14
  45. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +23 -17
  46. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js +6 -3
  47. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +3 -0
  48. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js +17 -14
  49. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +19 -16
  50. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js +6 -3
  51. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js +12 -9
  52. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +19 -16
  53. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +11 -11
  54. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js +6 -3
  55. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +99 -98
  56. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +139 -138
  57. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useWidgetFetch.js +11 -10
  58. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +6 -3
  60. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +6 -3
  61. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index8.js +6 -3
  62. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +6 -3
  63. package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +16 -13
  64. package/package.json +7 -1
@@ -10,35 +10,38 @@ import { useCallback as i, useMemo as a, useRef as o } from "react";
10
10
  import { useQueries as s } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js
12
12
  function c({ roleIds: c, enabled: l }) {
13
- let { client: u, organizationId: d, widgetToken: f, authEpoch: p } = n(), m = r(d), h = !!(d && f) && (l === !0 || l === void 0), g = a(() => [...new Set(c)].sort(), [c]), _ = s({ queries: g.map((n) => ({
13
+ let { client: u, organizationId: d, widgetToken: f, authEpoch: p, organizationPending: m } = n(), h = r(d), g = !!(d && f) && (l === !0 || l === void 0), _ = a(() => [...new Set(c)].sort(), [c]), v = s({ queries: _.map((n) => ({
14
14
  ...t(e({
15
15
  client: u,
16
- headers: m,
16
+ headers: h,
17
17
  path: { roleId: n }
18
- }), p),
19
- enabled: h
20
- })) }), v = o(_);
21
- v.current = _;
22
- let y = i(() => {
23
- for (let e of v.current) e.refetch();
18
+ }), {
19
+ authEpoch: p,
20
+ organizationPending: m
21
+ }),
22
+ enabled: g
23
+ })) }), y = o(v);
24
+ y.current = v;
25
+ let b = i(() => {
26
+ for (let e of y.current) e.refetch();
24
27
  }, []);
25
28
  return a(() => {
26
29
  let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
27
- return g.forEach((n, r) => {
28
- let i = _[r], a = i?.data?.data;
30
+ return _.forEach((n, r) => {
31
+ let i = v[r], a = i?.data?.data;
29
32
  a && e.set(n, new Set(a.map((e) => e.key))), i?.isLoading && t.add(n);
30
33
  }), {
31
34
  byRoleId: e,
32
- isResolving: h && g.length > 0 && _.some((e) => e.isLoading),
33
- isError: _.some((e) => e.isError),
35
+ isResolving: g && _.length > 0 && v.some((e) => e.isLoading),
36
+ isError: v.some((e) => e.isError),
34
37
  resolvingRoleIds: t,
35
- refetch: y
38
+ refetch: b
36
39
  };
37
40
  }, [
38
- g,
39
41
  _,
40
- h,
41
- y
42
+ v,
43
+ g,
44
+ b
42
45
  ]);
43
46
  }
44
47
  //#endregion
@@ -9,13 +9,16 @@ import { organizationHeaders as r } from "./organizationHeaders.js";
9
9
  import { useQuery as i } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js
11
11
  function a({ enabled: a } = {}) {
12
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l } = n(), u = !!(s && c) && (a === !0 || a === void 0);
12
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c) && (a === !0 || a === void 0);
13
13
  return i({
14
14
  ...t(e({
15
15
  client: o,
16
16
  headers: r(s)
17
- }), l),
18
- enabled: u,
17
+ }), {
18
+ authEpoch: l,
19
+ organizationPending: u
20
+ }),
21
+ enabled: d,
19
22
  staleTime: Infinity,
20
23
  refetchOnMount: !1
21
24
  });
@@ -9,25 +9,28 @@ import { isUserDataNotFoundError as r } from "./isUserDataNotFoundError.js";
9
9
  import { useQuery as i } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js
11
11
  function a({ key: a, enabled: o, defaultWhenNotFound: s }) {
12
- let { client: c, widgetToken: l, authEpoch: u } = n(), d = !!(l && a) && o !== !1, f = e({
12
+ let { client: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(l && a) && o !== !1, p = e({
13
13
  client: c,
14
14
  path: { key: a }
15
- }), p = f.queryFn, m = t(f, u);
16
- return i(s !== void 0 && p ? {
17
- ...m,
18
- enabled: d,
19
- queryKey: [...m.queryKey, { userDataNotFoundDefault: s }],
15
+ }), m = p.queryFn, h = t(p, {
16
+ authEpoch: u,
17
+ organizationPending: d
18
+ });
19
+ return i(s !== void 0 && m ? {
20
+ ...h,
21
+ enabled: f,
22
+ queryKey: [...h.queryKey, { userDataNotFoundDefault: s }],
20
23
  queryFn: async (e) => {
21
24
  try {
22
- return await p(e);
25
+ return await m(e);
23
26
  } catch (e) {
24
27
  if (r(e)) return { value: s };
25
28
  throw e;
26
29
  }
27
30
  }
28
31
  } : {
29
- ...m,
30
- enabled: d
32
+ ...h,
33
+ enabled: f
31
34
  });
32
35
  }
33
36
  //#endregion
@@ -13,26 +13,29 @@ import { useInfiniteQuery as l } from "@tanstack/react-query";
13
13
  //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js
14
14
  var u = 100;
15
15
  function d({ enabled: d, permissions: f } = {}) {
16
- let { client: p, organizationId: m, widgetToken: h, authEpoch: g } = r(), _ = i(m), v = !!(m && h) && (d === !0 || d === void 0), y = f?.length ? { Permissions: f } : {}, b = t({
16
+ let { client: p, organizationId: m, widgetToken: h, authEpoch: g, organizationPending: _ } = r(), v = i(m), y = !!(m && h) && (d === !0 || d === void 0), b = f?.length ? { Permissions: f } : {}, x = t({
17
17
  client: p,
18
- headers: _,
18
+ headers: v,
19
19
  query: {
20
20
  Status: "ACTIVE",
21
21
  Limit: u,
22
- ...y
22
+ ...b
23
23
  }
24
- }), x = l({
25
- queryKey: [...n(b, g).queryKey, "all"],
26
- enabled: v,
24
+ }), S = l({
25
+ queryKey: [...n(x, {
26
+ authEpoch: g,
27
+ organizationPending: _
28
+ }).queryKey, "all"],
29
+ enabled: y,
27
30
  initialPageParam: void 0,
28
31
  queryFn: async ({ signal: t, pageParam: n }) => {
29
32
  let { data: r } = await e({
30
33
  client: p,
31
- headers: _,
34
+ headers: v,
32
35
  query: {
33
36
  Status: "ACTIVE",
34
37
  Limit: u,
35
- ...y,
38
+ ...b,
36
39
  ...n ? { PaginationToken: n } : {}
37
40
  },
38
41
  signal: t,
@@ -42,18 +45,18 @@ function d({ enabled: d, permissions: f } = {}) {
42
45
  },
43
46
  getNextPageParam: a
44
47
  });
45
- s(x, v);
46
- let S = c(() => {
47
- if (x.data) return {
48
- data: x.data.pages.flatMap((e) => e.data ?? []),
48
+ s(S, y);
49
+ let C = c(() => {
50
+ if (S.data) return {
51
+ data: S.data.pages.flatMap((e) => e.data ?? []),
49
52
  nextPaginationToken: null,
50
53
  prevPaginationToken: null
51
54
  };
52
- }, [x.data]);
55
+ }, [S.data]);
53
56
  return {
54
- ...x,
55
- data: S,
56
- isResolving: o(x)
57
+ ...S,
58
+ data: C,
59
+ isResolving: o(S)
57
60
  };
58
61
  }
59
62
  //#endregion
@@ -11,21 +11,21 @@ function a(e, a, o) {
11
11
  let s = o ? r(e) : e, [c] = s;
12
12
  return i(a && t(c) ? [c.baseUrl, n(c)] : s);
13
13
  }
14
- function o(n) {
15
- let [r] = n;
16
- return t(r) && t(r.headers) && e in r.headers && !r.headers[e];
14
+ function o(n, r) {
15
+ let [i] = n;
16
+ return r && t(i) && t(i.headers) && e in i.headers && !i.headers[e];
17
17
  }
18
18
  var s = /* @__PURE__ */ new Map(), c = 500;
19
- function l(e, t) {
20
- let n = o(e), r = a(e, t, n), i = `${t}:${n}:${e.length}:${r}`, l = s.get(i);
21
- if (l) return s.delete(i), s.set(i, l), l;
22
- let u = (i, o) => o && a(o.queryKey.slice(0, e.length), t, n) === r ? i : void 0;
23
- return s.size >= c && s.delete(s.keys().next().value), s.set(i, u), u;
19
+ function l(e, t, n) {
20
+ let r = o(e, n), i = a(e, t, r), l = `${t}:${r}:${e.length}:${i}`, u = s.get(l);
21
+ if (u) return s.delete(l), s.set(l, u), u;
22
+ let d = (n, o) => o && a(o.queryKey.slice(0, e.length), t, r) === i ? n : void 0;
23
+ return s.size >= c && s.delete(s.keys().next().value), s.set(l, d), d;
24
24
  }
25
- var u = (e) => l(e, !1);
26
- function d(e, t, { carryWithinOrg: n = !1 } = {}) {
25
+ var u = (e, t) => l(e, !1, t);
26
+ function d(e, { authEpoch: t, organizationPending: n }, { carryWithinOrg: r = !1 } = {}) {
27
27
  return {
28
- placeholderData: l(e.queryKey, n),
28
+ placeholderData: l(e.queryKey, r, n),
29
29
  ...e,
30
30
  queryKey: [...e.queryKey, { authEpoch: t }]
31
31
  };
@@ -11,13 +11,16 @@ import { transactionsValidationsInvalidationKey as a } from "./index2.js";
11
11
  import { useMutation as o, useQuery as s } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js
13
13
  function c() {
14
- let { client: t, organizationId: r, widgetToken: a, authEpoch: o } = i(), c = !!(r && a), l = e({
14
+ let { client: t, organizationId: r, widgetToken: a, authEpoch: o, organizationPending: c } = i(), l = !!(r && a), u = e({
15
15
  client: t,
16
16
  headers: { "x-organization-id": r ?? "" }
17
17
  });
18
18
  return s({
19
- ...n(l, o),
20
- enabled: c
19
+ ...n(u, {
20
+ authEpoch: o,
21
+ organizationPending: c
22
+ }),
23
+ enabled: l
21
24
  });
22
25
  }
23
26
  function l() {
@@ -3,169 +3,170 @@
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 ee } from "../../../../data-access/dist/lib/clientRegistry.js";
7
- import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
6
+ import { registerQueryClient as t, unregisterQueryClient as n } from "../../../../data-access/dist/lib/clientRegistry.js";
7
+ import { createEmbeddedClient as ee } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
8
8
  import { EmbedApiProvider as te } from "../../../../data-access/dist/lib/EmbedApiContext.js";
9
9
  import "../../../../data-access/dist/index.js";
10
10
  import { resolveUIFramework as r } from "../../../../ui/dist/lib/UIContext/UIContext.js";
11
- import { UIProvider as i } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
12
- import { useDesignSystemEnsurer as a } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
11
+ import { UIProvider as ne } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
12
+ import { useDesignSystemEnsurer as re } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
13
13
  import "../../../../ui/dist/index.js";
14
- import { getGlobalSnapshot as o, subscribeToGlobal as s } from "./globalStore.js";
15
- import { configureEmbeddedClient as ne } from "../analytics/client.js";
16
- import { generateCorrelationId as re } from "../analytics/ids.js";
17
- import { WidgetContext as ie } from "./WidgetContext.js";
18
- import { resolveOrgId as ae, useAuthEpoch as c } from "./utils.js";
19
- import { useWidgetFetch as l } from "./useWidgetFetch.js";
20
- import { deriveWidgetInitState as oe, useWidgetInitPublisher as se } from "./useWidgetInitPublisher.js";
21
- import { useEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as ce } from "react";
22
- import { jsx as m } from "react/jsx-runtime";
23
- import { QueryClient as le, QueryClientProvider as ue } from "@tanstack/react-query";
14
+ import { getGlobalSnapshot as i, subscribeToGlobal as ie } from "./globalStore.js";
15
+ import { configureEmbeddedClient as ae } from "../analytics/client.js";
16
+ import { generateCorrelationId as oe } from "../analytics/ids.js";
17
+ import { WidgetContext as se } from "./WidgetContext.js";
18
+ import { resolveOrgId as ce, useAuthEpoch as le } from "./utils.js";
19
+ import { useWidgetFetch as ue } from "./useWidgetFetch.js";
20
+ import { deriveWidgetInitState as a, useWidgetInitPublisher as o } from "./useWidgetInitPublisher.js";
21
+ import { useEffect as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as de } from "react";
22
+ import { jsx as d } from "react/jsx-runtime";
23
+ import { QueryClient as f, QueryClientProvider as p } from "@tanstack/react-query";
24
24
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
25
- function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configClient: y, gatewayRouting: b, linkComponent: x, uiFramework: S, implementation: C, analytics: w, unstable_initResponseOverride: T, disclosuresAcceptance: E, providerLabels: D }) {
26
- let O = ce(s, o, o), k = g ?? O.baseUrl, A = _ === void 0 ? O.widgetToken : _, j = v === void 0 ? O.organizationId : v, M = y ?? O.configClient, N = b ?? O.gatewayRouting, P = x ?? O.linkComponent, F = S ?? O.uiFramework, I = C ?? O.implementation, L = w !== !1, [R] = p(re), z = f({
27
- enabled: L,
28
- organizationId: j,
29
- rootCorrelationId: R
30
- }), [B] = p(() => new le({ defaultOptions: {
25
+ function m({ children: m, baseUrl: h, widgetToken: g, organizationId: _, configClient: v, gatewayRouting: y, linkComponent: b, uiFramework: x, implementation: S, analytics: C, unstable_initResponseOverride: w, disclosuresAcceptance: T, providerLabels: E }) {
26
+ let D = de(ie, i, i), O = h ?? D.baseUrl, k = g === void 0 ? D.widgetToken : g, A = _ === void 0 ? D.organizationId : _, j = v ?? D.configClient, M = y ?? D.gatewayRouting, N = b ?? D.linkComponent, P = x ?? D.uiFramework, F = S ?? D.implementation, I = C !== !1, [L] = u(oe), R = l({
27
+ enabled: I,
28
+ organizationId: A,
29
+ rootCorrelationId: L
30
+ }), [z] = u(() => new f({ defaultOptions: {
31
31
  queries: {
32
32
  retry: !1,
33
33
  refetchOnWindowFocus: !1
34
34
  },
35
35
  mutations: { retry: !1 }
36
36
  } }));
37
- u(() => (t(B), () => ee(B)), [B]);
38
- let V = f(A);
39
- V.current = A;
40
- let H = f(null), de = d(() => e(H), []), fe = c(A), U = d(() => {
41
- let e = ne(n(k), {
42
- tokenRef: V,
43
- analyticsContextRef: z,
44
- clientSecretRef: H,
45
- gatewayRouting: N
37
+ s(() => (t(z), () => n(z)), [z]);
38
+ let B = l(k);
39
+ B.current = k;
40
+ let V = l(null), fe = c(() => e(V), []), pe = le(k), H = c(() => {
41
+ let e = ae(ee(O), {
42
+ tokenRef: B,
43
+ analyticsContextRef: R,
44
+ clientSecretRef: V,
45
+ gatewayRouting: M
46
46
  });
47
- return M ? M(e) : e;
47
+ return j ? j(e) : e;
48
48
  }, [
49
- k,
50
- M,
51
- N
49
+ O,
50
+ j,
51
+ M
52
52
  ]);
53
- u(() => {
54
- if (!L || !("window" in globalThis)) return;
53
+ s(() => {
54
+ if (!I || !("window" in globalThis)) return;
55
55
  let e = !1;
56
56
  return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
57
57
  e || t();
58
58
  }), () => {
59
59
  e = !0;
60
60
  };
61
- }, [L]);
62
- let W = a(r(F));
63
- u(() => {
64
- W && W().catch(() => {});
65
- }, [W]);
66
- let { result: pe, loading: G, error: K, initStaleForToken: me, refetch: q } = l(T ? null : U, A, z), J = A ? T ?? pe ?? void 0 : void 0, Y = !T && me, X = ae(j, Y ? void 0 : J?.organizationId), he = d(() => oe({
67
- hasToken: !!A,
68
- loading: G,
69
- error: K,
61
+ }, [I]);
62
+ let U = re(r(P));
63
+ s(() => {
64
+ U && U().catch(() => {});
65
+ }, [U]);
66
+ let { result: me, loading: W, error: G, initStaleForToken: he, initReplacementPending: K, refetch: q } = ue(w ? null : H, k, R), J = k ? w ?? me ?? void 0 : void 0, Y = !w && he, X = ce(A, Y ? void 0 : J?.organizationId), ge = A === void 0 && K, _e = c(() => a({
67
+ hasToken: !!k,
68
+ loading: W,
69
+ error: G,
70
70
  initResponse: J,
71
71
  initStaleForToken: Y
72
72
  }), [
73
- A,
73
+ k,
74
+ W,
74
75
  G,
75
- K,
76
76
  J,
77
77
  Y
78
78
  ]);
79
- se(he, A);
80
- let Z = d(() => ({
81
- enabled: L,
79
+ o(_e, k);
80
+ let Z = c(() => ({
81
+ enabled: I,
82
82
  organizationId: X,
83
- rootCorrelationId: R
83
+ rootCorrelationId: L
84
84
  }), [
85
- L,
85
+ I,
86
86
  X,
87
- R
87
+ L
88
88
  ]);
89
- z.current = Z;
90
- let Q = d(() => ({
91
- baseUrl: g,
92
- widgetToken: _,
93
- organizationId: v,
94
- configClient: y,
95
- gatewayRouting: b,
96
- linkComponent: x,
97
- uiFramework: S,
98
- implementation: C
89
+ R.current = Z;
90
+ let Q = c(() => ({
91
+ baseUrl: h,
92
+ widgetToken: g,
93
+ organizationId: _,
94
+ configClient: v,
95
+ gatewayRouting: y,
96
+ linkComponent: b,
97
+ uiFramework: x,
98
+ implementation: S
99
99
  }), [
100
+ h,
100
101
  g,
101
102
  _,
102
103
  v,
103
104
  y,
104
105
  b,
105
106
  x,
106
- S,
107
- C
108
- ]), $ = d(() => ({
109
- baseUrl: k,
110
- widgetToken: A,
107
+ S
108
+ ]), $ = c(() => ({
109
+ baseUrl: O,
110
+ widgetToken: k,
111
111
  organizationId: X,
112
- configClient: M,
113
- gatewayRouting: N,
114
- linkComponent: P,
115
- uiFramework: F,
116
- implementation: I,
112
+ configClient: j,
113
+ gatewayRouting: M,
114
+ linkComponent: N,
115
+ uiFramework: P,
116
+ implementation: F,
117
117
  initResponse: J
118
118
  }), [
119
+ O,
119
120
  k,
120
- A,
121
121
  X,
122
+ j,
122
123
  M,
123
124
  N,
124
125
  P,
125
126
  F,
126
- I,
127
127
  J
128
- ]), ge = d(() => ({
128
+ ]), ve = c(() => ({
129
129
  resolved: $,
130
130
  own: Q,
131
131
  refetch: q,
132
- loading: G,
133
- error: K,
132
+ loading: W,
133
+ error: G,
134
134
  analytics: Z,
135
- cascadeOrgId: j,
135
+ cascadeOrgId: A,
136
136
  initResponseStaleForToken: Y,
137
- disclosuresAcceptance: E,
138
- providerLabels: D
137
+ disclosuresAcceptance: T,
138
+ providerLabels: E
139
139
  }), [
140
140
  $,
141
141
  Q,
142
142
  q,
143
+ W,
143
144
  G,
144
- K,
145
145
  Z,
146
- j,
146
+ A,
147
147
  Y,
148
- E,
149
- D
148
+ T,
149
+ E
150
150
  ]);
151
- return /* @__PURE__ */ m(ue, {
152
- client: B,
153
- children: /* @__PURE__ */ m(te, {
154
- client: U,
151
+ return /* @__PURE__ */ d(p, {
152
+ client: z,
153
+ children: /* @__PURE__ */ d(te, {
154
+ client: H,
155
155
  organizationId: X,
156
- widgetToken: A,
157
- installClientSecret: de,
158
- authEpoch: fe,
159
- children: /* @__PURE__ */ m(ie.Provider, {
160
- value: ge,
161
- children: /* @__PURE__ */ m(i, {
162
- linkComponent: P,
163
- uiFramework: F,
164
- children: h
156
+ widgetToken: k,
157
+ installClientSecret: fe,
158
+ authEpoch: pe,
159
+ organizationPending: ge,
160
+ children: /* @__PURE__ */ d(se.Provider, {
161
+ value: ve,
162
+ children: /* @__PURE__ */ d(ne, {
163
+ linkComponent: N,
164
+ uiFramework: P,
165
+ children: m
165
166
  })
166
167
  })
167
168
  })
168
169
  });
169
170
  }
170
171
  //#endregion
171
- export { h as RootWidgetProvider };
172
+ export { m as RootWidgetProvider };