@foldspace-fe/casdoor-next-auth-kit 0.1.1
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/dist/billing/index.d.ts +16 -0
- package/dist/billing/index.js +28 -0
- package/dist/billing/index.js.map +1 -0
- package/dist/callback-BTzHQK_r.d.ts +12 -0
- package/dist/casdoor/index.d.ts +28 -0
- package/dist/casdoor/index.js +40 -0
- package/dist/casdoor/index.js.map +1 -0
- package/dist/chunk-6E27SZ7V.js +291 -0
- package/dist/chunk-6E27SZ7V.js.map +1 -0
- package/dist/chunk-DONQHN4U.js +56 -0
- package/dist/chunk-DONQHN4U.js.map +1 -0
- package/dist/chunk-IQEVUR77.js +909 -0
- package/dist/chunk-IQEVUR77.js.map +1 -0
- package/dist/chunk-RGTVPBH7.js +182 -0
- package/dist/chunk-RGTVPBH7.js.map +1 -0
- package/dist/chunk-T2M5MVPE.js +20 -0
- package/dist/chunk-T2M5MVPE.js.map +1 -0
- package/dist/chunk-XMBHIEYL.js +1 -0
- package/dist/chunk-XMBHIEYL.js.map +1 -0
- package/dist/chunk-Y4GJ2AEI.js +192 -0
- package/dist/chunk-Y4GJ2AEI.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +437 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +148 -0
- package/dist/index.js.map +1 -0
- package/dist/next/index.d.ts +17 -0
- package/dist/next/index.js +24 -0
- package/dist/next/index.js.map +1 -0
- package/dist/options-JUwZSXu2.d.ts +40 -0
- package/dist/react/index.d.ts +242 -0
- package/dist/react/index.js +774 -0
- package/dist/react/index.js.map +1 -0
- package/dist/skills/casdoor-next-auth-kit/SKILL.md +158 -0
- package/dist/skills/casdoor-next-auth-kit/references/casdoor-api-reference.md +2387 -0
- package/dist/skills/casdoor-next-auth-kit/references/swagger.json +3686 -0
- package/dist/types-BPsPs5Rv.d.ts +337 -0
- package/dist/types-DqVXdUge.d.ts +121 -0
- package/package.json +69 -0
|
@@ -0,0 +1,774 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildBillingActionPayload,
|
|
3
|
+
deriveBillingCreditsState,
|
|
4
|
+
deriveBillingEntitlements,
|
|
5
|
+
filterProductsByKind,
|
|
6
|
+
normalizeBillingCatalogConfig,
|
|
7
|
+
normalizeBillingPurchaseStatus,
|
|
8
|
+
normalizeBillingRuntimeConfig,
|
|
9
|
+
resolveBillingItem,
|
|
10
|
+
resolveBillingProductSnapshot,
|
|
11
|
+
resolveBillingSubscriptionProduct
|
|
12
|
+
} from "../chunk-RGTVPBH7.js";
|
|
13
|
+
import {
|
|
14
|
+
buildAuthJumpHref
|
|
15
|
+
} from "../chunk-T2M5MVPE.js";
|
|
16
|
+
|
|
17
|
+
// src/react/provider.tsx
|
|
18
|
+
import { SessionProvider } from "next-auth/react";
|
|
19
|
+
import { jsx } from "react/jsx-runtime";
|
|
20
|
+
function AuthProvider({
|
|
21
|
+
children,
|
|
22
|
+
session
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ jsx(SessionProvider, { session, children });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/react/hooks.ts
|
|
28
|
+
import { useSession } from "next-auth/react";
|
|
29
|
+
function getUserSummary(session) {
|
|
30
|
+
const user = session?.user;
|
|
31
|
+
const name = user?.name || "\u767B\u5F55";
|
|
32
|
+
const isAuthenticated = Boolean(user);
|
|
33
|
+
const isAdmin = Boolean(user?.isAdmin);
|
|
34
|
+
const role = !isAuthenticated ? "guest" : isAdmin ? "admin" : "user";
|
|
35
|
+
return {
|
|
36
|
+
id: user?.id ?? null,
|
|
37
|
+
name,
|
|
38
|
+
email: user?.email ?? null,
|
|
39
|
+
image: user?.image ?? null,
|
|
40
|
+
isAuthenticated,
|
|
41
|
+
isAdmin,
|
|
42
|
+
tokenBalance: Number(user?.tokenBalance ?? 2580),
|
|
43
|
+
isVip: Boolean(user?.isVip ?? true),
|
|
44
|
+
role
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function useAuthSession() {
|
|
48
|
+
return useSession();
|
|
49
|
+
}
|
|
50
|
+
function useAuthUser() {
|
|
51
|
+
const { data: session } = useAuthSession();
|
|
52
|
+
return getUserSummary(session ?? null);
|
|
53
|
+
}
|
|
54
|
+
function useAuthRole() {
|
|
55
|
+
return useAuthUser().role;
|
|
56
|
+
}
|
|
57
|
+
function useAuthActions(options = {}) {
|
|
58
|
+
const user = useAuthUser();
|
|
59
|
+
const redirect = options.redirect ?? null;
|
|
60
|
+
return {
|
|
61
|
+
loginHref: buildAuthJumpHref("login", redirect ?? void 0),
|
|
62
|
+
signupHref: buildAuthJumpHref("signup", redirect ?? void 0),
|
|
63
|
+
logoutHref: "/logout",
|
|
64
|
+
accountHref: user.isAdmin ? "/admin" : "/user/account",
|
|
65
|
+
adminHref: "/admin"
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/billing/react.tsx
|
|
70
|
+
import {
|
|
71
|
+
createContext,
|
|
72
|
+
useCallback,
|
|
73
|
+
useContext,
|
|
74
|
+
useEffect,
|
|
75
|
+
useMemo,
|
|
76
|
+
useState
|
|
77
|
+
} from "react";
|
|
78
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
79
|
+
var BillingCoreContext = createContext(null);
|
|
80
|
+
var BillingSubscriptionContext = createContext(null);
|
|
81
|
+
var BillingProductContext = createContext(null);
|
|
82
|
+
var BillingCreditsContext = createContext(null);
|
|
83
|
+
function useOptionalContext(context) {
|
|
84
|
+
return useContext(context);
|
|
85
|
+
}
|
|
86
|
+
function useRequiredCoreContext() {
|
|
87
|
+
const context = useContext(BillingCoreContext);
|
|
88
|
+
if (!context) {
|
|
89
|
+
throw new Error("Billing hooks must be used inside BillingProvider or BillingCoreProvider.");
|
|
90
|
+
}
|
|
91
|
+
return context;
|
|
92
|
+
}
|
|
93
|
+
function choose(primary, fallback) {
|
|
94
|
+
return primary ?? fallback;
|
|
95
|
+
}
|
|
96
|
+
function getLatestOrder(orders) {
|
|
97
|
+
return [...orders ?? []].sort((a, b) => {
|
|
98
|
+
const left = Date.parse(b.updatedAt ?? b.createdAt ?? "") || 0;
|
|
99
|
+
const right = Date.parse(a.updatedAt ?? a.createdAt ?? "") || 0;
|
|
100
|
+
return left - right;
|
|
101
|
+
})[0];
|
|
102
|
+
}
|
|
103
|
+
function getLatestPayment(payments) {
|
|
104
|
+
return [...payments ?? []].sort((a, b) => {
|
|
105
|
+
const left = Date.parse(b.updatedAt ?? b.createdAt ?? "") || 0;
|
|
106
|
+
const right = Date.parse(a.updatedAt ?? a.createdAt ?? "") || 0;
|
|
107
|
+
return left - right;
|
|
108
|
+
})[0];
|
|
109
|
+
}
|
|
110
|
+
function normalizeRuntimeConfigInput(config) {
|
|
111
|
+
if (!config) return void 0;
|
|
112
|
+
return normalizeBillingRuntimeConfig(config);
|
|
113
|
+
}
|
|
114
|
+
function normalizeCatalogConfigInput(config) {
|
|
115
|
+
if (!config) return void 0;
|
|
116
|
+
return normalizeBillingCatalogConfig(config);
|
|
117
|
+
}
|
|
118
|
+
function buildCoreValue(input) {
|
|
119
|
+
return {
|
|
120
|
+
apiClient: input.apiClient,
|
|
121
|
+
loaders: input.loaders,
|
|
122
|
+
runtimeConfigLoader: input.runtimeConfigLoader,
|
|
123
|
+
actionExecutor: input.actionExecutor,
|
|
124
|
+
defaults: input.defaults,
|
|
125
|
+
runtimeConfig: input.runtimeConfig,
|
|
126
|
+
runtimeCatalog: input.runtimeCatalog,
|
|
127
|
+
runtimeConfigLoading: input.runtimeConfigLoading,
|
|
128
|
+
runtimeConfigError: input.runtimeConfigError,
|
|
129
|
+
subscription: input.subscription,
|
|
130
|
+
subscriptionHistory: input.subscriptionHistory,
|
|
131
|
+
products: input.products,
|
|
132
|
+
orderHistory: input.orderHistory,
|
|
133
|
+
paymentHistory: input.paymentHistory,
|
|
134
|
+
credits: input.credits,
|
|
135
|
+
entitlements: input.entitlements,
|
|
136
|
+
purchaseStatus: input.purchaseStatus,
|
|
137
|
+
status: input.status,
|
|
138
|
+
refresh: input.refresh,
|
|
139
|
+
runAction: input.runAction,
|
|
140
|
+
setRuntimeConfig: input.setRuntimeConfig,
|
|
141
|
+
setSubscription: input.setSubscription,
|
|
142
|
+
setSubscriptionHistory: input.setSubscriptionHistory,
|
|
143
|
+
setProducts: input.setProducts,
|
|
144
|
+
setOrderHistory: input.setOrderHistory,
|
|
145
|
+
setPaymentHistory: input.setPaymentHistory,
|
|
146
|
+
setCredits: input.setCredits,
|
|
147
|
+
setEntitlements: input.setEntitlements,
|
|
148
|
+
setPurchaseStatus: input.setPurchaseStatus,
|
|
149
|
+
setStatus: input.setStatus
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function BillingProvider({
|
|
153
|
+
children,
|
|
154
|
+
apiClient,
|
|
155
|
+
loaders,
|
|
156
|
+
runtimeConfigLoader,
|
|
157
|
+
actionExecutor,
|
|
158
|
+
defaults,
|
|
159
|
+
runtimeConfig: runtimeConfigProp,
|
|
160
|
+
subscription: subscriptionProp,
|
|
161
|
+
subscriptionHistory: subscriptionHistoryProp,
|
|
162
|
+
products: productsProp,
|
|
163
|
+
orderHistory: orderHistoryProp,
|
|
164
|
+
paymentHistory: paymentHistoryProp,
|
|
165
|
+
credits: creditsProp,
|
|
166
|
+
entitlements: entitlementsProp,
|
|
167
|
+
status: statusProp,
|
|
168
|
+
purchaseStatus: purchaseStatusProp,
|
|
169
|
+
autoRefresh = true
|
|
170
|
+
}) {
|
|
171
|
+
const [runtimeConfig, setRuntimeConfig] = useState(normalizeRuntimeConfigInput(runtimeConfigProp));
|
|
172
|
+
const [runtimeCatalog, setRuntimeCatalog] = useState(normalizeCatalogConfigInput(runtimeConfigProp));
|
|
173
|
+
const [runtimeConfigLoading, setRuntimeConfigLoading] = useState(false);
|
|
174
|
+
const [runtimeConfigError, setRuntimeConfigError] = useState(null);
|
|
175
|
+
const [subscription, setSubscription] = useState(subscriptionProp);
|
|
176
|
+
const [subscriptionHistory, setSubscriptionHistory] = useState(subscriptionHistoryProp);
|
|
177
|
+
const [products, setProducts] = useState(productsProp);
|
|
178
|
+
const [orderHistory, setOrderHistory] = useState(orderHistoryProp);
|
|
179
|
+
const [paymentHistory, setPaymentHistory] = useState(paymentHistoryProp);
|
|
180
|
+
const [credits, setCredits] = useState(creditsProp);
|
|
181
|
+
const [entitlements, setEntitlements] = useState(entitlementsProp);
|
|
182
|
+
const [purchaseStatus, setPurchaseStatus] = useState(purchaseStatusProp);
|
|
183
|
+
const [status, setStatus] = useState(
|
|
184
|
+
statusProp ?? { loading: false, refreshing: false, error: null }
|
|
185
|
+
);
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
if (runtimeConfigProp) {
|
|
188
|
+
setRuntimeConfig(normalizeRuntimeConfigInput(runtimeConfigProp));
|
|
189
|
+
setRuntimeCatalog(normalizeCatalogConfigInput(runtimeConfigProp));
|
|
190
|
+
}
|
|
191
|
+
}, [runtimeConfigProp]);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
if (subscriptionProp) setSubscription(subscriptionProp);
|
|
194
|
+
}, [subscriptionProp]);
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
if (subscriptionHistoryProp) setSubscriptionHistory(subscriptionHistoryProp);
|
|
197
|
+
}, [subscriptionHistoryProp]);
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
if (productsProp) setProducts(productsProp);
|
|
200
|
+
}, [productsProp]);
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
if (orderHistoryProp) setOrderHistory(orderHistoryProp);
|
|
203
|
+
}, [orderHistoryProp]);
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
if (paymentHistoryProp) setPaymentHistory(paymentHistoryProp);
|
|
206
|
+
}, [paymentHistoryProp]);
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
if (creditsProp) setCredits(creditsProp);
|
|
209
|
+
}, [creditsProp]);
|
|
210
|
+
useEffect(() => {
|
|
211
|
+
if (entitlementsProp) setEntitlements(entitlementsProp);
|
|
212
|
+
}, [entitlementsProp]);
|
|
213
|
+
useEffect(() => {
|
|
214
|
+
if (purchaseStatusProp) setPurchaseStatus(purchaseStatusProp);
|
|
215
|
+
}, [purchaseStatusProp]);
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (statusProp) setStatus(statusProp);
|
|
218
|
+
}, [statusProp]);
|
|
219
|
+
const refresh = useCallback(async () => {
|
|
220
|
+
const catalogKey = runtimeCatalog?.catalogKey ?? runtimeConfig?.catalogKey ?? "default";
|
|
221
|
+
const runtimeLoader = runtimeConfigLoader ?? apiClient.fetchRuntimeConfig;
|
|
222
|
+
const resolvedLoaders = loaders ?? {};
|
|
223
|
+
const subscriptionLoader = resolvedLoaders.subscriptionLoader ?? apiClient.fetchSubscription;
|
|
224
|
+
const subscriptionHistoryLoader = resolvedLoaders.subscriptionHistoryLoader ?? apiClient.fetchSubscriptionHistory;
|
|
225
|
+
const productsLoader = resolvedLoaders.productsLoader ?? apiClient.fetchProducts;
|
|
226
|
+
const orderHistoryLoader = resolvedLoaders.orderHistoryLoader ?? apiClient.fetchOrderHistory;
|
|
227
|
+
const paymentHistoryLoader = resolvedLoaders.paymentHistoryLoader ?? apiClient.fetchPaymentHistory;
|
|
228
|
+
const purchaseStatusLoader = resolvedLoaders.purchaseStatusLoader ?? apiClient.fetchPurchaseStatus;
|
|
229
|
+
const creditsLoader = resolvedLoaders.creditsLoader ?? apiClient.fetchCredits;
|
|
230
|
+
const entitlementsLoader = resolvedLoaders.entitlementsLoader ?? apiClient.fetchEntitlements;
|
|
231
|
+
setRuntimeConfigLoading(true);
|
|
232
|
+
setRuntimeConfigError(null);
|
|
233
|
+
setStatus((current) => ({ ...current, loading: true, refreshing: true, error: null }));
|
|
234
|
+
try {
|
|
235
|
+
const nextRuntimeCatalog = normalizeCatalogConfigInput(await runtimeLoader(catalogKey));
|
|
236
|
+
const nextRuntimeConfig = nextRuntimeCatalog ? normalizeRuntimeConfigInput(nextRuntimeCatalog) : void 0;
|
|
237
|
+
if (nextRuntimeConfig) {
|
|
238
|
+
setRuntimeCatalog(nextRuntimeCatalog);
|
|
239
|
+
setRuntimeConfig(nextRuntimeConfig);
|
|
240
|
+
}
|
|
241
|
+
const nextCatalogKey = nextRuntimeConfig?.catalogKey ?? nextRuntimeCatalog?.catalogKey ?? catalogKey;
|
|
242
|
+
const [
|
|
243
|
+
nextSubscription,
|
|
244
|
+
nextSubscriptionHistory,
|
|
245
|
+
nextProducts,
|
|
246
|
+
nextOrderHistory,
|
|
247
|
+
nextPaymentHistory,
|
|
248
|
+
nextCredits,
|
|
249
|
+
nextEntitlements
|
|
250
|
+
] = await Promise.all([
|
|
251
|
+
subscriptionLoader({ catalogKey: nextCatalogKey }),
|
|
252
|
+
subscriptionHistoryLoader({ catalogKey: nextCatalogKey }),
|
|
253
|
+
productsLoader({ catalogKey: nextCatalogKey }),
|
|
254
|
+
orderHistoryLoader({ catalogKey: nextCatalogKey }),
|
|
255
|
+
paymentHistoryLoader({ catalogKey: nextCatalogKey }),
|
|
256
|
+
creditsLoader({ catalogKey: nextCatalogKey }),
|
|
257
|
+
entitlementsLoader({ catalogKey: nextCatalogKey })
|
|
258
|
+
]);
|
|
259
|
+
const subscriptionWithProduct = nextSubscription ? {
|
|
260
|
+
...nextSubscription,
|
|
261
|
+
product: resolveBillingSubscriptionProduct(nextSubscription, nextRuntimeConfig ?? runtimeConfig)
|
|
262
|
+
} : void 0;
|
|
263
|
+
const normalizedCredits = deriveBillingCreditsState(nextCredits, nextProducts, nextRuntimeConfig?.conversionRules ?? runtimeConfig?.conversionRules);
|
|
264
|
+
const normalizedEntitlements = nextEntitlements ?? deriveBillingEntitlements(subscriptionWithProduct, nextProducts, normalizedCredits, nextRuntimeConfig ?? runtimeConfig);
|
|
265
|
+
const latestOrder = getLatestOrder(nextOrderHistory);
|
|
266
|
+
const latestPayment = getLatestPayment(nextPaymentHistory);
|
|
267
|
+
const fetchedPurchaseStatus = await purchaseStatusLoader({
|
|
268
|
+
orderId: latestOrder?.orderId,
|
|
269
|
+
paymentId: latestPayment?.paymentId,
|
|
270
|
+
transactionId: latestPayment?.transactionId ?? latestOrder?.transactionId
|
|
271
|
+
}).catch(() => void 0);
|
|
272
|
+
const normalizedPurchaseStatus = normalizeBillingPurchaseStatus(
|
|
273
|
+
fetchedPurchaseStatus,
|
|
274
|
+
latestOrder,
|
|
275
|
+
latestPayment
|
|
276
|
+
);
|
|
277
|
+
setSubscription(subscriptionWithProduct);
|
|
278
|
+
setSubscriptionHistory(nextSubscriptionHistory);
|
|
279
|
+
setProducts(nextProducts);
|
|
280
|
+
setOrderHistory(nextOrderHistory);
|
|
281
|
+
setPaymentHistory(nextPaymentHistory);
|
|
282
|
+
setCredits(normalizedCredits);
|
|
283
|
+
setEntitlements(normalizedEntitlements);
|
|
284
|
+
setPurchaseStatus(normalizedPurchaseStatus);
|
|
285
|
+
setStatus({ loading: false, refreshing: false, error: null, lastFetchedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
286
|
+
} catch (error) {
|
|
287
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
288
|
+
setRuntimeConfigError(message);
|
|
289
|
+
setStatus((current) => ({ ...current, loading: false, refreshing: false, error: message }));
|
|
290
|
+
} finally {
|
|
291
|
+
setRuntimeConfigLoading(false);
|
|
292
|
+
}
|
|
293
|
+
}, [apiClient, loaders, runtimeConfig, runtimeConfigLoader, runtimeCatalog]);
|
|
294
|
+
const runAction = useCallback(
|
|
295
|
+
async (payload) => {
|
|
296
|
+
const prepared = buildBillingActionPayload(payload, runtimeConfig);
|
|
297
|
+
const executor = actionExecutor ?? ((input) => apiClient.createAction(input));
|
|
298
|
+
setPurchaseStatus((current) => ({
|
|
299
|
+
actionKey: prepared.key,
|
|
300
|
+
orderId: current?.orderId,
|
|
301
|
+
paymentId: current?.paymentId,
|
|
302
|
+
transactionId: current?.transactionId,
|
|
303
|
+
status: "pending",
|
|
304
|
+
redirectTo: current?.redirectTo,
|
|
305
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
306
|
+
}));
|
|
307
|
+
setStatus((current) => ({ ...current, loading: true, refreshing: true, error: null }));
|
|
308
|
+
try {
|
|
309
|
+
const result = await executor(prepared);
|
|
310
|
+
setPurchaseStatus((current) => ({
|
|
311
|
+
actionKey: prepared.key,
|
|
312
|
+
orderId: current?.orderId,
|
|
313
|
+
paymentId: current?.paymentId,
|
|
314
|
+
transactionId: current?.transactionId,
|
|
315
|
+
status: result.status === "failed" ? "failed" : result.status === "succeeded" ? "paid" : "pending",
|
|
316
|
+
redirectTo: result.redirectTo ?? current?.redirectTo,
|
|
317
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
318
|
+
}));
|
|
319
|
+
if (result.redirectTo || result.nextAction) {
|
|
320
|
+
}
|
|
321
|
+
await refresh();
|
|
322
|
+
return result;
|
|
323
|
+
} catch (error) {
|
|
324
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
325
|
+
setPurchaseStatus((current) => ({
|
|
326
|
+
actionKey: prepared.key,
|
|
327
|
+
orderId: current?.orderId,
|
|
328
|
+
paymentId: current?.paymentId,
|
|
329
|
+
transactionId: current?.transactionId,
|
|
330
|
+
status: "failed",
|
|
331
|
+
redirectTo: current?.redirectTo,
|
|
332
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
333
|
+
}));
|
|
334
|
+
setStatus((current) => ({ ...current, loading: false, refreshing: false, error: message }));
|
|
335
|
+
throw error;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
[actionExecutor, apiClient, refresh, runtimeConfig]
|
|
339
|
+
);
|
|
340
|
+
useEffect(() => {
|
|
341
|
+
if (!autoRefresh) return;
|
|
342
|
+
if (runtimeConfigLoading) return;
|
|
343
|
+
if (!runtimeConfig && !runtimeConfigError) {
|
|
344
|
+
void refresh();
|
|
345
|
+
}
|
|
346
|
+
}, [autoRefresh, refresh, runtimeConfig, runtimeConfigError, runtimeConfigLoading]);
|
|
347
|
+
const coreValue = useMemo(
|
|
348
|
+
() => buildCoreValue({
|
|
349
|
+
apiClient,
|
|
350
|
+
loaders,
|
|
351
|
+
runtimeConfigLoader,
|
|
352
|
+
actionExecutor,
|
|
353
|
+
defaults,
|
|
354
|
+
runtimeConfig,
|
|
355
|
+
runtimeCatalog,
|
|
356
|
+
runtimeConfigLoading,
|
|
357
|
+
runtimeConfigError,
|
|
358
|
+
subscription,
|
|
359
|
+
subscriptionHistory,
|
|
360
|
+
products,
|
|
361
|
+
orderHistory,
|
|
362
|
+
paymentHistory,
|
|
363
|
+
credits,
|
|
364
|
+
entitlements,
|
|
365
|
+
purchaseStatus,
|
|
366
|
+
status,
|
|
367
|
+
refresh,
|
|
368
|
+
runAction,
|
|
369
|
+
setRuntimeConfig,
|
|
370
|
+
setSubscription,
|
|
371
|
+
setSubscriptionHistory,
|
|
372
|
+
setProducts,
|
|
373
|
+
setOrderHistory,
|
|
374
|
+
setPaymentHistory,
|
|
375
|
+
setCredits,
|
|
376
|
+
setEntitlements,
|
|
377
|
+
setPurchaseStatus,
|
|
378
|
+
setStatus
|
|
379
|
+
}),
|
|
380
|
+
[
|
|
381
|
+
actionExecutor,
|
|
382
|
+
apiClient,
|
|
383
|
+
credits,
|
|
384
|
+
defaults,
|
|
385
|
+
entitlements,
|
|
386
|
+
orderHistory,
|
|
387
|
+
paymentHistory,
|
|
388
|
+
products,
|
|
389
|
+
purchaseStatus,
|
|
390
|
+
refresh,
|
|
391
|
+
runAction,
|
|
392
|
+
runtimeConfig,
|
|
393
|
+
runtimeConfigError,
|
|
394
|
+
runtimeConfigLoader,
|
|
395
|
+
runtimeConfigLoading,
|
|
396
|
+
runtimeCatalog,
|
|
397
|
+
loaders,
|
|
398
|
+
status,
|
|
399
|
+
subscription,
|
|
400
|
+
subscriptionHistory
|
|
401
|
+
]
|
|
402
|
+
);
|
|
403
|
+
return /* @__PURE__ */ jsx2(BillingCoreContext.Provider, { value: coreValue, children: /* @__PURE__ */ jsx2(SubscriptionProvider, { subscription, subscriptionHistory, entitlements, status, children: /* @__PURE__ */ jsx2(ProductProvider, { products, orderHistory, paymentHistory, status, children: /* @__PURE__ */ jsx2(CreditsProvider, { credits, status, children }) }) }) });
|
|
404
|
+
}
|
|
405
|
+
function BillingCoreProvider(props) {
|
|
406
|
+
return /* @__PURE__ */ jsx2(BillingProvider, { ...props });
|
|
407
|
+
}
|
|
408
|
+
function SubscriptionProvider({
|
|
409
|
+
children,
|
|
410
|
+
availablePlans,
|
|
411
|
+
subscription,
|
|
412
|
+
subscriptionHistory,
|
|
413
|
+
entitlements,
|
|
414
|
+
status
|
|
415
|
+
}) {
|
|
416
|
+
const core = useOptionalContext(BillingCoreContext);
|
|
417
|
+
const value = useMemo(
|
|
418
|
+
() => ({
|
|
419
|
+
availablePlans: choose(availablePlans, core?.runtimeConfig?.items?.filter((item) => item.kind === "subscription")),
|
|
420
|
+
subscription: choose(subscription, core?.subscription),
|
|
421
|
+
subscriptionHistory: choose(subscriptionHistory, core?.subscriptionHistory),
|
|
422
|
+
entitlements: choose(entitlements, core?.entitlements),
|
|
423
|
+
status: choose(status, core?.status)
|
|
424
|
+
}),
|
|
425
|
+
[availablePlans, core?.entitlements, core?.runtimeConfig?.items, core?.status, core?.subscription, core?.subscriptionHistory, entitlements, status, subscription, subscriptionHistory]
|
|
426
|
+
);
|
|
427
|
+
return /* @__PURE__ */ jsx2(BillingSubscriptionContext.Provider, { value, children });
|
|
428
|
+
}
|
|
429
|
+
function ProductProvider({
|
|
430
|
+
children,
|
|
431
|
+
availableProducts,
|
|
432
|
+
products,
|
|
433
|
+
orderHistory,
|
|
434
|
+
paymentHistory,
|
|
435
|
+
status
|
|
436
|
+
}) {
|
|
437
|
+
const core = useOptionalContext(BillingCoreContext);
|
|
438
|
+
const value = useMemo(
|
|
439
|
+
() => ({
|
|
440
|
+
availableProducts: choose(availableProducts, core?.runtimeConfig?.items?.filter((item) => item.kind === "product" || item.kind === "credits")),
|
|
441
|
+
products: choose(products, core?.products),
|
|
442
|
+
orderHistory: choose(orderHistory, core?.orderHistory),
|
|
443
|
+
paymentHistory: choose(paymentHistory, core?.paymentHistory),
|
|
444
|
+
status: choose(status, core?.status)
|
|
445
|
+
}),
|
|
446
|
+
[availableProducts, core?.orderHistory, core?.paymentHistory, core?.products, core?.runtimeConfig?.items, core?.status, orderHistory, paymentHistory, products, status]
|
|
447
|
+
);
|
|
448
|
+
return /* @__PURE__ */ jsx2(BillingProductContext.Provider, { value, children });
|
|
449
|
+
}
|
|
450
|
+
function CreditsProvider({ children, credits, status }) {
|
|
451
|
+
const core = useOptionalContext(BillingCoreContext);
|
|
452
|
+
const value = useMemo(
|
|
453
|
+
() => ({
|
|
454
|
+
credits: choose(credits, core?.credits),
|
|
455
|
+
status: choose(status, core?.status)
|
|
456
|
+
}),
|
|
457
|
+
[credits, core?.credits, core?.status, status]
|
|
458
|
+
);
|
|
459
|
+
return /* @__PURE__ */ jsx2(BillingCreditsContext.Provider, { value, children });
|
|
460
|
+
}
|
|
461
|
+
function useBillingContext() {
|
|
462
|
+
return useRequiredCoreContext();
|
|
463
|
+
}
|
|
464
|
+
function useBillingCatalog() {
|
|
465
|
+
const core = useRequiredCoreContext();
|
|
466
|
+
return useMemo(
|
|
467
|
+
() => ({
|
|
468
|
+
catalog: core.runtimeCatalog ?? core.runtimeConfig,
|
|
469
|
+
loading: core.runtimeConfigLoading,
|
|
470
|
+
error: core.runtimeConfigError,
|
|
471
|
+
refresh: core.refresh
|
|
472
|
+
}),
|
|
473
|
+
[core.refresh, core.runtimeCatalog, core.runtimeConfig, core.runtimeConfigError, core.runtimeConfigLoading]
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function useBillingItem(itemKey) {
|
|
477
|
+
const core = useRequiredCoreContext();
|
|
478
|
+
return useMemo(() => {
|
|
479
|
+
const item = resolveBillingItem(core.runtimeConfig?.items, itemKey);
|
|
480
|
+
return {
|
|
481
|
+
item: resolveBillingProductSnapshot(item),
|
|
482
|
+
loading: core.runtimeConfigLoading,
|
|
483
|
+
error: core.runtimeConfigError,
|
|
484
|
+
refresh: core.refresh
|
|
485
|
+
};
|
|
486
|
+
}, [core.refresh, core.runtimeConfig?.items, core.runtimeConfigError, core.runtimeConfigLoading, itemKey]);
|
|
487
|
+
}
|
|
488
|
+
function useBillingProducts(options = {}) {
|
|
489
|
+
const core = useRequiredCoreContext();
|
|
490
|
+
const productContext = useOptionalContext(BillingProductContext);
|
|
491
|
+
const products = choose(productContext?.products, core.products) ?? [];
|
|
492
|
+
return useMemo(
|
|
493
|
+
() => ({
|
|
494
|
+
products: filterProductsByKind(products, options.kind),
|
|
495
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
496
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
497
|
+
refresh: core.refresh
|
|
498
|
+
}),
|
|
499
|
+
[core.refresh, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, options.kind, products]
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
function useBillingAvailablePlans() {
|
|
503
|
+
const core = useRequiredCoreContext();
|
|
504
|
+
const subscriptionContext = useOptionalContext(BillingSubscriptionContext);
|
|
505
|
+
const plans = choose(subscriptionContext?.availablePlans, core.runtimeConfig?.items?.filter((item) => item.kind === "subscription")) ?? [];
|
|
506
|
+
return useMemo(
|
|
507
|
+
() => ({
|
|
508
|
+
plans,
|
|
509
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
510
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
511
|
+
refresh: core.refresh
|
|
512
|
+
}),
|
|
513
|
+
[core.refresh, core.runtimeConfig?.items, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, plans]
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
function useBillingAvailableProducts() {
|
|
517
|
+
const core = useRequiredCoreContext();
|
|
518
|
+
const productContext = useOptionalContext(BillingProductContext);
|
|
519
|
+
const items = choose(productContext?.availableProducts, core.runtimeConfig?.items?.filter((item) => item.kind === "product" || item.kind === "credits")) ?? [];
|
|
520
|
+
return useMemo(
|
|
521
|
+
() => ({
|
|
522
|
+
items,
|
|
523
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
524
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
525
|
+
refresh: core.refresh
|
|
526
|
+
}),
|
|
527
|
+
[core.refresh, core.runtimeConfig?.items, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, items]
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
function useBillingOrderHistory(_options = {}) {
|
|
531
|
+
const core = useRequiredCoreContext();
|
|
532
|
+
const productContext = useOptionalContext(BillingProductContext);
|
|
533
|
+
const orders = choose(productContext?.orderHistory, core.orderHistory) ?? [];
|
|
534
|
+
return useMemo(
|
|
535
|
+
() => ({
|
|
536
|
+
orders,
|
|
537
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
538
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
539
|
+
refresh: core.refresh
|
|
540
|
+
}),
|
|
541
|
+
[core.refresh, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, orders]
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
function useBillingPaymentHistory(_options = {}) {
|
|
545
|
+
const core = useRequiredCoreContext();
|
|
546
|
+
const productContext = useOptionalContext(BillingProductContext);
|
|
547
|
+
const payments = choose(productContext?.paymentHistory, core.paymentHistory) ?? [];
|
|
548
|
+
return useMemo(
|
|
549
|
+
() => ({
|
|
550
|
+
payments,
|
|
551
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
552
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
553
|
+
refresh: core.refresh
|
|
554
|
+
}),
|
|
555
|
+
[core.refresh, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, payments]
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
function useBillingSubscription() {
|
|
559
|
+
const core = useRequiredCoreContext();
|
|
560
|
+
const subscriptionContext = useOptionalContext(BillingSubscriptionContext);
|
|
561
|
+
return useMemo(
|
|
562
|
+
() => ({
|
|
563
|
+
subscription: choose(subscriptionContext?.subscription, core.subscription),
|
|
564
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
565
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
566
|
+
refresh: core.refresh
|
|
567
|
+
}),
|
|
568
|
+
[core.refresh, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, core.subscription, subscriptionContext?.subscription]
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
function useBillingSubscriptionProduct() {
|
|
572
|
+
const core = useRequiredCoreContext();
|
|
573
|
+
const subscriptionContext = useOptionalContext(BillingSubscriptionContext);
|
|
574
|
+
const subscription = choose(subscriptionContext?.subscription, core.subscription);
|
|
575
|
+
return useMemo(
|
|
576
|
+
() => ({
|
|
577
|
+
product: subscription?.product ?? resolveBillingSubscriptionProduct(subscription, core.runtimeConfig),
|
|
578
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
579
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
580
|
+
refresh: core.refresh
|
|
581
|
+
}),
|
|
582
|
+
[core.refresh, core.runtimeConfig, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, subscription]
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
function useBillingSubscriptionHistory(_options = {}) {
|
|
586
|
+
const core = useRequiredCoreContext();
|
|
587
|
+
const subscriptionContext = useOptionalContext(BillingSubscriptionContext);
|
|
588
|
+
const history = choose(subscriptionContext?.subscriptionHistory, core.subscriptionHistory) ?? [];
|
|
589
|
+
return useMemo(
|
|
590
|
+
() => ({
|
|
591
|
+
history,
|
|
592
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
593
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
594
|
+
refresh: core.refresh
|
|
595
|
+
}),
|
|
596
|
+
[core.refresh, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, history]
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
function useBillingCredits() {
|
|
600
|
+
const core = useRequiredCoreContext();
|
|
601
|
+
const creditsContext = useOptionalContext(BillingCreditsContext);
|
|
602
|
+
const credits = choose(creditsContext?.credits, core.credits) ?? deriveBillingCreditsState(void 0, core.products, core.runtimeConfig?.conversionRules);
|
|
603
|
+
return useMemo(
|
|
604
|
+
() => ({
|
|
605
|
+
credits,
|
|
606
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
607
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
608
|
+
refresh: core.refresh
|
|
609
|
+
}),
|
|
610
|
+
[core.refresh, core.runtimeConfig?.conversionRules, core.runtimeConfigError, core.runtimeConfigLoading, core.products, core.status.error, core.status.loading, credits]
|
|
611
|
+
);
|
|
612
|
+
}
|
|
613
|
+
function useBillingEntitlements() {
|
|
614
|
+
const core = useRequiredCoreContext();
|
|
615
|
+
const subscriptionContext = useOptionalContext(BillingSubscriptionContext);
|
|
616
|
+
const entitlements = choose(subscriptionContext?.entitlements, core.entitlements) ?? deriveBillingEntitlements(subscriptionContext?.subscription ?? core.subscription, core.products, core.credits, core.runtimeConfig);
|
|
617
|
+
return useMemo(
|
|
618
|
+
() => ({
|
|
619
|
+
entitlements,
|
|
620
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
621
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
622
|
+
refresh: core.refresh
|
|
623
|
+
}),
|
|
624
|
+
[core.credits, core.products, core.refresh, core.runtimeConfig, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, entitlements, subscriptionContext?.subscription, core.subscription]
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
function useBillingPurchaseStatus() {
|
|
628
|
+
const core = useRequiredCoreContext();
|
|
629
|
+
const productContext = useOptionalContext(BillingProductContext);
|
|
630
|
+
const order = getLatestOrder(choose(productContext?.orderHistory, core.orderHistory));
|
|
631
|
+
const payment = getLatestPayment(choose(productContext?.paymentHistory, core.paymentHistory));
|
|
632
|
+
const purchaseStatus = core.purchaseStatus ?? normalizeBillingPurchaseStatus(void 0, order, payment);
|
|
633
|
+
return useMemo(
|
|
634
|
+
() => ({
|
|
635
|
+
purchaseStatus,
|
|
636
|
+
loading: core.runtimeConfigLoading || core.status.loading,
|
|
637
|
+
error: core.runtimeConfigError ?? core.status.error,
|
|
638
|
+
refresh: core.refresh
|
|
639
|
+
}),
|
|
640
|
+
[core.purchaseStatus, core.refresh, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, order, payment, purchaseStatus]
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
function useBillingStatus() {
|
|
644
|
+
const core = useRequiredCoreContext();
|
|
645
|
+
return useMemo(() => ({ status: core.status }), [core.status]);
|
|
646
|
+
}
|
|
647
|
+
function useBillingRefresh() {
|
|
648
|
+
const core = useRequiredCoreContext();
|
|
649
|
+
return useMemo(() => ({ refresh: core.refresh }), [core.refresh]);
|
|
650
|
+
}
|
|
651
|
+
function useBillingPipeline(options = {}) {
|
|
652
|
+
const core = useRequiredCoreContext();
|
|
653
|
+
const purchaseStatusView = useBillingPurchaseStatus();
|
|
654
|
+
const run = useCallback(
|
|
655
|
+
async (payload) => {
|
|
656
|
+
const prepared = options.onBeforeAction ? await options.onBeforeAction(payload) : payload;
|
|
657
|
+
try {
|
|
658
|
+
const result = await core.runAction(prepared);
|
|
659
|
+
if (options.onAfterAction) {
|
|
660
|
+
await options.onAfterAction({ redirectTo: result.redirectTo, nextAction: result.nextAction });
|
|
661
|
+
}
|
|
662
|
+
} catch (error) {
|
|
663
|
+
if (options.onError) {
|
|
664
|
+
await options.onError(error);
|
|
665
|
+
}
|
|
666
|
+
throw error;
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
[core, options]
|
|
670
|
+
);
|
|
671
|
+
return useMemo(
|
|
672
|
+
() => ({
|
|
673
|
+
run,
|
|
674
|
+
loading: core.status.loading || core.runtimeConfigLoading,
|
|
675
|
+
error: core.status.error ?? core.runtimeConfigError,
|
|
676
|
+
purchaseStatus: purchaseStatusView.purchaseStatus,
|
|
677
|
+
refresh: core.refresh
|
|
678
|
+
}),
|
|
679
|
+
[core.refresh, core.runtimeConfigError, core.runtimeConfigLoading, core.status.error, core.status.loading, purchaseStatusView.purchaseStatus, run]
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
function useBillingActionRunner(kind, defaults) {
|
|
683
|
+
const pipeline = useBillingPipeline();
|
|
684
|
+
const run = useCallback(
|
|
685
|
+
async (payload) => {
|
|
686
|
+
await pipeline.run({
|
|
687
|
+
...defaults,
|
|
688
|
+
...payload,
|
|
689
|
+
kind
|
|
690
|
+
});
|
|
691
|
+
},
|
|
692
|
+
[defaults, kind, pipeline]
|
|
693
|
+
);
|
|
694
|
+
return useMemo(
|
|
695
|
+
() => ({
|
|
696
|
+
run,
|
|
697
|
+
loading: pipeline.loading,
|
|
698
|
+
error: pipeline.error
|
|
699
|
+
}),
|
|
700
|
+
[pipeline.error, pipeline.loading, run]
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
function useSubscribePlan() {
|
|
704
|
+
return useBillingActionRunner("subscribe");
|
|
705
|
+
}
|
|
706
|
+
function useManageSubscription() {
|
|
707
|
+
return useBillingActionRunner("manage");
|
|
708
|
+
}
|
|
709
|
+
function useUpgradePlan() {
|
|
710
|
+
return useBillingActionRunner("upgrade");
|
|
711
|
+
}
|
|
712
|
+
function useCancelSubscription() {
|
|
713
|
+
return useBillingActionRunner("cancel");
|
|
714
|
+
}
|
|
715
|
+
function usePurchaseCredits() {
|
|
716
|
+
return useBillingActionRunner("purchase");
|
|
717
|
+
}
|
|
718
|
+
function usePurchaseProduct() {
|
|
719
|
+
return useBillingActionRunner("purchase");
|
|
720
|
+
}
|
|
721
|
+
function useBillingProduct(productKey) {
|
|
722
|
+
const productsState = useBillingProducts();
|
|
723
|
+
const product = productsState.products.find((item) => item.productKey === productKey);
|
|
724
|
+
return useMemo(
|
|
725
|
+
() => ({
|
|
726
|
+
product,
|
|
727
|
+
loading: productsState.loading,
|
|
728
|
+
error: productsState.error,
|
|
729
|
+
refresh: productsState.refresh
|
|
730
|
+
}),
|
|
731
|
+
[product, productsState.error, productsState.loading, productsState.refresh]
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
function useBillingCatalogConfig() {
|
|
735
|
+
return useBillingCatalog();
|
|
736
|
+
}
|
|
737
|
+
export {
|
|
738
|
+
AuthProvider,
|
|
739
|
+
BillingCoreProvider,
|
|
740
|
+
BillingProvider,
|
|
741
|
+
CreditsProvider,
|
|
742
|
+
ProductProvider,
|
|
743
|
+
SubscriptionProvider,
|
|
744
|
+
useAuthActions,
|
|
745
|
+
useAuthRole,
|
|
746
|
+
useAuthSession,
|
|
747
|
+
useAuthUser,
|
|
748
|
+
useBillingAvailablePlans,
|
|
749
|
+
useBillingAvailableProducts,
|
|
750
|
+
useBillingCatalog,
|
|
751
|
+
useBillingCatalogConfig,
|
|
752
|
+
useBillingContext,
|
|
753
|
+
useBillingCredits,
|
|
754
|
+
useBillingEntitlements,
|
|
755
|
+
useBillingItem,
|
|
756
|
+
useBillingOrderHistory,
|
|
757
|
+
useBillingPaymentHistory,
|
|
758
|
+
useBillingPipeline,
|
|
759
|
+
useBillingProduct,
|
|
760
|
+
useBillingProducts,
|
|
761
|
+
useBillingPurchaseStatus,
|
|
762
|
+
useBillingRefresh,
|
|
763
|
+
useBillingStatus,
|
|
764
|
+
useBillingSubscription,
|
|
765
|
+
useBillingSubscriptionHistory,
|
|
766
|
+
useBillingSubscriptionProduct,
|
|
767
|
+
useCancelSubscription,
|
|
768
|
+
useManageSubscription,
|
|
769
|
+
usePurchaseCredits,
|
|
770
|
+
usePurchaseProduct,
|
|
771
|
+
useSubscribePlan,
|
|
772
|
+
useUpgradePlan
|
|
773
|
+
};
|
|
774
|
+
//# sourceMappingURL=index.js.map
|