@kelviq/react-sdk 2.0.2 → 2.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/components/KQFeatureList.d.ts +19 -0
- package/dist/components/KQPrice.d.ts +29 -0
- package/dist/contexts/KelviqContext.d.ts +6 -2
- package/dist/contexts/KelviqProvider.d.ts +6 -2
- package/dist/hooks/usePricing.d.ts +9 -0
- package/dist/index.d.ts +4 -0
- package/dist/kelviq-react-sdk.js +476 -300
- package/dist/kelviq-react-sdk.umd.cjs +1 -1
- package/dist/types/api.types.d.ts +95 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/sdk.types.d.ts +6 -0
- package/dist/utils/formatPrice.d.ts +11 -0
- package/package.json +1 -1
package/dist/kelviq-react-sdk.js
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { jsx as L, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as se, useState as I, useCallback as R, useEffect as ae, useMemo as le, useContext as ce } from "react";
|
|
3
|
+
const ue = "GET", de = 5e3, fe = 3, me = 1e3;
|
|
4
|
+
function x(n) {
|
|
5
5
|
const {
|
|
6
|
-
method:
|
|
7
|
-
headers:
|
|
6
|
+
method: i = ue,
|
|
7
|
+
headers: s = {},
|
|
8
8
|
// Renamed to avoid conflict with internal 'headers' variable
|
|
9
9
|
body: t,
|
|
10
|
-
timeout:
|
|
11
|
-
maxRetries:
|
|
12
|
-
backoffBaseDelay:
|
|
13
|
-
queryParams:
|
|
14
|
-
accessToken:
|
|
10
|
+
timeout: m = de,
|
|
11
|
+
maxRetries: u = fe,
|
|
12
|
+
backoffBaseDelay: d = me,
|
|
13
|
+
queryParams: E,
|
|
14
|
+
accessToken: o
|
|
15
15
|
// Use the direct accessToken
|
|
16
16
|
} = n;
|
|
17
|
-
let { url:
|
|
18
|
-
return new Promise((
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
for (const
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
let { url: a } = n, g = 0;
|
|
18
|
+
return new Promise((q, P) => {
|
|
19
|
+
if (E) {
|
|
20
|
+
const v = new URLSearchParams();
|
|
21
|
+
for (const S in E)
|
|
22
|
+
E[S] !== void 0 && v.append(S, String(E[S]));
|
|
23
|
+
v.toString() && (a += (a.includes("?") ? "&" : "?") + v.toString());
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
25
|
+
function b() {
|
|
26
|
+
const v = new XMLHttpRequest();
|
|
27
|
+
v.open(i, a, !0), v.timeout = m;
|
|
28
|
+
const S = {
|
|
29
29
|
Accept: "application/json",
|
|
30
30
|
"X-Requested-With": "XMLHttpRequest",
|
|
31
|
-
...
|
|
31
|
+
...s
|
|
32
32
|
// Apply custom headers, allowing them to override defaults
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
for (const [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const { status:
|
|
39
|
-
if (
|
|
34
|
+
i !== "GET" && t && typeof t == "object" && !(t instanceof FormData) && (S["Content-Type"] || (S["Content-Type"] = "application/json")), o && (S.Authorization = `Bearer ${o}`);
|
|
35
|
+
for (const [l, p] of Object.entries(S))
|
|
36
|
+
v.setRequestHeader(l, p);
|
|
37
|
+
v.onload = function() {
|
|
38
|
+
const { status: l, statusText: p, responseText: y } = v;
|
|
39
|
+
if (l >= 200 && l < 300)
|
|
40
40
|
try {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
} catch (
|
|
44
|
-
const
|
|
41
|
+
const A = y ? JSON.parse(y) : {};
|
|
42
|
+
q({ status: l, statusText: p, data: A });
|
|
43
|
+
} catch (A) {
|
|
44
|
+
const K = A instanceof Error ? A : new Error(String(A));
|
|
45
45
|
console.error(
|
|
46
|
-
`Kelviq SDK (apiRequest): Invalid JSON response for URL ${
|
|
46
|
+
`Kelviq SDK (apiRequest): Invalid JSON response for URL ${a}. Error: ${K.message}. Response: ${y}`
|
|
47
47
|
), P(
|
|
48
48
|
new Error(
|
|
49
|
-
`Invalid JSON response: ${
|
|
49
|
+
`Invalid JSON response: ${K.message}`
|
|
50
50
|
)
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
else
|
|
54
|
-
|
|
55
|
-
`Request to ${
|
|
54
|
+
$(
|
|
55
|
+
`Request to ${a} failed with status ${l} ${p}. Response: ${y}`
|
|
56
56
|
);
|
|
57
|
-
},
|
|
58
|
-
`Network error for URL ${
|
|
59
|
-
),
|
|
60
|
-
function
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
57
|
+
}, v.onerror = () => $(
|
|
58
|
+
`Network error for URL ${a}. The request could not be completed.`
|
|
59
|
+
), v.ontimeout = () => $(`Request to ${a} timed out.`);
|
|
60
|
+
function $(l) {
|
|
61
|
+
if (g < u) {
|
|
62
|
+
g++;
|
|
63
|
+
const p = Math.min(
|
|
64
|
+
d * Math.pow(2, g - 1),
|
|
65
65
|
3e4
|
|
66
66
|
// Cap retry delay at 30 seconds
|
|
67
67
|
);
|
|
68
68
|
console.warn(
|
|
69
|
-
`Kelviq SDK (apiRequest): Retrying request to ${
|
|
70
|
-
), setTimeout(
|
|
69
|
+
`Kelviq SDK (apiRequest): Retrying request to ${a}. Attempt ${g}/${u}. Error: ${l}. Retrying in ${p}ms.`
|
|
70
|
+
), setTimeout(b, p);
|
|
71
71
|
} else
|
|
72
72
|
P(
|
|
73
73
|
new Error(
|
|
74
|
-
`${
|
|
74
|
+
`${l} (Max retries ${u} reached)`
|
|
75
75
|
)
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
try {
|
|
79
|
-
let
|
|
80
|
-
t && typeof t == "object" && !(t instanceof FormData) &&
|
|
81
|
-
} catch (
|
|
82
|
-
const
|
|
79
|
+
let l = t;
|
|
80
|
+
t && typeof t == "object" && !(t instanceof FormData) && S["Content-Type"] === "application/json" && (l = JSON.stringify(t)), v.send(l);
|
|
81
|
+
} catch (l) {
|
|
82
|
+
const p = l instanceof Error ? l : new Error(String(l));
|
|
83
83
|
console.error(
|
|
84
|
-
`Kelviq SDK (apiRequest): Error sending request to ${
|
|
85
|
-
|
|
86
|
-
), P(new Error(`Failed to send request: ${
|
|
84
|
+
`Kelviq SDK (apiRequest): Error sending request to ${a}.`,
|
|
85
|
+
p
|
|
86
|
+
), P(new Error(`Failed to send request: ${p.message}`));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
b();
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
let t = 0,
|
|
96
|
-
for (const
|
|
97
|
-
const
|
|
98
|
-
|
|
92
|
+
function ge(n, i) {
|
|
93
|
+
const s = i[0].featureType;
|
|
94
|
+
if (s === "METER") {
|
|
95
|
+
let t = 0, m = 0, u = !1;
|
|
96
|
+
for (const E of i) {
|
|
97
|
+
const o = E, a = typeof o.usageLimit == "number" ? o.usageLimit : null, g = typeof o.currentUsage == "number" ? o.currentUsage : 0;
|
|
98
|
+
a === null && (t = null), t !== null && (t += a), m += g, o.hardLimit && (u = !0);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const d = t !== null ? t - m : null;
|
|
101
101
|
return {
|
|
102
102
|
featureId: n,
|
|
103
|
-
featureType:
|
|
104
|
-
hasAccess:
|
|
105
|
-
currentUsage:
|
|
103
|
+
featureType: s,
|
|
104
|
+
hasAccess: d === null || d > 0,
|
|
105
|
+
currentUsage: m,
|
|
106
106
|
usageLimit: t,
|
|
107
|
-
remaining:
|
|
108
|
-
hardLimit:
|
|
109
|
-
items:
|
|
107
|
+
remaining: d,
|
|
108
|
+
hardLimit: u,
|
|
109
|
+
items: i
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
if (
|
|
113
|
-
const t =
|
|
112
|
+
if (s === "CUSTOMIZABLE") {
|
|
113
|
+
const t = i[0];
|
|
114
114
|
return {
|
|
115
115
|
featureId: n,
|
|
116
|
-
featureType:
|
|
117
|
-
hasAccess:
|
|
116
|
+
featureType: s,
|
|
117
|
+
hasAccess: i.some((m) => m.hasAccess),
|
|
118
118
|
currentUsage: typeof t.currentUsage == "number" ? t.currentUsage : 0,
|
|
119
119
|
usageLimit: typeof t.usageLimit == "number" ? t.usageLimit : null,
|
|
120
120
|
remaining: typeof t.remaining == "number" ? t.remaining : null,
|
|
121
121
|
hardLimit: t.hardLimit === !0,
|
|
122
|
-
items:
|
|
122
|
+
items: i
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
return {
|
|
126
126
|
featureId: n,
|
|
127
|
-
featureType:
|
|
128
|
-
hasAccess:
|
|
127
|
+
featureType: s,
|
|
128
|
+
hasAccess: i.some((t) => t.hasAccess),
|
|
129
129
|
currentUsage: 0,
|
|
130
130
|
usageLimit: null,
|
|
131
131
|
remaining: null,
|
|
132
132
|
hardLimit: !1,
|
|
133
|
-
items:
|
|
133
|
+
items: i
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
const
|
|
136
|
+
function pe(n) {
|
|
137
|
+
const i = {};
|
|
138
138
|
if (!n || !Array.isArray(n.entitlements))
|
|
139
139
|
return console.warn(
|
|
140
140
|
"Kelviq SDK: Invalid or empty entitlements array in API response.",
|
|
141
141
|
n
|
|
142
|
-
),
|
|
143
|
-
const
|
|
142
|
+
), i;
|
|
143
|
+
const s = {};
|
|
144
144
|
for (const t of n.entitlements) {
|
|
145
145
|
if (!t || typeof t.featureId != "string" || typeof t.featureType != "string") {
|
|
146
146
|
console.warn(
|
|
@@ -149,16 +149,16 @@ function le(n) {
|
|
|
149
149
|
);
|
|
150
150
|
continue;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
s[t.featureId] || (s[t.featureId] = []), s[t.featureId].push(t);
|
|
153
153
|
}
|
|
154
|
-
for (const t in
|
|
155
|
-
|
|
154
|
+
for (const t in s)
|
|
155
|
+
i[t] = ge(
|
|
156
156
|
t,
|
|
157
|
-
|
|
157
|
+
s[t]
|
|
158
158
|
);
|
|
159
|
-
return
|
|
159
|
+
return i;
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const re = {
|
|
162
162
|
allEntitlements: {
|
|
163
163
|
data: null,
|
|
164
164
|
isLoading: !0,
|
|
@@ -193,93 +193,108 @@ const V = {
|
|
|
193
193
|
refreshCustomer: () => (console.warn(
|
|
194
194
|
"refreshCustomer called on default KelviqContext. Ensure KelviqProvider is properly set up."
|
|
195
195
|
), Promise.resolve()),
|
|
196
|
+
pricing: {
|
|
197
|
+
data: null,
|
|
198
|
+
isLoading: !1,
|
|
199
|
+
error: null
|
|
200
|
+
},
|
|
201
|
+
refreshPricing: () => (console.warn(
|
|
202
|
+
"refreshPricing called on default KelviqContext. Ensure KelviqProvider is properly set up."
|
|
203
|
+
), Promise.resolve()),
|
|
196
204
|
isLoading: !0,
|
|
197
205
|
error: null,
|
|
198
206
|
apiUrl: "",
|
|
199
207
|
environment: "production",
|
|
200
208
|
entitlementsPath: "",
|
|
201
209
|
customerId: ""
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
),
|
|
210
|
+
}, te = se(
|
|
211
|
+
re
|
|
212
|
+
), he = "https://edge.api.kelviq.com/api/v1/", Ee = "https://edge.sandboxapi.kelviq.com/api/v1/", Le = "https://api.kelviq.com/api/v1/", ve = "https://sandboxapi.kelviq.com/api/v1/", ye = "entitlements/", Ae = "monetization/product-offering/", Se = ({
|
|
205
213
|
children: n,
|
|
206
|
-
apiUrl:
|
|
207
|
-
entitlementsPath:
|
|
214
|
+
apiUrl: i,
|
|
215
|
+
entitlementsPath: s = ye,
|
|
208
216
|
customerId: t,
|
|
209
|
-
environment:
|
|
210
|
-
accessToken:
|
|
211
|
-
|
|
217
|
+
environment: m = "production",
|
|
218
|
+
accessToken: u,
|
|
219
|
+
productId: d,
|
|
220
|
+
plansEnabled: E,
|
|
221
|
+
config: o = {}
|
|
212
222
|
}) => {
|
|
213
223
|
const {
|
|
214
|
-
onError:
|
|
215
|
-
maxRetries:
|
|
216
|
-
timeout:
|
|
217
|
-
backoffBaseDelay:
|
|
218
|
-
fetchEntitlementsOnMount:
|
|
219
|
-
fetchSubscriptionsOnMount:
|
|
220
|
-
fetchCustomerOnMount:
|
|
221
|
-
|
|
224
|
+
onError: a,
|
|
225
|
+
maxRetries: g,
|
|
226
|
+
timeout: q,
|
|
227
|
+
backoffBaseDelay: P,
|
|
228
|
+
fetchEntitlementsOnMount: b = !0,
|
|
229
|
+
fetchSubscriptionsOnMount: v = !1,
|
|
230
|
+
fetchCustomerOnMount: S = !1,
|
|
231
|
+
fetchPricingOnMount: $ = !1
|
|
232
|
+
} = o, l = i || (m === "sandbox" ? Ee : he), p = m === "sandbox" ? ve : Le, [y, A] = I({
|
|
222
233
|
data: null,
|
|
223
|
-
isLoading: !!
|
|
234
|
+
isLoading: !!l && b,
|
|
224
235
|
error: null
|
|
225
|
-
}), [
|
|
236
|
+
}), [K, ie] = I(null), [k, M] = I({
|
|
226
237
|
data: null,
|
|
227
|
-
isLoading: !!
|
|
238
|
+
isLoading: !!l && v,
|
|
228
239
|
error: null
|
|
229
|
-
}), [
|
|
240
|
+
}), [X, D] = I({
|
|
230
241
|
data: null,
|
|
231
|
-
isLoading: !!
|
|
242
|
+
isLoading: !!l && S,
|
|
232
243
|
error: null
|
|
233
|
-
}), [
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
244
|
+
}), [z, _] = I({
|
|
245
|
+
data: null,
|
|
246
|
+
isLoading: !!l && $,
|
|
247
|
+
error: null
|
|
248
|
+
}), [F, T] = I(
|
|
249
|
+
!!l && b
|
|
250
|
+
), [W, j] = I(null), h = R(
|
|
251
|
+
(f, e, r) => {
|
|
237
252
|
const c = new Error(
|
|
238
|
-
`Kelviq SDK (${e}): ${
|
|
253
|
+
`Kelviq SDK (${e}): ${f}`
|
|
239
254
|
);
|
|
240
|
-
console.error(c.message, r || ""),
|
|
255
|
+
console.error(c.message, r || ""), j((U) => U || c), a && a(c);
|
|
241
256
|
},
|
|
242
|
-
[
|
|
243
|
-
),
|
|
244
|
-
if (!
|
|
257
|
+
[a]
|
|
258
|
+
), O = R(() => {
|
|
259
|
+
if (!l) {
|
|
245
260
|
const r = "API URL not configured. Cannot fetch entitlements.";
|
|
246
|
-
return
|
|
261
|
+
return A({
|
|
247
262
|
data: null,
|
|
248
263
|
isLoading: !1,
|
|
249
264
|
error: new Error(r)
|
|
250
|
-
}), h(r, "fetchAllEntitlements"),
|
|
265
|
+
}), h(r, "fetchAllEntitlements"), T(!1), Promise.reject(new Error(r));
|
|
251
266
|
}
|
|
252
267
|
if (!t) {
|
|
253
268
|
const r = "CustomerId must be provided as props to KelviqProvider.";
|
|
254
|
-
return
|
|
269
|
+
return A(() => ({
|
|
255
270
|
data: null,
|
|
256
271
|
isLoading: !1,
|
|
257
272
|
error: new Error(r)
|
|
258
|
-
})), h(r, "fetchAllEntitlements"),
|
|
273
|
+
})), h(r, "fetchAllEntitlements"), T(!1), Promise.reject(new Error(r));
|
|
259
274
|
}
|
|
260
|
-
|
|
275
|
+
A((r) => ({
|
|
261
276
|
...r,
|
|
262
277
|
isLoading: !0,
|
|
263
278
|
error: null
|
|
264
|
-
})),
|
|
265
|
-
const
|
|
266
|
-
return
|
|
267
|
-
url:
|
|
279
|
+
})), T(!0), j(null);
|
|
280
|
+
const f = `${l.replace(/\/$/, "")}/${s.replace(/^\//, "")}`;
|
|
281
|
+
return x({
|
|
282
|
+
url: f,
|
|
268
283
|
method: "GET",
|
|
269
|
-
timeout:
|
|
270
|
-
maxRetries:
|
|
271
|
-
backoffBaseDelay:
|
|
272
|
-
accessToken:
|
|
284
|
+
timeout: q,
|
|
285
|
+
maxRetries: g,
|
|
286
|
+
backoffBaseDelay: P,
|
|
287
|
+
accessToken: u,
|
|
273
288
|
queryParams: {
|
|
274
289
|
customer_id: t
|
|
275
290
|
}
|
|
276
291
|
}).then((r) => {
|
|
277
292
|
if (r && r.data && Array.isArray(r.data.entitlements)) {
|
|
278
|
-
|
|
279
|
-
const c =
|
|
293
|
+
ie(r.data);
|
|
294
|
+
const c = pe(
|
|
280
295
|
r.data
|
|
281
296
|
);
|
|
282
|
-
|
|
297
|
+
A({
|
|
283
298
|
data: c,
|
|
284
299
|
isLoading: !1,
|
|
285
300
|
error: null
|
|
@@ -288,7 +303,7 @@ const V = {
|
|
|
288
303
|
const c = new Error(
|
|
289
304
|
"Received empty, malformed, or invalid data structure from entitlements API."
|
|
290
305
|
);
|
|
291
|
-
throw
|
|
306
|
+
throw A({
|
|
292
307
|
data: null,
|
|
293
308
|
isLoading: !1,
|
|
294
309
|
error: c
|
|
@@ -300,27 +315,27 @@ const V = {
|
|
|
300
315
|
}
|
|
301
316
|
}).catch((r) => {
|
|
302
317
|
const c = r instanceof Error ? r : new Error(String(r));
|
|
303
|
-
return
|
|
304
|
-
...
|
|
318
|
+
return A((U) => ({
|
|
319
|
+
...U,
|
|
305
320
|
isLoading: !1,
|
|
306
321
|
error: c
|
|
307
322
|
})), h(c.message, "fetchAllEntitlements", r), Promise.reject(c);
|
|
308
323
|
}).finally(() => {
|
|
309
|
-
|
|
324
|
+
T(!1);
|
|
310
325
|
});
|
|
311
326
|
}, [
|
|
312
|
-
a,
|
|
313
|
-
t,
|
|
314
|
-
o,
|
|
315
|
-
d,
|
|
316
327
|
l,
|
|
317
|
-
|
|
328
|
+
t,
|
|
329
|
+
s,
|
|
330
|
+
q,
|
|
318
331
|
g,
|
|
332
|
+
P,
|
|
333
|
+
u,
|
|
319
334
|
h
|
|
320
|
-
]),
|
|
321
|
-
if (!
|
|
335
|
+
]), B = R(() => {
|
|
336
|
+
if (!p) {
|
|
322
337
|
const e = "Main API URL not configured. Cannot fetch subscriptions.";
|
|
323
|
-
return
|
|
338
|
+
return M({
|
|
324
339
|
data: null,
|
|
325
340
|
isLoading: !1,
|
|
326
341
|
error: new Error(e)
|
|
@@ -328,29 +343,29 @@ const V = {
|
|
|
328
343
|
}
|
|
329
344
|
if (!t) {
|
|
330
345
|
const e = "CustomerId must be provided as props to KelviqProvider.";
|
|
331
|
-
return
|
|
346
|
+
return M({
|
|
332
347
|
data: null,
|
|
333
348
|
isLoading: !1,
|
|
334
349
|
error: new Error(e)
|
|
335
350
|
}), h(e, "fetchSubscriptions"), Promise.reject(new Error(e));
|
|
336
351
|
}
|
|
337
|
-
|
|
352
|
+
M((e) => ({
|
|
338
353
|
...e,
|
|
339
354
|
isLoading: !0,
|
|
340
355
|
error: null
|
|
341
356
|
}));
|
|
342
|
-
const
|
|
343
|
-
return
|
|
344
|
-
url:
|
|
357
|
+
const f = `${p.replace(/\/$/, "")}/subscriptions/`;
|
|
358
|
+
return x({
|
|
359
|
+
url: f,
|
|
345
360
|
method: "GET",
|
|
346
|
-
timeout:
|
|
347
|
-
maxRetries:
|
|
348
|
-
backoffBaseDelay:
|
|
349
|
-
accessToken:
|
|
361
|
+
timeout: q,
|
|
362
|
+
maxRetries: g,
|
|
363
|
+
backoffBaseDelay: P,
|
|
364
|
+
accessToken: u,
|
|
350
365
|
queryParams: { customer_id: t }
|
|
351
366
|
}).then((e) => {
|
|
352
367
|
if (e && e.data && Array.isArray(e.data.results))
|
|
353
|
-
|
|
368
|
+
M({
|
|
354
369
|
data: e.data.results,
|
|
355
370
|
isLoading: !1,
|
|
356
371
|
error: null
|
|
@@ -359,7 +374,7 @@ const V = {
|
|
|
359
374
|
const r = new Error(
|
|
360
375
|
"Received empty, malformed, or invalid data structure from subscriptions API."
|
|
361
376
|
);
|
|
362
|
-
throw
|
|
377
|
+
throw M({
|
|
363
378
|
data: null,
|
|
364
379
|
isLoading: !1,
|
|
365
380
|
error: r
|
|
@@ -371,7 +386,7 @@ const V = {
|
|
|
371
386
|
}
|
|
372
387
|
}).catch((e) => {
|
|
373
388
|
const r = e instanceof Error ? e : new Error(String(e));
|
|
374
|
-
return
|
|
389
|
+
return M((c) => ({
|
|
375
390
|
...c,
|
|
376
391
|
isLoading: !1,
|
|
377
392
|
error: r
|
|
@@ -382,17 +397,17 @@ const V = {
|
|
|
382
397
|
), Promise.reject(r);
|
|
383
398
|
});
|
|
384
399
|
}, [
|
|
385
|
-
|
|
400
|
+
p,
|
|
386
401
|
t,
|
|
387
|
-
|
|
388
|
-
l,
|
|
389
|
-
L,
|
|
402
|
+
q,
|
|
390
403
|
g,
|
|
404
|
+
P,
|
|
405
|
+
u,
|
|
391
406
|
h
|
|
392
|
-
]),
|
|
393
|
-
if (!
|
|
407
|
+
]), N = R(() => {
|
|
408
|
+
if (!p) {
|
|
394
409
|
const e = "Main API URL not configured. Cannot fetch customer.";
|
|
395
|
-
return
|
|
410
|
+
return D({
|
|
396
411
|
data: null,
|
|
397
412
|
isLoading: !1,
|
|
398
413
|
error: new Error(e)
|
|
@@ -400,28 +415,28 @@ const V = {
|
|
|
400
415
|
}
|
|
401
416
|
if (!t) {
|
|
402
417
|
const e = "CustomerId must be provided as props to KelviqProvider.";
|
|
403
|
-
return
|
|
418
|
+
return D({
|
|
404
419
|
data: null,
|
|
405
420
|
isLoading: !1,
|
|
406
421
|
error: new Error(e)
|
|
407
422
|
}), h(e, "fetchCustomer"), Promise.reject(new Error(e));
|
|
408
423
|
}
|
|
409
|
-
|
|
424
|
+
D((e) => ({
|
|
410
425
|
...e,
|
|
411
426
|
isLoading: !0,
|
|
412
427
|
error: null
|
|
413
428
|
}));
|
|
414
|
-
const
|
|
415
|
-
return
|
|
416
|
-
url:
|
|
429
|
+
const f = `${p.replace(/\/$/, "")}/customers/${t}/`;
|
|
430
|
+
return x({
|
|
431
|
+
url: f,
|
|
417
432
|
method: "GET",
|
|
418
|
-
timeout:
|
|
419
|
-
maxRetries:
|
|
420
|
-
backoffBaseDelay:
|
|
421
|
-
accessToken:
|
|
433
|
+
timeout: q,
|
|
434
|
+
maxRetries: g,
|
|
435
|
+
backoffBaseDelay: P,
|
|
436
|
+
accessToken: u
|
|
422
437
|
}).then((e) => {
|
|
423
438
|
if (e && e.data)
|
|
424
|
-
|
|
439
|
+
D({
|
|
425
440
|
data: e.data,
|
|
426
441
|
isLoading: !1,
|
|
427
442
|
error: null
|
|
@@ -430,7 +445,7 @@ const V = {
|
|
|
430
445
|
const r = new Error(
|
|
431
446
|
"Received empty or invalid data from customer API."
|
|
432
447
|
);
|
|
433
|
-
throw
|
|
448
|
+
throw D({
|
|
434
449
|
data: null,
|
|
435
450
|
isLoading: !1,
|
|
436
451
|
error: r
|
|
@@ -442,207 +457,368 @@ const V = {
|
|
|
442
457
|
}
|
|
443
458
|
}).catch((e) => {
|
|
444
459
|
const r = e instanceof Error ? e : new Error(String(e));
|
|
445
|
-
return
|
|
460
|
+
return D((c) => ({
|
|
446
461
|
...c,
|
|
447
462
|
isLoading: !1,
|
|
448
463
|
error: r
|
|
449
464
|
})), h(r.message, "fetchCustomer", e), Promise.reject(r);
|
|
450
465
|
});
|
|
451
466
|
}, [
|
|
452
|
-
|
|
467
|
+
p,
|
|
453
468
|
t,
|
|
469
|
+
q,
|
|
470
|
+
g,
|
|
471
|
+
P,
|
|
472
|
+
u,
|
|
473
|
+
h
|
|
474
|
+
]), G = R(() => {
|
|
475
|
+
if (!p) {
|
|
476
|
+
const r = "Main API URL not configured. Cannot fetch pricing.";
|
|
477
|
+
return _({
|
|
478
|
+
data: null,
|
|
479
|
+
isLoading: !1,
|
|
480
|
+
error: new Error(r)
|
|
481
|
+
}), h(r, "fetchPricing"), Promise.reject(new Error(r));
|
|
482
|
+
}
|
|
483
|
+
if (!d) {
|
|
484
|
+
const r = "productId must be provided as a prop to KelviqProvider to fetch pricing.";
|
|
485
|
+
return _({
|
|
486
|
+
data: null,
|
|
487
|
+
isLoading: !1,
|
|
488
|
+
error: new Error(r)
|
|
489
|
+
}), h(r, "fetchPricing"), Promise.reject(new Error(r));
|
|
490
|
+
}
|
|
491
|
+
_((r) => ({
|
|
492
|
+
...r,
|
|
493
|
+
isLoading: !0,
|
|
494
|
+
error: null
|
|
495
|
+
}));
|
|
496
|
+
const f = `${p.replace(/\/$/, "")}/${Ae.replace(/^\//, "")}${d}/`, e = {};
|
|
497
|
+
return t && (e.customer_id = t), E && (e.plans_enabled = E), x({
|
|
498
|
+
url: f,
|
|
499
|
+
method: "GET",
|
|
500
|
+
timeout: q,
|
|
501
|
+
maxRetries: g,
|
|
502
|
+
backoffBaseDelay: P,
|
|
503
|
+
accessToken: u,
|
|
504
|
+
queryParams: e
|
|
505
|
+
}).then((r) => {
|
|
506
|
+
if (r && r.data && Array.isArray(r.data.plans))
|
|
507
|
+
_({
|
|
508
|
+
data: r.data,
|
|
509
|
+
isLoading: !1,
|
|
510
|
+
error: null
|
|
511
|
+
});
|
|
512
|
+
else {
|
|
513
|
+
const c = new Error(
|
|
514
|
+
"Received empty, malformed, or invalid data structure from pricing API."
|
|
515
|
+
);
|
|
516
|
+
throw _({
|
|
517
|
+
data: null,
|
|
518
|
+
isLoading: !1,
|
|
519
|
+
error: c
|
|
520
|
+
}), h(
|
|
521
|
+
c.message,
|
|
522
|
+
"fetchPricing",
|
|
523
|
+
r
|
|
524
|
+
), c;
|
|
525
|
+
}
|
|
526
|
+
}).catch((r) => {
|
|
527
|
+
const c = r instanceof Error ? r : new Error(String(r));
|
|
528
|
+
return _((U) => ({
|
|
529
|
+
...U,
|
|
530
|
+
isLoading: !1,
|
|
531
|
+
error: c
|
|
532
|
+
})), h(c.message, "fetchPricing", r), Promise.reject(c);
|
|
533
|
+
});
|
|
534
|
+
}, [
|
|
535
|
+
p,
|
|
454
536
|
d,
|
|
455
|
-
|
|
456
|
-
|
|
537
|
+
t,
|
|
538
|
+
E,
|
|
539
|
+
q,
|
|
457
540
|
g,
|
|
541
|
+
P,
|
|
542
|
+
u,
|
|
458
543
|
h
|
|
459
544
|
]);
|
|
460
|
-
|
|
461
|
-
let
|
|
462
|
-
if (!
|
|
463
|
-
if (
|
|
545
|
+
ae(() => {
|
|
546
|
+
let f = !0;
|
|
547
|
+
if (!l) {
|
|
548
|
+
if (f) {
|
|
464
549
|
const e = new Error(
|
|
465
550
|
"KelviqProvider: `apiBaseUrl` must be provided in config."
|
|
466
551
|
);
|
|
467
|
-
|
|
552
|
+
j(e), T(!1), A((r) => ({
|
|
468
553
|
...r,
|
|
469
554
|
isLoading: !1,
|
|
470
555
|
error: e
|
|
471
|
-
})),
|
|
556
|
+
})), o.onError && o.onError(e);
|
|
472
557
|
}
|
|
473
558
|
return;
|
|
474
559
|
}
|
|
475
|
-
return
|
|
476
|
-
|
|
560
|
+
return b ? O().catch((e) => {
|
|
561
|
+
f && F && T(!1), console.error(
|
|
477
562
|
"Kelviq SDK: Initial entitlement fetch failed.",
|
|
478
563
|
e
|
|
479
564
|
);
|
|
480
|
-
}) :
|
|
565
|
+
}) : f && (A((e) => ({
|
|
481
566
|
...e,
|
|
482
567
|
isLoading: !1,
|
|
483
568
|
data: null,
|
|
484
569
|
error: null
|
|
485
|
-
})),
|
|
570
|
+
})), T(!1)), v && B().catch((e) => {
|
|
486
571
|
console.error(
|
|
487
572
|
"Kelviq SDK: Initial subscriptions fetch failed.",
|
|
488
573
|
e
|
|
489
574
|
);
|
|
490
|
-
}),
|
|
575
|
+
}), S && N().catch((e) => {
|
|
491
576
|
console.error(
|
|
492
577
|
"Kelviq SDK: Initial customer fetch failed.",
|
|
493
578
|
e
|
|
494
579
|
);
|
|
580
|
+
}), $ && G().catch((e) => {
|
|
581
|
+
console.error(
|
|
582
|
+
"Kelviq SDK: Initial pricing fetch failed.",
|
|
583
|
+
e
|
|
584
|
+
);
|
|
495
585
|
}), () => {
|
|
496
|
-
|
|
586
|
+
f = !1;
|
|
497
587
|
};
|
|
498
|
-
}, [
|
|
499
|
-
const
|
|
500
|
-
() =>
|
|
501
|
-
[
|
|
502
|
-
),
|
|
503
|
-
() =>
|
|
504
|
-
customerId:
|
|
505
|
-
entitlements:
|
|
588
|
+
}, [l, b, v, S, $]);
|
|
589
|
+
const J = R(
|
|
590
|
+
() => y.data ? y.data : {},
|
|
591
|
+
[y.data]
|
|
592
|
+
), Q = R(
|
|
593
|
+
() => K ? {
|
|
594
|
+
customerId: K.customerId,
|
|
595
|
+
entitlements: K.entitlements
|
|
506
596
|
} : null,
|
|
507
|
-
[
|
|
508
|
-
),
|
|
509
|
-
(
|
|
510
|
-
customerId:
|
|
511
|
-
entitlements:
|
|
512
|
-
(e) => e.featureId ===
|
|
597
|
+
[K]
|
|
598
|
+
), V = R(
|
|
599
|
+
(f) => K ? {
|
|
600
|
+
customerId: K.customerId,
|
|
601
|
+
entitlements: K.entitlements.filter(
|
|
602
|
+
(e) => e.featureId === f
|
|
513
603
|
)
|
|
514
604
|
} : null,
|
|
515
|
-
[
|
|
516
|
-
),
|
|
517
|
-
(
|
|
518
|
-
[
|
|
519
|
-
),
|
|
520
|
-
(
|
|
521
|
-
|
|
605
|
+
[K]
|
|
606
|
+
), Y = R(
|
|
607
|
+
(f) => y.data ? y.data[f] ?? null : null,
|
|
608
|
+
[y.data]
|
|
609
|
+
), Z = R(
|
|
610
|
+
(f, e) => {
|
|
611
|
+
A((r) => {
|
|
522
612
|
if (!r.data) return r;
|
|
523
|
-
const c = r.data[
|
|
613
|
+
const c = r.data[f];
|
|
524
614
|
if (!c) return r;
|
|
525
|
-
const
|
|
526
|
-
return ("usageLimit" in e || "currentUsage" in e) && (
|
|
615
|
+
const U = { ...c, ...e };
|
|
616
|
+
return ("usageLimit" in e || "currentUsage" in e) && (U.remaining = U.usageLimit !== null ? U.usageLimit - U.currentUsage : null), {
|
|
527
617
|
...r,
|
|
528
618
|
data: {
|
|
529
619
|
...r.data,
|
|
530
|
-
[
|
|
620
|
+
[f]: U
|
|
531
621
|
}
|
|
532
622
|
};
|
|
533
623
|
});
|
|
534
624
|
},
|
|
535
625
|
[]
|
|
536
|
-
),
|
|
537
|
-
(
|
|
538
|
-
if (!
|
|
539
|
-
const e =
|
|
626
|
+
), ee = R(
|
|
627
|
+
(f) => {
|
|
628
|
+
if (!y.data) return !1;
|
|
629
|
+
const e = y.data[f];
|
|
540
630
|
return e ? e.hasAccess : !1;
|
|
541
631
|
},
|
|
542
|
-
[
|
|
543
|
-
),
|
|
632
|
+
[y.data]
|
|
633
|
+
), oe = le(
|
|
544
634
|
() => ({
|
|
545
|
-
allEntitlements:
|
|
546
|
-
refreshAllEntitlements:
|
|
547
|
-
getEntitlements:
|
|
548
|
-
getEntitlement:
|
|
549
|
-
getRawEntitlements:
|
|
550
|
-
getRawEntitlement:
|
|
551
|
-
hasAccess:
|
|
552
|
-
updateEntitlement:
|
|
553
|
-
subscriptions:
|
|
554
|
-
refreshSubscriptions:
|
|
555
|
-
customer:
|
|
556
|
-
refreshCustomer:
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
635
|
+
allEntitlements: y,
|
|
636
|
+
refreshAllEntitlements: O,
|
|
637
|
+
getEntitlements: J,
|
|
638
|
+
getEntitlement: Y,
|
|
639
|
+
getRawEntitlements: Q,
|
|
640
|
+
getRawEntitlement: V,
|
|
641
|
+
hasAccess: ee,
|
|
642
|
+
updateEntitlement: Z,
|
|
643
|
+
subscriptions: k,
|
|
644
|
+
refreshSubscriptions: B,
|
|
645
|
+
customer: X,
|
|
646
|
+
refreshCustomer: N,
|
|
647
|
+
pricing: z,
|
|
648
|
+
refreshPricing: G,
|
|
649
|
+
isLoading: F,
|
|
650
|
+
error: W,
|
|
651
|
+
environment: m,
|
|
652
|
+
apiUrl: l,
|
|
653
|
+
entitlementsPath: s,
|
|
562
654
|
customerId: t
|
|
563
655
|
}),
|
|
564
656
|
[
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
G,
|
|
568
|
-
W,
|
|
569
|
-
H,
|
|
570
|
-
X,
|
|
657
|
+
y,
|
|
658
|
+
O,
|
|
571
659
|
J,
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
660
|
+
Y,
|
|
661
|
+
Q,
|
|
662
|
+
V,
|
|
663
|
+
ee,
|
|
664
|
+
Z,
|
|
665
|
+
k,
|
|
666
|
+
B,
|
|
667
|
+
X,
|
|
575
668
|
N,
|
|
669
|
+
z,
|
|
670
|
+
G,
|
|
576
671
|
F,
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
o,
|
|
672
|
+
W,
|
|
673
|
+
m,
|
|
674
|
+
l,
|
|
675
|
+
s,
|
|
582
676
|
t
|
|
583
677
|
]
|
|
584
678
|
);
|
|
585
|
-
return /* @__PURE__ */
|
|
586
|
-
},
|
|
587
|
-
const n =
|
|
588
|
-
if (n === void 0 || n ===
|
|
679
|
+
return /* @__PURE__ */ L(te.Provider, { value: oe, children: n });
|
|
680
|
+
}, C = () => {
|
|
681
|
+
const n = ce(te);
|
|
682
|
+
if (n === void 0 || n === re)
|
|
589
683
|
throw new Error(
|
|
590
684
|
"useKelviq must be used within an initialized KelviqProvider."
|
|
591
685
|
);
|
|
592
686
|
return n;
|
|
593
|
-
},
|
|
687
|
+
}, H = ({
|
|
594
688
|
featureId: n,
|
|
595
|
-
children:
|
|
596
|
-
fallback:
|
|
689
|
+
children: i,
|
|
690
|
+
fallback: s = null,
|
|
597
691
|
loadingComponent: t,
|
|
598
|
-
condition:
|
|
692
|
+
condition: m
|
|
599
693
|
}) => {
|
|
600
694
|
const {
|
|
601
|
-
getEntitlement:
|
|
602
|
-
isLoading:
|
|
603
|
-
error:
|
|
604
|
-
} =
|
|
605
|
-
return
|
|
606
|
-
},
|
|
607
|
-
const
|
|
608
|
-
return /* @__PURE__ */
|
|
609
|
-
|
|
695
|
+
getEntitlement: u,
|
|
696
|
+
isLoading: d,
|
|
697
|
+
error: E
|
|
698
|
+
} = C(), o = u(n);
|
|
699
|
+
return d && !o ? /* @__PURE__ */ L(w, { children: t !== void 0 ? t : s }) : E && !o ? /* @__PURE__ */ L(w, { children: s }) : !o || !o.hasAccess || m && !m(o) ? /* @__PURE__ */ L(w, { children: s }) : typeof i == "function" ? /* @__PURE__ */ L(w, { children: i(o) }) : /* @__PURE__ */ L(w, { children: i });
|
|
700
|
+
}, be = (n) => /* @__PURE__ */ L(H, { ...n }), Ke = (n) => {
|
|
701
|
+
const i = (s) => s.hasAccess && (s.remaining === null || s.remaining > 0);
|
|
702
|
+
return /* @__PURE__ */ L(
|
|
703
|
+
H,
|
|
610
704
|
{
|
|
611
705
|
...n,
|
|
612
|
-
condition: n.condition ||
|
|
706
|
+
condition: n.condition || i
|
|
613
707
|
}
|
|
614
708
|
);
|
|
615
|
-
},
|
|
616
|
-
const { allEntitlements: n } =
|
|
709
|
+
}, Ue = (n) => /* @__PURE__ */ L(H, { ...n }), Re = () => {
|
|
710
|
+
const { allEntitlements: n } = C();
|
|
617
711
|
return n;
|
|
618
|
-
},
|
|
619
|
-
const { getEntitlement:
|
|
620
|
-
return
|
|
621
|
-
},
|
|
622
|
-
const { getEntitlement:
|
|
623
|
-
return
|
|
624
|
-
},
|
|
625
|
-
const { getEntitlement:
|
|
626
|
-
return
|
|
627
|
-
},
|
|
628
|
-
const { subscriptions: n } =
|
|
712
|
+
}, Ce = (n) => {
|
|
713
|
+
const { getEntitlement: i } = C();
|
|
714
|
+
return i(n);
|
|
715
|
+
}, $e = (n) => {
|
|
716
|
+
const { getEntitlement: i } = C();
|
|
717
|
+
return i(n);
|
|
718
|
+
}, Te = (n) => {
|
|
719
|
+
const { getEntitlement: i } = C();
|
|
720
|
+
return i(n);
|
|
721
|
+
}, Ie = () => {
|
|
722
|
+
const { subscriptions: n } = C();
|
|
629
723
|
return n;
|
|
630
|
-
},
|
|
631
|
-
const { customer: n } =
|
|
724
|
+
}, Me = () => {
|
|
725
|
+
const { customer: n } = C();
|
|
632
726
|
return n;
|
|
727
|
+
}, ne = () => {
|
|
728
|
+
const { pricing: n } = C();
|
|
729
|
+
return n;
|
|
730
|
+
}, Pe = (n, i, s = {}) => {
|
|
731
|
+
if (typeof n != "number")
|
|
732
|
+
return "";
|
|
733
|
+
const {
|
|
734
|
+
compact: t = !1,
|
|
735
|
+
locale: m = s.pricingLocale || "en-US",
|
|
736
|
+
includeCurrencySymbol: u = !0
|
|
737
|
+
} = s;
|
|
738
|
+
try {
|
|
739
|
+
const d = {
|
|
740
|
+
notation: t ? "compact" : "standard",
|
|
741
|
+
compactDisplay: "short"
|
|
742
|
+
}, o = new Intl.NumberFormat(m, d).format(n);
|
|
743
|
+
return u ? `${i}${o}` : o;
|
|
744
|
+
} catch {
|
|
745
|
+
const d = n.toString();
|
|
746
|
+
return u ? `${i}${d}` : d;
|
|
747
|
+
}
|
|
748
|
+
}, De = ({
|
|
749
|
+
planIdentifier: n,
|
|
750
|
+
billingPeriod: i,
|
|
751
|
+
children: s,
|
|
752
|
+
formatOptions: t,
|
|
753
|
+
loadingComponent: m = null,
|
|
754
|
+
fallback: u = null
|
|
755
|
+
}) => {
|
|
756
|
+
const { data: d, isLoading: E } = ne();
|
|
757
|
+
if (E)
|
|
758
|
+
return /* @__PURE__ */ L(w, { children: m });
|
|
759
|
+
if (!d || !Array.isArray(d.plans))
|
|
760
|
+
return /* @__PURE__ */ L(w, { children: u });
|
|
761
|
+
const o = d.plans.find(
|
|
762
|
+
(b) => b.identifier === n && b.enabled
|
|
763
|
+
);
|
|
764
|
+
if (!o)
|
|
765
|
+
return /* @__PURE__ */ L(w, { children: u });
|
|
766
|
+
const a = o.price.charges.find(
|
|
767
|
+
(b) => b.chargePeriod === i
|
|
768
|
+
) ?? null, g = a ? a.priceData.amount : 0, q = o.price.priceType === "FREE", P = q ? "Free" : Pe(g, d.currencySymbol, {
|
|
769
|
+
...t,
|
|
770
|
+
pricingLocale: d.pricingLocale
|
|
771
|
+
});
|
|
772
|
+
return /* @__PURE__ */ L(w, { children: s({
|
|
773
|
+
plan: o,
|
|
774
|
+
charge: a,
|
|
775
|
+
amount: g,
|
|
776
|
+
formattedPrice: P,
|
|
777
|
+
currencySymbol: d.currencySymbol,
|
|
778
|
+
currencyCode: d.currencyCode,
|
|
779
|
+
pricingLocale: d.pricingLocale,
|
|
780
|
+
isFree: q,
|
|
781
|
+
hasFreeTrial: o.price.freeTrial,
|
|
782
|
+
trialPeriod: o.price.trialPeriod
|
|
783
|
+
}) });
|
|
784
|
+
}, _e = ({
|
|
785
|
+
planIdentifier: n,
|
|
786
|
+
children: i,
|
|
787
|
+
loadingComponent: s = null,
|
|
788
|
+
fallback: t = null,
|
|
789
|
+
featureType: m
|
|
790
|
+
}) => {
|
|
791
|
+
const { data: u, isLoading: d } = ne();
|
|
792
|
+
if (d)
|
|
793
|
+
return /* @__PURE__ */ L(w, { children: s });
|
|
794
|
+
if (!u || !Array.isArray(u.plans))
|
|
795
|
+
return /* @__PURE__ */ L(w, { children: t });
|
|
796
|
+
const E = u.plans.find(
|
|
797
|
+
(a) => a.identifier === n && a.enabled
|
|
798
|
+
);
|
|
799
|
+
if (!E)
|
|
800
|
+
return /* @__PURE__ */ L(w, { children: t });
|
|
801
|
+
let o = E.features.filter((a) => a.enabled);
|
|
802
|
+
return m && (o = o.filter((a) => a.featureType === m)), o.length === 0 ? /* @__PURE__ */ L(w, { children: t }) : /* @__PURE__ */ L(w, { children: o.map(
|
|
803
|
+
(a, g) => i({ feature: a, plan: E, index: g })
|
|
804
|
+
) });
|
|
633
805
|
};
|
|
634
806
|
export {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
807
|
+
_e as KQFeatureList,
|
|
808
|
+
De as KQPrice,
|
|
809
|
+
te as KelviqContext,
|
|
810
|
+
Se as KelviqProvider,
|
|
811
|
+
Ue as ShowWhenBooleanEntitled,
|
|
812
|
+
be as ShowWhenCustomizableEntitled,
|
|
813
|
+
Ke as ShowWhenMeteredEntitled,
|
|
814
|
+
re as defaultKelviqContextValue,
|
|
815
|
+
Pe as kqFormatPrice,
|
|
816
|
+
Re as useAllEntitlements,
|
|
817
|
+
Ce as useBooleanEntitlement,
|
|
818
|
+
Me as useCustomer,
|
|
819
|
+
$e as useCustomizableEntitlement,
|
|
820
|
+
C as useKelviq,
|
|
821
|
+
Te as useMeteredEntitlement,
|
|
822
|
+
ne as usePricing,
|
|
823
|
+
Ie as useSubscriptions
|
|
648
824
|
};
|