@tesouro/embedded-components-react 0.3.31 → 0.3.33
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.
- package/README.md +11 -10
- package/dist/index.d.ts +38 -0
- package/dist/index.js +2 -2
- package/dist/lib/CardsWidget.d.ts +36 -0
- package/dist/lib/CreateCardWidget.d.ts +38 -0
- package/dist/lib/CreateCardWidget.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +38 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +83 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +47 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index3.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index5.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index6.js +19 -12
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index7.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js +35 -30
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js +52 -10
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index6.js +12 -31
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +25 -248
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js +389 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControlRow.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControls.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/MerchantCategoriesControl.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +19 -18
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +53 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +224 -206
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +174 -146
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
+
import { useAllBankAccountsQuery as n } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
8
|
+
import { useAllMerchantCategoryGroupsQuery as r } from "../../../shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
|
|
9
|
+
import { useAllOrganizationUsersQuery as i } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
10
|
+
import "../../../shared/data-access/dist/index.js";
|
|
11
|
+
import { EmbeddedToaster as a } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
12
|
+
import "../../../shared/ui/dist/index.js";
|
|
13
|
+
import { useAnalyticsTrack as o } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
14
|
+
import { WidgetProvider as s } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
15
|
+
import { getStateOptions as ee } from "../../../shared/util/dist/lib/usStates.js";
|
|
16
|
+
import { useWidgetConfig as te } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
17
|
+
import "../../../shared/feature/dist/index.js";
|
|
18
|
+
import { CREATE_CARD_WIDGET_LABELS_EN as c } from "../../ui/dist/lib/CreateCardWidget/labels.js";
|
|
19
|
+
import { CreateCardView as l, MailingOptionValue as u } from "../../ui/dist/lib/CreateCardWidget/types.js";
|
|
20
|
+
import { CreateCardWidget as ne } from "../../ui/dist/lib/CreateCardWidget/CreateCardWidget.js";
|
|
21
|
+
import "../../ui/dist/index.js";
|
|
22
|
+
import { CardFormatValue as d, buildCreateDebitCardRequest as re, createDebitCardReference as ie, formatBusinessAddress as ae, isBusinessAddressComplete as oe, isManualAddressComplete as se } from "./index3.js";
|
|
23
|
+
import { resolveCreateCardFeatureLabels as ce } from "./index5.js";
|
|
24
|
+
import { CreateCardWidgetAnalyticsEvent as le, WIDGET_NAME as ue } from "./index2.js";
|
|
25
|
+
import { SpendLimitPeriodValue as f, buildPerTransactionMaximumVelocityControlRequest as de, buildSpendLimitVelocityControlRequest as fe, parseControlAmountToMinorUnits as pe } from "./index4.js";
|
|
26
|
+
import { getCreateCardPermissions as me } from "./index6.js";
|
|
27
|
+
import { useCreateCardCardholderOptions as he } from "./index7.js";
|
|
28
|
+
import { useCreateCard as ge } from "../../data-access/dist/index2.js";
|
|
29
|
+
import { useCreateDebitCardMutation as _e } from "../../data-access/dist/index4.js";
|
|
30
|
+
import { useCreateVelocityControlMutation as ve } from "../../data-access/dist/index5.js";
|
|
31
|
+
import { useManageDebitCardAccessMutation as ye } from "../../data-access/dist/index6.js";
|
|
32
|
+
import { useCreateCardOrganizationQuery as be } from "../../data-access/dist/index7.js";
|
|
33
|
+
import "../../data-access/dist/index.js";
|
|
34
|
+
import { useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
35
|
+
import { Fragment as xe, jsx as _, jsxs as Se } from "react/jsx-runtime";
|
|
36
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js
|
|
37
|
+
var Ce = t.DebitCardIssueOrg, we = {
|
|
38
|
+
street: "",
|
|
39
|
+
city: "",
|
|
40
|
+
state: "",
|
|
41
|
+
zip: ""
|
|
42
|
+
}, Te = 3e3, v = 5e3;
|
|
43
|
+
function Ee(e, t) {
|
|
44
|
+
if (e === "PENDING_ACTIVATION") return {
|
|
45
|
+
title: t.success.pendingActivationTitle,
|
|
46
|
+
description: t.success.pendingActivationDescription
|
|
47
|
+
};
|
|
48
|
+
if (e !== null && e !== "ACTIVE") return {
|
|
49
|
+
title: t.success.createdTitle,
|
|
50
|
+
description: t.success.createdDescription
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function De(e) {
|
|
54
|
+
let t = e?.trim().slice(-4);
|
|
55
|
+
return t ? `••••${t}` : void 0;
|
|
56
|
+
}
|
|
57
|
+
function Oe(e, t) {
|
|
58
|
+
let n = e.nickname?.trim(), r = De(e.accountNumber);
|
|
59
|
+
return n && r ? `${n} (${r})` : n || r || t;
|
|
60
|
+
}
|
|
61
|
+
function y({ cardArtSrc: t, labels: s, featureLabels: ue, className: De, onClose: y, onCancel: ke, onViewCard: Ae }) {
|
|
62
|
+
let je = o(), { isReady: b } = ge(), { initResponse: Me, organizationId: x } = te(), S = m(() => me(Me?.scopes), [Me?.scopes]), C = ce(ue), w = {
|
|
63
|
+
...c,
|
|
64
|
+
...s,
|
|
65
|
+
setup: {
|
|
66
|
+
...c.setup,
|
|
67
|
+
...s?.setup
|
|
68
|
+
}
|
|
69
|
+
}, Ne = m(() => [{
|
|
70
|
+
value: d.Virtual,
|
|
71
|
+
label: w.setup.cardFormatVirtual
|
|
72
|
+
}, {
|
|
73
|
+
value: d.Physical,
|
|
74
|
+
label: w.setup.cardFormatPhysical
|
|
75
|
+
}], [w.setup.cardFormatPhysical, w.setup.cardFormatVirtual]), Pe = m(() => ee(), []), [Fe, T] = g(l.Setup), [E, Ie] = g(null), [D, Le] = g(null), [Re, ze] = g(null), [O, k] = g(null), [A, Be] = g(we), [Ve, He] = g(null), [Ue, We] = g(null), [j, M] = g(!1), [N, P] = g(""), [F, I] = g(null), [L, R] = g(!1), [z, B] = g(""), [V, H] = g(!1), [U, W] = g([]), Ge = () => {
|
|
76
|
+
Ie(null), Le(null), ze(null), k(null), Be(we), He(null), We(null), M(!1), P(""), I(null), R(!1), B(""), H(!1), W([]), T(l.Setup);
|
|
77
|
+
}, Ke = h(x);
|
|
78
|
+
x && x !== Ke.current && (Ke.current = x, Ge());
|
|
79
|
+
let G = h(!0);
|
|
80
|
+
p(() => (G.current = !0, () => {
|
|
81
|
+
G.current = !1;
|
|
82
|
+
}), []), p(() => {
|
|
83
|
+
je(le.Mounted);
|
|
84
|
+
}, [je]);
|
|
85
|
+
let { options: qe, isError: K, refetch: Je } = he({ enabled: b && S.canReadUsers }), q = i({
|
|
86
|
+
enabled: b && S.canReadUsers,
|
|
87
|
+
permissions: [Ce]
|
|
88
|
+
}), Ye = m(() => !b || !S.canReadUsers || q.isResolving || q.isError ? [] : (q.data?.data ?? []).filter((e) => e.organizationId === x).map((e) => e.id), [
|
|
89
|
+
q.data?.data,
|
|
90
|
+
q.isError,
|
|
91
|
+
q.isResolving,
|
|
92
|
+
b,
|
|
93
|
+
x,
|
|
94
|
+
S.canReadUsers
|
|
95
|
+
]), J = !!q.isError && b && S.canReadUsers, Xe = b && S.canReadUsers && q.isResolving, Y = h(null);
|
|
96
|
+
p(() => {
|
|
97
|
+
if (!J) {
|
|
98
|
+
Y.current !== null && (e.dismiss(Y.current), Y.current = null);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
return Y.current = e.error(C.toast.debitCardIssuersError, {
|
|
102
|
+
duration: Infinity,
|
|
103
|
+
action: {
|
|
104
|
+
label: C.toast.retry,
|
|
105
|
+
onClick: () => {
|
|
106
|
+
q.refetch();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}), () => {
|
|
110
|
+
Y.current !== null && (e.dismiss(Y.current), Y.current = null);
|
|
111
|
+
};
|
|
112
|
+
}, [
|
|
113
|
+
q.refetch,
|
|
114
|
+
C.toast.debitCardIssuersError,
|
|
115
|
+
C.toast.retry,
|
|
116
|
+
J
|
|
117
|
+
]);
|
|
118
|
+
let Ze = be({ enabled: b && S.canReadOrganization }), X = n({ enabled: b && S.canReadFundingAccounts }), Qe = r({ enabled: b && S.canReadMerchantCategoryGroups }), $e = _e(), et = ve(), tt = ye(), Z = !!X.isError && b && S.canReadFundingAccounts, Q = m(() => Z ? [] : (X.data?.data ?? []).map((e) => ({
|
|
119
|
+
value: e.id,
|
|
120
|
+
label: Oe(e, C.untitledFundingAccount)
|
|
121
|
+
})), [
|
|
122
|
+
X.data?.data,
|
|
123
|
+
C.untitledFundingAccount,
|
|
124
|
+
Z
|
|
125
|
+
]), nt = m(() => (Qe.data?.data ?? []).map((e) => ({
|
|
126
|
+
value: e.id,
|
|
127
|
+
label: e.name
|
|
128
|
+
})), [Qe.data?.data]), rt = Re ?? (Q.length === 1 ? Q[0].value : null), it = Ze.data?.address, at = ae(it), ot = oe(it), $ = D === d.Physical, st = $ && O === u.BusinessAddress && !!at, ct = $ && O === u.DifferentAddress, lt = Z || Q.length > 0, ut = b && S.canWriteAuthorizationControls, dt = m(() => [
|
|
129
|
+
{
|
|
130
|
+
value: f.OneTime,
|
|
131
|
+
label: C.spendLimit.periodOneTime
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: f.Daily,
|
|
135
|
+
label: C.spendLimit.periodDaily
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
value: f.Monthly,
|
|
139
|
+
label: C.spendLimit.periodMonthly
|
|
140
|
+
}
|
|
141
|
+
], [
|
|
142
|
+
C.spendLimit.periodDaily,
|
|
143
|
+
C.spendLimit.periodMonthly,
|
|
144
|
+
C.spendLimit.periodOneTime
|
|
145
|
+
]), ft = m(() => [
|
|
146
|
+
{
|
|
147
|
+
value: f.OneTime,
|
|
148
|
+
variant: "warning",
|
|
149
|
+
title: C.spendLimit.oneTimeWarningTitle,
|
|
150
|
+
description: C.spendLimit.oneTimeWarningDescription
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
value: f.Daily,
|
|
154
|
+
variant: "info",
|
|
155
|
+
description: C.spendLimit.dailyResetNotice
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
value: f.Monthly,
|
|
159
|
+
variant: "info",
|
|
160
|
+
description: C.spendLimit.monthlyResetNotice
|
|
161
|
+
}
|
|
162
|
+
], [
|
|
163
|
+
C.spendLimit.dailyResetNotice,
|
|
164
|
+
C.spendLimit.monthlyResetNotice,
|
|
165
|
+
C.spendLimit.oneTimeWarningDescription,
|
|
166
|
+
C.spendLimit.oneTimeWarningTitle
|
|
167
|
+
]), pt = j && (pe(N) === null || F === null), mt = L && pe(z) === null, ht = V && U.length === 0, gt = nt.length === 0 && !V;
|
|
168
|
+
ut || (j && M(!1), N !== "" && P(""), F !== null && I(null), L && R(!1), z !== "" && B(""), V && H(!1), U.length > 0 && W([]));
|
|
169
|
+
let _t = m(() => ({
|
|
170
|
+
isSpendLimitEnabled: j,
|
|
171
|
+
onSpendLimitEnabledChange: (e) => {
|
|
172
|
+
M(e), e && I((e) => e ?? f.Monthly);
|
|
173
|
+
},
|
|
174
|
+
spendLimitAmount: N,
|
|
175
|
+
onSpendLimitAmountChange: P,
|
|
176
|
+
spendLimitPeriodOptions: dt,
|
|
177
|
+
selectedSpendLimitPeriod: F,
|
|
178
|
+
onSpendLimitPeriodSelect: I,
|
|
179
|
+
spendLimitPeriodNotices: ft,
|
|
180
|
+
isMerchantCategoriesEnabled: V,
|
|
181
|
+
onMerchantCategoriesEnabledChange: H,
|
|
182
|
+
merchantCategoryOptions: nt,
|
|
183
|
+
selectedMerchantCategories: U,
|
|
184
|
+
onMerchantCategoryToggle: (e) => {
|
|
185
|
+
W((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
186
|
+
},
|
|
187
|
+
isMerchantCategoriesToggleDisabled: gt,
|
|
188
|
+
isPerTransactionMaximumEnabled: L,
|
|
189
|
+
onPerTransactionMaximumEnabledChange: R,
|
|
190
|
+
perTransactionMaximumAmount: z,
|
|
191
|
+
onPerTransactionMaximumAmountChange: B
|
|
192
|
+
}), [
|
|
193
|
+
V,
|
|
194
|
+
gt,
|
|
195
|
+
L,
|
|
196
|
+
j,
|
|
197
|
+
nt,
|
|
198
|
+
z,
|
|
199
|
+
U,
|
|
200
|
+
F,
|
|
201
|
+
N,
|
|
202
|
+
ft,
|
|
203
|
+
dt
|
|
204
|
+
]), vt = !b || !S.canIssue || $e.isPending || et.isPending || tt.isPending || K || Z || J || Xe || !E || !D || !rt || pt || mt || ht || D === d.Physical && (!O || O === u.BusinessAddress && !ot || O === u.DifferentAddress && !se(A)), yt = m(() => {
|
|
205
|
+
let e = Ee(Ue, C);
|
|
206
|
+
return {
|
|
207
|
+
...s,
|
|
208
|
+
success: {
|
|
209
|
+
...s?.success,
|
|
210
|
+
...e
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
}, [
|
|
214
|
+
Ue,
|
|
215
|
+
C,
|
|
216
|
+
s
|
|
217
|
+
]), bt = async () => {
|
|
218
|
+
if (!b) return;
|
|
219
|
+
let t = ie(), n = re({
|
|
220
|
+
cardholderUserId: E,
|
|
221
|
+
format: D,
|
|
222
|
+
bankAccountId: rt,
|
|
223
|
+
reference: t,
|
|
224
|
+
mailingOption: O,
|
|
225
|
+
orgAddress: it,
|
|
226
|
+
manualAddress: A
|
|
227
|
+
});
|
|
228
|
+
if (!n) return;
|
|
229
|
+
T(l.Preparing);
|
|
230
|
+
let r = e.loading(C.toast.creating);
|
|
231
|
+
try {
|
|
232
|
+
let t = await $e.mutateAsync({ body: n });
|
|
233
|
+
if (!G.current) {
|
|
234
|
+
e.dismiss(r);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
He(t.id), We(t.cardStatus);
|
|
238
|
+
let i = [];
|
|
239
|
+
if (j) {
|
|
240
|
+
let e = fe({
|
|
241
|
+
cardId: t.id,
|
|
242
|
+
amount: N,
|
|
243
|
+
period: F,
|
|
244
|
+
id: crypto.randomUUID(),
|
|
245
|
+
name: C.velocityControlNames.spendLimit
|
|
246
|
+
});
|
|
247
|
+
e && i.push(e);
|
|
248
|
+
}
|
|
249
|
+
if (L) {
|
|
250
|
+
let e = de({
|
|
251
|
+
cardId: t.id,
|
|
252
|
+
amount: z,
|
|
253
|
+
id: crypto.randomUUID(),
|
|
254
|
+
name: C.velocityControlNames.perTransactionMaximum
|
|
255
|
+
});
|
|
256
|
+
e && i.push(e);
|
|
257
|
+
}
|
|
258
|
+
let a = !1;
|
|
259
|
+
if (i.length > 0) try {
|
|
260
|
+
await Promise.all(i.map((e) => et.mutateAsync({ body: e })));
|
|
261
|
+
} catch {
|
|
262
|
+
a = !0;
|
|
263
|
+
}
|
|
264
|
+
if (!G.current) {
|
|
265
|
+
e.dismiss(r);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
let o = !1;
|
|
269
|
+
if (Ye.length > 0) try {
|
|
270
|
+
await tt.mutateAsync({ body: {
|
|
271
|
+
debitCardIds: [t.id],
|
|
272
|
+
type: "GRANT",
|
|
273
|
+
userIds: Ye
|
|
274
|
+
} });
|
|
275
|
+
} catch {
|
|
276
|
+
o = !0;
|
|
277
|
+
}
|
|
278
|
+
if (!G.current) {
|
|
279
|
+
e.dismiss(r);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (T(l.Success), a && o) {
|
|
283
|
+
e.warning(C.toast.controlsAndAccessWarning, {
|
|
284
|
+
id: r,
|
|
285
|
+
duration: v
|
|
286
|
+
});
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (a) {
|
|
290
|
+
e.warning(C.toast.controlsWarning, {
|
|
291
|
+
id: r,
|
|
292
|
+
duration: v
|
|
293
|
+
});
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (o) {
|
|
297
|
+
e.warning(C.toast.companyAdminAccessWarning, {
|
|
298
|
+
id: r,
|
|
299
|
+
duration: v
|
|
300
|
+
});
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
e.success(C.toast.success, {
|
|
304
|
+
id: r,
|
|
305
|
+
duration: Te
|
|
306
|
+
});
|
|
307
|
+
} catch {
|
|
308
|
+
if (!G.current) {
|
|
309
|
+
e.dismiss(r);
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
T(l.Setup), e.error(C.toast.error, {
|
|
313
|
+
id: r,
|
|
314
|
+
duration: v
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
return /* @__PURE__ */ Se(xe, { children: [/* @__PURE__ */ _(a, {}), /* @__PURE__ */ _(ne, {
|
|
319
|
+
view: Fe,
|
|
320
|
+
cardArtSrc: t,
|
|
321
|
+
labels: yt,
|
|
322
|
+
className: De,
|
|
323
|
+
cardholderOptions: qe,
|
|
324
|
+
selectedCardholder: E,
|
|
325
|
+
onCardholderSelect: Ie,
|
|
326
|
+
isCardholderError: K,
|
|
327
|
+
onCardholderRetry: K ? Je : void 0,
|
|
328
|
+
cardFormatOptions: Ne,
|
|
329
|
+
selectedCardFormat: D,
|
|
330
|
+
onCardFormatSelect: (e) => {
|
|
331
|
+
Le(e), k(null);
|
|
332
|
+
},
|
|
333
|
+
isFundingAccountVisible: lt,
|
|
334
|
+
fundingAccountOptions: Q,
|
|
335
|
+
selectedFundingAccount: rt,
|
|
336
|
+
onFundingAccountSelect: ze,
|
|
337
|
+
isFundingAccountError: Z,
|
|
338
|
+
onFundingAccountRetry: Z ? () => {
|
|
339
|
+
X.refetch();
|
|
340
|
+
} : void 0,
|
|
341
|
+
isMailingSectionVisible: $,
|
|
342
|
+
selectedMailingOption: O,
|
|
343
|
+
onMailingOptionSelect: k,
|
|
344
|
+
businessAddress: at,
|
|
345
|
+
isBusinessAddressVisible: st,
|
|
346
|
+
isManualAddressVisible: ct,
|
|
347
|
+
manualAddress: A,
|
|
348
|
+
onManualAddressChange: (e) => Be((t) => ({
|
|
349
|
+
...t,
|
|
350
|
+
...e
|
|
351
|
+
})),
|
|
352
|
+
stateOptions: Pe,
|
|
353
|
+
isCardControlsSectionVisible: ut,
|
|
354
|
+
cardControls: _t,
|
|
355
|
+
isCreateDisabled: vt,
|
|
356
|
+
onCreateClick: () => {
|
|
357
|
+
bt();
|
|
358
|
+
},
|
|
359
|
+
onCancelClick: () => {
|
|
360
|
+
ke?.(), y?.();
|
|
361
|
+
},
|
|
362
|
+
onClose: y,
|
|
363
|
+
onCreateAnotherClick: Ge,
|
|
364
|
+
onViewCardClick: Ae && Ve ? () => {
|
|
365
|
+
Ae(Ve);
|
|
366
|
+
} : void 0
|
|
367
|
+
})] });
|
|
368
|
+
}
|
|
369
|
+
function ke({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: ee, errorFallback: te, onError: c, analytics: l, disclosuresAcceptance: u, providerLabels: ne, ...d }) {
|
|
370
|
+
return /* @__PURE__ */ _(s, {
|
|
371
|
+
widgetName: ue,
|
|
372
|
+
baseUrl: e,
|
|
373
|
+
widgetToken: t,
|
|
374
|
+
organizationId: n,
|
|
375
|
+
configClient: r,
|
|
376
|
+
gatewayRouting: i,
|
|
377
|
+
linkComponent: a,
|
|
378
|
+
implementation: o,
|
|
379
|
+
uiFramework: ee,
|
|
380
|
+
errorFallback: te,
|
|
381
|
+
onError: c,
|
|
382
|
+
analytics: l,
|
|
383
|
+
disclosuresAcceptance: u,
|
|
384
|
+
providerLabels: ne,
|
|
385
|
+
children: /* @__PURE__ */ _(y, { ...d })
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
export { ke as CreateCardWidget, Oe as formatFundingAccountLabel };
|
|
@@ -2,8 +2,8 @@ import { Collapsible as e, CollapsibleContent as t, Switch as n } from "../../..
|
|
|
2
2
|
import { useId as r } from "react";
|
|
3
3
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControlRow.js
|
|
5
|
-
function o({ title: o, description: s, checked: c, onCheckedChange: l,
|
|
6
|
-
let
|
|
5
|
+
function o({ title: o, description: s, checked: c, onCheckedChange: l, disabled: u = !1, children: d }) {
|
|
6
|
+
let f = r(), p = `${f}-title`, m = `${f}-description`, h = `${f}-drawer`;
|
|
7
7
|
return /* @__PURE__ */ a("div", {
|
|
8
8
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:p-4",
|
|
9
9
|
children: [/* @__PURE__ */ a("div", {
|
|
@@ -11,28 +11,29 @@ function o({ title: o, description: s, checked: c, onCheckedChange: l, children:
|
|
|
11
11
|
children: [/* @__PURE__ */ a("div", {
|
|
12
12
|
className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
|
|
13
13
|
children: [/* @__PURE__ */ i("span", {
|
|
14
|
-
id:
|
|
14
|
+
id: p,
|
|
15
15
|
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
16
16
|
children: o
|
|
17
17
|
}), /* @__PURE__ */ i("span", {
|
|
18
|
-
id:
|
|
18
|
+
id: m,
|
|
19
19
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
20
20
|
children: s
|
|
21
21
|
})]
|
|
22
22
|
}), /* @__PURE__ */ i(n, {
|
|
23
23
|
checked: c,
|
|
24
24
|
onCheckedChange: l,
|
|
25
|
-
|
|
26
|
-
"aria-
|
|
27
|
-
"aria-
|
|
25
|
+
disabled: u,
|
|
26
|
+
"aria-labelledby": p,
|
|
27
|
+
"aria-describedby": m,
|
|
28
|
+
"aria-controls": h,
|
|
28
29
|
"aria-expanded": c,
|
|
29
30
|
className: "ttw:mt-0.5 ttw:shrink-0"
|
|
30
31
|
})]
|
|
31
32
|
}), /* @__PURE__ */ i(e, {
|
|
32
33
|
open: c,
|
|
33
34
|
children: /* @__PURE__ */ i(t, {
|
|
34
|
-
id:
|
|
35
|
-
children:
|
|
35
|
+
id: h,
|
|
36
|
+
children: d
|
|
36
37
|
})
|
|
37
38
|
})]
|
|
38
39
|
});
|
|
@@ -6,14 +6,14 @@ import { SpendLimitControl as i } from "./SpendLimitControl.js";
|
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControls.js
|
|
8
8
|
var s = () => void 0;
|
|
9
|
-
function c({ labels: c, className: l, isSpendLimitEnabled: u = !1, onSpendLimitEnabledChange: d = s, spendLimitAmount: f = "", onSpendLimitAmountChange: p = s, spendLimitPeriodOptions: m = [], selectedSpendLimitPeriod: h = null, onSpendLimitPeriodSelect: g = s, spendLimitPeriodNotices: _, isMerchantCategoriesEnabled: v = !1, onMerchantCategoriesEnabledChange: y = s, merchantCategoryOptions: b = [], selectedMerchantCategories: x = [], onMerchantCategoryToggle: S = s,
|
|
10
|
-
let
|
|
9
|
+
function c({ labels: c, className: l, isSpendLimitEnabled: u = !1, onSpendLimitEnabledChange: d = s, spendLimitAmount: f = "", onSpendLimitAmountChange: p = s, spendLimitPeriodOptions: m = [], selectedSpendLimitPeriod: h = null, onSpendLimitPeriodSelect: g = s, spendLimitPeriodNotices: _, isMerchantCategoriesEnabled: v = !1, onMerchantCategoriesEnabledChange: y = s, merchantCategoryOptions: b = [], selectedMerchantCategories: x = [], onMerchantCategoryToggle: S = s, isMerchantCategoriesToggleDisabled: C = !1, isPerTransactionMaximumEnabled: w = !1, onPerTransactionMaximumEnabledChange: T = s, perTransactionMaximumAmount: E = "", onPerTransactionMaximumAmountChange: D = s }) {
|
|
10
|
+
let O = t(c);
|
|
11
11
|
return /* @__PURE__ */ o("div", {
|
|
12
12
|
className: e("ttw:flex ttw:flex-col ttw:divide-y ttw:divide-border ttw:overflow-hidden ttw:rounded-lg ttw:border ttw:border-border", l),
|
|
13
13
|
children: [
|
|
14
14
|
/* @__PURE__ */ a(i, {
|
|
15
|
-
labels:
|
|
16
|
-
currencySymbol:
|
|
15
|
+
labels: O.spendLimit,
|
|
16
|
+
currencySymbol: O.currencySymbol,
|
|
17
17
|
isEnabled: u,
|
|
18
18
|
onEnabledChange: d,
|
|
19
19
|
amount: f,
|
|
@@ -24,20 +24,21 @@ function c({ labels: c, className: l, isSpendLimitEnabled: u = !1, onSpendLimitE
|
|
|
24
24
|
periodNotices: _
|
|
25
25
|
}),
|
|
26
26
|
/* @__PURE__ */ a(n, {
|
|
27
|
-
labels:
|
|
27
|
+
labels: O.merchantCategories,
|
|
28
28
|
isEnabled: v,
|
|
29
29
|
onEnabledChange: y,
|
|
30
30
|
categoryOptions: b,
|
|
31
31
|
selectedCategories: x,
|
|
32
|
-
onCategoryToggle: S
|
|
32
|
+
onCategoryToggle: S,
|
|
33
|
+
isToggleDisabled: C
|
|
33
34
|
}),
|
|
34
35
|
/* @__PURE__ */ a(r, {
|
|
35
|
-
labels:
|
|
36
|
-
currencySymbol:
|
|
37
|
-
isEnabled:
|
|
38
|
-
onEnabledChange:
|
|
39
|
-
amount:
|
|
40
|
-
onAmountChange:
|
|
36
|
+
labels: O.perTransactionMaximum,
|
|
37
|
+
currencySymbol: O.currencySymbol,
|
|
38
|
+
isEnabled: w,
|
|
39
|
+
onEnabledChange: T,
|
|
40
|
+
amount: E,
|
|
41
|
+
onAmountChange: D
|
|
41
42
|
})
|
|
42
43
|
]
|
|
43
44
|
});
|
|
@@ -3,12 +3,13 @@ import { CardControlRow as t } from "./CardControlRow.js";
|
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
import { CheckIcon as i } from "lucide-react";
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/MerchantCategoriesControl.js
|
|
6
|
-
function a({ labels: a, isEnabled: o, onEnabledChange: s, categoryOptions: c, selectedCategories: l, onCategoryToggle: u }) {
|
|
6
|
+
function a({ labels: a, isEnabled: o, onEnabledChange: s, categoryOptions: c, selectedCategories: l, onCategoryToggle: u, isToggleDisabled: d = !1 }) {
|
|
7
7
|
return /* @__PURE__ */ n(t, {
|
|
8
8
|
title: a.title,
|
|
9
9
|
description: a.description,
|
|
10
10
|
checked: o,
|
|
11
11
|
onCheckedChange: s,
|
|
12
|
+
disabled: d,
|
|
12
13
|
children: /* @__PURE__ */ n("div", {
|
|
13
14
|
className: "ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
14
15
|
children: c.map((t) => {
|
|
@@ -8,24 +8,25 @@ import { optionalOrganizationHeaders as d, organizationHeaders as f } from "./li
|
|
|
8
8
|
import { bulkUpdateDepartmentMembers as p, bulkUpdateLocationMembers as m, bulkUpdateRoleMembers as h, createDepartment as g, createLocation as _, createUser as v, deactivateDepartment as y, deactivateLocation as b, deleteCounterpartsId as x, deleteCounterpartsIdBankAccountsId as S, deleteMeasureUnitsId as C, deletePayablesId as w, deletePayablesIdFile as T, deleteProductsId as E, deleteReceivablesId as D, deleteTagsId as O, downloadBankAccountTransactions as k, getApplicationStatus as A, getApprovalPolicies as j, getBankAccountAccess as M, getDepartment as N, getExternalBankAccountAccess as P, getLocation as F, getPayablesId as I, getPayablesIdLineItems as L, getPaymentRecords as R, getUsers as z, listDepartments as B, listLocations as V, listRoles as H, manageBankAccountAccess as U, patchCounterpartsId as W, patchCounterpartsIdAddressesId as G, patchCounterpartsIdBankAccountsId as K, patchMeasureUnitsId as q, patchPayablesId as J, patchProductsId as Y, patchReceivablesId as X, patchTagsId as Z, postApprovalRequestsIdApprove as Q, postApprovalRequestsIdReject as $, postCounterparts as ee, postCounterpartsIdAddresses as te, postCounterpartsIdBankAccounts as ne, postCounterpartsIdBankAccountsIdMakeDefault as re, postMeasureUnits as ie, postPayables as ae, postPayablesIdApprovePaymentOperation as oe, postPayablesIdAttachFile as se, postPayablesIdCancel as ce, postPayablesIdMarkAsPaid as le, postPayablesIdReject as ue, postPayablesIdReopen as de, postPayablesIdSchedulePayment as fe, postPayablesIdSubmitForApproval as pe, postPayablesIdValidate as me, postPayablesUploadFromFile as he, postPaymentRecordsIdCancel as ge, postProducts as _e, postReceivables as ve, postReceivablesIdAccept as ye, postReceivablesIdCancel as be, postReceivablesIdClone as xe, postReceivablesIdDecline as Se, postReceivablesIdIssue as Ce, postReceivablesIdMarkAsPaid as we, postReceivablesIdMarkAsPartiallyPaid as Te, postReceivablesIdMarkAsUncollectible as Ee, postReceivablesIdSend as De, postTags as Oe, putPayablesIdLineItems as ke, putReceivablesIdLineItems as Ae, updateDepartment as je, updateLocation as Me, updateUser as Ne } from "./lib/rest/sdk.gen.js";
|
|
9
9
|
import { fetchWidgetInit as Pe } from "./lib/fetchWidgetInit.js";
|
|
10
10
|
import { hasAnyScope as Fe } from "./lib/hasAnyScope.js";
|
|
11
|
-
import { connectExternalBankAccountMutation as Ie, createAchMoneyMovementMutation as Le, createApplicationMutation as Re, createBankAccountMutation as ze, createBookTransferMutation as Be, createDebitCardMutation as Ve,
|
|
11
|
+
import { connectExternalBankAccountMutation as Ie, createAchMoneyMovementMutation as Le, createApplicationMutation as Re, createBankAccountMutation as ze, createBookTransferMutation as Be, createDebitCardMutation as Ve, createVelocityControlMutation as He, deleteApprovalPoliciesIdMutation as Ue, deleteLedgerAccountsIdMutation as We, deleteReceiptsIdMutation as Ge, disableUserMutation as Ke, getAnalyticsPayablesOptions as qe, getAnalyticsReceivablesOptions as Je, getApplicationStatusOptions as Ye, getApprovalPoliciesOptions as Xe, getApprovalPoliciesQueryKey as Ze, getApprovalRequestsOptions as Qe, getApprovalRequestsQueryKey as $e, getBankAccountAccessQueryKey as et, getBankAccountOptions as tt, getBankAccountQueryKey as nt, getBankAccountTransactionsOptions as rt, getBankAccountTransfersOptions as it, getBankAccountTransfersQueryKey as at, getBankAccountsQueryKey as ot, getCounterpartsIdAddressesOptions as st, getCounterpartsIdAddressesQueryKey as ct, getCounterpartsIdBankAccountsOptions as lt, getCounterpartsIdBankAccountsQueryKey as ut, getCounterpartsIdOptions as dt, getCounterpartsIdQueryKey as ft, getCounterpartsOptions as pt, getCounterpartsQueryKey as mt, getCreditCardByIdOptions as ht, getCreditCardsOptions as gt, getDebitCardByIdOptions as _t, getDebitCardsOptions as vt, getDebitCardsQueryKey as yt, getDepartmentOptions as bt, getDepartmentQueryKey as xt, getEntitiesIdSettingsOptions as St, getEntitiesIdSettingsQueryKey as Ct, getEntitiesMeOptions as wt, getEntityUsersMyEntityOptions as Tt, getEntityUsersOptions as Et, getExternalBankAccountAccessQueryKey as Dt, getExternalBankAccountsOptions as Ot, getExternalBankAccountsQueryKey as kt, getLedgerAccountsQueryKey as At, getLocationOptions as jt, getLocationQueryKey as Mt, getMeasureUnitsOptions as Nt, getMeasureUnitsQueryKey as Pt, getOrganizationOptions as Ft, getPayablesAnalyticsOptions as It, getPayablesAnalyticsQueryKey as Lt, getPayablesIdHistoryOptions as Rt, getPayablesIdHistoryQueryKey as zt, getPayablesIdLineItemsOptions as Bt, getPayablesIdLineItemsQueryKey as Vt, getPayablesIdOptions as Ht, getPayablesIdQueryKey as Ut, getPayablesIdSuggestionsOptions as Wt, getPayablesOptions as Gt, getPayablesQueryKey as Kt, getPaymentRecordsOptions as qt, getPaymentRecordsQueryKey as Jt, getProductsIdOptions as Yt, getProductsIdQueryKey as Xt, getProductsOptions as Zt, getProductsQueryKey as Qt, getReceiptsIdQueryKey as $t, getReceiptsOptions as en, getReceiptsQueryKey as tn, getReceivablesIdHistoryOptions as nn, getReceivablesIdHistoryQueryKey as rn, getReceivablesIdMailsOptions as an, getReceivablesIdMailsQueryKey as on, getReceivablesIdOptions as sn, getReceivablesIdPdfLinkOptions as cn, getReceivablesIdPdfLinkQueryKey as ln, getReceivablesIdQueryKey as un, getReceivablesOptions as dn, getReceivablesQueryKey as fn, getTagsOptions as pn, getTagsQueryKey as mn, getTransactionsIdQueryKey as hn, getTransactionsOptions as gn, getTransactionsQueryKey as _n, getTransactionsValidationsOptions as vn, getTransactionsValidationsQueryKey as yn, getUsersOptions as bn, getUsersQueryKey as xn, getVelocityControlsQueryKey as Sn, grantBankAccountAccessMutation as Cn, grantExternalBankAccountAccessMutation as wn, linkExternalBankAccountMutation as Tn, listDepartmentsOptions as En, listDepartmentsQueryKey as Dn, listLocationsOptions as On, listLocationsQueryKey as kn, listRolesQueryKey as An, manageDebitCardAccessMutation as jn, patchApprovalPoliciesIdMutation as Mn, patchEntitiesIdSettingsMutation as Nn, patchLedgerAccountsIdMutation as Pn, patchReceiptsIdMutation as Fn, postApprovalPoliciesMutation as In, postLedgerAccountsMutation as Ln, putTransactionsValidationsMutation as Rn, submitApplicationMutation as zn, unlinkExternalBankAccountMutation as Bn, updateApplicationMutation as Vn, updateBankAccountMutation as Hn, updateExternalBankAccountMutation as Un, validateExternalBankAccountMutation as Wn } from "./lib/rest/@tanstack/react-query.gen.js";
|
|
12
12
|
import "./lib/queryKeys.js";
|
|
13
|
-
import { withAuthEpoch as
|
|
14
|
-
import { useCurrentUserQuery as
|
|
15
|
-
import { isApiNotFoundError as
|
|
13
|
+
import { withAuthEpoch as Gn } from "./lib/withAuthEpoch.js";
|
|
14
|
+
import { useCurrentUserQuery as Kn } from "./lib/useCurrentUserQuery.js";
|
|
15
|
+
import { isApiNotFoundError as qn } from "./lib/isApiNotFoundError.js";
|
|
16
16
|
import "./lib/isUserDataNotFoundError.js";
|
|
17
|
-
import { useGetUserDataQuery as
|
|
18
|
-
import { useUpsertUserDataMutation as
|
|
17
|
+
import { useGetUserDataQuery as Jn } from "./lib/useGetUserDataQuery.js";
|
|
18
|
+
import { useUpsertUserDataMutation as Yn } from "./lib/useUpsertUserDataMutation.js";
|
|
19
19
|
import "./lib/rest/zod.gen.js";
|
|
20
|
-
import { Scope as
|
|
21
|
-
import { getAllPagesNextPageParam as
|
|
22
|
-
import { useAllBankAccountsQuery as
|
|
23
|
-
import { useAllExternalBankAccountsQuery as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
20
|
+
import { Scope as Xn } from "./lib/scopes.js";
|
|
21
|
+
import { getAllPagesNextPageParam as Zn, getAllPagesNextPaginationTokenParam as Qn, isAllPagesResolving as $n, useAutoFetchNextPage as er } from "./lib/allPages.js";
|
|
22
|
+
import { useAllBankAccountsQuery as tr } from "./lib/bank-account/useAllBankAccountsQuery.js";
|
|
23
|
+
import { useAllExternalBankAccountsQuery as nr } from "./lib/external-bank-account/useAllExternalBankAccountsQuery.js";
|
|
24
|
+
import { useAllMerchantCategoryGroupsQuery as rr } from "./lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
|
|
25
|
+
import { useAllLedgerAccountsQuery as ir, useLedgerAccountsQuery as ar } from "./lib/reference-data/useLedgerAccountsQuery.js";
|
|
26
|
+
import { usePaymentTermsQuery as or } from "./lib/reference-data/usePaymentTermsQuery.js";
|
|
27
|
+
import { useAllOrganizationRolesQuery as sr } from "./lib/role/useAllOrganizationRolesQuery.js";
|
|
28
|
+
import { useRolePermissionsQueries as cr } from "./lib/role/useRolePermissionsQueries.js";
|
|
29
|
+
import { useAllOrganizationUsersQuery as lr } from "./lib/user/useAllOrganizationUsersQuery.js";
|
|
30
|
+
import { useAcceptWidgetDisclosures as ur } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
31
|
+
import { useDisclosuresQuery as dr } from "./lib/disclosures/useDisclosuresQuery.js";
|
|
32
|
+
export { l as EmbedApiProvider, Xn as Scope, p as bulkUpdateDepartmentMembers, m as bulkUpdateLocationMembers, h as bulkUpdateRoleMembers, e as cancelAllClients, o as cloneEmbeddedClient, Ie as connectExternalBankAccountMutation, Le as createAchMoneyMovementMutation, Re as createApplicationMutation, ze as createBankAccountMutation, Be as createBookTransferMutation, Ve as createDebitCardMutation, g as createDepartment, s as createEmbeddedClient, _ as createLocation, v as createUser, He as createVelocityControlMutation, y as deactivateDepartment, b as deactivateLocation, Ue as deleteApprovalPoliciesIdMutation, x as deleteCounterpartsId, S as deleteCounterpartsIdBankAccountsId, We as deleteLedgerAccountsIdMutation, C as deleteMeasureUnitsId, w as deletePayablesId, T as deletePayablesIdFile, E as deleteProductsId, Ge as deleteReceiptsIdMutation, D as deleteReceivablesId, O as deleteTagsId, Ke as disableUserMutation, k as downloadBankAccountTransactions, Pe as fetchWidgetInit, Zn as getAllPagesNextPageParam, Qn as getAllPagesNextPaginationTokenParam, qe as getAnalyticsPayablesOptions, Je as getAnalyticsReceivablesOptions, A as getApplicationStatus, Ye as getApplicationStatusOptions, j as getApprovalPolicies, Xe as getApprovalPoliciesOptions, Ze as getApprovalPoliciesQueryKey, Qe as getApprovalRequestsOptions, $e as getApprovalRequestsQueryKey, M as getBankAccountAccess, et as getBankAccountAccessQueryKey, tt as getBankAccountOptions, nt as getBankAccountQueryKey, rt as getBankAccountTransactionsOptions, it as getBankAccountTransfersOptions, at as getBankAccountTransfersQueryKey, ot as getBankAccountsQueryKey, st as getCounterpartsIdAddressesOptions, ct as getCounterpartsIdAddressesQueryKey, lt as getCounterpartsIdBankAccountsOptions, ut as getCounterpartsIdBankAccountsQueryKey, dt as getCounterpartsIdOptions, ft as getCounterpartsIdQueryKey, pt as getCounterpartsOptions, mt as getCounterpartsQueryKey, ht as getCreditCardByIdOptions, gt as getCreditCardsOptions, _t as getDebitCardByIdOptions, vt as getDebitCardsOptions, yt as getDebitCardsQueryKey, N as getDepartment, bt as getDepartmentOptions, xt as getDepartmentQueryKey, St as getEntitiesIdSettingsOptions, Ct as getEntitiesIdSettingsQueryKey, wt as getEntitiesMeOptions, Tt as getEntityUsersMyEntityOptions, Et as getEntityUsersOptions, P as getExternalBankAccountAccess, Dt as getExternalBankAccountAccessQueryKey, Ot as getExternalBankAccountsOptions, kt as getExternalBankAccountsQueryKey, At as getLedgerAccountsQueryKey, F as getLocation, jt as getLocationOptions, Mt as getLocationQueryKey, Nt as getMeasureUnitsOptions, Pt as getMeasureUnitsQueryKey, Ft as getOrganizationOptions, It as getPayablesAnalyticsOptions, Lt as getPayablesAnalyticsQueryKey, I as getPayablesId, Rt as getPayablesIdHistoryOptions, zt as getPayablesIdHistoryQueryKey, L as getPayablesIdLineItems, Bt as getPayablesIdLineItemsOptions, Vt as getPayablesIdLineItemsQueryKey, Ht as getPayablesIdOptions, Ut as getPayablesIdQueryKey, Wt as getPayablesIdSuggestionsOptions, Gt as getPayablesOptions, Kt as getPayablesQueryKey, R as getPaymentRecords, qt as getPaymentRecordsOptions, Jt as getPaymentRecordsQueryKey, Yt as getProductsIdOptions, Xt as getProductsIdQueryKey, Zt as getProductsOptions, Qt as getProductsQueryKey, $t as getReceiptsIdQueryKey, en as getReceiptsOptions, tn as getReceiptsQueryKey, nn as getReceivablesIdHistoryOptions, rn as getReceivablesIdHistoryQueryKey, an as getReceivablesIdMailsOptions, on as getReceivablesIdMailsQueryKey, sn as getReceivablesIdOptions, cn as getReceivablesIdPdfLinkOptions, ln as getReceivablesIdPdfLinkQueryKey, un as getReceivablesIdQueryKey, dn as getReceivablesOptions, fn as getReceivablesQueryKey, pn as getTagsOptions, mn as getTagsQueryKey, hn as getTransactionsIdQueryKey, gn as getTransactionsOptions, _n as getTransactionsQueryKey, vn as getTransactionsValidationsOptions, yn as getTransactionsValidationsQueryKey, z as getUsers, bn as getUsersOptions, xn as getUsersQueryKey, Sn as getVelocityControlsQueryKey, Cn as grantBankAccountAccessMutation, wn as grantExternalBankAccountAccessMutation, Fe as hasAnyScope, t as invalidateAllClients, $n as isAllPagesResolving, qn as isApiNotFoundError, c as isWidgetGatewayHost, Tn as linkExternalBankAccountMutation, B as listDepartments, En as listDepartmentsOptions, Dn as listDepartmentsQueryKey, V as listLocations, On as listLocationsOptions, kn as listLocationsQueryKey, H as listRoles, An as listRolesQueryKey, U as manageBankAccountAccess, jn as manageDebitCardAccessMutation, d as optionalOrganizationHeaders, f as organizationHeaders, Mn as patchApprovalPoliciesIdMutation, W as patchCounterpartsId, G as patchCounterpartsIdAddressesId, K as patchCounterpartsIdBankAccountsId, Nn as patchEntitiesIdSettingsMutation, Pn as patchLedgerAccountsIdMutation, q as patchMeasureUnitsId, J as patchPayablesId, Y as patchProductsId, Fn as patchReceiptsIdMutation, X as patchReceivablesId, Z as patchTagsId, In as postApprovalPoliciesMutation, Q as postApprovalRequestsIdApprove, $ as postApprovalRequestsIdReject, ee as postCounterparts, te as postCounterpartsIdAddresses, ne as postCounterpartsIdBankAccounts, re as postCounterpartsIdBankAccountsIdMakeDefault, Ln as postLedgerAccountsMutation, ie as postMeasureUnits, ae as postPayables, oe as postPayablesIdApprovePaymentOperation, se as postPayablesIdAttachFile, ce as postPayablesIdCancel, le as postPayablesIdMarkAsPaid, ue as postPayablesIdReject, de as postPayablesIdReopen, fe as postPayablesIdSchedulePayment, pe as postPayablesIdSubmitForApproval, me as postPayablesIdValidate, he as postPayablesUploadFromFile, ge as postPaymentRecordsIdCancel, _e as postProducts, ve as postReceivables, ye as postReceivablesIdAccept, be as postReceivablesIdCancel, xe as postReceivablesIdClone, Se as postReceivablesIdDecline, Ce as postReceivablesIdIssue, we as postReceivablesIdMarkAsPaid, Te as postReceivablesIdMarkAsPartiallyPaid, Ee as postReceivablesIdMarkAsUncollectible, De as postReceivablesIdSend, Oe as postTags, ke as putPayablesIdLineItems, Ae as putReceivablesIdLineItems, Rn as putTransactionsValidationsMutation, n as registerQueryClient, r as removeInactiveFromAllClients, i as setAllClientsQueriesData, zn as submitApplicationMutation, Bn as unlinkExternalBankAccountMutation, a as unregisterQueryClient, Vn as updateApplicationMutation, Hn as updateBankAccountMutation, je as updateDepartment, Un as updateExternalBankAccountMutation, Me as updateLocation, Ne as updateUser, ur as useAcceptWidgetDisclosures, tr as useAllBankAccountsQuery, nr as useAllExternalBankAccountsQuery, ir as useAllLedgerAccountsQuery, rr as useAllMerchantCategoryGroupsQuery, sr as useAllOrganizationRolesQuery, lr as useAllOrganizationUsersQuery, er as useAutoFetchNextPage, Kn as useCurrentUserQuery, dr as useDisclosuresQuery, u as useEmbedApi, Jn as useGetUserDataQuery, ar as useLedgerAccountsQuery, or as usePaymentTermsQuery, cr as useRolePermissionsQueries, Yn as useUpsertUserDataMutation, Wn as validateExternalBankAccountMutation, Gn as withAuthEpoch };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useEmbedApi as e } from "../EmbedApiContext.js";
|
|
6
|
+
import { organizationHeaders as t } from "../organizationHeaders.js";
|
|
7
|
+
import { getMerchantCategoryGroups as n } from "../rest/sdk.gen.js";
|
|
8
|
+
import { getMerchantCategoryGroupsOptions as r } from "../rest/@tanstack/react-query.gen.js";
|
|
9
|
+
import { withAuthEpoch as i } from "../withAuthEpoch.js";
|
|
10
|
+
import { getAllPagesNextPageParam as a, isAllPagesResolving as o, useAutoFetchNextPage as s } from "../allPages.js";
|
|
11
|
+
import { useMemo as c } from "react";
|
|
12
|
+
import { useInfiniteQuery as l } from "@tanstack/react-query";
|
|
13
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js
|
|
14
|
+
function u({ enabled: u } = {}) {
|
|
15
|
+
let { client: d, organizationId: f, widgetToken: p, authEpoch: m } = e(), h = t(f), g = !!(f && p) && (u === !0 || u === void 0), _ = r({
|
|
16
|
+
client: d,
|
|
17
|
+
headers: h,
|
|
18
|
+
query: { active: !0 }
|
|
19
|
+
}), v = l({
|
|
20
|
+
queryKey: [...i(_, m).queryKey, "all"],
|
|
21
|
+
enabled: g,
|
|
22
|
+
initialPageParam: void 0,
|
|
23
|
+
queryFn: async ({ signal: e, pageParam: t }) => {
|
|
24
|
+
let { data: r } = await n({
|
|
25
|
+
client: d,
|
|
26
|
+
headers: h,
|
|
27
|
+
query: {
|
|
28
|
+
active: !0,
|
|
29
|
+
...t ? { pagination_token: t } : {}
|
|
30
|
+
},
|
|
31
|
+
signal: e,
|
|
32
|
+
throwOnError: !0
|
|
33
|
+
});
|
|
34
|
+
return r;
|
|
35
|
+
},
|
|
36
|
+
getNextPageParam: a
|
|
37
|
+
});
|
|
38
|
+
s(v, g);
|
|
39
|
+
let y = c(() => {
|
|
40
|
+
if (v.data) return {
|
|
41
|
+
data: v.data.pages.flatMap((e) => e.data ?? []),
|
|
42
|
+
nextPaginationToken: null,
|
|
43
|
+
prevPaginationToken: null
|
|
44
|
+
};
|
|
45
|
+
}, [v.data]);
|
|
46
|
+
return {
|
|
47
|
+
...v,
|
|
48
|
+
data: y,
|
|
49
|
+
isResolving: o(v)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { u as useAllMerchantCategoryGroupsQuery };
|