@carlonicora/nextjs-jsonapi 3.5.0 → 3.5.2
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/{BlockNoteEditor-MSFNIMZP.mjs → BlockNoteEditor-BZVLUX7S.mjs} +2 -2
- package/dist/{BlockNoteEditor-7K2ENAU6.js → BlockNoteEditor-ZEGEKDSN.js} +9 -9
- package/dist/{BlockNoteEditor-7K2ENAU6.js.map → BlockNoteEditor-ZEGEKDSN.js.map} +1 -1
- package/dist/billing/index.js +333 -333
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-LKFWEYVS.js → chunk-JEFI32DM.js} +3 -3
- package/dist/{chunk-LKFWEYVS.js.map → chunk-JEFI32DM.js.map} +1 -1
- package/dist/{chunk-3LF5PPRY.mjs → chunk-UFPENIXZ.mjs} +3 -3
- package/dist/chunk-UFPENIXZ.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +2 -2
- package/src/components/containers/RoundPageContainer.tsx +1 -1
- package/dist/chunk-3LF5PPRY.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-MSFNIMZP.mjs.map → BlockNoteEditor-BZVLUX7S.mjs.map} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunkJEFI32DMjs = require('../chunk-JEFI32DM.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
@@ -131,41 +131,41 @@ function SubscriptionSummaryCard({
|
|
|
131
131
|
onManageClick
|
|
132
132
|
}) {
|
|
133
133
|
if (loading) {
|
|
134
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
135
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
136
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
134
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
135
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
136
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Subscriptions" }),
|
|
137
137
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
138
138
|
] }),
|
|
139
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
140
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { children: [
|
|
140
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
142
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-40" })
|
|
143
143
|
] })
|
|
144
144
|
] });
|
|
145
145
|
}
|
|
146
146
|
if (error) {
|
|
147
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
148
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
149
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
147
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
148
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
149
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Subscriptions" }),
|
|
150
150
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
151
151
|
] }),
|
|
152
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
152
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
153
153
|
] });
|
|
154
154
|
}
|
|
155
155
|
const activeSubscriptions = subscriptions.filter(
|
|
156
156
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
157
157
|
);
|
|
158
158
|
const primarySubscription = activeSubscriptions[0];
|
|
159
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
160
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
159
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
160
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
161
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Subscriptions" }),
|
|
162
162
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
163
163
|
] }),
|
|
164
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
165
165
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No active plan" }),
|
|
166
166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Subscribe to get started" }),
|
|
167
167
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
168
|
-
|
|
168
|
+
_chunkJEFI32DMjs.Button,
|
|
169
169
|
{
|
|
170
170
|
variant: "outline",
|
|
171
171
|
size: "sm",
|
|
@@ -184,7 +184,7 @@ function SubscriptionSummaryCard({
|
|
|
184
184
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
185
185
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription) }),
|
|
186
186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
187
|
-
|
|
187
|
+
_chunkJEFI32DMjs.Badge,
|
|
188
188
|
{
|
|
189
189
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
190
190
|
children: primarySubscription.cancelAtPeriodEnd ? "Canceling" : primarySubscription.status
|
|
@@ -226,37 +226,37 @@ function PaymentMethodSummaryCard({
|
|
|
226
226
|
onManageClick
|
|
227
227
|
}) {
|
|
228
228
|
if (loading) {
|
|
229
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
230
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
231
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
229
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
230
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
231
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Payment Method" }),
|
|
232
232
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
233
233
|
] }),
|
|
234
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
235
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
236
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { children: [
|
|
235
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
236
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-24" })
|
|
237
237
|
] })
|
|
238
238
|
] });
|
|
239
239
|
}
|
|
240
240
|
if (error) {
|
|
241
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
242
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
243
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
242
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Payment Method" }),
|
|
244
244
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
245
245
|
] }),
|
|
246
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
246
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
247
247
|
] });
|
|
248
248
|
}
|
|
249
249
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
250
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
251
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
252
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
251
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Payment Method" }),
|
|
253
253
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
254
254
|
] }),
|
|
255
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
255
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
256
256
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No payment method" }),
|
|
257
257
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Add a card to enable subscriptions" }),
|
|
258
258
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
259
|
-
|
|
259
|
+
_chunkJEFI32DMjs.Button,
|
|
260
260
|
{
|
|
261
261
|
variant: "outline",
|
|
262
262
|
size: "sm",
|
|
@@ -329,52 +329,52 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
329
329
|
}
|
|
330
330
|
}, "handlePortalClick");
|
|
331
331
|
if (loading) {
|
|
332
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
333
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
334
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
332
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Billing Account" }),
|
|
335
335
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
336
336
|
] }),
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
337
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { children: [
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-24" })
|
|
341
341
|
] })
|
|
342
342
|
] });
|
|
343
343
|
}
|
|
344
344
|
if (error) {
|
|
345
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
346
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
347
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
345
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
346
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Billing Account" }),
|
|
348
348
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
349
349
|
] }),
|
|
350
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
350
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
351
351
|
] });
|
|
352
352
|
}
|
|
353
353
|
if (!customer) {
|
|
354
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
355
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
356
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
355
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Billing Account" }),
|
|
357
357
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
358
358
|
] }),
|
|
359
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
359
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { children: [
|
|
360
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "Not set up" }),
|
|
361
361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Billing account will be created when you subscribe" })
|
|
362
362
|
] })
|
|
363
363
|
] });
|
|
364
364
|
}
|
|
365
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
366
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
367
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
365
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
366
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Billing Account" }),
|
|
368
368
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
369
369
|
] }),
|
|
370
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
371
371
|
customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
|
|
372
372
|
customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
373
373
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
374
374
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
375
375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
376
376
|
] }),
|
|
377
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
377
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
378
378
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
379
379
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ms-1" })
|
|
380
380
|
] })
|
|
@@ -418,42 +418,42 @@ function formatAmount(amount, currency) {
|
|
|
418
418
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
419
419
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
420
420
|
if (loading) {
|
|
421
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
422
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
423
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
421
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
422
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
423
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Recent Invoices" }),
|
|
424
424
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
425
425
|
] }),
|
|
426
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
427
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
426
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { children: [
|
|
427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-20" })
|
|
430
430
|
] })
|
|
431
431
|
] });
|
|
432
432
|
}
|
|
433
433
|
if (error) {
|
|
434
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
435
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
434
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
435
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Recent Invoices" }),
|
|
437
437
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
438
438
|
] }),
|
|
439
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
440
440
|
] });
|
|
441
441
|
}
|
|
442
442
|
const latestInvoice = invoices[0];
|
|
443
443
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
444
444
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
445
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
446
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
445
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
446
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Recent Invoices" }),
|
|
448
448
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
449
449
|
] }),
|
|
450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No invoices yet" }),
|
|
452
452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Invoices will appear after your first billing cycle" })
|
|
453
453
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
454
454
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
455
455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency) }),
|
|
456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: latestInvoice.status })
|
|
457
457
|
] }),
|
|
458
458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || `Invoice from ${formatDate2(latestInvoice.periodStart)}` }),
|
|
459
459
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
@@ -493,24 +493,24 @@ function BillingUsageSummaryCard({
|
|
|
493
493
|
onViewDetailsClick
|
|
494
494
|
}) {
|
|
495
495
|
if (loading) {
|
|
496
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
497
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
498
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
496
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
497
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
498
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Usage This Month" }),
|
|
499
499
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
500
500
|
] }),
|
|
501
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
502
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
503
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
501
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { children: [
|
|
502
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
503
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-32" })
|
|
504
504
|
] })
|
|
505
505
|
] });
|
|
506
506
|
}
|
|
507
507
|
if (error) {
|
|
508
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
509
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
510
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
508
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
509
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
510
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Usage This Month" }),
|
|
511
511
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
512
512
|
] }),
|
|
513
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
514
514
|
] });
|
|
515
515
|
}
|
|
516
516
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -518,12 +518,12 @@ function BillingUsageSummaryCard({
|
|
|
518
518
|
}, 0);
|
|
519
519
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
|
|
520
520
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
521
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
522
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
523
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
521
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
522
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
523
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Usage This Month" }),
|
|
524
524
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
525
525
|
] }),
|
|
526
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
526
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
527
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No meters" }),
|
|
528
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "No usage meters are configured" })
|
|
529
529
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -629,7 +629,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
629
629
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: "Loading payment form..." }) });
|
|
630
630
|
}
|
|
631
631
|
if (!setupIntent && error) {
|
|
632
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
632
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDescription, { children: error }) });
|
|
633
633
|
}
|
|
634
634
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
635
635
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -652,13 +652,13 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
652
652
|
}
|
|
653
653
|
) }),
|
|
654
654
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
655
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
655
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: "Set as default payment method" })
|
|
657
657
|
] }),
|
|
658
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
658
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDescription, { children: error }) }),
|
|
659
659
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: "Cancel" }),
|
|
661
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? "Processing..." : "Add Card" })
|
|
662
662
|
] })
|
|
663
663
|
] });
|
|
664
664
|
}
|
|
@@ -674,10 +674,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
674
674
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
675
675
|
onOpenChange(false);
|
|
676
676
|
}, "handleCancel");
|
|
677
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
678
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
679
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
680
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
677
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogContent, { className: "max-w-md", children: [
|
|
678
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogHeader, { children: [
|
|
679
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogTitle, { children: "Add Payment Method" }),
|
|
680
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogDescription, { children: "Add a new payment method to your account. Your card information is securely processed by Stripe." })
|
|
681
681
|
] }),
|
|
682
682
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
|
|
683
683
|
] }) });
|
|
@@ -738,16 +738,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
738
738
|
}
|
|
739
739
|
}, "handleRemove");
|
|
740
740
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
741
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
742
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
741
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { className: "relative", children: [
|
|
742
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softGreen", className: "absolute end-2 top-2", children: "Default" }),
|
|
743
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
744
744
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
745
745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
746
746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
747
747
|
] }),
|
|
748
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
-
|
|
748
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DropdownMenu, { children: [
|
|
749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
+
_chunkJEFI32DMjs.Button,
|
|
751
751
|
{
|
|
752
752
|
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
753
753
|
nativeButton: false,
|
|
@@ -758,10 +758,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
758
758
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
|
|
759
759
|
}
|
|
760
760
|
) }),
|
|
761
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
762
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
761
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DropdownMenuContent, { align: "end", children: [
|
|
762
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
763
763
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
764
|
-
|
|
764
|
+
_chunkJEFI32DMjs.DropdownMenuItem,
|
|
765
765
|
{
|
|
766
766
|
onClick: () => setShowRemoveDialog(true),
|
|
767
767
|
disabled: loading,
|
|
@@ -772,7 +772,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
772
772
|
] })
|
|
773
773
|
] })
|
|
774
774
|
] }),
|
|
775
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
775
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
776
776
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
777
777
|
"\u2022\u2022\u2022\u2022 ",
|
|
778
778
|
last4
|
|
@@ -785,17 +785,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
785
785
|
] })
|
|
786
786
|
] }) })
|
|
787
787
|
] }),
|
|
788
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
789
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
790
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
791
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
788
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.AlertDialogContent, { children: [
|
|
789
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.AlertDialogHeader, { children: [
|
|
790
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDialogTitle, { children: "Remove Payment Method" }),
|
|
791
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.AlertDialogDescription, { children: [
|
|
792
792
|
"Are you sure you want to remove this payment method? This action cannot be undone.",
|
|
793
793
|
isDefault && " This is your default payment method."
|
|
794
794
|
] })
|
|
795
795
|
] }),
|
|
796
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
797
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
798
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
796
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.AlertDialogFooter, { children: [
|
|
797
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDialogCancel, { disabled: loading, children: "Cancel" }),
|
|
798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? "Removing..." : "Remove" })
|
|
799
799
|
] })
|
|
800
800
|
] }) })
|
|
801
801
|
] });
|
|
@@ -838,14 +838,14 @@ function PaymentMethodsContainer() {
|
|
|
838
838
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
839
839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Payment Methods" })
|
|
840
840
|
] }),
|
|
841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
841
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
842
842
|
] }),
|
|
843
843
|
paymentMethods.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed border-gray-300 bg-muted/50 p-12", children: [
|
|
844
844
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
845
845
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
846
846
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: "No payment methods" }),
|
|
847
847
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
848
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
848
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
849
849
|
] })
|
|
850
850
|
] }),
|
|
851
851
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -913,7 +913,7 @@ var statusConfig = {
|
|
|
913
913
|
};
|
|
914
914
|
function InvoiceStatusBadge({ status }) {
|
|
915
915
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
916
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: config.variant, children: config.label });
|
|
917
917
|
}
|
|
918
918
|
_chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
919
919
|
|
|
@@ -944,13 +944,13 @@ function InvoiceDetails({
|
|
|
944
944
|
return invoice.stripeInvoiceId.slice(-8);
|
|
945
945
|
}, "getInvoiceNumber");
|
|
946
946
|
const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || "Subscription";
|
|
947
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
948
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
949
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
947
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogContent, { className: "max-w-2xl", children: [
|
|
948
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogHeader, { children: [
|
|
949
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogTitle, { children: [
|
|
950
950
|
"Invoice ",
|
|
951
951
|
getInvoiceNumber()
|
|
952
952
|
] }),
|
|
953
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
953
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogDescription, { children: formatDate3(invoice.periodStart) })
|
|
954
954
|
] }),
|
|
955
955
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
956
956
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -988,42 +988,42 @@ function InvoiceDetails({
|
|
|
988
988
|
] }) }),
|
|
989
989
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { className: "border-t", children: [
|
|
990
990
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3", children: productName }),
|
|
991
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children:
|
|
991
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
992
992
|
] }) })
|
|
993
993
|
] }) })
|
|
994
994
|
] }),
|
|
995
995
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2 border-t pt-4", children: [
|
|
996
996
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
997
997
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Subtotal:" }),
|
|
998
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
998
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
999
999
|
] }),
|
|
1000
1000
|
invoice.tax !== void 0 && invoice.tax > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1001
1001
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Tax:" }),
|
|
1002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
1002
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, invoice.tax, invoice.currency) })
|
|
1003
1003
|
] }),
|
|
1004
1004
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-lg font-semibold border-t pt-2", children: [
|
|
1005
1005
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Total:" }),
|
|
1006
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1006
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkJEFI32DMjs.formatCurrency.call(void 0, invoice.total, invoice.currency) })
|
|
1007
1007
|
] }),
|
|
1008
1008
|
invoice.amountPaid > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1009
1009
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Paid:" }),
|
|
1010
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children:
|
|
1010
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, invoice.amountPaid, invoice.currency) })
|
|
1011
1011
|
] }),
|
|
1012
1012
|
invoice.amountRemaining > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1013
1013
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Due:" }),
|
|
1014
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children:
|
|
1014
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, invoice.amountRemaining, invoice.currency) })
|
|
1015
1015
|
] })
|
|
1016
1016
|
] }),
|
|
1017
1017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1018
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1018
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1019
1019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "me-2 h-4 w-4" }),
|
|
1020
1020
|
"Download PDF"
|
|
1021
1021
|
] }),
|
|
1022
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1022
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1023
1023
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "me-2 h-4 w-4" }),
|
|
1024
1024
|
"Retry Payment"
|
|
1025
1025
|
] }),
|
|
1026
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1026
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1027
1027
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "me-2 h-4 w-4" }),
|
|
1028
1028
|
"View in Stripe"
|
|
1029
1029
|
] })
|
|
@@ -1047,30 +1047,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1047
1047
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1048
1048
|
}, "getInvoiceNumber");
|
|
1049
1049
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1050
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1051
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1052
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1053
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1055
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1050
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Table, { children: [
|
|
1051
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.TableRow, { children: [
|
|
1052
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Invoice #" }),
|
|
1053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Date" }),
|
|
1054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Status" }),
|
|
1055
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { className: "text-end", children: "Amount" }),
|
|
1056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Period" })
|
|
1057
1057
|
] }) }),
|
|
1058
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1058
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableBody, { children: invoices.map((invoice) => {
|
|
1059
1059
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1060
1060
|
const date = formatDate3(invoice.periodStart);
|
|
1061
|
-
const amount =
|
|
1061
|
+
const amount = _chunkJEFI32DMjs.formatCurrency.call(void 0, invoice.total, invoice.currency);
|
|
1062
1062
|
const period = `${formatDate3(invoice.periodStart)} - ${formatDate3(invoice.periodEnd)}`;
|
|
1063
1063
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1064
|
-
|
|
1064
|
+
_chunkJEFI32DMjs.TableRow,
|
|
1065
1065
|
{
|
|
1066
1066
|
onClick: () => handleRowClick(invoice),
|
|
1067
1067
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1068
1068
|
children: [
|
|
1069
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1071
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1072
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1072
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1074
1074
|
]
|
|
1075
1075
|
},
|
|
1076
1076
|
invoice.id
|
|
@@ -1119,12 +1119,12 @@ function InvoicesContainer() {
|
|
|
1119
1119
|
setStatusFilter(value);
|
|
1120
1120
|
}, "handleFilterChange");
|
|
1121
1121
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
1122
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1124
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1122
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.TabsList, { children: [
|
|
1123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TabsTrigger, { value: "all", children: "All" }),
|
|
1124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TabsTrigger, { value: "paid" /* PAID */, children: "Paid" }),
|
|
1125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TabsTrigger, { value: "open" /* OPEN */, children: "Open" }),
|
|
1126
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TabsTrigger, { value: "void" /* VOID */, children: "Void" }),
|
|
1127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: "Uncollectible" })
|
|
1128
1128
|
] }) }),
|
|
1129
1129
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: "Loading invoices..." }),
|
|
1130
1130
|
!loading && invoices.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "border border-dashed border-gray-300 rounded-lg p-8 text-center", children: [
|
|
@@ -1184,19 +1184,19 @@ function CancelSubscriptionDialog({
|
|
|
1184
1184
|
}
|
|
1185
1185
|
}, "onSubmit");
|
|
1186
1186
|
const periodEndDate = formatDate3(subscription.currentPeriodEnd);
|
|
1187
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1188
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1189
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1187
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogContent, { className: "max-w-md", children: [
|
|
1188
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogHeader, { children: [
|
|
1189
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogTitle, { children: "Cancel Subscription" }),
|
|
1190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1191
1191
|
] }),
|
|
1192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1192
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1193
1193
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: [
|
|
1194
1194
|
"Your subscription will remain active until ",
|
|
1195
1195
|
periodEndDate,
|
|
1196
1196
|
". You can continue using the service until then."
|
|
1197
1197
|
] }),
|
|
1198
1198
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1199
|
-
|
|
1199
|
+
_chunkJEFI32DMjs.FormTextarea,
|
|
1200
1200
|
{
|
|
1201
1201
|
form,
|
|
1202
1202
|
id: "reason",
|
|
@@ -1206,8 +1206,8 @@ function CancelSubscriptionDialog({
|
|
|
1206
1206
|
}
|
|
1207
1207
|
),
|
|
1208
1208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1210
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: "Keep Subscription" }),
|
|
1210
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? "Canceling..." : "Confirm Cancellation" })
|
|
1211
1211
|
] })
|
|
1212
1212
|
] }) })
|
|
1213
1213
|
] }) });
|
|
@@ -1256,7 +1256,7 @@ var cancelingConfig = {
|
|
|
1256
1256
|
};
|
|
1257
1257
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1258
1258
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1259
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1259
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: config.variant, children: config.label });
|
|
1260
1260
|
}
|
|
1261
1261
|
_chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1262
1262
|
|
|
@@ -1283,7 +1283,7 @@ function formatPlanName2(price) {
|
|
|
1283
1283
|
_chunk7QVYU63Ejs.__name.call(void 0, formatPlanName2, "formatPlanName");
|
|
1284
1284
|
function formatBillingAmount(price) {
|
|
1285
1285
|
if (!_optionalChain([price, 'optionalAccess', _37 => _37.unitAmount])) return "N/A";
|
|
1286
|
-
return
|
|
1286
|
+
return _chunkJEFI32DMjs.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1287
1287
|
}
|
|
1288
1288
|
_chunk7QVYU63Ejs.__name.call(void 0, formatBillingAmount, "formatBillingAmount");
|
|
1289
1289
|
function SubscriptionDetails({
|
|
@@ -1329,10 +1329,10 @@ function SubscriptionDetails({
|
|
|
1329
1329
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1330
1330
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1331
1331
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1332
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1333
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1334
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogContent, { className: "max-w-2xl", children: [
|
|
1333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogHeader, { children: [
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogTitle, { children: "Subscription Details" }),
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogDescription, { children: "View and manage your subscription" })
|
|
1336
1336
|
] }),
|
|
1337
1337
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1338
1338
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1374,11 +1374,11 @@ function SubscriptionDetails({
|
|
|
1374
1374
|
"."
|
|
1375
1375
|
] }) }),
|
|
1376
1376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1377
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1378
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1379
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1380
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1377
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: "Change Plan" }),
|
|
1378
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? "Pausing..." : "Pause" }),
|
|
1379
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? "Resuming..." : "Resume" }),
|
|
1380
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: "Cancel" }),
|
|
1381
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: handleManageViaPortal, children: "Manage via Portal" })
|
|
1382
1382
|
] })
|
|
1383
1383
|
] })
|
|
1384
1384
|
] }) }),
|
|
@@ -1425,36 +1425,36 @@ function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan
|
|
|
1425
1425
|
setSelectedSub(subscription);
|
|
1426
1426
|
}, "handleRowClick");
|
|
1427
1427
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1432
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1433
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Table, { children: [
|
|
1429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.TableRow, { children: [
|
|
1430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Status" }),
|
|
1431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Plan" }),
|
|
1432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Period" }),
|
|
1433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { className: "text-end", children: "Amount" }),
|
|
1434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { className: "text-end", children: "Actions" })
|
|
1435
1435
|
] }) }),
|
|
1436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableBody, { children: subscriptions.map((subscription) => {
|
|
1437
1437
|
const price = subscription.price;
|
|
1438
|
-
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ?
|
|
1438
|
+
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? _chunkJEFI32DMjs.formatCurrency.call(void 0, price.unitAmount, price.currency) : "0";
|
|
1439
1439
|
const period = `${formatDate3(subscription.currentPeriodStart)} - ${formatDate3(subscription.currentPeriodEnd)}`;
|
|
1440
1440
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1441
|
-
|
|
1441
|
+
_chunkJEFI32DMjs.TableRow,
|
|
1442
1442
|
{
|
|
1443
1443
|
onClick: () => handleRowClick(subscription),
|
|
1444
1444
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1445
1445
|
children: [
|
|
1446
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1446
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1447
1447
|
SubscriptionStatusBadge,
|
|
1448
1448
|
{
|
|
1449
1449
|
status: subscription.status,
|
|
1450
1450
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
|
|
1451
1451
|
}
|
|
1452
1452
|
) }),
|
|
1453
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
-
|
|
1453
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "font-medium", children: formatPlanName3(price) }),
|
|
1454
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1455
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-end", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
+
_chunkJEFI32DMjs.Button,
|
|
1458
1458
|
{
|
|
1459
1459
|
size: "sm",
|
|
1460
1460
|
variant: "outline",
|
|
@@ -1522,7 +1522,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1522
1522
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1523
1523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Subscriptions" })
|
|
1524
1524
|
] }),
|
|
1525
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1525
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _43 => _43()]), children: hasActiveRecurringSubscription ? "Purchase Add-ons" : "Subscribe to a Plan" })
|
|
1526
1526
|
] }),
|
|
1527
1527
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1528
1528
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1530,7 +1530,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1530
1530
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1531
1531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: "No Active Subscriptions" }),
|
|
1532
1532
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1533
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1533
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: "Subscribe to a Plan" })
|
|
1534
1534
|
] })
|
|
1535
1535
|
] }),
|
|
1536
1536
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1551,9 +1551,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1551
1551
|
if (!hasMonthly || !hasYearly) {
|
|
1552
1552
|
return null;
|
|
1553
1553
|
}
|
|
1554
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1556
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1554
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.TabsList, { children: [
|
|
1555
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TabsTrigger, { value: "month", children: "Monthly" }),
|
|
1556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TabsTrigger, { value: "year", children: "Yearly" })
|
|
1557
1557
|
] }) });
|
|
1558
1558
|
}
|
|
1559
1559
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1571,8 +1571,8 @@ function PricingCard({
|
|
|
1571
1571
|
}) {
|
|
1572
1572
|
const description = price.description || price.nickname || "Standard";
|
|
1573
1573
|
const features = price.features || [];
|
|
1574
|
-
const formattedPrice =
|
|
1575
|
-
const interval =
|
|
1574
|
+
const formattedPrice = _chunkJEFI32DMjs.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1575
|
+
const interval = _chunkJEFI32DMjs.formatInterval.call(void 0, price);
|
|
1576
1576
|
const handleKeyDown = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (e) => {
|
|
1577
1577
|
if ((e.key === "Enter" || e.key === " ") && !isDisabled && !isCurrentPlan) {
|
|
1578
1578
|
e.preventDefault();
|
|
@@ -1585,7 +1585,7 @@ function PricingCard({
|
|
|
1585
1585
|
}
|
|
1586
1586
|
}, "handleClick");
|
|
1587
1587
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1588
|
-
|
|
1588
|
+
_chunkJEFI32DMjs.Card,
|
|
1589
1589
|
{
|
|
1590
1590
|
role: "radio",
|
|
1591
1591
|
"aria-checked": isSelected,
|
|
@@ -1603,9 +1603,9 @@ function PricingCard({
|
|
|
1603
1603
|
isLoading && "pointer-events-none"
|
|
1604
1604
|
),
|
|
1605
1605
|
children: [
|
|
1606
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1607
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1608
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1606
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "secondary", className: "absolute top-2 end-2", children: "Current" }),
|
|
1607
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
|
|
1608
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { className: "pb-4 grow", children: [
|
|
1609
1609
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1610
1610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1611
1611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ms-1", children: interval })
|
|
@@ -1615,8 +1615,8 @@ function PricingCard({
|
|
|
1615
1615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1616
1616
|
] }, index)) })
|
|
1617
1617
|
] }),
|
|
1618
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
-
|
|
1618
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
+
_chunkJEFI32DMjs.Button,
|
|
1620
1620
|
{
|
|
1621
1621
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1622
1622
|
className: "w-full",
|
|
@@ -1644,7 +1644,7 @@ function ProductPricingRow({
|
|
|
1644
1644
|
return null;
|
|
1645
1645
|
}
|
|
1646
1646
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1647
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SectionHeader, { children: product.name }),
|
|
1648
1648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1649
1649
|
"div",
|
|
1650
1650
|
{
|
|
@@ -1744,15 +1744,15 @@ function ProductPricingList({
|
|
|
1744
1744
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1745
1745
|
function ProductPricingListSkeleton() {
|
|
1746
1746
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-6", children: [1, 2].map((rowIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1747
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-6 w-32" }),
|
|
1748
1748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: [1, 2, 3].map((cardIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-4 rounded-lg border animate-pulse space-y-3", children: [
|
|
1749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-6 w-24" }),
|
|
1750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-8 w-32" }),
|
|
1751
1751
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-full" }),
|
|
1753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-4 w-3/4" })
|
|
1754
1754
|
] }),
|
|
1755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1755
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Skeleton, { className: "h-10 w-full" })
|
|
1756
1756
|
] }, cardIndex)) })
|
|
1757
1757
|
] }, rowIndex)) });
|
|
1758
1758
|
}
|
|
@@ -1766,18 +1766,18 @@ function ProrationPreview({ preview }) {
|
|
|
1766
1766
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1767
1767
|
preview.lineItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
1768
1768
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: item.description }),
|
|
1769
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children:
|
|
1769
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children: _chunkJEFI32DMjs.formatCurrency.call(void 0, item.amount, preview.currency) })
|
|
1770
1770
|
] }, index)),
|
|
1771
1771
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-primary/30 mt-2 border-t pt-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between font-semibold", children: [
|
|
1772
1772
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: "Net Due Today" }),
|
|
1773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children:
|
|
1773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, preview.immediateCharge, preview.currency) })
|
|
1774
1774
|
] }) }),
|
|
1775
1775
|
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: [
|
|
1776
1776
|
"Next invoice on ",
|
|
1777
1777
|
formatDate3(preview.lineItems[0].period.end),
|
|
1778
1778
|
" for",
|
|
1779
1779
|
" ",
|
|
1780
|
-
|
|
1780
|
+
_chunkJEFI32DMjs.formatCurrency.call(void 0, preview.amountDue, preview.currency)
|
|
1781
1781
|
] })
|
|
1782
1782
|
] })
|
|
1783
1783
|
] });
|
|
@@ -1799,16 +1799,16 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1799
1799
|
productDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm text-muted-foreground", children: productDescription })
|
|
1800
1800
|
] }),
|
|
1801
1801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-lg font-semibold", children: [
|
|
1802
|
-
|
|
1803
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children:
|
|
1802
|
+
_chunkJEFI32DMjs.formatCurrency.call(void 0, price.unitAmount, price.currency),
|
|
1803
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children: _chunkJEFI32DMjs.formatInterval.call(void 0, price) })
|
|
1804
1804
|
] }),
|
|
1805
1805
|
features.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-1", children: features.map((feature, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 text-sm ", children: [
|
|
1806
1806
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: "h-4 w-4 text-primary" }),
|
|
1807
1807
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1808
1808
|
] }, index)) }),
|
|
1809
1809
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1810
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1811
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1810
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
1811
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1812
1812
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin me-2" }),
|
|
1813
1813
|
"Processing..."
|
|
1814
1814
|
] }) : "Subscribe" })
|
|
@@ -2138,7 +2138,7 @@ function WizardStepPlanSelection({
|
|
|
2138
2138
|
onSelectPrice: handleSelectPrice
|
|
2139
2139
|
}
|
|
2140
2140
|
),
|
|
2141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? "Loading..." : "Next: Review" }) })
|
|
2142
2142
|
] });
|
|
2143
2143
|
}
|
|
2144
2144
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2199,7 +2199,7 @@ function PromoCodeInput({
|
|
|
2199
2199
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2200
2200
|
] }),
|
|
2201
2201
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2202
|
-
|
|
2202
|
+
_chunkJEFI32DMjs.Button,
|
|
2203
2203
|
{
|
|
2204
2204
|
variant: "ghost",
|
|
2205
2205
|
size: "sm",
|
|
@@ -2216,7 +2216,7 @@ function PromoCodeInput({
|
|
|
2216
2216
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2217
2217
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
2218
2218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2219
|
-
|
|
2219
|
+
_chunkJEFI32DMjs.Input,
|
|
2220
2220
|
{
|
|
2221
2221
|
placeholder: "Enter promo code",
|
|
2222
2222
|
value: code,
|
|
@@ -2226,7 +2226,7 @@ function PromoCodeInput({
|
|
|
2226
2226
|
className: "flex-1"
|
|
2227
2227
|
}
|
|
2228
2228
|
),
|
|
2229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: handleApply, disabled: disabled || isValidating || !code.trim(), children: isValidating ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }) : "Apply" })
|
|
2230
2230
|
] }),
|
|
2231
2231
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2232
2232
|
] });
|
|
@@ -2291,14 +2291,14 @@ function WizardStepReview({
|
|
|
2291
2291
|
return `${promotionCode.discountValue}% off`;
|
|
2292
2292
|
}
|
|
2293
2293
|
if (promotionCode.discountType === "amount_off" && promotionCode.discountValue) {
|
|
2294
|
-
return `${
|
|
2294
|
+
return `${_chunkJEFI32DMjs.formatCurrency.call(void 0, promotionCode.discountValue, promotionCode.currency || selectedPrice.currency)} off`;
|
|
2295
2295
|
}
|
|
2296
2296
|
return null;
|
|
2297
2297
|
}, "getDiscountDescription");
|
|
2298
2298
|
const discountDescription = getDiscountDescription();
|
|
2299
2299
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2300
2300
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2301
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2301
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SectionHeader, { children: "Selected Plan" }),
|
|
2302
2302
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
|
|
2303
2303
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2304
2304
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _92 => _92.product, 'optionalAccess', _93 => _93.name]) }),
|
|
@@ -2306,10 +2306,10 @@ function WizardStepReview({
|
|
|
2306
2306
|
] }),
|
|
2307
2307
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-end", children: [
|
|
2308
2308
|
discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2309
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children:
|
|
2310
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children:
|
|
2311
|
-
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2312
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children:
|
|
2309
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2310
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, discountedPrice, selectedPrice.currency) }),
|
|
2311
|
+
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softGreen", children: discountDescription })
|
|
2312
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2313
2313
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2314
2314
|
] })
|
|
2315
2315
|
] })
|
|
@@ -2324,9 +2324,9 @@ function WizardStepReview({
|
|
|
2324
2324
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
2325
2325
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? "Amount to charge now:" : "Amount due now:" }),
|
|
2326
2326
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: discountedImmediateCharge !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2327
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children:
|
|
2328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children:
|
|
2329
|
-
] }) :
|
|
2327
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) }),
|
|
2328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, discountedImmediateCharge, prorationPreview.currency) })
|
|
2329
|
+
] }) : _chunkJEFI32DMjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) })
|
|
2330
2330
|
] })
|
|
2331
2331
|
]
|
|
2332
2332
|
}
|
|
@@ -2350,15 +2350,15 @@ function WizardStepReview({
|
|
|
2350
2350
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: "Payment Method" }),
|
|
2351
2351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: hasPaymentMethod ? "A payment method is on file" : "No payment method on file" })
|
|
2352
2352
|
] }),
|
|
2353
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2353
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: onAddPaymentMethod, children: "Add Payment Method" })
|
|
2354
2354
|
] }) }),
|
|
2355
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2355
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Alert, { variant: "destructive", children: [
|
|
2356
2356
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDescription, { children: error })
|
|
2358
2358
|
] }),
|
|
2359
2359
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2360
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2361
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2360
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: "Back" }),
|
|
2361
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? "Processing..." : hasPaymentMethod ? isChangingPlan ? "Confirm Plan Change" : "Subscribe Now" : "Add Payment Method" })
|
|
2362
2362
|
] })
|
|
2363
2363
|
] });
|
|
2364
2364
|
}
|
|
@@ -2369,7 +2369,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, WizardStepReview, "WizardStepReview");
|
|
|
2369
2369
|
function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
2370
2370
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2371
2371
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
2372
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2372
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SectionHeader, { children: "Add Payment Method" }),
|
|
2373
2373
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: "Enter your card details to complete your subscription" })
|
|
2374
2374
|
] }),
|
|
2375
2375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2411,10 +2411,10 @@ function SubscriptionWizard({
|
|
|
2411
2411
|
const isChangePlanMode = !!subscription;
|
|
2412
2412
|
const dialogTitle = subscription ? "Change Subscription Plan" : isPurchasingAddons ? "Purchase Add-ons" : "Subscribe to a Plan";
|
|
2413
2413
|
const dialogDescription = subscription ? "Select a new plan for your subscription" : isPurchasingAddons ? "Select one-time products to purchase" : "Choose a subscription plan to get started";
|
|
2414
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2415
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2416
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2414
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogContent, { className: "max-w-2xl", children: [
|
|
2415
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogHeader, { children: [
|
|
2416
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogTitle, { children: dialogTitle }),
|
|
2417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogDescription, { children: dialogDescription })
|
|
2418
2418
|
] }),
|
|
2419
2419
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2420
2420
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2497,15 +2497,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2497
2497
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2498
2498
|
const displayName = meter.displayName || meter.eventName;
|
|
2499
2499
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2500
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2501
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2500
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
2501
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2502
2502
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-5 w-5" }) }),
|
|
2503
2503
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2504
2504
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
|
|
2505
2505
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2506
2506
|
] })
|
|
2507
2507
|
] }),
|
|
2508
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2508
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2509
2509
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2510
2510
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2511
2511
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-muted-foreground text-sm", children: [
|
|
@@ -2632,22 +2632,22 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2632
2632
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-lg border p-8 text-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: "No usage history available." }) });
|
|
2633
2633
|
}
|
|
2634
2634
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2635
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2636
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2638
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2639
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2640
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2641
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2635
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SectionHeader, { level: 2, children: "Usage History" }),
|
|
2636
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Table, { children: [
|
|
2637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.TableRow, { children: [
|
|
2638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Date & Time" }),
|
|
2639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Meter Event" }),
|
|
2640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { className: "text-end", children: "Quantity" }),
|
|
2641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableHead, { children: "Event ID" })
|
|
2642
2642
|
] }) }),
|
|
2643
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2643
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableBody, { children: usageRecords.map((record) => {
|
|
2644
2644
|
const dateTime = formatDateTime(record.timestamp);
|
|
2645
2645
|
const quantity = record.quantity.toLocaleString();
|
|
2646
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2646
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.TableRow, { children: [
|
|
2647
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "font-medium", children: dateTime }),
|
|
2648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2649
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-end font-medium", children: quantity }),
|
|
2650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2651
2651
|
] }, record.id);
|
|
2652
2652
|
}) })
|
|
2653
2653
|
] }) })
|
|
@@ -2658,8 +2658,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
|
|
|
2658
2658
|
// src/features/billing/components/modals/BillingDetailModal.tsx
|
|
2659
2659
|
|
|
2660
2660
|
function BillingDetailModal({ open, onOpenChange, title, children, className }) {
|
|
2661
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2661
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2662
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DialogTitle, { children: title }) }),
|
|
2663
2663
|
children
|
|
2664
2664
|
] }) });
|
|
2665
2665
|
}
|
|
@@ -2676,7 +2676,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2676
2676
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: "Payment Failed" }),
|
|
2677
2677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive mt-1 text-sm", children: "Your last payment failed. Please update your payment method to avoid service interruption." })
|
|
2678
2678
|
] }),
|
|
2679
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2679
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: "Update Payment Method" })
|
|
2680
2680
|
] });
|
|
2681
2681
|
}
|
|
2682
2682
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2696,7 +2696,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2696
2696
|
". Add a payment method to continue your subscription."
|
|
2697
2697
|
] })
|
|
2698
2698
|
] }),
|
|
2699
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2699
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: "Add Payment Method" })
|
|
2700
2700
|
] });
|
|
2701
2701
|
}
|
|
2702
2702
|
}
|
|
@@ -2920,18 +2920,18 @@ function BillingDashboardContainer() {
|
|
|
2920
2920
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2921
2921
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Billing" })
|
|
2922
2922
|
] }),
|
|
2923
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2924
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2925
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2923
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) }),
|
|
2924
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Card, { children: [
|
|
2925
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.CardHeader, { className: "text-center", children: [
|
|
2926
2926
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8 text-primary" }) }),
|
|
2927
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2927
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardTitle, { children: "Set Up Billing" }),
|
|
2928
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardDescription, { children: "Your company doesn't have a billing account yet. Set one up to manage subscriptions, payment methods, and view invoices." })
|
|
2929
2929
|
] }),
|
|
2930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2930
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2931
2931
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "me-2 h-4 w-4 animate-spin" }),
|
|
2932
2932
|
"Setting up..."
|
|
2933
2933
|
] }) : "Set Up Billing Account" }) }),
|
|
2934
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2934
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: errors.customer }) })
|
|
2935
2935
|
] }),
|
|
2936
2936
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2937
2937
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3103,12 +3103,12 @@ function PriceArchiver({ price }) {
|
|
|
3103
3103
|
const isArchived = !price.active;
|
|
3104
3104
|
const scope = isArchived ? "restore" : "archive";
|
|
3105
3105
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3106
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3106
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3107
3107
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3108
3108
|
t(`billing.admin.prices.${scope}.confirm`)
|
|
3109
3109
|
] }),
|
|
3110
3110
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3111
|
-
|
|
3111
|
+
_chunkJEFI32DMjs.ConfirmDialog,
|
|
3112
3112
|
{
|
|
3113
3113
|
open,
|
|
3114
3114
|
onOpenChange: setOpen,
|
|
@@ -3122,7 +3122,7 @@ function PriceArchiver({ price }) {
|
|
|
3122
3122
|
if (isArchived) await restorePrice(price.id);
|
|
3123
3123
|
else await archivePrice(price.id);
|
|
3124
3124
|
} catch (error) {
|
|
3125
|
-
|
|
3125
|
+
_chunkJEFI32DMjs.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
|
|
3126
3126
|
throw error;
|
|
3127
3127
|
}
|
|
3128
3128
|
}
|
|
@@ -3246,7 +3246,7 @@ function PriceEditorInternal({
|
|
|
3246
3246
|
{ id: "metered", text: t("billing.admin.prices.usage.metered") }
|
|
3247
3247
|
];
|
|
3248
3248
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3249
|
-
|
|
3249
|
+
_chunkJEFI32DMjs.EditorSheet,
|
|
3250
3250
|
{
|
|
3251
3251
|
form,
|
|
3252
3252
|
entityType: t("billing.admin.prices.entity"),
|
|
@@ -3301,13 +3301,13 @@ function PriceEditorInternal({
|
|
|
3301
3301
|
dialogOpen,
|
|
3302
3302
|
onDialogOpenChange,
|
|
3303
3303
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3304
|
-
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3305
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3306
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3304
|
+
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Alert, { children: [
|
|
3305
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
|
|
3306
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
|
|
3307
3307
|
] }),
|
|
3308
3308
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3309
3309
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3310
|
-
|
|
3310
|
+
_chunkJEFI32DMjs.FormInput,
|
|
3311
3311
|
{
|
|
3312
3312
|
form,
|
|
3313
3313
|
id: "unitAmount",
|
|
@@ -3319,7 +3319,7 @@ function PriceEditorInternal({
|
|
|
3319
3319
|
}
|
|
3320
3320
|
),
|
|
3321
3321
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3322
|
-
|
|
3322
|
+
_chunkJEFI32DMjs.FormSelect,
|
|
3323
3323
|
{
|
|
3324
3324
|
form,
|
|
3325
3325
|
id: "currency",
|
|
@@ -3330,7 +3330,7 @@ function PriceEditorInternal({
|
|
|
3330
3330
|
)
|
|
3331
3331
|
] }),
|
|
3332
3332
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3333
|
-
|
|
3333
|
+
_chunkJEFI32DMjs.FormSelect,
|
|
3334
3334
|
{
|
|
3335
3335
|
form,
|
|
3336
3336
|
id: "interval",
|
|
@@ -3341,7 +3341,7 @@ function PriceEditorInternal({
|
|
|
3341
3341
|
),
|
|
3342
3342
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3343
3343
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3344
|
-
|
|
3344
|
+
_chunkJEFI32DMjs.FormInput,
|
|
3345
3345
|
{
|
|
3346
3346
|
form,
|
|
3347
3347
|
id: "intervalCount",
|
|
@@ -3352,7 +3352,7 @@ function PriceEditorInternal({
|
|
|
3352
3352
|
}
|
|
3353
3353
|
),
|
|
3354
3354
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3355
|
-
|
|
3355
|
+
_chunkJEFI32DMjs.FormSelect,
|
|
3356
3356
|
{
|
|
3357
3357
|
form,
|
|
3358
3358
|
id: "usageType",
|
|
@@ -3363,7 +3363,7 @@ function PriceEditorInternal({
|
|
|
3363
3363
|
)
|
|
3364
3364
|
] }),
|
|
3365
3365
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3366
|
-
|
|
3366
|
+
_chunkJEFI32DMjs.FormInput,
|
|
3367
3367
|
{
|
|
3368
3368
|
form,
|
|
3369
3369
|
id: "nickname",
|
|
@@ -3372,7 +3372,7 @@ function PriceEditorInternal({
|
|
|
3372
3372
|
}
|
|
3373
3373
|
),
|
|
3374
3374
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3375
|
-
|
|
3375
|
+
_chunkJEFI32DMjs.FormTextarea,
|
|
3376
3376
|
{
|
|
3377
3377
|
form,
|
|
3378
3378
|
id: "description",
|
|
@@ -3382,7 +3382,7 @@ function PriceEditorInternal({
|
|
|
3382
3382
|
}
|
|
3383
3383
|
),
|
|
3384
3384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3385
|
-
|
|
3385
|
+
_chunkJEFI32DMjs.FormInput,
|
|
3386
3386
|
{
|
|
3387
3387
|
form,
|
|
3388
3388
|
id: "token",
|
|
@@ -3392,10 +3392,10 @@ function PriceEditorInternal({
|
|
|
3392
3392
|
}
|
|
3393
3393
|
),
|
|
3394
3394
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3395
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
|
|
3396
3396
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3397
3397
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3398
|
-
|
|
3398
|
+
_chunkJEFI32DMjs.Input,
|
|
3399
3399
|
{
|
|
3400
3400
|
...form.register(`features.${index}`),
|
|
3401
3401
|
placeholder: t("billing.admin.prices.placeholders.feature", { index: index + 1 }),
|
|
@@ -3403,7 +3403,7 @@ function PriceEditorInternal({
|
|
|
3403
3403
|
}
|
|
3404
3404
|
),
|
|
3405
3405
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3406
|
-
|
|
3406
|
+
_chunkJEFI32DMjs.Button,
|
|
3407
3407
|
{
|
|
3408
3408
|
type: "button",
|
|
3409
3409
|
variant: "outline",
|
|
@@ -3418,7 +3418,7 @@ function PriceEditorInternal({
|
|
|
3418
3418
|
)
|
|
3419
3419
|
] }, index)),
|
|
3420
3420
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3421
|
-
|
|
3421
|
+
_chunkJEFI32DMjs.Button,
|
|
3422
3422
|
{
|
|
3423
3423
|
type: "button",
|
|
3424
3424
|
variant: "outline",
|
|
@@ -3433,12 +3433,12 @@ function PriceEditorInternal({
|
|
|
3433
3433
|
)
|
|
3434
3434
|
] }),
|
|
3435
3435
|
isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3437
3437
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex max-h-48 flex-col gap-y-2 overflow-y-auto rounded-md border p-4", children: allFeatures.map((feature) => {
|
|
3438
3438
|
const isChecked = form.watch("featureIds").includes(feature.id);
|
|
3439
3439
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3440
3440
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3441
|
-
|
|
3441
|
+
_chunkJEFI32DMjs.Checkbox,
|
|
3442
3442
|
{
|
|
3443
3443
|
id: `feature-${feature.id}`,
|
|
3444
3444
|
checked: isChecked,
|
|
@@ -3454,13 +3454,13 @@ function PriceEditorInternal({
|
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
3456
3456
|
),
|
|
3457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
|
|
3458
3458
|
feature.isCore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.admin.prices.help.core") })
|
|
3459
3459
|
] }, feature.id);
|
|
3460
3460
|
}) })
|
|
3461
3461
|
] }),
|
|
3462
3462
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3463
|
-
|
|
3463
|
+
_chunkJEFI32DMjs.FormCheckbox,
|
|
3464
3464
|
{
|
|
3465
3465
|
form,
|
|
3466
3466
|
id: "isTrial",
|
|
@@ -3503,7 +3503,7 @@ var defaultContextValue = {
|
|
|
3503
3503
|
productId: void 0
|
|
3504
3504
|
};
|
|
3505
3505
|
function priceLabel(price) {
|
|
3506
|
-
return _nullishCoalesce(price.nickname, () => ( `${
|
|
3506
|
+
return _nullishCoalesce(price.nickname, () => ( `${_chunkJEFI32DMjs.formatCurrency.call(void 0, price.unitAmount, price.currency)} ${_chunkJEFI32DMjs.formatInterval.call(void 0, price)}`.trim()));
|
|
3507
3507
|
}
|
|
3508
3508
|
_chunk7QVYU63Ejs.__name.call(void 0, priceLabel, "priceLabel");
|
|
3509
3509
|
var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
@@ -3513,8 +3513,8 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3513
3513
|
productId: productIdProp
|
|
3514
3514
|
}) => {
|
|
3515
3515
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3516
|
-
const generateUrl =
|
|
3517
|
-
const { hasRole } =
|
|
3516
|
+
const generateUrl = _chunkJEFI32DMjs.usePageUrlGenerator.call(void 0, );
|
|
3517
|
+
const { hasRole } = _chunkJEFI32DMjs.useCurrentUserContext.call(void 0, );
|
|
3518
3518
|
const [price, setPrice] = _react.useState.call(void 0,
|
|
3519
3519
|
dehydratedPrice ? _chunk6T6QB6K2js.rehydrate.call(void 0, _chunk6T6QB6K2js.Modules.StripePrice, dehydratedPrice) : void 0
|
|
3520
3520
|
);
|
|
@@ -3602,7 +3602,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3602
3602
|
}
|
|
3603
3603
|
return response;
|
|
3604
3604
|
}, "title");
|
|
3605
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3605
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
|
|
3606
3606
|
}, "PriceProvider");
|
|
3607
3607
|
var usePriceContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, PriceContext), () => ( defaultContextValue)), "usePriceContext");
|
|
3608
3608
|
|
|
@@ -3622,12 +3622,12 @@ function ProductArchiver({ product }) {
|
|
|
3622
3622
|
const isArchived = !product.active;
|
|
3623
3623
|
const scope = isArchived ? "restore" : "archive";
|
|
3624
3624
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3625
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3625
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkJEFI32DMjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3626
3626
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3627
3627
|
t(`billing.admin.products.${scope}.confirm`)
|
|
3628
3628
|
] }),
|
|
3629
3629
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3630
|
-
|
|
3630
|
+
_chunkJEFI32DMjs.ConfirmDialog,
|
|
3631
3631
|
{
|
|
3632
3632
|
open,
|
|
3633
3633
|
onOpenChange: setOpen,
|
|
@@ -3641,7 +3641,7 @@ function ProductArchiver({ product }) {
|
|
|
3641
3641
|
if (isArchived) await restoreProduct(product.id);
|
|
3642
3642
|
else await archiveProduct(product.id);
|
|
3643
3643
|
} catch (error) {
|
|
3644
|
-
|
|
3644
|
+
_chunkJEFI32DMjs.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
|
|
3645
3645
|
throw error;
|
|
3646
3646
|
}
|
|
3647
3647
|
}
|
|
@@ -3694,7 +3694,7 @@ function ProductEditorInternal({
|
|
|
3694
3694
|
defaultValues: getDefaultValues()
|
|
3695
3695
|
});
|
|
3696
3696
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3697
|
-
|
|
3697
|
+
_chunkJEFI32DMjs.EditorSheet,
|
|
3698
3698
|
{
|
|
3699
3699
|
form,
|
|
3700
3700
|
entityType: t("billing.admin.products.entity"),
|
|
@@ -3717,7 +3717,7 @@ function ProductEditorInternal({
|
|
|
3717
3717
|
onDialogOpenChange,
|
|
3718
3718
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3719
3719
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3720
|
-
|
|
3720
|
+
_chunkJEFI32DMjs.FormInput,
|
|
3721
3721
|
{
|
|
3722
3722
|
form,
|
|
3723
3723
|
id: "name",
|
|
@@ -3727,7 +3727,7 @@ function ProductEditorInternal({
|
|
|
3727
3727
|
}
|
|
3728
3728
|
),
|
|
3729
3729
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3730
|
-
|
|
3730
|
+
_chunkJEFI32DMjs.FormTextarea,
|
|
3731
3731
|
{
|
|
3732
3732
|
form,
|
|
3733
3733
|
id: "description",
|
|
@@ -3771,8 +3771,8 @@ var defaultContextValue2 = {
|
|
|
3771
3771
|
};
|
|
3772
3772
|
var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedProduct, publishChrome = true }) => {
|
|
3773
3773
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3774
|
-
const generateUrl =
|
|
3775
|
-
const { hasRole } =
|
|
3774
|
+
const generateUrl = _chunkJEFI32DMjs.usePageUrlGenerator.call(void 0, );
|
|
3775
|
+
const { hasRole } = _chunkJEFI32DMjs.useCurrentUserContext.call(void 0, );
|
|
3776
3776
|
const [product, setProduct] = _react.useState.call(void 0,
|
|
3777
3777
|
dehydratedProduct ? _chunk6T6QB6K2js.rehydrate.call(void 0, _chunk6T6QB6K2js.Modules.StripeProduct, dehydratedProduct) : void 0
|
|
3778
3778
|
);
|
|
@@ -3866,7 +3866,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3866
3866
|
}
|
|
3867
3867
|
return response;
|
|
3868
3868
|
}, "title");
|
|
3869
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3869
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
|
|
3870
3870
|
}, "ProductProvider");
|
|
3871
3871
|
var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, ProductContext), () => ( defaultContextValue2)), "useProductContext");
|
|
3872
3872
|
|
|
@@ -3875,56 +3875,56 @@ var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ()
|
|
|
3875
3875
|
|
|
3876
3876
|
function PriceDetails() {
|
|
3877
3877
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3878
|
-
const generateUrl =
|
|
3878
|
+
const generateUrl = _chunkJEFI32DMjs.usePageUrlGenerator.call(void 0, );
|
|
3879
3879
|
const { price } = usePriceContext();
|
|
3880
3880
|
if (!price) return null;
|
|
3881
3881
|
const isRecurring = price.priceType === "recurring";
|
|
3882
3882
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-8", children: [
|
|
3883
3883
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3884
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3884
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SectionHeader, { children: t("billing.admin.prices.title") }),
|
|
3885
3885
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3886
3886
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3887
|
-
|
|
3887
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3888
3888
|
{
|
|
3889
3889
|
label: t("billing.admin.prices.fields.product"),
|
|
3890
|
-
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3890
|
+
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Link, { href: generateUrl({ page: _chunk6T6QB6K2js.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
|
|
3891
3891
|
}
|
|
3892
3892
|
),
|
|
3893
3893
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3894
|
-
|
|
3894
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3895
3895
|
{
|
|
3896
3896
|
label: t("billing.admin.prices.fields.status"),
|
|
3897
3897
|
value: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
3898
|
-
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3899
|
-
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3898
|
+
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
|
|
3899
|
+
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
|
|
3900
3900
|
] })
|
|
3901
3901
|
}
|
|
3902
3902
|
),
|
|
3903
3903
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3904
|
-
|
|
3904
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3905
3905
|
{
|
|
3906
3906
|
label: t("billing.admin.prices.fields.amount"),
|
|
3907
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children:
|
|
3907
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunkJEFI32DMjs.formatCurrency.call(void 0, price.unitAmount, price.currency) })
|
|
3908
3908
|
}
|
|
3909
3909
|
),
|
|
3910
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3910
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
|
|
3911
3911
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3912
|
-
|
|
3912
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3913
3913
|
{
|
|
3914
3914
|
label: t("billing.admin.prices.fields.type"),
|
|
3915
3915
|
value: isRecurring ? t("billing.admin.prices.type.recurring") : t("billing.admin.prices.type.oneTime")
|
|
3916
3916
|
}
|
|
3917
3917
|
),
|
|
3918
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3918
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunkJEFI32DMjs.formatInterval.call(void 0, price) }),
|
|
3919
3919
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3920
|
-
|
|
3920
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3921
3921
|
{
|
|
3922
3922
|
label: t("billing.admin.prices.fields.intervalCount"),
|
|
3923
3923
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _157 => _157.recurring, 'optionalAccess', _158 => _158.intervalCount]), () => ( 1)) })
|
|
3924
3924
|
}
|
|
3925
3925
|
),
|
|
3926
3926
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3927
|
-
|
|
3927
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3928
3928
|
{
|
|
3929
3929
|
label: t("billing.admin.prices.fields.usageType"),
|
|
3930
3930
|
value: _optionalChain([price, 'access', _159 => _159.recurring, 'optionalAccess', _160 => _160.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
|
|
@@ -3933,24 +3933,24 @@ function PriceDetails() {
|
|
|
3933
3933
|
] })
|
|
3934
3934
|
] }),
|
|
3935
3935
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3936
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3936
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3937
3937
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3938
3938
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3939
|
-
|
|
3939
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3940
3940
|
{
|
|
3941
3941
|
label: t("billing.admin.prices.fields.token"),
|
|
3942
3942
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(price.token, () => ( "\u2014")) })
|
|
3943
3943
|
}
|
|
3944
3944
|
),
|
|
3945
3945
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3946
|
-
|
|
3946
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3947
3947
|
{
|
|
3948
3948
|
label: t("billing.admin.prices.fields.stripeId"),
|
|
3949
3949
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: price.stripePriceId })
|
|
3950
3950
|
}
|
|
3951
3951
|
),
|
|
3952
3952
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3953
|
-
|
|
3953
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3954
3954
|
{
|
|
3955
3955
|
label: t("billing.admin.prices.fields.description"),
|
|
3956
3956
|
value: _nullishCoalesce(price.description, () => ( "\u2014")),
|
|
@@ -3958,7 +3958,7 @@ function PriceDetails() {
|
|
|
3958
3958
|
}
|
|
3959
3959
|
),
|
|
3960
3960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3961
|
-
|
|
3961
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3962
3962
|
{
|
|
3963
3963
|
label: t("billing.admin.prices.fields.features"),
|
|
3964
3964
|
className: "md:col-span-2",
|
|
@@ -3966,11 +3966,11 @@ function PriceDetails() {
|
|
|
3966
3966
|
}
|
|
3967
3967
|
),
|
|
3968
3968
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3969
|
-
|
|
3969
|
+
_chunkJEFI32DMjs.DetailField,
|
|
3970
3970
|
{
|
|
3971
3971
|
label: t("billing.admin.prices.fields.platformFeatures"),
|
|
3972
3972
|
className: "md:col-span-2",
|
|
3973
|
-
value: price.priceFeatures.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: price.priceFeatures.map((feature) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3973
|
+
value: price.priceFeatures.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: price.priceFeatures.map((feature) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
|
|
3974
3974
|
}
|
|
3975
3975
|
)
|
|
3976
3976
|
] })
|
|
@@ -3984,7 +3984,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceDetails, "PriceDetails");
|
|
|
3984
3984
|
function PriceContainer() {
|
|
3985
3985
|
const { price } = usePriceContext();
|
|
3986
3986
|
if (!price) return null;
|
|
3987
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3987
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.RoundPageContainer, { module: _chunk6T6QB6K2js.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
|
|
3988
3988
|
}
|
|
3989
3989
|
_chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
3990
3990
|
|
|
@@ -3996,7 +3996,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
|
3996
3996
|
function PricesList({ productId, fullWidth }) {
|
|
3997
3997
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3998
3998
|
const { priceVersion } = usePriceContext();
|
|
3999
|
-
const data =
|
|
3999
|
+
const data = _chunkJEFI32DMjs.useDataListRetriever.call(void 0, {
|
|
4000
4000
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk6T6QB6K2js.StripePriceService.listPrices({ ...params, productId }), "retriever"),
|
|
4001
4001
|
retrieverParams: {},
|
|
4002
4002
|
module: _chunk6T6QB6K2js.Modules.StripePrice
|
|
@@ -4006,7 +4006,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4006
4006
|
}, [priceVersion]);
|
|
4007
4007
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceEditor, { productId }, "create-price")];
|
|
4008
4008
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4009
|
-
|
|
4009
|
+
_chunkJEFI32DMjs.ContentListTable,
|
|
4010
4010
|
{
|
|
4011
4011
|
data,
|
|
4012
4012
|
fields: [
|
|
@@ -4021,7 +4021,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4021
4021
|
fullWidth,
|
|
4022
4022
|
title: t("billing.admin.prices.title"),
|
|
4023
4023
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4024
|
-
|
|
4024
|
+
_chunkJEFI32DMjs.EmptyState,
|
|
4025
4025
|
{
|
|
4026
4026
|
icon: _lucidereact.DollarSignIcon,
|
|
4027
4027
|
title: t("billing.admin.prices.empty.title"),
|
|
@@ -4044,18 +4044,18 @@ function ProductDetails() {
|
|
|
4044
4044
|
const { product } = useProductContext();
|
|
4045
4045
|
if (!product) return null;
|
|
4046
4046
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
4047
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4047
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
|
|
4048
4048
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
4049
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4049
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
|
|
4050
4050
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4051
|
-
|
|
4051
|
+
_chunkJEFI32DMjs.DetailField,
|
|
4052
4052
|
{
|
|
4053
4053
|
label: t("billing.admin.products.fields.status"),
|
|
4054
|
-
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4054
|
+
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
|
|
4055
4055
|
}
|
|
4056
4056
|
),
|
|
4057
4057
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4058
|
-
|
|
4058
|
+
_chunkJEFI32DMjs.DetailField,
|
|
4059
4059
|
{
|
|
4060
4060
|
label: t("billing.admin.products.fields.description"),
|
|
4061
4061
|
value: _nullishCoalesce(product.description, () => ( "\u2014")),
|
|
@@ -4063,14 +4063,14 @@ function ProductDetails() {
|
|
|
4063
4063
|
}
|
|
4064
4064
|
),
|
|
4065
4065
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4066
|
-
|
|
4066
|
+
_chunkJEFI32DMjs.DetailField,
|
|
4067
4067
|
{
|
|
4068
4068
|
label: t("billing.admin.products.fields.prices"),
|
|
4069
4069
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripePrices.length })
|
|
4070
4070
|
}
|
|
4071
4071
|
),
|
|
4072
4072
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4073
|
-
|
|
4073
|
+
_chunkJEFI32DMjs.DetailField,
|
|
4074
4074
|
{
|
|
4075
4075
|
label: t("billing.admin.products.fields.stripeId"),
|
|
4076
4076
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripeProductId })
|
|
@@ -4088,7 +4088,7 @@ function ProductContainer() {
|
|
|
4088
4088
|
const { product } = useProductContext();
|
|
4089
4089
|
if (!product) return null;
|
|
4090
4090
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4091
|
-
|
|
4091
|
+
_chunkJEFI32DMjs.RoundPageContainer,
|
|
4092
4092
|
{
|
|
4093
4093
|
module: _chunk6T6QB6K2js.Modules.StripeProduct,
|
|
4094
4094
|
id: product.id,
|
|
@@ -4123,7 +4123,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductContainer, "ProductContainer");
|
|
|
4123
4123
|
function ProductsList({ fullWidth } = {}) {
|
|
4124
4124
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
4125
4125
|
const { catalogueVersion } = useProductContext();
|
|
4126
|
-
const data =
|
|
4126
|
+
const data = _chunkJEFI32DMjs.useDataListRetriever.call(void 0, {
|
|
4127
4127
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk6T6QB6K2js.StripeProductService.listProducts(params), "retriever"),
|
|
4128
4128
|
retrieverParams: {},
|
|
4129
4129
|
module: _chunk6T6QB6K2js.Modules.StripeProduct
|
|
@@ -4133,7 +4133,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4133
4133
|
}, [catalogueVersion]);
|
|
4134
4134
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, {}, "create-product")];
|
|
4135
4135
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4136
|
-
|
|
4136
|
+
_chunkJEFI32DMjs.ContentListTable,
|
|
4137
4137
|
{
|
|
4138
4138
|
data,
|
|
4139
4139
|
fields: ["name" /* name */, "status" /* status */, "prices" /* prices */],
|
|
@@ -4142,7 +4142,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4142
4142
|
fullWidth,
|
|
4143
4143
|
title: t("billing.admin.products.title"),
|
|
4144
4144
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4145
|
-
|
|
4145
|
+
_chunkJEFI32DMjs.EmptyState,
|
|
4146
4146
|
{
|
|
4147
4147
|
icon: _lucidereact.PackageIcon,
|
|
4148
4148
|
title: t("billing.admin.products.empty.title"),
|
|
@@ -4157,7 +4157,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
4157
4157
|
// src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx
|
|
4158
4158
|
|
|
4159
4159
|
function ProductsListContainer() {
|
|
4160
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4160
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJEFI32DMjs.RoundPageContainer, { module: _chunk6T6QB6K2js.Modules.StripeProduct, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { fullWidth: true }) }) });
|
|
4161
4161
|
}
|
|
4162
4162
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContainer");
|
|
4163
4163
|
|
|
@@ -4215,5 +4215,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContain
|
|
|
4215
4215
|
|
|
4216
4216
|
|
|
4217
4217
|
|
|
4218
|
-
exports.BillingAlertBanner = BillingAlertBanner; exports.BillingDashboardContainer = BillingDashboardContainer; exports.BillingDetailModal = BillingDetailModal; exports.BillingUsageSummaryCard = BillingUsageSummaryCard; exports.CancelSubscriptionDialog = CancelSubscriptionDialog; exports.CustomerInfoCard = CustomerInfoCard; exports.IntervalToggle = IntervalToggle; exports.InvoiceDetails = InvoiceDetails; exports.InvoiceStatusBadge = InvoiceStatusBadge; exports.InvoicesContainer = InvoicesContainer; exports.InvoicesList = InvoicesList; exports.InvoicesSummaryCard = InvoicesSummaryCard; exports.PaymentMethodCard = PaymentMethodCard; exports.PaymentMethodEditor = PaymentMethodEditor; exports.PaymentMethodForm = PaymentMethodForm; exports.PaymentMethodSummaryCard = PaymentMethodSummaryCard; exports.PaymentMethodsContainer = PaymentMethodsContainer; exports.PaymentMethodsList = PaymentMethodsList; exports.PriceArchiver = PriceArchiver; exports.PriceContainer = PriceContainer; exports.PriceDetails = PriceDetails; exports.PriceEditor = PriceEditor; exports.PriceProvider = PriceProvider; exports.PricesList = PricesList; exports.PricingCard = PricingCard; exports.ProductArchiver = ProductArchiver; exports.ProductContainer = ProductContainer; exports.ProductDetails = ProductDetails; exports.ProductEditor = ProductEditor; exports.ProductPricingList = ProductPricingList; exports.ProductPricingRow = ProductPricingRow; exports.ProductProvider = ProductProvider; exports.ProductsList = ProductsList; exports.ProductsListContainer = ProductsListContainer; exports.PromoCodeInput = PromoCodeInput; exports.ProrationPreview = ProrationPreview; exports.StripeProvider = StripeProvider; exports.SubscriptionConfirmation = SubscriptionConfirmation; exports.SubscriptionDetails = SubscriptionDetails; exports.SubscriptionStatusBadge = SubscriptionStatusBadge; exports.SubscriptionSummaryCard = SubscriptionSummaryCard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.formatCurrency =
|
|
4218
|
+
exports.BillingAlertBanner = BillingAlertBanner; exports.BillingDashboardContainer = BillingDashboardContainer; exports.BillingDetailModal = BillingDetailModal; exports.BillingUsageSummaryCard = BillingUsageSummaryCard; exports.CancelSubscriptionDialog = CancelSubscriptionDialog; exports.CustomerInfoCard = CustomerInfoCard; exports.IntervalToggle = IntervalToggle; exports.InvoiceDetails = InvoiceDetails; exports.InvoiceStatusBadge = InvoiceStatusBadge; exports.InvoicesContainer = InvoicesContainer; exports.InvoicesList = InvoicesList; exports.InvoicesSummaryCard = InvoicesSummaryCard; exports.PaymentMethodCard = PaymentMethodCard; exports.PaymentMethodEditor = PaymentMethodEditor; exports.PaymentMethodForm = PaymentMethodForm; exports.PaymentMethodSummaryCard = PaymentMethodSummaryCard; exports.PaymentMethodsContainer = PaymentMethodsContainer; exports.PaymentMethodsList = PaymentMethodsList; exports.PriceArchiver = PriceArchiver; exports.PriceContainer = PriceContainer; exports.PriceDetails = PriceDetails; exports.PriceEditor = PriceEditor; exports.PriceProvider = PriceProvider; exports.PricesList = PricesList; exports.PricingCard = PricingCard; exports.ProductArchiver = ProductArchiver; exports.ProductContainer = ProductContainer; exports.ProductDetails = ProductDetails; exports.ProductEditor = ProductEditor; exports.ProductPricingList = ProductPricingList; exports.ProductPricingRow = ProductPricingRow; exports.ProductProvider = ProductProvider; exports.ProductsList = ProductsList; exports.ProductsListContainer = ProductsListContainer; exports.PromoCodeInput = PromoCodeInput; exports.ProrationPreview = ProrationPreview; exports.StripeProvider = StripeProvider; exports.SubscriptionConfirmation = SubscriptionConfirmation; exports.SubscriptionDetails = SubscriptionDetails; exports.SubscriptionStatusBadge = SubscriptionStatusBadge; exports.SubscriptionSummaryCard = SubscriptionSummaryCard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.formatCurrency = _chunkJEFI32DMjs.formatCurrency; exports.formatDate = formatDate3; exports.formatInterval = _chunkJEFI32DMjs.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.priceLabel = priceLabel; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
|
|
4219
4219
|
//# sourceMappingURL=index.js.map
|