@tesouro/embedded-components-react 0.5.294 → 0.5.295

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.
@@ -2,46 +2,47 @@ import "./lib/finopsApiVersion.js";
2
2
  import "./lib/rest/client.gen.js";
3
3
  import { bulkUpdateDepartmentMembers as e, bulkUpdateLocationMembers as t, bulkUpdateRoleMembers as n, createDepartment as r, createLocation as i, createUser as a, deactivateDepartment as o, deactivateLocation as s, deleteCounterpartsId as c, deleteCounterpartsIdBankAccountsId as l, deleteEntitiesIdLogo as u, deleteFilesId as d, deleteMeasureUnitsId as f, deletePayablesId as p, deletePayablesIdFile as m, deleteProductsId as h, deleteReceivablesId as g, downloadBankAccountTransactions as _, getApplicationStatus as v, getApprovalPolicies as y, getApprovalRequests as b, getBankAccountAccess as x, getBankAccountStatement as S, getCounterparts as C, getDepartment as w, getDepositableBankAccounts as T, getExternalBankAccountAccess as E, getLocation as D, getPayables as O, getPayablesId as k, getPayablesIdHistory as A, getPayablesIdLineItems as j, getPaymentRecords as M, getProducts as N, getReceipts as P, getReceivables as F, getReceivablesIdHistory as I, getUsers as L, listDepartments as R, listLocations as z, listRoles as B, manageBankAccountAccess as V, manageDebitCardAccess as H, patchCounterpartsId as U, patchCounterpartsIdAddressesId as W, patchCounterpartsIdBankAccountsId as G, patchEntitiesIdSettings as K, patchMeasureUnitsId as q, patchPayablesId as J, patchProductsId as Y, patchReceivablesId as X, patchRecurrencesId as Z, patchTransactionsId as Q, postApprovalRequestsIdApprove as $, postApprovalRequestsIdReject as ee, postBankDetails as te, postCounterparts as ne, postCounterpartsIdAddresses as re, postCounterpartsIdBankAccounts as ie, postCounterpartsIdBankAccountsIdMakeDefault as ae, postFiles as oe, postMeasureUnits as se, postOverdueReminders as ce, postPayables as le, postPayablesIdApprovePaymentOperation as ue, postPayablesIdAttachFile as de, postPayablesIdCancel as fe, postPayablesIdDuplicatesIdConfirm as pe, postPayablesIdDuplicatesIdDismiss as me, postPayablesIdMarkAsPaid as he, postPayablesIdReject as ge, postPayablesIdReopen as _e, postPayablesIdSchedulePayment as ve, postPayablesIdSubmitForApproval as ye, postPayablesIdValidate as be, postPayablesUploadFromFile as xe, postPaymentIntentsIdCancel as Se, postPaymentLinks as Ce, postPaymentRecords as we, postPaymentReminders as Te, postProducts as Ee, postReceivables as De, postReceivablesIdAccept as Oe, postReceivablesIdCancel as ke, postReceivablesIdClone as Ae, postReceivablesIdDecline as je, postReceivablesIdIssue as Me, postReceivablesIdMarkAsPaid as Ne, postReceivablesIdMarkAsUncollectible as Pe, postReceivablesIdSend as Fe, postRecurrences as Ie, postRecurrencesIdCancel as Le, postRecurrencesIdPause as Re, postRecurrencesIdResume as ze, postTransactionsIdApprove as Be, postTransactionsIdReject as Ve, postTransactionsIdReopen as He, postTransactionsIdSubmit as Ue, putEntitiesIdLogo as We, putPayablesIdLineItems as Ge, updateDepartment as Ke, updateLocation as qe, updateUser as Je } from "./lib/rest/sdk.gen.js";
4
4
  import { activateCreditCardMutation as Ye, activateDebitCardMutation as Xe, connectExternalBankAccountMutation as Ze, createAchMoneyMovementMutation as Qe, createApplicationMutation as $e, createBankAccountMutation as et, createBookTransferMutation as tt, createCheckDepositMutation as nt, createDebitCardMutation as rt, createVelocityControlMutation as it, deleteApprovalPoliciesIdMutation as at, deleteBankAccountApplicationMutation as ot, deleteLedgerAccountsIdMutation as st, deleteReceiptsIdMutation as ct, disableUserMutation as lt, getAnalyticsPayablesOptions as ut, getAnalyticsPayablesQueryKey as dt, getAnalyticsReceiptsOptions as ft, getAnalyticsReceiptsQueryKey as pt, getAnalyticsReceivablesOptions as mt, getAnalyticsReceivablesQueryKey as ht, getAnalyticsTransactionsOptions as gt, getAnalyticsTransactionsQueryKey as _t, getApprovalPoliciesOptions as vt, getApprovalPoliciesQueryKey as yt, getApprovalRequestsOptions as bt, getApprovalRequestsQueryKey as xt, getBankAccountAccessQueryKey as St, getBankAccountApplicationOptions as Ct, getBankAccountOptions as wt, getBankAccountQueryKey as Tt, getBankAccountStatementsOptions as Et, getBankAccountTransactionsOptions as Dt, getBankAccountTransactionsQueryKey as Ot, getBankAccountTransfersOptions as kt, getBankAccountTransfersQueryKey as At, getBankAccountsQueryKey as jt, getBankDetailsIdOptions as Mt, getBankDetailsOptions as Nt, getBankDetailsQueryKey as Pt, getCounterpartsIdAddressesOptions as Ft, getCounterpartsIdAddressesQueryKey as It, getCounterpartsIdBankAccountsOptions as Lt, getCounterpartsIdBankAccountsQueryKey as Rt, getCounterpartsIdOptions as zt, getCounterpartsIdQueryKey as Bt, getCounterpartsOptions as Vt, getCounterpartsQueryKey as Ht, getCreditCardByIdOptions as Ut, getCreditCardByIdQueryKey as Wt, getCreditCardsOptions as Gt, getCreditCardsQueryKey as Kt, getDebitCardByIdOptions as qt, getDebitCardByIdQueryKey as Jt, getDebitCardCredentialsOptions as Yt, getDebitCardsOptions as Xt, getDebitCardsQueryKey as Zt, getDepartmentOptions as Qt, getDepartmentQueryKey as $t, getDepositableBankAccountsOptions as en, getDocumentsIdNextNumbersOptions as tn, getDocumentsIdNextNumbersQueryKey as nn, getEntitiesIdPaymentMethodsOptions as rn, getEntitiesIdSettingsOptions as an, getEntitiesIdSettingsQueryKey as on, getEntityUsersOptions as sn, getExternalBankAccountAccessQueryKey as cn, getExternalBankAccountOptions as ln, getExternalBankAccountsOptions as un, getExternalBankAccountsQueryKey as dn, getFilesQueryKey as fn, getLedgerAccountsQueryKey as pn, getLocationOptions as mn, getLocationQueryKey as hn, getMeOptions as gn, getMeasureUnitsOptions as _n, getMeasureUnitsQueryKey as vn, getOrganizationOptions as yn, getOverdueRemindersOptions as bn, getOverdueRemindersQueryKey as xn, getPayablesIdHistoryOptions as Sn, getPayablesIdHistoryQueryKey as Cn, getPayablesIdLineItemsOptions as wn, getPayablesIdLineItemsQueryKey as Tn, getPayablesIdOptions as En, getPayablesIdQueryKey as Dn, getPayablesIdSuggestionsOptions as On, getPayablesOptions as kn, getPayablesQueryKey as An, getPaymentRecordsOptions as jn, getPaymentRecordsQueryKey as Mn, getPaymentRemindersOptions as Nn, getPaymentRemindersQueryKey as Pn, getProductsIdOptions as Fn, getProductsIdQueryKey as In, getProductsOptions as Ln, getProductsQueryKey as Rn, getReceiptsIdQueryKey as zn, getReceiptsOptions as Bn, getReceiptsQueryKey as Vn, getReceivablesIdHistoryQueryKey as Hn, getReceivablesIdMailsQueryKey as Un, getReceivablesIdOptions as Wn, getReceivablesIdPdfLinkOptions as Gn, getReceivablesIdPdfLinkQueryKey as Kn, getReceivablesIdQueryKey as qn, getReceivablesOptions as Jn, getReceivablesQueryKey as Yn, getReceivablesRequiredFieldsOptions as Xn, getRecurrencesIdOptions as Zn, getRecurrencesIdQueryKey as Qn, getRecurrencesQueryKey as $n, getTransactionsIdExpenseHistoryOptions as er, getTransactionsIdExpenseHistoryQueryKey as tr, getTransactionsIdOptions as nr, getTransactionsIdQueryKey as rr, getTransactionsOptions as ir, getTransactionsQueryKey as ar, getTransactionsValidationsOptions as or, getTransactionsValidationsQueryKey as sr, getUsersOptions as cr, getUsersQueryKey as lr, getVelocityControlsQueryKey as ur, grantBankAccountAccessMutation as dr, grantExternalBankAccountAccessMutation as fr, linkExternalBankAccountMutation as pr, listDepartmentsOptions as mr, listDepartmentsQueryKey as hr, listLocationsOptions as gr, listLocationsQueryKey as _r, listRolesQueryKey as vr, manageDebitCardAccessMutation as yr, patchApprovalPoliciesIdMutation as br, patchLedgerAccountsIdMutation as xr, patchReceiptsIdMutation as Sr, postApprovalPoliciesMutation as Cr, postLedgerAccountsMutation as wr, postReceiptsUploadFromFileMutation as Tr, putTransactionsValidationsMutation as Er, setDebitCardLockStatusMutation as Dr, submitApplicationMutation as Or, unlinkExternalBankAccountMutation as kr, updateApplicationMutation as Ar, updateBankAccountMutation as jr, updateDebitCardMutation as Mr, updateExternalBankAccountMutation as Nr, validateExternalBankAccountMutation as Pr, verifyDebitCardMutation as Fr } from "./lib/rest/@tanstack/react-query.gen.js";
