@carlonicora/nextjs-jsonapi 4.0.5 → 4.0.7
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-H6EXQD46.js → BlockNoteEditor-J7EF7BRX.js} +9 -9
- package/dist/{BlockNoteEditor-H6EXQD46.js.map → BlockNoteEditor-J7EF7BRX.js.map} +1 -1
- package/dist/{BlockNoteEditor-L3STMBP2.mjs → BlockNoteEditor-KOHN3SSR.mjs} +2 -2
- package/dist/billing/index.js +335 -335
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-3JET3LL7.js → chunk-3M7D6NXU.js} +20 -13
- package/dist/chunk-3M7D6NXU.js.map +1 -0
- package/dist/{chunk-KX2776OK.mjs → chunk-3W3VVX2N.mjs} +322 -315
- package/dist/chunk-3W3VVX2N.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/analytics/index.js +88 -88
- package/dist/features/analytics/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 +1 -1
- package/src/components/navigations/RecentPagesNavigator.tsx +11 -1
- package/src/components/navigations/__tests__/RecentPagesNavigator.spec.tsx +19 -0
- package/src/shadcnui/ui/__tests__/sidebar.session.test.tsx +136 -0
- package/src/shadcnui/ui/sidebar.tsx +21 -13
- package/dist/chunk-3JET3LL7.js.map +0 -1
- package/dist/chunk-KX2776OK.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-L3STMBP2.mjs.map → BlockNoteEditor-KOHN3SSR.mjs.map} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunk3M7D6NXUjs = require('../chunk-3M7D6NXU.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
var _chunk7ZRQOLSVjs = require('../chunk-7ZRQOLSV.js');
|
|
@@ -134,41 +134,41 @@ function SubscriptionSummaryCard({
|
|
|
134
134
|
onManageClick
|
|
135
135
|
}) {
|
|
136
136
|
if (loading) {
|
|
137
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
138
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
139
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
137
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
138
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
139
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Subscriptions" }),
|
|
140
140
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
141
141
|
] }),
|
|
142
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
143
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
144
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
145
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: [
|
|
143
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
144
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
145
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-40" })
|
|
146
146
|
] })
|
|
147
147
|
] });
|
|
148
148
|
}
|
|
149
149
|
if (error) {
|
|
150
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
151
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
152
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
150
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
151
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
152
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Subscriptions" }),
|
|
153
153
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
154
154
|
] }),
|
|
155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
155
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
156
156
|
] });
|
|
157
157
|
}
|
|
158
158
|
const activeSubscriptions = subscriptions.filter(
|
|
159
159
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
160
160
|
);
|
|
161
161
|
const primarySubscription = activeSubscriptions[0];
|
|
162
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
163
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
164
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
162
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
163
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Subscriptions" }),
|
|
165
165
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
166
166
|
] }),
|
|
167
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
167
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
168
168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No active plan" }),
|
|
169
169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Subscribe to get started" }),
|
|
170
170
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
171
|
-
|
|
171
|
+
_chunk3M7D6NXUjs.Button,
|
|
172
172
|
{
|
|
173
173
|
variant: "outline",
|
|
174
174
|
size: "sm",
|
|
@@ -187,7 +187,7 @@ function SubscriptionSummaryCard({
|
|
|
187
187
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
188
188
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription) }),
|
|
189
189
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
190
|
-
|
|
190
|
+
_chunk3M7D6NXUjs.Badge,
|
|
191
191
|
{
|
|
192
192
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
193
193
|
children: primarySubscription.cancelAtPeriodEnd ? "Canceling" : primarySubscription.status
|
|
@@ -229,37 +229,37 @@ function PaymentMethodSummaryCard({
|
|
|
229
229
|
onManageClick
|
|
230
230
|
}) {
|
|
231
231
|
if (loading) {
|
|
232
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
233
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
234
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
232
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
233
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Payment Method" }),
|
|
235
235
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
236
236
|
] }),
|
|
237
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
238
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
239
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
237
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: [
|
|
238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
239
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-24" })
|
|
240
240
|
] })
|
|
241
241
|
] });
|
|
242
242
|
}
|
|
243
243
|
if (error) {
|
|
244
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
245
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
246
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
244
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
245
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
246
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Payment Method" }),
|
|
247
247
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
248
248
|
] }),
|
|
249
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
249
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
250
250
|
] });
|
|
251
251
|
}
|
|
252
252
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
253
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
254
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
255
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
253
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
254
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
255
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Payment Method" }),
|
|
256
256
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
257
257
|
] }),
|
|
258
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
258
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
259
259
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No payment method" }),
|
|
260
260
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Add a card to enable subscriptions" }),
|
|
261
261
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
262
|
-
|
|
262
|
+
_chunk3M7D6NXUjs.Button,
|
|
263
263
|
{
|
|
264
264
|
variant: "outline",
|
|
265
265
|
size: "sm",
|
|
@@ -332,52 +332,52 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
332
332
|
}
|
|
333
333
|
}, "handlePortalClick");
|
|
334
334
|
if (loading) {
|
|
335
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
336
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
335
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
336
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Billing Account" }),
|
|
338
338
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
339
339
|
] }),
|
|
340
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
341
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
342
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
343
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
340
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: [
|
|
341
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
342
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
343
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-24" })
|
|
344
344
|
] })
|
|
345
345
|
] });
|
|
346
346
|
}
|
|
347
347
|
if (error) {
|
|
348
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
349
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
350
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
348
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
349
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
350
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Billing Account" }),
|
|
351
351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
352
352
|
] }),
|
|
353
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
353
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
354
354
|
] });
|
|
355
355
|
}
|
|
356
356
|
if (!customer) {
|
|
357
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
358
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
359
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
357
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
358
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
359
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Billing Account" }),
|
|
360
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
361
361
|
] }),
|
|
362
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
362
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: [
|
|
363
363
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "Not set up" }),
|
|
364
364
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Billing account will be created when you subscribe" })
|
|
365
365
|
] })
|
|
366
366
|
] });
|
|
367
367
|
}
|
|
368
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
369
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
370
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
368
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
369
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Billing Account" }),
|
|
371
371
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
372
372
|
] }),
|
|
373
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
373
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
374
374
|
customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
|
|
375
375
|
customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
376
376
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
377
377
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
378
378
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
379
379
|
] }),
|
|
380
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
380
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
381
381
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
382
382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ms-1" })
|
|
383
383
|
] })
|
|
@@ -421,42 +421,42 @@ function formatAmount(amount, currency) {
|
|
|
421
421
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
422
422
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
423
423
|
if (loading) {
|
|
424
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
425
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
426
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
424
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
425
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
426
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Recent Invoices" }),
|
|
427
427
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
428
428
|
] }),
|
|
429
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
432
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
429
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: [
|
|
430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-20" })
|
|
433
433
|
] })
|
|
434
434
|
] });
|
|
435
435
|
}
|
|
436
436
|
if (error) {
|
|
437
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
438
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
439
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
437
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
438
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Recent Invoices" }),
|
|
440
440
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
441
441
|
] }),
|
|
442
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
442
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
443
443
|
] });
|
|
444
444
|
}
|
|
445
445
|
const latestInvoice = invoices[0];
|
|
446
446
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
447
447
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
448
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
449
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
448
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
449
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Recent Invoices" }),
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
452
452
|
] }),
|
|
453
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
453
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
454
454
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No invoices yet" }),
|
|
455
455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Invoices will appear after your first billing cycle" })
|
|
456
456
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
457
457
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
458
458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency) }),
|
|
459
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: latestInvoice.status })
|
|
460
460
|
] }),
|
|
461
461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || `Invoice from ${formatDate2(latestInvoice.periodStart)}` }),
|
|
462
462
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
@@ -496,24 +496,24 @@ function BillingUsageSummaryCard({
|
|
|
496
496
|
onViewDetailsClick
|
|
497
497
|
}) {
|
|
498
498
|
if (loading) {
|
|
499
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
500
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
501
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
499
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
500
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
501
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Usage This Month" }),
|
|
502
502
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
503
503
|
] }),
|
|
504
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
505
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
506
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
504
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: [
|
|
505
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
506
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-32" })
|
|
507
507
|
] })
|
|
508
508
|
] });
|
|
509
509
|
}
|
|
510
510
|
if (error) {
|
|
511
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
512
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
513
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
511
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
512
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
513
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Usage This Month" }),
|
|
514
514
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
515
515
|
] }),
|
|
516
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
517
517
|
] });
|
|
518
518
|
}
|
|
519
519
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -521,12 +521,12 @@ function BillingUsageSummaryCard({
|
|
|
521
521
|
}, 0);
|
|
522
522
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
|
|
523
523
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
524
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
525
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
526
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
524
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
525
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
526
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Usage This Month" }),
|
|
527
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
528
528
|
] }),
|
|
529
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
529
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
530
530
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No meters" }),
|
|
531
531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "No usage meters are configured" })
|
|
532
532
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -632,7 +632,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
632
632
|
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..." }) });
|
|
633
633
|
}
|
|
634
634
|
if (!setupIntent && error) {
|
|
635
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
635
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDescription, { children: error }) });
|
|
636
636
|
}
|
|
637
637
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
638
638
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -655,13 +655,13 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
655
655
|
}
|
|
656
656
|
) }),
|
|
657
657
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
658
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
659
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
658
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
659
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: "Set as default payment method" })
|
|
660
660
|
] }),
|
|
661
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDescription, { children: error }) }),
|
|
662
662
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
663
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
664
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
663
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: "Cancel" }),
|
|
664
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? "Processing..." : "Add Card" })
|
|
665
665
|
] })
|
|
666
666
|
] });
|
|
667
667
|
}
|
|
@@ -677,10 +677,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
677
677
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
678
678
|
onOpenChange(false);
|
|
679
679
|
}, "handleCancel");
|
|
680
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
681
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
682
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
683
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
680
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogContent, { className: "max-w-md", children: [
|
|
681
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogHeader, { children: [
|
|
682
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogTitle, { children: "Add Payment Method" }),
|
|
683
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogDescription, { children: "Add a new payment method to your account. Your card information is securely processed by Stripe." })
|
|
684
684
|
] }),
|
|
685
685
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
|
|
686
686
|
] }) });
|
|
@@ -741,16 +741,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
741
741
|
}
|
|
742
742
|
}, "handleRemove");
|
|
743
743
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
744
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
745
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
746
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
744
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { className: "relative", children: [
|
|
745
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "softGreen", className: "absolute end-2 top-2", children: "Default" }),
|
|
746
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
747
747
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
748
748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
749
749
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
750
750
|
] }),
|
|
751
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
753
|
-
|
|
751
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DropdownMenu, { children: [
|
|
752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
753
|
+
_chunk3M7D6NXUjs.Button,
|
|
754
754
|
{
|
|
755
755
|
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
756
756
|
nativeButton: false,
|
|
@@ -761,10 +761,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
761
761
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
|
|
762
762
|
}
|
|
763
763
|
) }),
|
|
764
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
765
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
764
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DropdownMenuContent, { align: "end", children: [
|
|
765
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
766
766
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
767
|
-
|
|
767
|
+
_chunk3M7D6NXUjs.DropdownMenuItem,
|
|
768
768
|
{
|
|
769
769
|
onClick: () => setShowRemoveDialog(true),
|
|
770
770
|
disabled: loading,
|
|
@@ -775,7 +775,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
775
775
|
] })
|
|
776
776
|
] })
|
|
777
777
|
] }),
|
|
778
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
778
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
779
779
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
780
780
|
"\u2022\u2022\u2022\u2022 ",
|
|
781
781
|
last4
|
|
@@ -788,17 +788,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
788
788
|
] })
|
|
789
789
|
] }) })
|
|
790
790
|
] }),
|
|
791
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
793
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
794
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
791
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.AlertDialogContent, { children: [
|
|
792
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.AlertDialogHeader, { children: [
|
|
793
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDialogTitle, { children: "Remove Payment Method" }),
|
|
794
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.AlertDialogDescription, { children: [
|
|
795
795
|
"Are you sure you want to remove this payment method? This action cannot be undone.",
|
|
796
796
|
isDefault && " This is your default payment method."
|
|
797
797
|
] })
|
|
798
798
|
] }),
|
|
799
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
800
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
801
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
799
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.AlertDialogFooter, { children: [
|
|
800
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDialogCancel, { disabled: loading, children: "Cancel" }),
|
|
801
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? "Removing..." : "Remove" })
|
|
802
802
|
] })
|
|
803
803
|
] }) })
|
|
804
804
|
] });
|
|
@@ -841,14 +841,14 @@ function PaymentMethodsContainer() {
|
|
|
841
841
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
842
842
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Payment Methods" })
|
|
843
843
|
] }),
|
|
844
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
844
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
845
845
|
] }),
|
|
846
846
|
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: [
|
|
847
847
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
848
848
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
849
849
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: "No payment methods" }),
|
|
850
850
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
851
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
851
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
852
852
|
] })
|
|
853
853
|
] }),
|
|
854
854
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -916,7 +916,7 @@ var statusConfig = {
|
|
|
916
916
|
};
|
|
917
917
|
function InvoiceStatusBadge({ status }) {
|
|
918
918
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
919
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
919
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: config.variant, children: config.label });
|
|
920
920
|
}
|
|
921
921
|
_chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
922
922
|
|
|
@@ -947,13 +947,13 @@ function InvoiceDetails({
|
|
|
947
947
|
return invoice.stripeInvoiceId.slice(-8);
|
|
948
948
|
}, "getInvoiceNumber");
|
|
949
949
|
const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || "Subscription";
|
|
950
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
951
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
952
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
950
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogContent, { className: "max-w-2xl", children: [
|
|
951
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogHeader, { children: [
|
|
952
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogTitle, { children: [
|
|
953
953
|
"Invoice ",
|
|
954
954
|
getInvoiceNumber()
|
|
955
955
|
] }),
|
|
956
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
956
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogDescription, { children: formatDate3(invoice.periodStart) })
|
|
957
957
|
] }),
|
|
958
958
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
959
959
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -991,42 +991,42 @@ function InvoiceDetails({
|
|
|
991
991
|
] }) }),
|
|
992
992
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { className: "border-t", children: [
|
|
993
993
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3", children: productName }),
|
|
994
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children:
|
|
994
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
995
995
|
] }) })
|
|
996
996
|
] }) })
|
|
997
997
|
] }),
|
|
998
998
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2 border-t pt-4", children: [
|
|
999
999
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1000
1000
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Subtotal:" }),
|
|
1001
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
1001
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
1002
1002
|
] }),
|
|
1003
1003
|
invoice.tax !== void 0 && invoice.tax > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1004
1004
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Tax:" }),
|
|
1005
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
1005
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, invoice.tax, invoice.currency) })
|
|
1006
1006
|
] }),
|
|
1007
1007
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-lg font-semibold border-t pt-2", children: [
|
|
1008
1008
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Total:" }),
|
|
1009
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1009
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, invoice.total, invoice.currency) })
|
|
1010
1010
|
] }),
|
|
1011
1011
|
invoice.amountPaid > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1012
1012
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Paid:" }),
|
|
1013
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children:
|
|
1013
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, invoice.amountPaid, invoice.currency) })
|
|
1014
1014
|
] }),
|
|
1015
1015
|
invoice.amountRemaining > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1016
1016
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Due:" }),
|
|
1017
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children:
|
|
1017
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, invoice.amountRemaining, invoice.currency) })
|
|
1018
1018
|
] })
|
|
1019
1019
|
] }),
|
|
1020
1020
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1021
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1021
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1022
1022
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "me-2 h-4 w-4" }),
|
|
1023
1023
|
"Download PDF"
|
|
1024
1024
|
] }),
|
|
1025
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1025
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1026
1026
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "me-2 h-4 w-4" }),
|
|
1027
1027
|
"Retry Payment"
|
|
1028
1028
|
] }),
|
|
1029
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1029
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1030
1030
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "me-2 h-4 w-4" }),
|
|
1031
1031
|
"View in Stripe"
|
|
1032
1032
|
] })
|
|
@@ -1050,30 +1050,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1050
1050
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1051
1051
|
}, "getInvoiceNumber");
|
|
1052
1052
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1053
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1055
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1057
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1058
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1059
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Table, { children: [
|
|
1054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.TableRow, { children: [
|
|
1055
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Invoice #" }),
|
|
1056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Date" }),
|
|
1057
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Status" }),
|
|
1058
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { className: "text-end", children: "Amount" }),
|
|
1059
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Period" })
|
|
1060
1060
|
] }) }),
|
|
1061
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1061
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableBody, { children: invoices.map((invoice) => {
|
|
1062
1062
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1063
1063
|
const date = formatDate3(invoice.periodStart);
|
|
1064
|
-
const amount =
|
|
1064
|
+
const amount = _chunk3M7D6NXUjs.formatCurrency.call(void 0, invoice.total, invoice.currency);
|
|
1065
1065
|
const period = `${formatDate3(invoice.periodStart)} - ${formatDate3(invoice.periodEnd)}`;
|
|
1066
1066
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1067
|
-
|
|
1067
|
+
_chunk3M7D6NXUjs.TableRow,
|
|
1068
1068
|
{
|
|
1069
1069
|
onClick: () => handleRowClick(invoice),
|
|
1070
1070
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1071
1071
|
children: [
|
|
1072
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1074
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1076
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1072
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1074
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1075
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1076
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1077
1077
|
]
|
|
1078
1078
|
},
|
|
1079
1079
|
invoice.id
|
|
@@ -1122,12 +1122,12 @@ function InvoicesContainer() {
|
|
|
1122
1122
|
setStatusFilter(value);
|
|
1123
1123
|
}, "handleFilterChange");
|
|
1124
1124
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
1125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1128
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1129
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1130
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.TabsList, { children: [
|
|
1126
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TabsTrigger, { value: "all", children: "All" }),
|
|
1127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TabsTrigger, { value: "paid" /* PAID */, children: "Paid" }),
|
|
1128
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TabsTrigger, { value: "open" /* OPEN */, children: "Open" }),
|
|
1129
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TabsTrigger, { value: "void" /* VOID */, children: "Void" }),
|
|
1130
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: "Uncollectible" })
|
|
1131
1131
|
] }) }),
|
|
1132
1132
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: "Loading invoices..." }),
|
|
1133
1133
|
!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: [
|
|
@@ -1187,19 +1187,19 @@ function CancelSubscriptionDialog({
|
|
|
1187
1187
|
}
|
|
1188
1188
|
}, "onSubmit");
|
|
1189
1189
|
const periodEndDate = formatDate3(subscription.currentPeriodEnd);
|
|
1190
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1191
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1193
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogContent, { className: "max-w-md", children: [
|
|
1191
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogHeader, { children: [
|
|
1192
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogTitle, { children: "Cancel Subscription" }),
|
|
1193
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1194
1194
|
] }),
|
|
1195
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1195
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1196
1196
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: [
|
|
1197
1197
|
"Your subscription will remain active until ",
|
|
1198
1198
|
periodEndDate,
|
|
1199
1199
|
". You can continue using the service until then."
|
|
1200
1200
|
] }),
|
|
1201
1201
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1202
|
-
|
|
1202
|
+
_chunk3M7D6NXUjs.FormTextarea,
|
|
1203
1203
|
{
|
|
1204
1204
|
form,
|
|
1205
1205
|
id: "reason",
|
|
@@ -1209,8 +1209,8 @@ function CancelSubscriptionDialog({
|
|
|
1209
1209
|
}
|
|
1210
1210
|
),
|
|
1211
1211
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1212
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1213
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1212
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: "Keep Subscription" }),
|
|
1213
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? "Canceling..." : "Confirm Cancellation" })
|
|
1214
1214
|
] })
|
|
1215
1215
|
] }) })
|
|
1216
1216
|
] }) });
|
|
@@ -1259,7 +1259,7 @@ var cancelingConfig = {
|
|
|
1259
1259
|
};
|
|
1260
1260
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1261
1261
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1262
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1262
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: config.variant, children: config.label });
|
|
1263
1263
|
}
|
|
1264
1264
|
_chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1265
1265
|
|
|
@@ -1286,7 +1286,7 @@ function formatPlanName2(price) {
|
|
|
1286
1286
|
_chunk7QVYU63Ejs.__name.call(void 0, formatPlanName2, "formatPlanName");
|
|
1287
1287
|
function formatBillingAmount(price) {
|
|
1288
1288
|
if (!_optionalChain([price, 'optionalAccess', _37 => _37.unitAmount])) return "N/A";
|
|
1289
|
-
return
|
|
1289
|
+
return _chunk3M7D6NXUjs.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1290
1290
|
}
|
|
1291
1291
|
_chunk7QVYU63Ejs.__name.call(void 0, formatBillingAmount, "formatBillingAmount");
|
|
1292
1292
|
function SubscriptionDetails({
|
|
@@ -1332,10 +1332,10 @@ function SubscriptionDetails({
|
|
|
1332
1332
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1333
1333
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1334
1334
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1336
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogContent, { className: "max-w-2xl", children: [
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogHeader, { children: [
|
|
1337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogTitle, { children: "Subscription Details" }),
|
|
1338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogDescription, { children: "View and manage your subscription" })
|
|
1339
1339
|
] }),
|
|
1340
1340
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1341
1341
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1377,11 +1377,11 @@ function SubscriptionDetails({
|
|
|
1377
1377
|
"."
|
|
1378
1378
|
] }) }),
|
|
1379
1379
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1380
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1381
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1382
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1383
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1384
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1380
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: "Change Plan" }),
|
|
1381
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? "Pausing..." : "Pause" }),
|
|
1382
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? "Resuming..." : "Resume" }),
|
|
1383
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: "Cancel" }),
|
|
1384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: handleManageViaPortal, children: "Manage via Portal" })
|
|
1385
1385
|
] })
|
|
1386
1386
|
] })
|
|
1387
1387
|
] }) }),
|
|
@@ -1428,36 +1428,36 @@ function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan
|
|
|
1428
1428
|
setSelectedSub(subscription);
|
|
1429
1429
|
}, "handleRowClick");
|
|
1430
1430
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1432
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1433
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1435
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Table, { children: [
|
|
1432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.TableRow, { children: [
|
|
1433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Status" }),
|
|
1434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Plan" }),
|
|
1435
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Period" }),
|
|
1436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { className: "text-end", children: "Amount" }),
|
|
1437
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { className: "text-end", children: "Actions" })
|
|
1438
1438
|
] }) }),
|
|
1439
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableBody, { children: subscriptions.map((subscription) => {
|
|
1440
1440
|
const price = subscription.price;
|
|
1441
|
-
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ?
|
|
1441
|
+
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? _chunk3M7D6NXUjs.formatCurrency.call(void 0, price.unitAmount, price.currency) : "0";
|
|
1442
1442
|
const period = `${formatDate3(subscription.currentPeriodStart)} - ${formatDate3(subscription.currentPeriodEnd)}`;
|
|
1443
1443
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1444
|
-
|
|
1444
|
+
_chunk3M7D6NXUjs.TableRow,
|
|
1445
1445
|
{
|
|
1446
1446
|
onClick: () => handleRowClick(subscription),
|
|
1447
1447
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1448
1448
|
children: [
|
|
1449
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1450
1450
|
SubscriptionStatusBadge,
|
|
1451
1451
|
{
|
|
1452
1452
|
status: subscription.status,
|
|
1453
1453
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
|
|
1454
1454
|
}
|
|
1455
1455
|
) }),
|
|
1456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1458
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1459
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1460
|
-
|
|
1456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "font-medium", children: formatPlanName3(price) }),
|
|
1457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1458
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-end", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1460
|
+
_chunk3M7D6NXUjs.Button,
|
|
1461
1461
|
{
|
|
1462
1462
|
size: "sm",
|
|
1463
1463
|
variant: "outline",
|
|
@@ -1525,7 +1525,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1525
1525
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1526
1526
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Subscriptions" })
|
|
1527
1527
|
] }),
|
|
1528
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1528
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _43 => _43()]), children: hasActiveRecurringSubscription ? "Purchase Add-ons" : "Subscribe to a Plan" })
|
|
1529
1529
|
] }),
|
|
1530
1530
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1531
1531
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1533,7 +1533,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1533
1533
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1534
1534
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: "No Active Subscriptions" }),
|
|
1535
1535
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1536
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1536
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: "Subscribe to a Plan" })
|
|
1537
1537
|
] })
|
|
1538
1538
|
] }),
|
|
1539
1539
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1554,9 +1554,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1554
1554
|
if (!hasMonthly || !hasYearly) {
|
|
1555
1555
|
return null;
|
|
1556
1556
|
}
|
|
1557
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1558
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1559
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1557
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.TabsList, { children: [
|
|
1558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TabsTrigger, { value: "month", children: "Monthly" }),
|
|
1559
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TabsTrigger, { value: "year", children: "Yearly" })
|
|
1560
1560
|
] }) });
|
|
1561
1561
|
}
|
|
1562
1562
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1574,8 +1574,8 @@ function PricingCard({
|
|
|
1574
1574
|
}) {
|
|
1575
1575
|
const description = price.description || price.nickname || "Standard";
|
|
1576
1576
|
const features = price.features || [];
|
|
1577
|
-
const formattedPrice =
|
|
1578
|
-
const interval =
|
|
1577
|
+
const formattedPrice = _chunk3M7D6NXUjs.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1578
|
+
const interval = _chunk3M7D6NXUjs.formatInterval.call(void 0, price);
|
|
1579
1579
|
const handleKeyDown = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (e) => {
|
|
1580
1580
|
if ((e.key === "Enter" || e.key === " ") && !isDisabled && !isCurrentPlan) {
|
|
1581
1581
|
e.preventDefault();
|
|
@@ -1588,7 +1588,7 @@ function PricingCard({
|
|
|
1588
1588
|
}
|
|
1589
1589
|
}, "handleClick");
|
|
1590
1590
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1591
|
-
|
|
1591
|
+
_chunk3M7D6NXUjs.Card,
|
|
1592
1592
|
{
|
|
1593
1593
|
role: "radio",
|
|
1594
1594
|
"aria-checked": isSelected,
|
|
@@ -1606,9 +1606,9 @@ function PricingCard({
|
|
|
1606
1606
|
isLoading && "pointer-events-none"
|
|
1607
1607
|
),
|
|
1608
1608
|
children: [
|
|
1609
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1610
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1611
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1609
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "secondary", className: "absolute top-2 end-2", children: "Current" }),
|
|
1610
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
|
|
1611
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { className: "pb-4 grow", children: [
|
|
1612
1612
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1613
1613
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1614
1614
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ms-1", children: interval })
|
|
@@ -1618,8 +1618,8 @@ function PricingCard({
|
|
|
1618
1618
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1619
1619
|
] }, index)) })
|
|
1620
1620
|
] }),
|
|
1621
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1622
|
-
|
|
1621
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1622
|
+
_chunk3M7D6NXUjs.Button,
|
|
1623
1623
|
{
|
|
1624
1624
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1625
1625
|
className: "w-full",
|
|
@@ -1647,7 +1647,7 @@ function ProductPricingRow({
|
|
|
1647
1647
|
return null;
|
|
1648
1648
|
}
|
|
1649
1649
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SectionHeader, { children: product.name }),
|
|
1651
1651
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1652
1652
|
"div",
|
|
1653
1653
|
{
|
|
@@ -1747,15 +1747,15 @@ function ProductPricingList({
|
|
|
1747
1747
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1748
1748
|
function ProductPricingListSkeleton() {
|
|
1749
1749
|
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: [
|
|
1750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-6 w-32" }),
|
|
1751
1751
|
/* @__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: [
|
|
1752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-6 w-24" }),
|
|
1753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-8 w-32" }),
|
|
1754
1754
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1756
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1755
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-full" }),
|
|
1756
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-4 w-3/4" })
|
|
1757
1757
|
] }),
|
|
1758
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1758
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Skeleton, { className: "h-10 w-full" })
|
|
1759
1759
|
] }, cardIndex)) })
|
|
1760
1760
|
] }, rowIndex)) });
|
|
1761
1761
|
}
|
|
@@ -1769,18 +1769,18 @@ function ProrationPreview({ preview }) {
|
|
|
1769
1769
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1770
1770
|
preview.lineItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
1771
1771
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: item.description }),
|
|
1772
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children:
|
|
1772
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, item.amount, preview.currency) })
|
|
1773
1773
|
] }, index)),
|
|
1774
1774
|
/* @__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: [
|
|
1775
1775
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: "Net Due Today" }),
|
|
1776
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children:
|
|
1776
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, preview.immediateCharge, preview.currency) })
|
|
1777
1777
|
] }) }),
|
|
1778
1778
|
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: [
|
|
1779
1779
|
"Next invoice on ",
|
|
1780
1780
|
formatDate3(preview.lineItems[0].period.end),
|
|
1781
1781
|
" for",
|
|
1782
1782
|
" ",
|
|
1783
|
-
|
|
1783
|
+
_chunk3M7D6NXUjs.formatCurrency.call(void 0, preview.amountDue, preview.currency)
|
|
1784
1784
|
] })
|
|
1785
1785
|
] })
|
|
1786
1786
|
] });
|
|
@@ -1802,16 +1802,16 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1802
1802
|
productDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm text-muted-foreground", children: productDescription })
|
|
1803
1803
|
] }),
|
|
1804
1804
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-lg font-semibold", children: [
|
|
1805
|
-
|
|
1806
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children:
|
|
1805
|
+
_chunk3M7D6NXUjs.formatCurrency.call(void 0, price.unitAmount, price.currency),
|
|
1806
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children: _chunk3M7D6NXUjs.formatInterval.call(void 0, price) })
|
|
1807
1807
|
] }),
|
|
1808
1808
|
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: [
|
|
1809
1809
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: "h-4 w-4 text-primary" }),
|
|
1810
1810
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1811
1811
|
] }, index)) }),
|
|
1812
1812
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1813
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1814
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1813
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
1814
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1815
1815
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin me-2" }),
|
|
1816
1816
|
"Processing..."
|
|
1817
1817
|
] }) : "Subscribe" })
|
|
@@ -2141,7 +2141,7 @@ function WizardStepPlanSelection({
|
|
|
2141
2141
|
onSelectPrice: handleSelectPrice
|
|
2142
2142
|
}
|
|
2143
2143
|
),
|
|
2144
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2144
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? "Loading..." : "Next: Review" }) })
|
|
2145
2145
|
] });
|
|
2146
2146
|
}
|
|
2147
2147
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2202,7 +2202,7 @@ function PromoCodeInput({
|
|
|
2202
2202
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2203
2203
|
] }),
|
|
2204
2204
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2205
|
-
|
|
2205
|
+
_chunk3M7D6NXUjs.Button,
|
|
2206
2206
|
{
|
|
2207
2207
|
variant: "ghost",
|
|
2208
2208
|
size: "sm",
|
|
@@ -2219,7 +2219,7 @@ function PromoCodeInput({
|
|
|
2219
2219
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2220
2220
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
2221
2221
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2222
|
-
|
|
2222
|
+
_chunk3M7D6NXUjs.Input,
|
|
2223
2223
|
{
|
|
2224
2224
|
placeholder: "Enter promo code",
|
|
2225
2225
|
value: code,
|
|
@@ -2229,7 +2229,7 @@ function PromoCodeInput({
|
|
|
2229
2229
|
className: "flex-1"
|
|
2230
2230
|
}
|
|
2231
2231
|
),
|
|
2232
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2232
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.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" })
|
|
2233
2233
|
] }),
|
|
2234
2234
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2235
2235
|
] });
|
|
@@ -2294,14 +2294,14 @@ function WizardStepReview({
|
|
|
2294
2294
|
return `${promotionCode.discountValue}% off`;
|
|
2295
2295
|
}
|
|
2296
2296
|
if (promotionCode.discountType === "amount_off" && promotionCode.discountValue) {
|
|
2297
|
-
return `${
|
|
2297
|
+
return `${_chunk3M7D6NXUjs.formatCurrency.call(void 0, promotionCode.discountValue, promotionCode.currency || selectedPrice.currency)} off`;
|
|
2298
2298
|
}
|
|
2299
2299
|
return null;
|
|
2300
2300
|
}, "getDiscountDescription");
|
|
2301
2301
|
const discountDescription = getDiscountDescription();
|
|
2302
2302
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2303
2303
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2304
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2304
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SectionHeader, { children: "Selected Plan" }),
|
|
2305
2305
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
|
|
2306
2306
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2307
2307
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _92 => _92.product, 'optionalAccess', _93 => _93.name]) }),
|
|
@@ -2309,10 +2309,10 @@ function WizardStepReview({
|
|
|
2309
2309
|
] }),
|
|
2310
2310
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-end", children: [
|
|
2311
2311
|
discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2312
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children:
|
|
2313
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children:
|
|
2314
|
-
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2315
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children:
|
|
2312
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2313
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, discountedPrice, selectedPrice.currency) }),
|
|
2314
|
+
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "softGreen", children: discountDescription })
|
|
2315
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2316
2316
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2317
2317
|
] })
|
|
2318
2318
|
] })
|
|
@@ -2327,9 +2327,9 @@ function WizardStepReview({
|
|
|
2327
2327
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
2328
2328
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? "Amount to charge now:" : "Amount due now:" }),
|
|
2329
2329
|
/* @__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: [
|
|
2330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children:
|
|
2331
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children:
|
|
2332
|
-
] }) :
|
|
2330
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) }),
|
|
2331
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, discountedImmediateCharge, prorationPreview.currency) })
|
|
2332
|
+
] }) : _chunk3M7D6NXUjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) })
|
|
2333
2333
|
] })
|
|
2334
2334
|
]
|
|
2335
2335
|
}
|
|
@@ -2353,15 +2353,15 @@ function WizardStepReview({
|
|
|
2353
2353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: "Payment Method" }),
|
|
2354
2354
|
/* @__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" })
|
|
2355
2355
|
] }),
|
|
2356
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2356
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: onAddPaymentMethod, children: "Add Payment Method" })
|
|
2357
2357
|
] }) }),
|
|
2358
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2358
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Alert, { variant: "destructive", children: [
|
|
2359
2359
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2360
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2360
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDescription, { children: error })
|
|
2361
2361
|
] }),
|
|
2362
2362
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2363
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2364
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2363
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: "Back" }),
|
|
2364
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? "Processing..." : hasPaymentMethod ? isChangingPlan ? "Confirm Plan Change" : "Subscribe Now" : "Add Payment Method" })
|
|
2365
2365
|
] })
|
|
2366
2366
|
] });
|
|
2367
2367
|
}
|
|
@@ -2372,7 +2372,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, WizardStepReview, "WizardStepReview");
|
|
|
2372
2372
|
function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
2373
2373
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2374
2374
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
2375
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2375
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SectionHeader, { children: "Add Payment Method" }),
|
|
2376
2376
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: "Enter your card details to complete your subscription" })
|
|
2377
2377
|
] }),
|
|
2378
2378
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2414,10 +2414,10 @@ function SubscriptionWizard({
|
|
|
2414
2414
|
const isChangePlanMode = !!subscription;
|
|
2415
2415
|
const dialogTitle = subscription ? "Change Subscription Plan" : isPurchasingAddons ? "Purchase Add-ons" : "Subscribe to a Plan";
|
|
2416
2416
|
const dialogDescription = subscription ? "Select a new plan for your subscription" : isPurchasingAddons ? "Select one-time products to purchase" : "Choose a subscription plan to get started";
|
|
2417
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2418
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2419
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2420
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogContent, { className: "max-w-2xl", children: [
|
|
2418
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogHeader, { children: [
|
|
2419
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogTitle, { children: dialogTitle }),
|
|
2420
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogDescription, { children: dialogDescription })
|
|
2421
2421
|
] }),
|
|
2422
2422
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2423
2423
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2500,15 +2500,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2500
2500
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2501
2501
|
const displayName = meter.displayName || meter.eventName;
|
|
2502
2502
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2503
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2504
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2503
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
2504
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2505
2505
|
/* @__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" }) }),
|
|
2506
2506
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2507
2507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
|
|
2508
2508
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2509
2509
|
] })
|
|
2510
2510
|
] }),
|
|
2511
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2511
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2512
2512
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2513
2513
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2514
2514
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-muted-foreground text-sm", children: [
|
|
@@ -2635,22 +2635,22 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2635
2635
|
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." }) });
|
|
2636
2636
|
}
|
|
2637
2637
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2638
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2639
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2640
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2641
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2642
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2643
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SectionHeader, { level: 2, children: "Usage History" }),
|
|
2639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Table, { children: [
|
|
2640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.TableRow, { children: [
|
|
2641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Date & Time" }),
|
|
2642
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Meter Event" }),
|
|
2643
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { className: "text-end", children: "Quantity" }),
|
|
2644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableHead, { children: "Event ID" })
|
|
2645
2645
|
] }) }),
|
|
2646
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2646
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableBody, { children: usageRecords.map((record) => {
|
|
2647
2647
|
const dateTime = formatDateTime(record.timestamp);
|
|
2648
2648
|
const quantity = record.quantity.toLocaleString();
|
|
2649
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2651
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2652
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2653
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.TableRow, { children: [
|
|
2650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "font-medium", children: dateTime }),
|
|
2651
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2652
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-end font-medium", children: quantity }),
|
|
2653
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2654
2654
|
] }, record.id);
|
|
2655
2655
|
}) })
|
|
2656
2656
|
] }) })
|
|
@@ -2661,8 +2661,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
|
|
|
2661
2661
|
// src/features/billing/components/modals/BillingDetailModal.tsx
|
|
2662
2662
|
|
|
2663
2663
|
function BillingDetailModal({ open, onOpenChange, title, children, className }) {
|
|
2664
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2665
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2664
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2665
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DialogTitle, { children: title }) }),
|
|
2666
2666
|
children
|
|
2667
2667
|
] }) });
|
|
2668
2668
|
}
|
|
@@ -2679,7 +2679,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2679
2679
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: "Payment Failed" }),
|
|
2680
2680
|
/* @__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." })
|
|
2681
2681
|
] }),
|
|
2682
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2682
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: "Update Payment Method" })
|
|
2683
2683
|
] });
|
|
2684
2684
|
}
|
|
2685
2685
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2699,7 +2699,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2699
2699
|
". Add a payment method to continue your subscription."
|
|
2700
2700
|
] })
|
|
2701
2701
|
] }),
|
|
2702
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2702
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: "Add Payment Method" })
|
|
2703
2703
|
] });
|
|
2704
2704
|
}
|
|
2705
2705
|
}
|
|
@@ -2923,18 +2923,18 @@ function BillingDashboardContainer() {
|
|
|
2923
2923
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2924
2924
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Billing" })
|
|
2925
2925
|
] }),
|
|
2926
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2927
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2928
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2926
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.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" }) }) }),
|
|
2927
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Card, { children: [
|
|
2928
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.CardHeader, { className: "text-center", children: [
|
|
2929
2929
|
/* @__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" }) }),
|
|
2930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2931
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2930
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardTitle, { children: "Set Up Billing" }),
|
|
2931
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardDescription, { children: "Your company doesn't have a billing account yet. Set one up to manage subscriptions, payment methods, and view invoices." })
|
|
2932
2932
|
] }),
|
|
2933
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2933
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2934
2934
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "me-2 h-4 w-4 animate-spin" }),
|
|
2935
2935
|
"Setting up..."
|
|
2936
2936
|
] }) : "Set Up Billing Account" }) }),
|
|
2937
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2937
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: errors.customer }) })
|
|
2938
2938
|
] }),
|
|
2939
2939
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2940
2940
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3106,12 +3106,12 @@ function PriceArchiver({ price }) {
|
|
|
3106
3106
|
const isArchived = !price.active;
|
|
3107
3107
|
const scope = isArchived ? "restore" : "archive";
|
|
3108
3108
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3109
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3109
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3110
3110
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3111
3111
|
t(`billing.admin.prices.${scope}.confirm`)
|
|
3112
3112
|
] }),
|
|
3113
3113
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3114
|
-
|
|
3114
|
+
_chunk3M7D6NXUjs.ConfirmDialog,
|
|
3115
3115
|
{
|
|
3116
3116
|
open,
|
|
3117
3117
|
onOpenChange: setOpen,
|
|
@@ -3125,7 +3125,7 @@ function PriceArchiver({ price }) {
|
|
|
3125
3125
|
if (isArchived) await restorePrice(price.id);
|
|
3126
3126
|
else await archivePrice(price.id);
|
|
3127
3127
|
} catch (error) {
|
|
3128
|
-
|
|
3128
|
+
_chunk3M7D6NXUjs.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
|
|
3129
3129
|
throw error;
|
|
3130
3130
|
}
|
|
3131
3131
|
}
|
|
@@ -3298,7 +3298,7 @@ function PriceEditorInternal({
|
|
|
3298
3298
|
{ id: "metered", text: t("billing.admin.prices.usage.metered") }
|
|
3299
3299
|
];
|
|
3300
3300
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3301
|
-
|
|
3301
|
+
_chunk3M7D6NXUjs.EditorSheet,
|
|
3302
3302
|
{
|
|
3303
3303
|
form,
|
|
3304
3304
|
entityType: t("billing.admin.prices.entity"),
|
|
@@ -3353,13 +3353,13 @@ function PriceEditorInternal({
|
|
|
3353
3353
|
dialogOpen,
|
|
3354
3354
|
onDialogOpenChange,
|
|
3355
3355
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3356
|
-
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3358
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3356
|
+
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Alert, { children: [
|
|
3357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
|
|
3358
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
|
|
3359
3359
|
] }),
|
|
3360
3360
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3361
3361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3362
|
-
|
|
3362
|
+
_chunk3M7D6NXUjs.FormInput,
|
|
3363
3363
|
{
|
|
3364
3364
|
form,
|
|
3365
3365
|
id: "unitAmount",
|
|
@@ -3371,7 +3371,7 @@ function PriceEditorInternal({
|
|
|
3371
3371
|
}
|
|
3372
3372
|
),
|
|
3373
3373
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3374
|
-
|
|
3374
|
+
_chunk3M7D6NXUjs.FormSelect,
|
|
3375
3375
|
{
|
|
3376
3376
|
form,
|
|
3377
3377
|
id: "currency",
|
|
@@ -3382,7 +3382,7 @@ function PriceEditorInternal({
|
|
|
3382
3382
|
)
|
|
3383
3383
|
] }),
|
|
3384
3384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3385
|
-
|
|
3385
|
+
_chunk3M7D6NXUjs.FormSelect,
|
|
3386
3386
|
{
|
|
3387
3387
|
form,
|
|
3388
3388
|
id: "interval",
|
|
@@ -3393,7 +3393,7 @@ function PriceEditorInternal({
|
|
|
3393
3393
|
),
|
|
3394
3394
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3395
3395
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3396
|
-
|
|
3396
|
+
_chunk3M7D6NXUjs.FormInput,
|
|
3397
3397
|
{
|
|
3398
3398
|
form,
|
|
3399
3399
|
id: "intervalCount",
|
|
@@ -3404,7 +3404,7 @@ function PriceEditorInternal({
|
|
|
3404
3404
|
}
|
|
3405
3405
|
),
|
|
3406
3406
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3407
|
-
|
|
3407
|
+
_chunk3M7D6NXUjs.FormSelect,
|
|
3408
3408
|
{
|
|
3409
3409
|
form,
|
|
3410
3410
|
id: "usageType",
|
|
@@ -3415,7 +3415,7 @@ function PriceEditorInternal({
|
|
|
3415
3415
|
)
|
|
3416
3416
|
] }),
|
|
3417
3417
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3418
|
-
|
|
3418
|
+
_chunk3M7D6NXUjs.FormInput,
|
|
3419
3419
|
{
|
|
3420
3420
|
form,
|
|
3421
3421
|
id: "nickname",
|
|
@@ -3424,7 +3424,7 @@ function PriceEditorInternal({
|
|
|
3424
3424
|
}
|
|
3425
3425
|
),
|
|
3426
3426
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3427
|
-
|
|
3427
|
+
_chunk3M7D6NXUjs.FormTextarea,
|
|
3428
3428
|
{
|
|
3429
3429
|
form,
|
|
3430
3430
|
id: "description",
|
|
@@ -3434,7 +3434,7 @@ function PriceEditorInternal({
|
|
|
3434
3434
|
}
|
|
3435
3435
|
),
|
|
3436
3436
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3437
|
-
|
|
3437
|
+
_chunk3M7D6NXUjs.FormInput,
|
|
3438
3438
|
{
|
|
3439
3439
|
form,
|
|
3440
3440
|
id: "token",
|
|
@@ -3444,10 +3444,10 @@ function PriceEditorInternal({
|
|
|
3444
3444
|
}
|
|
3445
3445
|
),
|
|
3446
3446
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
|
|
3448
3448
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3449
3449
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3450
|
-
|
|
3450
|
+
_chunk3M7D6NXUjs.Input,
|
|
3451
3451
|
{
|
|
3452
3452
|
...form.register(`features.${index}`),
|
|
3453
3453
|
placeholder: t("billing.admin.prices.placeholders.feature", { index: index + 1 }),
|
|
@@ -3455,7 +3455,7 @@ function PriceEditorInternal({
|
|
|
3455
3455
|
}
|
|
3456
3456
|
),
|
|
3457
3457
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3458
|
-
|
|
3458
|
+
_chunk3M7D6NXUjs.Button,
|
|
3459
3459
|
{
|
|
3460
3460
|
type: "button",
|
|
3461
3461
|
variant: "outline",
|
|
@@ -3470,7 +3470,7 @@ function PriceEditorInternal({
|
|
|
3470
3470
|
)
|
|
3471
3471
|
] }, index)),
|
|
3472
3472
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3473
|
-
|
|
3473
|
+
_chunk3M7D6NXUjs.Button,
|
|
3474
3474
|
{
|
|
3475
3475
|
type: "button",
|
|
3476
3476
|
variant: "outline",
|
|
@@ -3485,12 +3485,12 @@ function PriceEditorInternal({
|
|
|
3485
3485
|
)
|
|
3486
3486
|
] }),
|
|
3487
3487
|
isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3488
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3488
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3489
3489
|
/* @__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) => {
|
|
3490
3490
|
const isChecked = form.watch("featureIds").includes(feature.id);
|
|
3491
3491
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3492
3492
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3493
|
-
|
|
3493
|
+
_chunk3M7D6NXUjs.Checkbox,
|
|
3494
3494
|
{
|
|
3495
3495
|
id: `feature-${feature.id}`,
|
|
3496
3496
|
checked: isChecked,
|
|
@@ -3506,13 +3506,13 @@ function PriceEditorInternal({
|
|
|
3506
3506
|
}
|
|
3507
3507
|
}
|
|
3508
3508
|
),
|
|
3509
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3509
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
|
|
3510
3510
|
feature.isCore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.admin.prices.help.core") })
|
|
3511
3511
|
] }, feature.id);
|
|
3512
3512
|
}) })
|
|
3513
3513
|
] }),
|
|
3514
3514
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3515
|
-
|
|
3515
|
+
_chunk3M7D6NXUjs.FormCheckbox,
|
|
3516
3516
|
{
|
|
3517
3517
|
form,
|
|
3518
3518
|
id: "isTrial",
|
|
@@ -3555,7 +3555,7 @@ var defaultContextValue = {
|
|
|
3555
3555
|
productId: void 0
|
|
3556
3556
|
};
|
|
3557
3557
|
function priceLabel(price) {
|
|
3558
|
-
return _nullishCoalesce(price.nickname, () => ( `${
|
|
3558
|
+
return _nullishCoalesce(price.nickname, () => ( `${_chunk3M7D6NXUjs.formatCurrency.call(void 0, price.unitAmount, price.currency)} ${_chunk3M7D6NXUjs.formatInterval.call(void 0, price)}`.trim()));
|
|
3559
3559
|
}
|
|
3560
3560
|
_chunk7QVYU63Ejs.__name.call(void 0, priceLabel, "priceLabel");
|
|
3561
3561
|
var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
@@ -3565,8 +3565,8 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3565
3565
|
productId: productIdProp
|
|
3566
3566
|
}) => {
|
|
3567
3567
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3568
|
-
const generateUrl =
|
|
3569
|
-
const { hasRole } =
|
|
3568
|
+
const generateUrl = _chunk3M7D6NXUjs.usePageUrlGenerator.call(void 0, );
|
|
3569
|
+
const { hasRole } = _chunk3M7D6NXUjs.useCurrentUserContext.call(void 0, );
|
|
3570
3570
|
const [price, setPrice] = _react.useState.call(void 0,
|
|
3571
3571
|
dehydratedPrice ? _chunk5PNDDYGLjs.rehydrate.call(void 0, _chunk5PNDDYGLjs.Modules.StripePrice, dehydratedPrice) : void 0
|
|
3572
3572
|
);
|
|
@@ -3654,7 +3654,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3654
3654
|
}
|
|
3655
3655
|
return response;
|
|
3656
3656
|
}, "title");
|
|
3657
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3657
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
|
|
3658
3658
|
}, "PriceProvider");
|
|
3659
3659
|
var usePriceContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, PriceContext), () => ( defaultContextValue)), "usePriceContext");
|
|
3660
3660
|
|
|
@@ -3674,12 +3674,12 @@ function ProductArchiver({ product }) {
|
|
|
3674
3674
|
const isArchived = !product.active;
|
|
3675
3675
|
const scope = isArchived ? "restore" : "archive";
|
|
3676
3676
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3677
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3677
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3678
3678
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3679
3679
|
t(`billing.admin.products.${scope}.confirm`)
|
|
3680
3680
|
] }),
|
|
3681
3681
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3682
|
-
|
|
3682
|
+
_chunk3M7D6NXUjs.ConfirmDialog,
|
|
3683
3683
|
{
|
|
3684
3684
|
open,
|
|
3685
3685
|
onOpenChange: setOpen,
|
|
@@ -3693,7 +3693,7 @@ function ProductArchiver({ product }) {
|
|
|
3693
3693
|
if (isArchived) await restoreProduct(product.id);
|
|
3694
3694
|
else await archiveProduct(product.id);
|
|
3695
3695
|
} catch (error) {
|
|
3696
|
-
|
|
3696
|
+
_chunk3M7D6NXUjs.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
|
|
3697
3697
|
throw error;
|
|
3698
3698
|
}
|
|
3699
3699
|
}
|
|
@@ -3746,7 +3746,7 @@ function ProductEditorInternal({
|
|
|
3746
3746
|
defaultValues: getDefaultValues()
|
|
3747
3747
|
});
|
|
3748
3748
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3749
|
-
|
|
3749
|
+
_chunk3M7D6NXUjs.EditorSheet,
|
|
3750
3750
|
{
|
|
3751
3751
|
form,
|
|
3752
3752
|
entityType: t("billing.admin.products.entity"),
|
|
@@ -3769,7 +3769,7 @@ function ProductEditorInternal({
|
|
|
3769
3769
|
onDialogOpenChange,
|
|
3770
3770
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3771
3771
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3772
|
-
|
|
3772
|
+
_chunk3M7D6NXUjs.FormInput,
|
|
3773
3773
|
{
|
|
3774
3774
|
form,
|
|
3775
3775
|
id: "name",
|
|
@@ -3779,7 +3779,7 @@ function ProductEditorInternal({
|
|
|
3779
3779
|
}
|
|
3780
3780
|
),
|
|
3781
3781
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3782
|
-
|
|
3782
|
+
_chunk3M7D6NXUjs.FormTextarea,
|
|
3783
3783
|
{
|
|
3784
3784
|
form,
|
|
3785
3785
|
id: "description",
|
|
@@ -3823,8 +3823,8 @@ var defaultContextValue2 = {
|
|
|
3823
3823
|
};
|
|
3824
3824
|
var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedProduct, publishChrome = true }) => {
|
|
3825
3825
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3826
|
-
const generateUrl =
|
|
3827
|
-
const { hasRole } =
|
|
3826
|
+
const generateUrl = _chunk3M7D6NXUjs.usePageUrlGenerator.call(void 0, );
|
|
3827
|
+
const { hasRole } = _chunk3M7D6NXUjs.useCurrentUserContext.call(void 0, );
|
|
3828
3828
|
const [product, setProduct] = _react.useState.call(void 0,
|
|
3829
3829
|
dehydratedProduct ? _chunk5PNDDYGLjs.rehydrate.call(void 0, _chunk5PNDDYGLjs.Modules.StripeProduct, dehydratedProduct) : void 0
|
|
3830
3830
|
);
|
|
@@ -3918,7 +3918,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3918
3918
|
}
|
|
3919
3919
|
return response;
|
|
3920
3920
|
}, "title");
|
|
3921
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3921
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
|
|
3922
3922
|
}, "ProductProvider");
|
|
3923
3923
|
var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, ProductContext), () => ( defaultContextValue2)), "useProductContext");
|
|
3924
3924
|
|
|
@@ -3927,56 +3927,56 @@ var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ()
|
|
|
3927
3927
|
|
|
3928
3928
|
function PriceDetails() {
|
|
3929
3929
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3930
|
-
const generateUrl =
|
|
3930
|
+
const generateUrl = _chunk3M7D6NXUjs.usePageUrlGenerator.call(void 0, );
|
|
3931
3931
|
const { price } = usePriceContext();
|
|
3932
3932
|
if (!price) return null;
|
|
3933
3933
|
const isRecurring = price.priceType === "recurring";
|
|
3934
3934
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-8", children: [
|
|
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, _chunk3M7D6NXUjs.SectionHeader, { children: t("billing.admin.prices.title") }),
|
|
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
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3940
3940
|
{
|
|
3941
3941
|
label: t("billing.admin.prices.fields.product"),
|
|
3942
|
-
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3942
|
+
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Link, { href: generateUrl({ page: _chunk5PNDDYGLjs.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
|
|
3943
3943
|
}
|
|
3944
3944
|
),
|
|
3945
3945
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3946
|
-
|
|
3946
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3947
3947
|
{
|
|
3948
3948
|
label: t("billing.admin.prices.fields.status"),
|
|
3949
3949
|
value: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
3950
|
-
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3951
|
-
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3950
|
+
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
|
|
3951
|
+
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
|
|
3952
3952
|
] })
|
|
3953
3953
|
}
|
|
3954
3954
|
),
|
|
3955
3955
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3956
|
-
|
|
3956
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3957
3957
|
{
|
|
3958
3958
|
label: t("billing.admin.prices.fields.amount"),
|
|
3959
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children:
|
|
3959
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunk3M7D6NXUjs.formatCurrency.call(void 0, price.unitAmount, price.currency) })
|
|
3960
3960
|
}
|
|
3961
3961
|
),
|
|
3962
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3962
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
|
|
3963
3963
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3964
|
-
|
|
3964
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3965
3965
|
{
|
|
3966
3966
|
label: t("billing.admin.prices.fields.type"),
|
|
3967
3967
|
value: isRecurring ? t("billing.admin.prices.type.recurring") : t("billing.admin.prices.type.oneTime")
|
|
3968
3968
|
}
|
|
3969
3969
|
),
|
|
3970
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3970
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunk3M7D6NXUjs.formatInterval.call(void 0, price) }),
|
|
3971
3971
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3972
|
-
|
|
3972
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3973
3973
|
{
|
|
3974
3974
|
label: t("billing.admin.prices.fields.intervalCount"),
|
|
3975
3975
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _160 => _160.recurring, 'optionalAccess', _161 => _161.intervalCount]), () => ( 1)) })
|
|
3976
3976
|
}
|
|
3977
3977
|
),
|
|
3978
3978
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3979
|
-
|
|
3979
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3980
3980
|
{
|
|
3981
3981
|
label: t("billing.admin.prices.fields.usageType"),
|
|
3982
3982
|
value: _optionalChain([price, 'access', _162 => _162.recurring, 'optionalAccess', _163 => _163.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
|
|
@@ -3985,24 +3985,24 @@ function PriceDetails() {
|
|
|
3985
3985
|
] })
|
|
3986
3986
|
] }),
|
|
3987
3987
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3988
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3988
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3989
3989
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3990
3990
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3991
|
-
|
|
3991
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3992
3992
|
{
|
|
3993
3993
|
label: t("billing.admin.prices.fields.token"),
|
|
3994
3994
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(price.token, () => ( "\u2014")) })
|
|
3995
3995
|
}
|
|
3996
3996
|
),
|
|
3997
3997
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3998
|
-
|
|
3998
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
3999
3999
|
{
|
|
4000
4000
|
label: t("billing.admin.prices.fields.stripeId"),
|
|
4001
4001
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: price.stripePriceId })
|
|
4002
4002
|
}
|
|
4003
4003
|
),
|
|
4004
4004
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4005
|
-
|
|
4005
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
4006
4006
|
{
|
|
4007
4007
|
label: t("billing.admin.prices.fields.description"),
|
|
4008
4008
|
value: _nullishCoalesce(price.description, () => ( "\u2014")),
|
|
@@ -4010,7 +4010,7 @@ function PriceDetails() {
|
|
|
4010
4010
|
}
|
|
4011
4011
|
),
|
|
4012
4012
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4013
|
-
|
|
4013
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
4014
4014
|
{
|
|
4015
4015
|
label: t("billing.admin.prices.fields.features"),
|
|
4016
4016
|
className: "md:col-span-2",
|
|
@@ -4018,11 +4018,11 @@ function PriceDetails() {
|
|
|
4018
4018
|
}
|
|
4019
4019
|
),
|
|
4020
4020
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4021
|
-
|
|
4021
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
4022
4022
|
{
|
|
4023
4023
|
label: t("billing.admin.prices.fields.platformFeatures"),
|
|
4024
4024
|
className: "md:col-span-2",
|
|
4025
|
-
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,
|
|
4025
|
+
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, _chunk3M7D6NXUjs.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
|
|
4026
4026
|
}
|
|
4027
4027
|
)
|
|
4028
4028
|
] })
|
|
@@ -4036,7 +4036,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceDetails, "PriceDetails");
|
|
|
4036
4036
|
function PriceContainer() {
|
|
4037
4037
|
const { price } = usePriceContext();
|
|
4038
4038
|
if (!price) return null;
|
|
4039
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4039
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.RoundPageContainer, { module: _chunk5PNDDYGLjs.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
|
|
4040
4040
|
}
|
|
4041
4041
|
_chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
4042
4042
|
|
|
@@ -4161,7 +4161,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4161
4161
|
const importInputRef = _react.useRef.call(void 0, null);
|
|
4162
4162
|
const [seed, setSeed] = _react.useState.call(void 0, void 0);
|
|
4163
4163
|
const [seedNonce, setSeedNonce] = _react.useState.call(void 0, 0);
|
|
4164
|
-
const data =
|
|
4164
|
+
const data = _chunk3M7D6NXUjs.useDataListRetriever.call(void 0, {
|
|
4165
4165
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk5PNDDYGLjs.StripePriceService.listPrices({ ...params, productId }), "retriever"),
|
|
4166
4166
|
retrieverParams: {},
|
|
4167
4167
|
module: _chunk5PNDDYGLjs.Modules.StripePrice
|
|
@@ -4199,7 +4199,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4199
4199
|
openSeededEditor(transfer.price);
|
|
4200
4200
|
} catch (error) {
|
|
4201
4201
|
console.error("[PricesList] price import failed", error);
|
|
4202
|
-
|
|
4202
|
+
_chunk3M7D6NXUjs.errorToast.call(void 0, {
|
|
4203
4203
|
title: t("billing.admin.prices.import.errors.title"),
|
|
4204
4204
|
error: t("billing.admin.prices.import.errors.invalid")
|
|
4205
4205
|
});
|
|
@@ -4218,7 +4218,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4218
4218
|
"create-price"
|
|
4219
4219
|
),
|
|
4220
4220
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
|
|
4221
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4221
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3M7D6NXUjs.Button, { variant: "outline", size: "sm", type: "button", onClick: () => _optionalChain([importInputRef, 'access', _178 => _178.current, 'optionalAccess', _179 => _179.click, 'call', _180 => _180()]), children: [
|
|
4222
4222
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, {}),
|
|
4223
4223
|
t("billing.admin.prices.actions.import")
|
|
4224
4224
|
] }),
|
|
@@ -4236,7 +4236,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4236
4236
|
];
|
|
4237
4237
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4238
4238
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4239
|
-
|
|
4239
|
+
_chunk3M7D6NXUjs.ContentListTable,
|
|
4240
4240
|
{
|
|
4241
4241
|
data,
|
|
4242
4242
|
fields: [
|
|
@@ -4253,7 +4253,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4253
4253
|
fullWidth,
|
|
4254
4254
|
title: t("billing.admin.prices.title"),
|
|
4255
4255
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4256
|
-
|
|
4256
|
+
_chunk3M7D6NXUjs.EmptyState,
|
|
4257
4257
|
{
|
|
4258
4258
|
icon: _lucidereact.DollarSignIcon,
|
|
4259
4259
|
title: t("billing.admin.prices.empty.title"),
|
|
@@ -4293,18 +4293,18 @@ function ProductDetails() {
|
|
|
4293
4293
|
const { product } = useProductContext();
|
|
4294
4294
|
if (!product) return null;
|
|
4295
4295
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
4296
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4296
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
|
|
4297
4297
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
4298
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4298
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
|
|
4299
4299
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4300
|
-
|
|
4300
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
4301
4301
|
{
|
|
4302
4302
|
label: t("billing.admin.products.fields.status"),
|
|
4303
|
-
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4303
|
+
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
|
|
4304
4304
|
}
|
|
4305
4305
|
),
|
|
4306
4306
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4307
|
-
|
|
4307
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
4308
4308
|
{
|
|
4309
4309
|
label: t("billing.admin.products.fields.description"),
|
|
4310
4310
|
value: _nullishCoalesce(product.description, () => ( "\u2014")),
|
|
@@ -4312,14 +4312,14 @@ function ProductDetails() {
|
|
|
4312
4312
|
}
|
|
4313
4313
|
),
|
|
4314
4314
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4315
|
-
|
|
4315
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
4316
4316
|
{
|
|
4317
4317
|
label: t("billing.admin.products.fields.prices"),
|
|
4318
4318
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripePrices.length })
|
|
4319
4319
|
}
|
|
4320
4320
|
),
|
|
4321
4321
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4322
|
-
|
|
4322
|
+
_chunk3M7D6NXUjs.DetailField,
|
|
4323
4323
|
{
|
|
4324
4324
|
label: t("billing.admin.products.fields.stripeId"),
|
|
4325
4325
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripeProductId })
|
|
@@ -4337,7 +4337,7 @@ function ProductContainer() {
|
|
|
4337
4337
|
const { product } = useProductContext();
|
|
4338
4338
|
if (!product) return null;
|
|
4339
4339
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4340
|
-
|
|
4340
|
+
_chunk3M7D6NXUjs.RoundPageContainer,
|
|
4341
4341
|
{
|
|
4342
4342
|
module: _chunk5PNDDYGLjs.Modules.StripeProduct,
|
|
4343
4343
|
id: product.id,
|
|
@@ -4372,7 +4372,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductContainer, "ProductContainer");
|
|
|
4372
4372
|
function ProductsList({ fullWidth } = {}) {
|
|
4373
4373
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
4374
4374
|
const { catalogueVersion } = useProductContext();
|
|
4375
|
-
const data =
|
|
4375
|
+
const data = _chunk3M7D6NXUjs.useDataListRetriever.call(void 0, {
|
|
4376
4376
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk5PNDDYGLjs.StripeProductService.listProducts(params), "retriever"),
|
|
4377
4377
|
retrieverParams: {},
|
|
4378
4378
|
module: _chunk5PNDDYGLjs.Modules.StripeProduct
|
|
@@ -4382,7 +4382,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4382
4382
|
}, [catalogueVersion]);
|
|
4383
4383
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, {}, "create-product")];
|
|
4384
4384
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4385
|
-
|
|
4385
|
+
_chunk3M7D6NXUjs.ContentListTable,
|
|
4386
4386
|
{
|
|
4387
4387
|
data,
|
|
4388
4388
|
fields: ["name" /* name */, "status" /* status */, "prices" /* prices */],
|
|
@@ -4391,7 +4391,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4391
4391
|
fullWidth,
|
|
4392
4392
|
title: t("billing.admin.products.title"),
|
|
4393
4393
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4394
|
-
|
|
4394
|
+
_chunk3M7D6NXUjs.EmptyState,
|
|
4395
4395
|
{
|
|
4396
4396
|
icon: _lucidereact.PackageIcon,
|
|
4397
4397
|
title: t("billing.admin.products.empty.title"),
|
|
@@ -4406,7 +4406,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
4406
4406
|
// src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx
|
|
4407
4407
|
|
|
4408
4408
|
function ProductsListContainer() {
|
|
4409
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4409
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3M7D6NXUjs.RoundPageContainer, { module: _chunk5PNDDYGLjs.Modules.StripeProduct, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { fullWidth: true }) }) });
|
|
4410
4410
|
}
|
|
4411
4411
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContainer");
|
|
4412
4412
|
|
|
@@ -4469,5 +4469,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContain
|
|
|
4469
4469
|
|
|
4470
4470
|
|
|
4471
4471
|
|
|
4472
|
-
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.SubscriptionWizard = SubscriptionWizard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.WizardProgressIndicator = WizardProgressIndicator; exports.WizardStepPaymentMethod = WizardStepPaymentMethod; exports.WizardStepPlanSelection = WizardStepPlanSelection; exports.WizardStepReview = WizardStepReview; exports.formatCurrency =
|
|
4472
|
+
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.SubscriptionWizard = SubscriptionWizard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.WizardProgressIndicator = WizardProgressIndicator; exports.WizardStepPaymentMethod = WizardStepPaymentMethod; exports.WizardStepPlanSelection = WizardStepPlanSelection; exports.WizardStepReview = WizardStepReview; exports.formatCurrency = _chunk3M7D6NXUjs.formatCurrency; exports.formatDate = formatDate3; exports.formatInterval = _chunk3M7D6NXUjs.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.priceLabel = priceLabel; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
|
|
4473
4473
|
//# sourceMappingURL=index.js.map
|