5
- import { OrganizationStatus as Ir, isOrganizationOnItsWay as Lr } from "./lib/organizationStatus.js";
6
- import { withAuthEpoch as Rr, withAuthEpochInfinite as zr } from "./lib/withAuthEpoch.js";
7
- import { applicationStatusInvalidationKey as Br, applicationStatusQueryOptions as Vr } from "./lib/applicationStatusQueryOptions.js";
8
- import { createClientSecretInstaller as Hr } from "./lib/scopedClientSecret.js";
9
- import { cancelAllClients as Ur, invalidateAllClients as Wr, registerQueryClient as Gr, removeInactiveFromAllClients as Kr, resetAllClients as qr, setAllClientsQueriesData as Jr, unregisterQueryClient as Yr } from "./lib/clientRegistry.js";
10
- import { cloneEmbeddedClient as Xr, createEmbeddedClient as Zr } from "./lib/createEmbeddedClient.js";
5
+ import { widgetTokenCacheId as Ir } from "./lib/widgetTokenCacheId.js";
6
+ import { OrganizationStatus as Lr, isOrganizationOnItsWay as Rr } from "./lib/organizationStatus.js";
7
+ import { withAuthEpoch as zr, withAuthEpochInfinite as Br } from "./lib/withAuthEpoch.js";
8
+ import { applicationStatusInvalidationKey as Vr, applicationStatusQueryOptions as Hr } from "./lib/applicationStatusQueryOptions.js";
9
+ import { createClientSecretInstaller as Ur } from "./lib/scopedClientSecret.js";
10
+ import { cancelAllClients as Wr, invalidateAllClients as Gr, registerQueryClient as Kr, removeInactiveFromAllClients as qr, resetAllClients as Jr, setAllClientsQueriesData as Yr, unregisterQueryClient as Xr } from "./lib/clientRegistry.js";
11
+ import { cloneEmbeddedClient as Zr, createEmbeddedClient as Qr } from "./lib/createEmbeddedClient.js";
11
12
  import "./lib/widgetGatewayHosts.js";
12
- import { attachTransportInterceptors as Qr } from "./lib/transportInterceptors.js";
13
- import { EmbedApiProvider as $r, useEmbedApi as ei } from "./lib/EmbedApiContext.js";
14
- import { optionalOrganizationHeaders as ti, organizationHeaders as ni } from "./lib/organizationHeaders.js";
15
- import { fetchWidgetInit as ri } from "./lib/fetchWidgetInit.js";
16
- import { hasAnyScope as ii } from "./lib/hasAnyScope.js";
17
- import { myEntityInvalidationKey as ai } from "./lib/queryKeys.js";
18
- import { useCurrentUserQuery as oi } from "./lib/useCurrentUserQuery.js";
19
- import { useMyEntityQuery as si } from "./lib/useMyEntityQuery.js";
20
- import { useMailboxAddress as ci } from "./lib/useMailboxAddress.js";
13
+ import { attachTransportInterceptors as $r } from "./lib/transportInterceptors.js";
14
+ import { EmbedApiProvider as ei, useEmbedApi as ti } from "./lib/EmbedApiContext.js";
15
+ import { optionalOrganizationHeaders as ni, organizationHeaders as ri } from "./lib/organizationHeaders.js";
16
+ import { fetchWidgetInit as ii } from "./lib/fetchWidgetInit.js";
17
+ import { hasAnyScope as ai } from "./lib/hasAnyScope.js";
18
+ import { myEntityInvalidationKey as oi } from "./lib/queryKeys.js";
19
+ import { useCurrentUserQuery as si } from "./lib/useCurrentUserQuery.js";
20
+ import { useMyEntityQuery as ci } from "./lib/useMyEntityQuery.js";
21
+ import { useMailboxAddress as li } from "./lib/useMailboxAddress.js";
21
22
  import "./lib/apiErrorStatus.js";
22
- import { isApiConflictError as li } from "./lib/isApiConflictError.js";
23
- import { isApiForbiddenError as ui } from "./lib/isApiForbiddenError.js";
24
- import { isApiNotFoundError as di } from "./lib/isApiNotFoundError.js";
25
- import { isApiUnprocessableError as fi } from "./lib/isApiUnprocessableError.js";
23
+ import { isApiConflictError as ui } from "./lib/isApiConflictError.js";
24
+ import { isApiForbiddenError as di } from "./lib/isApiForbiddenError.js";
25
+ import { isApiNotFoundError as fi } from "./lib/isApiNotFoundError.js";
26
+ import { isApiUnprocessableError as pi } from "./lib/isApiUnprocessableError.js";
26
27
  import "./lib/isUserDataNotFoundError.js";
27
- import { useGetUserDataQuery as pi } from "./lib/useGetUserDataQuery.js";
28
- import { useUpsertUserDataMutation as mi } from "./lib/useUpsertUserDataMutation.js";
28
+ import { useGetUserDataQuery as mi } from "./lib/useGetUserDataQuery.js";
29
+ import { useUpsertUserDataMutation as hi } from "./lib/useUpsertUserDataMutation.js";
29
30
  import "./lib/rest/zod.gen.js";
30
- import { Scope as hi, isScope as gi } from "./lib/scopes.js";
31
- import { getAllPagesNextPageParam as _i, getAllPagesNextPaginationTokenParam as vi, isAllPagesResolving as yi, useAutoFetchNextPage as bi } from "./lib/allPages.js";
32
- import { useAllBankAccountsQuery as xi } from "./lib/bank-account/useAllBankAccountsQuery.js";
33
- import { useAllDebitCardsQuery as Si } from "./lib/debit-card/useAllDebitCardsQuery.js";
34
- import { useAllExternalBankAccountsQuery as Ci } from "./lib/external-bank-account/useAllExternalBankAccountsQuery.js";
35
- import { useAllMerchantCategoryGroupsQuery as wi } from "./lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
36
- import { useAllLedgerAccountsQuery as Ti, useLedgerAccountsQuery as Ei } from "./lib/reference-data/useLedgerAccountsQuery.js";
37
- import { usePaymentTermsQuery as Di } from "./lib/reference-data/usePaymentTermsQuery.js";
38
- import { useAllOrganizationRolesQuery as Oi } from "./lib/role/useAllOrganizationRolesQuery.js";
39
- import { useRolePermissionsQueries as ki } from "./lib/role/useRolePermissionsQueries.js";
40
- import { useAllOrganizationUsersQuery as Ai } from "./lib/user/useAllOrganizationUsersQuery.js";
41
- import { personDisclosure as ji } from "./lib/disclosures/personDisclosure.js";
42
- import { useAcceptWidgetDisclosures as Mi } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
43
- import { useDisclosuresQuery as Ni } from "./lib/disclosures/useDisclosuresQuery.js";
44
- import { OnboardingSuppressionReason as Pi } from "./lib/onboardingSuppressionReason.js";
45
- import { useOrganizationOnboardingSuppression as Fi } from "./lib/useOrganizationOnboardingSuppression.js";
46
- import { useOrganizationApplicationStatus as Ii } from "./lib/useOrganizationApplicationStatus.js";
47
- export { $r as EmbedApiProvider, Pi as OnboardingSuppressionReason, Ir as OrganizationStatus, hi as Scope, Ye as activateCreditCardMutation, Xe as activateDebitCardMutation, Br as applicationStatusInvalidationKey, Vr as applicationStatusQueryOptions, Qr as attachTransportInterceptors, e as bulkUpdateDepartmentMembers, t as bulkUpdateLocationMembers, n as bulkUpdateRoleMembers, Ur as cancelAllClients, Xr as cloneEmbeddedClient, Ze as connectExternalBankAccountMutation, Qe as createAchMoneyMovementMutation, $e as createApplicationMutation, et as createBankAccountMutation, tt as createBookTransferMutation, nt as createCheckDepositMutation, Hr as createClientSecretInstaller, rt as createDebitCardMutation, r as createDepartment, Zr as createEmbeddedClient, i as createLocation, a as createUser, it as createVelocityControlMutation, o as deactivateDepartment, s as deactivateLocation, at as deleteApprovalPoliciesIdMutation, ot as deleteBankAccountApplicationMutation, c as deleteCounterpartsId, l as deleteCounterpartsIdBankAccountsId, u as deleteEntitiesIdLogo, d as deleteFilesId, st as deleteLedgerAccountsIdMutation, f as deleteMeasureUnitsId, p as deletePayablesId, m as deletePayablesIdFile, h as deleteProductsId, ct as deleteReceiptsIdMutation, g as deleteReceivablesId, lt as disableUserMutation, _ as downloadBankAccountTransactions, ri as fetchWidgetInit, _i as getAllPagesNextPageParam, vi as getAllPagesNextPaginationTokenParam, ut as getAnalyticsPayablesOptions, dt as getAnalyticsPayablesQueryKey, ft as getAnalyticsReceiptsOptions, pt as getAnalyticsReceiptsQueryKey, mt as getAnalyticsReceivablesOptions, ht as getAnalyticsReceivablesQueryKey, gt as getAnalyticsTransactionsOptions, _t as getAnalyticsTransactionsQueryKey, v as getApplicationStatus, y as getApprovalPolicies, vt as getApprovalPoliciesOptions, yt as getApprovalPoliciesQueryKey, b as getApprovalRequests, bt as getApprovalRequestsOptions, xt as getApprovalRequestsQueryKey, x as getBankAccountAccess, St as getBankAccountAccessQueryKey, Ct as getBankAccountApplicationOptions, wt as getBankAccountOptions, Tt as getBankAccountQueryKey, S as getBankAccountStatement, Et as getBankAccountStatementsOptions, Dt as getBankAccountTransactionsOptions, Ot as getBankAccountTransactionsQueryKey, kt as getBankAccountTransfersOptions, At as getBankAccountTransfersQueryKey, jt as getBankAccountsQueryKey, Mt as getBankDetailsIdOptions, Nt as getBankDetailsOptions, Pt as getBankDetailsQueryKey, C as getCounterparts, Ft as getCounterpartsIdAddressesOptions, It as getCounterpartsIdAddressesQueryKey, Lt as getCounterpartsIdBankAccountsOptions, Rt as getCounterpartsIdBankAccountsQueryKey, zt as getCounterpartsIdOptions, Bt as getCounterpartsIdQueryKey, Vt as getCounterpartsOptions, Ht as getCounterpartsQueryKey, Ut as getCreditCardByIdOptions, Wt as getCreditCardByIdQueryKey, Gt as getCreditCardsOptions, Kt as getCreditCardsQueryKey, qt as getDebitCardByIdOptions, Jt as getDebitCardByIdQueryKey, Yt as getDebitCardCredentialsOptions, Xt as getDebitCardsOptions, Zt as getDebitCardsQueryKey, w as getDepartment, Qt as getDepartmentOptions, $t as getDepartmentQueryKey, T as getDepositableBankAccounts, en as getDepositableBankAccountsOptions, tn as getDocumentsIdNextNumbersOptions, nn as getDocumentsIdNextNumbersQueryKey, rn as getEntitiesIdPaymentMethodsOptions, an as getEntitiesIdSettingsOptions, on as getEntitiesIdSettingsQueryKey, sn as getEntityUsersOptions, E as getExternalBankAccountAccess, cn as getExternalBankAccountAccessQueryKey, ln as getExternalBankAccountOptions, un as getExternalBankAccountsOptions, dn as getExternalBankAccountsQueryKey, fn as getFilesQueryKey, pn as getLedgerAccountsQueryKey, D as getLocation, mn as getLocationOptions, hn as getLocationQueryKey, gn as getMeOptions, _n as getMeasureUnitsOptions, vn as getMeasureUnitsQueryKey, yn as getOrganizationOptions, bn as getOverdueRemindersOptions, xn as getOverdueRemindersQueryKey, O as getPayables, k as getPayablesId, A as getPayablesIdHistory, Sn as getPayablesIdHistoryOptions, Cn as getPayablesIdHistoryQueryKey, j as getPayablesIdLineItems, wn as getPayablesIdLineItemsOptions, Tn as getPayablesIdLineItemsQueryKey, En as getPayablesIdOptions, Dn as getPayablesIdQueryKey, On as getPayablesIdSuggestionsOptions, kn as getPayablesOptions, An as getPayablesQueryKey, M as getPaymentRecords, jn as getPaymentRecordsOptions, Mn as getPaymentRecordsQueryKey, Nn as getPaymentRemindersOptions, Pn as getPaymentRemindersQueryKey, N as getProducts, Fn as getProductsIdOptions, In as getProductsIdQueryKey, Ln as getProductsOptions, Rn as getProductsQueryKey, P as getReceipts, zn as getReceiptsIdQueryKey, Bn as getReceiptsOptions, Vn as getReceiptsQueryKey, F as getReceivables, I as getReceivablesIdHistory, Hn as getReceivablesIdHistoryQueryKey, Un as getReceivablesIdMailsQueryKey, Wn as getReceivablesIdOptions, Gn as getReceivablesIdPdfLinkOptions, Kn as getReceivablesIdPdfLinkQueryKey, qn as getReceivablesIdQueryKey, Jn as getReceivablesOptions, Yn as getReceivablesQueryKey, Xn as getReceivablesRequiredFieldsOptions, Zn as getRecurrencesIdOptions, Qn as getRecurrencesIdQueryKey, $n as getRecurrencesQueryKey, er as getTransactionsIdExpenseHistoryOptions, tr as getTransactionsIdExpenseHistoryQueryKey, nr as getTransactionsIdOptions, rr as getTransactionsIdQueryKey, ir as getTransactionsOptions, ar as getTransactionsQueryKey, or as getTransactionsValidationsOptions, sr as getTransactionsValidationsQueryKey, L as getUsers, cr as getUsersOptions, lr as getUsersQueryKey, ur as getVelocityControlsQueryKey, dr as grantBankAccountAccessMutation, fr as grantExternalBankAccountAccessMutation, ii as hasAnyScope, Wr as invalidateAllClients, yi as isAllPagesResolving, li as isApiConflictError, ui as isApiForbiddenError, di as isApiNotFoundError, fi as isApiUnprocessableError, Lr as isOrganizationOnItsWay, gi as isScope, pr as linkExternalBankAccountMutation, R as listDepartments, mr as listDepartmentsOptions, hr as listDepartmentsQueryKey, z as listLocations, gr as listLocationsOptions, _r as listLocationsQueryKey, B as listRoles, vr as listRolesQueryKey, V as manageBankAccountAccess, H as manageDebitCardAccess, yr as manageDebitCardAccessMutation, ai as myEntityInvalidationKey, ti as optionalOrganizationHeaders, ni as organizationHeaders, br as patchApprovalPoliciesIdMutation, U as patchCounterpartsId, W as patchCounterpartsIdAddressesId, G as patchCounterpartsIdBankAccountsId, K as patchEntitiesIdSettings, xr as patchLedgerAccountsIdMutation, q as patchMeasureUnitsId, J as patchPayablesId, Y as patchProductsId, Sr as patchReceiptsIdMutation, X as patchReceivablesId, Z as patchRecurrencesId, Q as patchTransactionsId, ji as personDisclosure, Cr as postApprovalPoliciesMutation, $ as postApprovalRequestsIdApprove, ee as postApprovalRequestsIdReject, te as postBankDetails, ne as postCounterparts, re as postCounterpartsIdAddresses, ie as postCounterpartsIdBankAccounts, ae as postCounterpartsIdBankAccountsIdMakeDefault, oe as postFiles, wr as postLedgerAccountsMutation, se as postMeasureUnits, ce as postOverdueReminders, le as postPayables, ue as postPayablesIdApprovePaymentOperation, de as postPayablesIdAttachFile, fe as postPayablesIdCancel, pe as postPayablesIdDuplicatesIdConfirm, me as postPayablesIdDuplicatesIdDismiss, he as postPayablesIdMarkAsPaid, ge as postPayablesIdReject, _e as postPayablesIdReopen, ve as postPayablesIdSchedulePayment, ye as postPayablesIdSubmitForApproval, be as postPayablesIdValidate, xe as postPayablesUploadFromFile, Se as postPaymentIntentsIdCancel, Ce as postPaymentLinks, we as postPaymentRecords, Te as postPaymentReminders, Ee as postProducts, Tr as postReceiptsUploadFromFileMutation, De as postReceivables, Oe as postReceivablesIdAccept, ke as postReceivablesIdCancel, Ae as postReceivablesIdClone, je as postReceivablesIdDecline, Me as postReceivablesIdIssue, Ne as postReceivablesIdMarkAsPaid, Pe as postReceivablesIdMarkAsUncollectible, Fe as postReceivablesIdSend, Ie as postRecurrences, Le as postRecurrencesIdCancel, Re as postRecurrencesIdPause, ze as postRecurrencesIdResume, Be as postTransactionsIdApprove, Ve as postTransactionsIdReject, He as postTransactionsIdReopen, Ue as postTransactionsIdSubmit, We as putEntitiesIdLogo, Ge as putPayablesIdLineItems, Er as putTransactionsValidationsMutation, Gr as registerQueryClient, Kr as removeInactiveFromAllClients, qr as resetAllClients, Jr as setAllClientsQueriesData, Dr as setDebitCardLockStatusMutation, Or as submitApplicationMutation, kr as unlinkExternalBankAccountMutation, Yr as unregisterQueryClient, Ar as updateApplicationMutation, jr as updateBankAccountMutation, Mr as updateDebitCardMutation, Ke as updateDepartment, Nr as updateExternalBankAccountMutation, qe as updateLocation, Je as updateUser, Mi as useAcceptWidgetDisclosures, xi as useAllBankAccountsQuery, Si as useAllDebitCardsQuery, Ci as useAllExternalBankAccountsQuery, Ti as useAllLedgerAccountsQuery, wi as useAllMerchantCategoryGroupsQuery, Oi as useAllOrganizationRolesQuery, Ai as useAllOrganizationUsersQuery, bi as useAutoFetchNextPage, oi as useCurrentUserQuery, Ni as useDisclosuresQuery, ei as useEmbedApi, pi as useGetUserDataQuery, Ei as useLedgerAccountsQuery, ci as useMailboxAddress, si as useMyEntityQuery, Ii as useOrganizationApplicationStatus, Fi as useOrganizationOnboardingSuppression, Di as usePaymentTermsQuery, ki as useRolePermissionsQueries, mi as useUpsertUserDataMutation, Pr as validateExternalBankAccountMutation, Fr as verifyDebitCardMutation, Rr as withAuthEpoch, zr as withAuthEpochInfinite };
31
+ import { Scope as gi, isScope as _i } from "./lib/scopes.js";
32
+ import { getAllPagesNextPageParam as vi, getAllPagesNextPaginationTokenParam as yi, isAllPagesResolving as bi, useAutoFetchNextPage as xi } from "./lib/allPages.js";
33
+ import { useAllBankAccountsQuery as Si } from "./lib/bank-account/useAllBankAccountsQuery.js";
34
+ import { useAllDebitCardsQuery as Ci } from "./lib/debit-card/useAllDebitCardsQuery.js";
35
+ import { useAllExternalBankAccountsQuery as wi } from "./lib/external-bank-account/useAllExternalBankAccountsQuery.js";
36
+ import { useAllMerchantCategoryGroupsQuery as Ti } from "./lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
37
+ import { useAllLedgerAccountsQuery as Ei, useLedgerAccountsQuery as Di } from "./lib/reference-data/useLedgerAccountsQuery.js";
38
+ import { usePaymentTermsQuery as Oi } from "./lib/reference-data/usePaymentTermsQuery.js";
39
+ import { useAllOrganizationRolesQuery as ki } from "./lib/role/useAllOrganizationRolesQuery.js";
40
+ import { useRolePermissionsQueries as Ai } from "./lib/role/useRolePermissionsQueries.js";
41
+ import { useAllOrganizationUsersQuery as ji } from "./lib/user/useAllOrganizationUsersQuery.js";
42
+ import { personDisclosure as Mi } from "./lib/disclosures/personDisclosure.js";
43
+ import { useAcceptWidgetDisclosures as Ni } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
44
+ import { useDisclosuresQuery as Pi } from "./lib/disclosures/useDisclosuresQuery.js";
45
+ import { OnboardingSuppressionReason as Fi } from "./lib/onboardingSuppressionReason.js";
46
+ import { useOrganizationOnboardingSuppression as Ii } from "./lib/useOrganizationOnboardingSuppression.js";
47
+ import { useOrganizationApplicationStatus as Li } from "./lib/useOrganizationApplicationStatus.js";
48
+ export { ei as EmbedApiProvider, Fi as OnboardingSuppressionReason, Lr as OrganizationStatus, gi as Scope, Ye as activateCreditCardMutation, Xe as activateDebitCardMutation, Vr as applicationStatusInvalidationKey, Hr as applicationStatusQueryOptions, $r as attachTransportInterceptors, e as bulkUpdateDepartmentMembers, t as bulkUpdateLocationMembers, n as bulkUpdateRoleMembers, Wr as cancelAllClients, Zr as cloneEmbeddedClient, Ze as connectExternalBankAccountMutation, Qe as createAchMoneyMovementMutation, $e as createApplicationMutation, et as createBankAccountMutation, tt as createBookTransferMutation, nt as createCheckDepositMutation, Ur as createClientSecretInstaller, rt as createDebitCardMutation, r as createDepartment, Qr as createEmbeddedClient, i as createLocation, a as createUser, it as createVelocityControlMutation, o as deactivateDepartment, s as deactivateLocation, at as deleteApprovalPoliciesIdMutation, ot as deleteBankAccountApplicationMutation, c as deleteCounterpartsId, l as deleteCounterpartsIdBankAccountsId, u as deleteEntitiesIdLogo, d as deleteFilesId, st as deleteLedgerAccountsIdMutation, f as deleteMeasureUnitsId, p as deletePayablesId, m as deletePayablesIdFile, h as deleteProductsId, ct as deleteReceiptsIdMutation, g as deleteReceivablesId, lt as disableUserMutation, _ as downloadBankAccountTransactions, ii as fetchWidgetInit, vi as getAllPagesNextPageParam, yi as getAllPagesNextPaginationTokenParam, ut as getAnalyticsPayablesOptions, dt as getAnalyticsPayablesQueryKey, ft as getAnalyticsReceiptsOptions, pt as getAnalyticsReceiptsQueryKey, mt as getAnalyticsReceivablesOptions, ht as getAnalyticsReceivablesQueryKey, gt as getAnalyticsTransactionsOptions, _t as getAnalyticsTransactionsQueryKey, v as getApplicationStatus, y as getApprovalPolicies, vt as getApprovalPoliciesOptions, yt as getApprovalPoliciesQueryKey, b as getApprovalRequests, bt as getApprovalRequestsOptions, xt as getApprovalRequestsQueryKey, x as getBankAccountAccess, St as getBankAccountAccessQueryKey, Ct as getBankAccountApplicationOptions, wt as getBankAccountOptions, Tt as getBankAccountQueryKey, S as getBankAccountStatement, Et as getBankAccountStatementsOptions, Dt as getBankAccountTransactionsOptions, Ot as getBankAccountTransactionsQueryKey, kt as getBankAccountTransfersOptions, At as getBankAccountTransfersQueryKey, jt as getBankAccountsQueryKey, Mt as getBankDetailsIdOptions, Nt as getBankDetailsOptions, Pt as getBankDetailsQueryKey, C as getCounterparts, Ft as getCounterpartsIdAddressesOptions, It as getCounterpartsIdAddressesQueryKey, Lt as getCounterpartsIdBankAccountsOptions, Rt as getCounterpartsIdBankAccountsQueryKey, zt as getCounterpartsIdOptions, Bt as getCounterpartsIdQueryKey, Vt as getCounterpartsOptions, Ht as getCounterpartsQueryKey, Ut as getCreditCardByIdOptions, Wt as getCreditCardByIdQueryKey, Gt as getCreditCardsOptions, Kt as getCreditCardsQueryKey, qt as getDebitCardByIdOptions, Jt as getDebitCardByIdQueryKey, Yt as getDebitCardCredentialsOptions, Xt as getDebitCardsOptions, Zt as getDebitCardsQueryKey, w as getDepartment, Qt as getDepartmentOptions, $t as getDepartmentQueryKey, T as getDepositableBankAccounts, en as getDepositableBankAccountsOptions, tn as getDocumentsIdNextNumbersOptions, nn as getDocumentsIdNextNumbersQueryKey, rn as getEntitiesIdPaymentMethodsOptions, an as getEntitiesIdSettingsOptions, on as getEntitiesIdSettingsQueryKey, sn as getEntityUsersOptions, E as getExternalBankAccountAccess, cn as getExternalBankAccountAccessQueryKey, ln as getExternalBankAccountOptions, un as getExternalBankAccountsOptions, dn as getExternalBankAccountsQueryKey, fn as getFilesQueryKey, pn as getLedgerAccountsQueryKey, D as getLocation, mn as getLocationOptions, hn as getLocationQueryKey, gn as getMeOptions, _n as getMeasureUnitsOptions, vn as getMeasureUnitsQueryKey, yn as getOrganizationOptions, bn as getOverdueRemindersOptions, xn as getOverdueRemindersQueryKey, O as getPayables, k as getPayablesId, A as getPayablesIdHistory, Sn as getPayablesIdHistoryOptions, Cn as getPayablesIdHistoryQueryKey, j as getPayablesIdLineItems, wn as getPayablesIdLineItemsOptions, Tn as getPayablesIdLineItemsQueryKey, En as getPayablesIdOptions, Dn as getPayablesIdQueryKey, On as getPayablesIdSuggestionsOptions, kn as getPayablesOptions, An as getPayablesQueryKey, M as getPaymentRecords, jn as getPaymentRecordsOptions, Mn as getPaymentRecordsQueryKey, Nn as getPaymentRemindersOptions, Pn as getPaymentRemindersQueryKey, N as getProducts, Fn as getProductsIdOptions, In as getProductsIdQueryKey, Ln as getProductsOptions, Rn as getProductsQueryKey, P as getReceipts, zn as getReceiptsIdQueryKey, Bn as getReceiptsOptions, Vn as getReceiptsQueryKey, F as getReceivables, I as getReceivablesIdHistory, Hn as getReceivablesIdHistoryQueryKey, Un as getReceivablesIdMailsQueryKey, Wn as getReceivablesIdOptions, Gn as getReceivablesIdPdfLinkOptions, Kn as getReceivablesIdPdfLinkQueryKey, qn as getReceivablesIdQueryKey, Jn as getReceivablesOptions, Yn as getReceivablesQueryKey, Xn as getReceivablesRequiredFieldsOptions, Zn as getRecurrencesIdOptions, Qn as getRecurrencesIdQueryKey, $n as getRecurrencesQueryKey, er as getTransactionsIdExpenseHistoryOptions, tr as getTransactionsIdExpenseHistoryQueryKey, nr as getTransactionsIdOptions, rr as getTransactionsIdQueryKey, ir as getTransactionsOptions, ar as getTransactionsQueryKey, or as getTransactionsValidationsOptions, sr as getTransactionsValidationsQueryKey, L as getUsers, cr as getUsersOptions, lr as getUsersQueryKey, ur as getVelocityControlsQueryKey, dr as grantBankAccountAccessMutation, fr as grantExternalBankAccountAccessMutation, ai as hasAnyScope, Gr as invalidateAllClients, bi as isAllPagesResolving, ui as isApiConflictError, di as isApiForbiddenError, fi as isApiNotFoundError, pi as isApiUnprocessableError, Rr as isOrganizationOnItsWay, _i as isScope, pr as linkExternalBankAccountMutation, R as listDepartments, mr as listDepartmentsOptions, hr as listDepartmentsQueryKey, z as listLocations, gr as listLocationsOptions, _r as listLocationsQueryKey, B as listRoles, vr as listRolesQueryKey, V as manageBankAccountAccess, H as manageDebitCardAccess, yr as manageDebitCardAccessMutation, oi as myEntityInvalidationKey, ni as optionalOrganizationHeaders, ri as organizationHeaders, br as patchApprovalPoliciesIdMutation, U as patchCounterpartsId, W as patchCounterpartsIdAddressesId, G as patchCounterpartsIdBankAccountsId, K as patchEntitiesIdSettings, xr as patchLedgerAccountsIdMutation, q as patchMeasureUnitsId, J as patchPayablesId, Y as patchProductsId, Sr as patchReceiptsIdMutation, X as patchReceivablesId, Z as patchRecurrencesId, Q as patchTransactionsId, Mi as personDisclosure, Cr as postApprovalPoliciesMutation, $ as postApprovalRequestsIdApprove, ee as postApprovalRequestsIdReject, te as postBankDetails, ne as postCounterparts, re as postCounterpartsIdAddresses, ie as postCounterpartsIdBankAccounts, ae as postCounterpartsIdBankAccountsIdMakeDefault, oe as postFiles, wr as postLedgerAccountsMutation, se as postMeasureUnits, ce as postOverdueReminders, le as postPayables, ue as postPayablesIdApprovePaymentOperation, de as postPayablesIdAttachFile, fe as postPayablesIdCancel, pe as postPayablesIdDuplicatesIdConfirm, me as postPayablesIdDuplicatesIdDismiss, he as postPayablesIdMarkAsPaid, ge as postPayablesIdReject, _e as postPayablesIdReopen, ve as postPayablesIdSchedulePayment, ye as postPayablesIdSubmitForApproval, be as postPayablesIdValidate, xe as postPayablesUploadFromFile, Se as postPaymentIntentsIdCancel, Ce as postPaymentLinks, we as postPaymentRecords, Te as postPaymentReminders, Ee as postProducts, Tr as postReceiptsUploadFromFileMutation, De as postReceivables, Oe as postReceivablesIdAccept, ke as postReceivablesIdCancel, Ae as postReceivablesIdClone, je as postReceivablesIdDecline, Me as postReceivablesIdIssue, Ne as postReceivablesIdMarkAsPaid, Pe as postReceivablesIdMarkAsUncollectible, Fe as postReceivablesIdSend, Ie as postRecurrences, Le as postRecurrencesIdCancel, Re as postRecurrencesIdPause, ze as postRecurrencesIdResume, Be as postTransactionsIdApprove, Ve as postTransactionsIdReject, He as postTransactionsIdReopen, Ue as postTransactionsIdSubmit, We as putEntitiesIdLogo, Ge as putPayablesIdLineItems, Er as putTransactionsValidationsMutation, Kr as registerQueryClient, qr as removeInactiveFromAllClients, Jr as resetAllClients, Yr as setAllClientsQueriesData, Dr as setDebitCardLockStatusMutation, Or as submitApplicationMutation, kr as unlinkExternalBankAccountMutation, Xr as unregisterQueryClient, Ar as updateApplicationMutation, jr as updateBankAccountMutation, Mr as updateDebitCardMutation, Ke as updateDepartment, Nr as updateExternalBankAccountMutation, qe as updateLocation, Je as updateUser, Ni as useAcceptWidgetDisclosures, Si as useAllBankAccountsQuery, Ci as useAllDebitCardsQuery, wi as useAllExternalBankAccountsQuery, Ei as useAllLedgerAccountsQuery, Ti as useAllMerchantCategoryGroupsQuery, ki as useAllOrganizationRolesQuery, ji as useAllOrganizationUsersQuery, xi as useAutoFetchNextPage, si as useCurrentUserQuery, Pi as useDisclosuresQuery, ti as useEmbedApi, mi as useGetUserDataQuery, Di as useLedgerAccountsQuery, li as useMailboxAddress, ci as useMyEntityQuery, Li as useOrganizationApplicationStatus, Ii as useOrganizationOnboardingSuppression, Oi as usePaymentTermsQuery, Ai as useRolePermissionsQueries, hi as useUpsertUserDataMutation, Pr as validateExternalBankAccountMutation, Fr as verifyDebitCardMutation, Ir as widgetTokenCacheId, zr as withAuthEpoch, Br as withAuthEpochInfinite };
@@ -1,22 +1,22 @@
1
1
  import { getApplicationStatusOptions as e } from "./rest/@tanstack/react-query.gen.js";
2
- import { OrganizationStatus as t } from "./organizationStatus.js";
3
- import { withAuthEpoch as n } from "./withAuthEpoch.js";
4
- import { widgetTokenCacheId as r } from "./widgetTokenCacheId.js";
2
+ import { widgetTokenCacheId as t } from "./widgetTokenCacheId.js";
3
+ import { OrganizationStatus as n } from "./organizationStatus.js";
4
+ import { withAuthEpoch as r } from "./withAuthEpoch.js";
5
5
  //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js
6
6
  var i = 1e4;
7
7
  function a({ client: t }) {
8
8
  return e({ client: t }).queryKey;
9
9
  }
10
10
  function o({ client: a, widgetToken: o, authEpoch: s }) {
11
- let { queryFn: c, queryKey: l } = e({ client: a }), { placeholderData: u } = n({ queryKey: l }, {
11
+ let { queryFn: c, queryKey: l } = e({ client: a }), { placeholderData: u } = r({ queryKey: l }, {
12
12
  authEpoch: s,
13
- organizationStatus: t.Known
13
+ organizationStatus: n.Known
14
14
  });
15
15
  return {
16
16
  queryKey: [
17
17
  l[0],
18
18
  { authEpoch: s },
19
- { widgetTokenId: r(o) }
19
+ { widgetTokenId: t(o) }
20
20
  ],
21
21
  queryFn: c,
22
22
  placeholderData: u,
@@ -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.294", n = "f6d82ddbcfdfe0dcf1e2b99ca0c84db60c3da088", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.295", n = "39bfa1177515d639e75bfc53d233e90bc22c66c6", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -1,53 +1,67 @@
1
- import { EmbeddedAnalyticsEvent as e, MUTATION_METHODS as t } from "./events.js";
2
- import { captureExceptionWithContext as n, trackWithContext as r } from "./runtime.js";
3
- import { isExpectedApiNotFound as i } from "./expectedApiNotFound.js";
4
- import { extractTraceIdFromHeaders as a, resolveTraceId as o } from "./traceId.js";
1
+ import { widgetTokenCacheId as e } from "../../../../data-access/dist/lib/widgetTokenCacheId.js";
2
+ import "../../../../data-access/dist/index.js";
3
+ import { EmbeddedAnalyticsEvent as t, MUTATION_METHODS as n } from "./events.js";
4
+ import { captureExceptionWithContext as r, trackWithContext as i } from "./runtime.js";
5
+ import { isExpectedApiNotFound as a } from "./expectedApiNotFound.js";
6
+ import { extractTraceIdFromHeaders as o, resolveTraceId as s } from "./traceId.js";
5
7
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js
6
- function s(s, f) {
7
- let p = /* @__PURE__ */ new WeakMap();
8
- return s.interceptors.request.use((e) => (p.set(e, u()), e)), s.interceptors.response.use((n, i, o) => {
9
- if (!n.ok || !t.has(i.method.toUpperCase())) return n;
10
- let s = a(n);
11
- return r(e.ApiRequestCompleted, {
12
- method: i.method,
13
- route: o.url,
14
- status: n.status,
15
- duration_ms: d(p.get(i)),
8
+ function c(c, m) {
9
+ let h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new Set();
10
+ return c.interceptors.request.use((e) => (h.set(e, f()), e)), c.interceptors.response.use((e, r, a) => {
11
+ if (!e.ok || !n.has(r.method.toUpperCase())) return e;
12
+ let s = o(e);
13
+ return i(t.ApiRequestCompleted, {
14
+ method: r.method,
15
+ route: a.url,
16
+ status: e.status,
17
+ duration_ms: p(h.get(r)),
16
18
  ...s ? { trace_id: s } : {}
17
- }, f.current), n;
18
- }), s.interceptors.error.use((t, a, s, u) => {
19
- if (l(t, s)) return t;
20
- let m = o(a, t);
21
- return r(e.ApiRequestFailed, {
22
- method: s?.method ?? u.method,
23
- route: u.url,
24
- status: a?.status,
25
- duration_ms: s ? d(p.get(s)) : void 0,
26
- error_kind: a ? "http" : "network",
27
- error_name: t instanceof Error ? t.name : "unknown",
28
- ...m ? { trace_id: m } : {}
29
- }, f.current), i(a?.status, s?.method ?? u.method, u.url) || n(c(a, u.url), {
30
- method: s?.method ?? u.method,
31
- route: u.url,
32
- status: a?.status,
33
- error_kind: a ? "http" : "network",
34
- error_name: t instanceof Error ? t.name : "unknown",
35
- ...m ? { trace_id: m } : {}
36
- }, f.current), t;
37
- }), s;
19
+ }, m.current), e;
20
+ }), c.interceptors.error.use((n, o, c, f) => {
21
+ if (d(n, c)) return n;
22
+ let _ = s(o, n);
23
+ if (i(t.ApiRequestFailed, {
24
+ method: c?.method ?? f.method,
25
+ route: f.url,
26
+ status: o?.status,
27
+ duration_ms: c ? p(h.get(c)) : void 0,
28
+ error_kind: o ? "http" : "network",
29
+ error_name: n instanceof Error ? n.name : "unknown",
30
+ ..._ ? { trace_id: _ } : {}
31
+ }, m.current), a(o?.status, c?.method ?? f.method, f.url)) return n;
32
+ if (o?.status === 401) {
33
+ let t = e(u(c));
34
+ if (g.has(t)) return n;
35
+ g.add(t);
36
+ }
37
+ return r(l(o, f.url), {
38
+ method: c?.method ?? f.method,
39
+ route: f.url,
40
+ status: o?.status,
41
+ error_kind: o ? "http" : "network",
42
+ error_name: n instanceof Error ? n.name : "unknown",
43
+ ..._ ? { trace_id: _ } : {}
44
+ }, m.current), n;
45
+ }), c;
38
46
  }
39
- function c(e, t) {
47
+ function l(e, t) {
40
48
  let n = /* @__PURE__ */ Error(`API request failed (${e?.status ?? "network"}): ${t ?? "unknown route"}`);
41
49
  return n.name = "ApiRequestError", n;
42
50
  }
43
- function l(e, t) {
51
+ function u(e) {
52
+ let t = e?.headers.get("X-Widget-Token");
53
+ if (t) return t;
54
+ let n = e?.headers.get("Authorization");
55
+ return n?.startsWith("Bearer ") ? n.slice(7) : void 0;
56
+ }
57
+ function d(e, t) {
44
58
  return t?.signal.aborted ? !0 : e instanceof Error && e.name === "AbortError";
45
59
  }
46
- function u() {
60
+ function f() {
47
61
  return typeof performance < "u" ? performance.now() : Date.now();
48
62
  }
49
- function d(e) {
50
- return e === void 0 ? void 0 : Math.round(u() - e);
63
+ function p(e) {
64
+ return e === void 0 ? void 0 : Math.round(f() - e);
51
65
  }
52
66
  //#endregion
53
- export { s as attachAnalyticsInterceptors };
67
+ export { c as attachAnalyticsInterceptors };
@@ -1,70 +1,91 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/util/dist/lib/widgetTokenManager.js
2
2
  function e(e) {
3
- let { fetcher: t } = e, n = e.leadSeconds ?? 60, r = { status: "loading" }, i = /* @__PURE__ */ new Set(), a = 0, o = 0, s = 0, c = !1, l, u, d, f = () => {
3
+ let { fetcher: t } = e, n = e.leadSeconds ?? 60, r = { status: "loading" }, i = /* @__PURE__ */ new Set(), a = 0, o = 0, s = 0, c = !1, l = !1, u = !1, d, f, p, m = () => {
4
4
  i.forEach((e) => e());
5
- }, p = (e) => {
6
- r = e, f();
7
- }, m = () => {
8
- l !== void 0 && (clearTimeout(l), l = void 0), u !== void 0 && (clearTimeout(u), u = void 0), d !== void 0 && (clearTimeout(d), d = void 0);
9
5
  }, h = (e) => {
6
+ r = e, m();
7
+ }, g = () => {
8
+ d !== void 0 && (clearTimeout(d), d = void 0), f !== void 0 && (clearTimeout(f), f = void 0), p !== void 0 && (clearTimeout(p), p = void 0);
9
+ }, _ = (e) => {
10
10
  let t = Math.max(0, e * 1e3 - Date.now() - n * 1e3);
11
- l = setTimeout(() => {
12
- l = void 0, _({ manual: !1 });
11
+ d = setTimeout(() => {
12
+ d = void 0, b({ manual: !1 });
13
13
  }, t);
14
- }, g = (e) => {
14
+ }, v = (e) => {
15
15
  let t = Math.max(0, e * 1e3 - Date.now());
16
- d = setTimeout(() => {
17
- d = void 0, r.status === "ready" && r.lastError !== void 0 && p({
16
+ p = setTimeout(() => {
17
+ p = void 0, r.status === "ready" && r.lastError !== void 0 && h({
18
18
  status: "error",
19
19
  error: r.lastError
20
20
  });
21
21
  }, t);
22
- }, _ = async ({ manual: e }) => {
23
- m();
24
- let n = a, i = ++o, c = r;
25
- c.status === "ready" && p({
22
+ }, y = async ({ manual: e, gen: n, myId: i }) => {
23
+ g();
24
+ let c = r;
25
+ c.status === "ready" && h({
26
26
  ...c,
27
27
  isRefreshing: !0
28
28
  });
29
- let l, d, f = !1;
29
+ let l, u, d = !1;
30
30
  try {
31
31
  l = await t();
32
32
  } catch (e) {
33
- f = !0, d = e;
33
+ d = !0, u = e;
34
34
  }
35
35
  if (n !== a || i !== o) return;
36
- if (!f && l !== void 0 && l.exp !== void 0 && l.exp * 1e3 <= Date.now() && (f = !0, d = /* @__PURE__ */ Error("Fetched widget token is already expired")), !f && l !== void 0) {
37
- p({
36
+ if (!d && l !== void 0 && l.exp !== void 0 && l.exp * 1e3 <= Date.now() && (d = !0, u = /* @__PURE__ */ Error("Fetched widget token is already expired")), !d && l !== void 0) {
37
+ h({
38
38
  status: "ready",
39
39
  widgetToken: l.widgetToken,
40
40
  exp: l.exp,
41
41
  isRefreshing: !1
42
- }), s = 0, l.exp !== void 0 && h(l.exp);
42
+ }), s = 0, l.exp !== void 0 && _(l.exp);
43
43
  return;
44
44
  }
45
- c.status === "ready" && (c.exp === void 0 || c.exp * 1e3 > Date.now()) ? (p({
45
+ c.status === "ready" && (c.exp === void 0 || c.exp * 1e3 > Date.now()) ? (h({
46
46
  status: "ready",
47
47
  widgetToken: c.widgetToken,
48
48
  exp: c.exp,
49
49
  isRefreshing: !1,
50
- lastError: d
51
- }), c.exp !== void 0 && g(c.exp)) : p({
50
+ lastError: u
51
+ }), c.exp !== void 0 && v(c.exp)) : h({
52
52
  status: "error",
53
- error: d
53
+ error: u
54
54
  });
55
- let v = Math.max(50, Math.random() * Math.min(3e4, 1e3 * 2 ** s));
56
- s++, u = setTimeout(() => {
57
- u = void 0, _({ manual: !1 });
58
- }, v);
55
+ let p = Math.max(50, Math.random() * Math.min(3e4, 1e3 * 2 ** s));
56
+ s++, f = setTimeout(() => {
57
+ f = void 0, b({ manual: !1 });
58
+ }, p);
59
+ }, b = ({ manual: e }) => {
60
+ let t = a, n = ++o;
61
+ return u = !0, y({
62
+ manual: e,
63
+ gen: t,
64
+ myId: n
65
+ }).finally(() => {
66
+ n === o && (u = !1);
67
+ });
68
+ }, x = (e) => {
69
+ if ((e.type !== "visibilitychange" || document.visibilityState === "visible") && c && !u && r.status !== "loading") {
70
+ if (r.status === "error") {
71
+ b({ manual: !1 });
72
+ return;
73
+ }
74
+ !r.isRefreshing && r.exp !== void 0 && r.exp * 1e3 - Date.now() < n * 1e3 && b({ manual: !1 });
75
+ }
76
+ }, S = () => {
77
+ l || typeof window > "u" || typeof document > "u" || (l = !0, document.addEventListener("visibilitychange", x), window.addEventListener("focus", x), window.addEventListener("online", x));
78
+ }, C = () => {
79
+ l && (l = !1, document.removeEventListener("visibilitychange", x), window.removeEventListener("focus", x), window.removeEventListener("online", x));
59
80
  };
60
81
  return {
61
82
  start: () => {
62
- c || (c = !0, _({ manual: !1 }));
83
+ c || (c = !0, S(), b({ manual: !1 }));
63
84
  },
64
85
  stop: () => {
65
- c = !1, a++, m();
86
+ c = !1, a++, g(), C();
66
87
  },
67
- refresh: () => (c = !0, _({ manual: !0 })),
88
+ refresh: () => (c = !0, S(), b({ manual: !0 })),
68
89
  getState: () => r,
69
90
  subscribe: (e) => (i.add(e), () => {
70
91
  i.delete(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.294",
3
+ "version": "0.5.295",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [