@burdenoff/microfe-billing 2026.623.3 → 2026.624.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/BillingUserRoutes.js +3 -3
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +34 -34
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +94 -94
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +162 -187
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +146 -153
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +10 -10
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +62 -62
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +164 -179
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +8 -8
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +243 -305
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +73 -78
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +173 -179
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +4 -4
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +181 -173
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +111 -99
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +68 -83
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.js +4 -4
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.js +8 -8
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +11 -11
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.js +1 -1
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,435 +1,373 @@
|
|
|
1
1
|
import { useBilling as e } from "../../../providers/BillingProvider.js";
|
|
2
2
|
import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
|
|
3
|
-
import { PageHeader as
|
|
4
|
-
import { StatCard as
|
|
5
|
-
import { EmptyState as
|
|
6
|
-
import { ServerError as
|
|
3
|
+
import { PageHeader as ee } from "../../../shared/components/PageHeader.js";
|
|
4
|
+
import { StatCard as n } from "../../../shared/components/StatCard.js";
|
|
5
|
+
import { EmptyState as r } from "../../../shared/components/EmptyState.js";
|
|
6
|
+
import { ServerError as i } from "../../../shared/components/ServerError.js";
|
|
7
7
|
import "../../../shared/components/index.js";
|
|
8
|
-
import { formatCurrency as
|
|
9
|
-
import { isServerError as
|
|
8
|
+
import { formatCurrency as a, formatDateTime as o } from "../../../shared/utils/format.js";
|
|
9
|
+
import { isServerError as s } from "../../../shared/utils/error.js";
|
|
10
10
|
import "../../../shared/utils/index.js";
|
|
11
|
-
import { useBillingPermissions as
|
|
12
|
-
import { useGetDefaultBillingAccountSettingsQuery as
|
|
13
|
-
import { fetchDeveloperPortalRevenueDashboard as
|
|
14
|
-
import { useEffect as
|
|
15
|
-
import { Coins as
|
|
16
|
-
import { useSearchParams as
|
|
17
|
-
import { jsx as
|
|
11
|
+
import { useBillingPermissions as c } from "../../../hooks/useBillingPermissions.js";
|
|
12
|
+
import { useGetDefaultBillingAccountSettingsQuery as l } from "../../../../generated/global-operations.js";
|
|
13
|
+
import { fetchDeveloperPortalRevenueDashboard as u, fetchEarningsEntries as d, fetchEarningsSummary as f } from "../api.js";
|
|
14
|
+
import { useEffect as p, useMemo as m, useState as h } from "react";
|
|
15
|
+
import { Coins as g, HandCoins as _, RefreshCw as v, Wallet as y } from "lucide-react";
|
|
16
|
+
import { useSearchParams as b } from "react-router-dom";
|
|
17
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
18
|
+
import { ResponsiveTable as C } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
//#region src/billing/modules/earnings/pages/EarningsPage.tsx
|
|
19
|
-
var w =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
var w = [
|
|
21
|
+
{
|
|
22
|
+
key: "application",
|
|
23
|
+
header: "Application",
|
|
24
|
+
priority: "primary",
|
|
25
|
+
cell: (e) => e.application?.name || e.application?.slug || "Unknown app"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: "pricing",
|
|
29
|
+
header: "Pricing",
|
|
30
|
+
cell: (e) => e.pricingModel
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "gross",
|
|
34
|
+
header: "Gross",
|
|
35
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
36
|
+
className: "tabular-nums",
|
|
37
|
+
children: a(e.grossAmount, e.currency || "USD")
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "net",
|
|
42
|
+
header: "Net",
|
|
43
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
44
|
+
className: "tabular-nums",
|
|
45
|
+
children: a(e.netAmount, e.currency || "USD")
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "status",
|
|
50
|
+
header: "Status",
|
|
51
|
+
cell: (e) => e.status
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: "purchased",
|
|
55
|
+
header: "Purchased",
|
|
56
|
+
cell: (e) => o(e.purchasedAt)
|
|
57
|
+
}
|
|
58
|
+
], T = [
|
|
59
|
+
{
|
|
60
|
+
key: "period",
|
|
61
|
+
header: "Period",
|
|
62
|
+
priority: "primary",
|
|
63
|
+
cell: (e) => e.periodLabel || "-"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "amount",
|
|
67
|
+
header: "Amount",
|
|
68
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
69
|
+
className: "tabular-nums",
|
|
70
|
+
children: a(e.netAmount, e.currency || "USD")
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: "status",
|
|
75
|
+
header: "Status",
|
|
76
|
+
cell: (e) => e.status
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: "scheduled",
|
|
80
|
+
header: "Scheduled",
|
|
81
|
+
cell: (e) => e.scheduledAt ? o(e.scheduledAt) : "-"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
key: "completed",
|
|
85
|
+
header: "Completed",
|
|
86
|
+
cell: (e) => e.completedAt ? o(e.completedAt) : "-"
|
|
87
|
+
}
|
|
88
|
+
], E = [
|
|
89
|
+
{
|
|
90
|
+
key: "category",
|
|
91
|
+
header: "Category",
|
|
92
|
+
priority: "primary",
|
|
93
|
+
cell: (e) => e.sourceCategory
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
key: "description",
|
|
97
|
+
header: "Description",
|
|
98
|
+
cell: (e) => e.description || e.sourceSubcategory || "-"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: "unit",
|
|
102
|
+
header: "Unit",
|
|
103
|
+
cell: (e) => e.unitType
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: "amount",
|
|
107
|
+
header: "Amount",
|
|
108
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
109
|
+
className: "tabular-nums",
|
|
110
|
+
children: e.unitType === "CREDITS" ? `${e.amount.toLocaleString()} credits` : a(e.amount, e.currency || "USD")
|
|
111
|
+
})
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
key: "status",
|
|
115
|
+
header: "Status",
|
|
116
|
+
cell: (e) => e.status
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: "created",
|
|
120
|
+
header: "Created",
|
|
121
|
+
cell: (e) => o(e.createdAt)
|
|
122
|
+
}
|
|
123
|
+
], D = () => {
|
|
124
|
+
let [o] = b(), D = c(), { apiGatewayUrl: O, authToken: k, orgId: A } = e(), j = o.get("developerOrgId"), M = o.get("developerOrgName"), { data: N, loading: P } = l({}), F = N?.getDefaultBillingAccount?.id, [I, L] = h(null), [R, z] = h([]), [B, V] = h(null), [H, U] = h("ALL"), [W, G] = h(!0), [K, q] = h(null), J = m(() => ({
|
|
125
|
+
apiGatewayUrl: O,
|
|
126
|
+
authToken: k,
|
|
127
|
+
orgId: A
|
|
24
128
|
}), [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]),
|
|
29
|
-
|
|
129
|
+
O,
|
|
130
|
+
k,
|
|
131
|
+
A
|
|
132
|
+
]), Y = async () => {
|
|
133
|
+
G(!0), q(null);
|
|
30
134
|
try {
|
|
31
|
-
if (
|
|
32
|
-
|
|
135
|
+
if (j) {
|
|
136
|
+
V(await u(j, J)), L(null), z([]);
|
|
33
137
|
return;
|
|
34
138
|
}
|
|
35
|
-
if (!
|
|
36
|
-
|
|
139
|
+
if (!F) {
|
|
140
|
+
L(null), z([]), V(null);
|
|
37
141
|
return;
|
|
38
142
|
}
|
|
39
|
-
let [e, t] = await Promise.all([
|
|
40
|
-
|
|
143
|
+
let [e, t] = await Promise.all([f(F, J), d(F, J)]);
|
|
144
|
+
L(e), z(t), V(null);
|
|
41
145
|
} catch (e) {
|
|
42
|
-
|
|
146
|
+
q(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load earnings"));
|
|
43
147
|
} finally {
|
|
44
|
-
|
|
148
|
+
G(!1);
|
|
45
149
|
}
|
|
46
150
|
};
|
|
47
|
-
if (
|
|
48
|
-
|
|
151
|
+
if (p(() => {
|
|
152
|
+
Y();
|
|
49
153
|
}, [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
]), !
|
|
54
|
-
if (!
|
|
55
|
-
icon: /* @__PURE__ */
|
|
154
|
+
F,
|
|
155
|
+
j,
|
|
156
|
+
J
|
|
157
|
+
]), !D.canViewBillingAccount) return /* @__PURE__ */ x(t, { message: "You don't have permission to view earnings." });
|
|
158
|
+
if (!j && !F && !P) return /* @__PURE__ */ x(r, {
|
|
159
|
+
icon: /* @__PURE__ */ x(y, { className: "size-8" }),
|
|
56
160
|
title: "No billing account found",
|
|
57
161
|
description: "Create a billing account first to view earnings."
|
|
58
162
|
});
|
|
59
|
-
if (
|
|
163
|
+
if (K && s(K)) return /* @__PURE__ */ x(i, {
|
|
60
164
|
title: "Earnings unavailable",
|
|
61
|
-
message:
|
|
62
|
-
onRetry: () => void
|
|
165
|
+
message: K.message,
|
|
166
|
+
onRetry: () => void Y(),
|
|
63
167
|
showRetry: !0
|
|
64
168
|
});
|
|
65
|
-
let
|
|
169
|
+
let X = I ? [
|
|
66
170
|
{
|
|
67
171
|
title: "Available",
|
|
68
|
-
value:
|
|
69
|
-
icon: /* @__PURE__ */
|
|
172
|
+
value: a(I.availableAmount, "USD"),
|
|
173
|
+
icon: /* @__PURE__ */ x(_, { className: "size-5" })
|
|
70
174
|
},
|
|
71
175
|
{
|
|
72
176
|
title: "Reserved",
|
|
73
|
-
value:
|
|
74
|
-
icon: /* @__PURE__ */
|
|
177
|
+
value: a(I.reservedAmount, "USD"),
|
|
178
|
+
icon: /* @__PURE__ */ x(g, { className: "size-5" })
|
|
75
179
|
},
|
|
76
180
|
{
|
|
77
181
|
title: "Paid out",
|
|
78
|
-
value:
|
|
79
|
-
icon: /* @__PURE__ */
|
|
182
|
+
value: a(I.paidAmount, "USD"),
|
|
183
|
+
icon: /* @__PURE__ */ x(y, { className: "size-5" })
|
|
80
184
|
},
|
|
81
185
|
{
|
|
82
186
|
title: "Lifetime",
|
|
83
|
-
value:
|
|
84
|
-
icon: /* @__PURE__ */
|
|
187
|
+
value: a(I.totalLifetimeAmount, "USD"),
|
|
188
|
+
icon: /* @__PURE__ */ x(v, { className: "size-5" })
|
|
85
189
|
}
|
|
86
|
-
] : [],
|
|
190
|
+
] : [], Z = H === "ALL" ? R : R.filter((e) => e.sourceCategory === H), Q = I?.categoryBreakdown?.map((e) => ({
|
|
87
191
|
title: `${e.category} earnings`,
|
|
88
|
-
value:
|
|
192
|
+
value: a(e.amount, "USD"),
|
|
89
193
|
helperText: `${e.count} entries`
|
|
90
|
-
})) ?? [],
|
|
194
|
+
})) ?? [], te = B?.summary ? [
|
|
91
195
|
{
|
|
92
196
|
title: "Gross revenue",
|
|
93
|
-
value:
|
|
94
|
-
icon: /* @__PURE__ */
|
|
197
|
+
value: a(B.summary.totalGrossRevenue, "USD"),
|
|
198
|
+
icon: /* @__PURE__ */ x(_, { className: "size-5" })
|
|
95
199
|
},
|
|
96
200
|
{
|
|
97
201
|
title: "Net revenue",
|
|
98
|
-
value:
|
|
99
|
-
icon: /* @__PURE__ */
|
|
202
|
+
value: a(B.summary.totalNetRevenue, "USD"),
|
|
203
|
+
icon: /* @__PURE__ */ x(y, { className: "size-5" })
|
|
100
204
|
},
|
|
101
205
|
{
|
|
102
206
|
title: "Pending balance",
|
|
103
|
-
value:
|
|
104
|
-
icon: /* @__PURE__ */
|
|
207
|
+
value: a(B.summary.pendingBalance, "USD"),
|
|
208
|
+
icon: /* @__PURE__ */ x(g, { className: "size-5" })
|
|
105
209
|
},
|
|
106
210
|
{
|
|
107
211
|
title: "Platform fees",
|
|
108
|
-
value:
|
|
109
|
-
icon: /* @__PURE__ */
|
|
212
|
+
value: a(B.summary.totalPlatformFees, "USD"),
|
|
213
|
+
icon: /* @__PURE__ */ x(v, { className: "size-5" })
|
|
110
214
|
}
|
|
111
|
-
] : [],
|
|
112
|
-
return /* @__PURE__ */
|
|
215
|
+
] : [], $ = !!j;
|
|
216
|
+
return /* @__PURE__ */ S("div", {
|
|
113
217
|
className: "space-y-6 p-6",
|
|
114
218
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
title:
|
|
117
|
-
description:
|
|
219
|
+
/* @__PURE__ */ x(ee, {
|
|
220
|
+
title: $ ? "Marketplace earnings" : "Earnings",
|
|
221
|
+
description: $ ? `Developer portal revenue, sales, and payouts${M ? ` for ${M}` : ""}.` : "Track affiliate, store, and other earning sources in one ledger."
|
|
118
222
|
}),
|
|
119
|
-
|
|
223
|
+
W ? /* @__PURE__ */ x("div", {
|
|
120
224
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
121
225
|
children: [
|
|
122
226
|
1,
|
|
123
227
|
2,
|
|
124
228
|
3,
|
|
125
229
|
4
|
|
126
|
-
].map((e) => /* @__PURE__ */
|
|
127
|
-
}) :
|
|
230
|
+
].map((e) => /* @__PURE__ */ x("div", { className: "h-28 animate-pulse rounded-lg border border-border-subtle bg-bg-surface" }, e))
|
|
231
|
+
}) : $ ? B?.summary ? /* @__PURE__ */ S("div", {
|
|
128
232
|
className: "space-y-6",
|
|
129
233
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ x("div", {
|
|
131
235
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
132
|
-
children:
|
|
236
|
+
children: te.map((e) => /* @__PURE__ */ x(n, {
|
|
133
237
|
label: e.title,
|
|
134
238
|
value: e.value,
|
|
135
239
|
icon: e.icon
|
|
136
240
|
}, e.title))
|
|
137
241
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
className: "rounded-lg border border-border bg-
|
|
140
|
-
children: [/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ S("section", {
|
|
243
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
244
|
+
children: [/* @__PURE__ */ S("div", {
|
|
141
245
|
className: "mb-4 flex items-center justify-between",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
143
|
-
className: "text-lg font-semibold text-
|
|
246
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
247
|
+
className: "text-lg font-semibold text-text-primary",
|
|
144
248
|
children: "Recent sales"
|
|
145
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ S("button", {
|
|
146
250
|
type: "button",
|
|
147
|
-
onClick: () => void
|
|
148
|
-
className: "inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-
|
|
149
|
-
children: [/* @__PURE__ */
|
|
251
|
+
onClick: () => void Y(),
|
|
252
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
|
|
253
|
+
children: [/* @__PURE__ */ x(v, { className: "size-4" }), "Refresh"]
|
|
150
254
|
})]
|
|
151
|
-
}),
|
|
152
|
-
icon: /* @__PURE__ */
|
|
255
|
+
}), B.sales.length === 0 ? /* @__PURE__ */ x(r, {
|
|
256
|
+
icon: /* @__PURE__ */ x(g, { className: "size-8" }),
|
|
153
257
|
title: "No sales yet",
|
|
154
258
|
description: "Sales will appear here when customers start purchasing your apps."
|
|
155
|
-
}) : /* @__PURE__ */
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
children: [/* @__PURE__ */ S("thead", { children: /* @__PURE__ */ C("tr", {
|
|
160
|
-
className: "border-b border-border text-left text-muted-foreground",
|
|
161
|
-
children: [
|
|
162
|
-
/* @__PURE__ */ S("th", {
|
|
163
|
-
className: "px-3 py-2",
|
|
164
|
-
children: "Application"
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ S("th", {
|
|
167
|
-
className: "px-3 py-2",
|
|
168
|
-
children: "Pricing"
|
|
169
|
-
}),
|
|
170
|
-
/* @__PURE__ */ S("th", {
|
|
171
|
-
className: "px-3 py-2",
|
|
172
|
-
children: "Gross"
|
|
173
|
-
}),
|
|
174
|
-
/* @__PURE__ */ S("th", {
|
|
175
|
-
className: "px-3 py-2",
|
|
176
|
-
children: "Net"
|
|
177
|
-
}),
|
|
178
|
-
/* @__PURE__ */ S("th", {
|
|
179
|
-
className: "px-3 py-2",
|
|
180
|
-
children: "Status"
|
|
181
|
-
}),
|
|
182
|
-
/* @__PURE__ */ S("th", {
|
|
183
|
-
className: "px-3 py-2",
|
|
184
|
-
children: "Purchased"
|
|
185
|
-
})
|
|
186
|
-
]
|
|
187
|
-
}) }), /* @__PURE__ */ S("tbody", { children: R.sales.map((e) => /* @__PURE__ */ C("tr", {
|
|
188
|
-
className: "border-b border-border/70 text-foreground",
|
|
189
|
-
children: [
|
|
190
|
-
/* @__PURE__ */ S("td", {
|
|
191
|
-
className: "px-3 py-2 font-medium",
|
|
192
|
-
children: e.application?.name || e.application?.slug || "Unknown app"
|
|
193
|
-
}),
|
|
194
|
-
/* @__PURE__ */ S("td", {
|
|
195
|
-
className: "px-3 py-2",
|
|
196
|
-
children: e.pricingModel
|
|
197
|
-
}),
|
|
198
|
-
/* @__PURE__ */ S("td", {
|
|
199
|
-
className: "px-3 py-2",
|
|
200
|
-
children: o(e.grossAmount, e.currency || "USD")
|
|
201
|
-
}),
|
|
202
|
-
/* @__PURE__ */ S("td", {
|
|
203
|
-
className: "px-3 py-2",
|
|
204
|
-
children: o(e.netAmount, e.currency || "USD")
|
|
205
|
-
}),
|
|
206
|
-
/* @__PURE__ */ S("td", {
|
|
207
|
-
className: "px-3 py-2",
|
|
208
|
-
children: e.status
|
|
209
|
-
}),
|
|
210
|
-
/* @__PURE__ */ S("td", {
|
|
211
|
-
className: "px-3 py-2",
|
|
212
|
-
children: s(e.purchasedAt)
|
|
213
|
-
})
|
|
214
|
-
]
|
|
215
|
-
}, e.id)) })]
|
|
216
|
-
})
|
|
259
|
+
}) : /* @__PURE__ */ x(C, {
|
|
260
|
+
data: B.sales,
|
|
261
|
+
rowKey: (e) => e.id,
|
|
262
|
+
columns: w
|
|
217
263
|
})]
|
|
218
264
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
className: "rounded-lg border border-border bg-
|
|
221
|
-
children: [/* @__PURE__ */
|
|
222
|
-
className: "mb-4 text-lg font-semibold text-
|
|
265
|
+
/* @__PURE__ */ S("section", {
|
|
266
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
267
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
268
|
+
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
223
269
|
children: "Payouts"
|
|
224
|
-
}),
|
|
225
|
-
icon: /* @__PURE__ */
|
|
270
|
+
}), B.payouts.length === 0 ? /* @__PURE__ */ x(r, {
|
|
271
|
+
icon: /* @__PURE__ */ x(y, { className: "size-8" }),
|
|
226
272
|
title: "No payouts yet",
|
|
227
273
|
description: "Scheduled and completed payouts will appear here."
|
|
228
|
-
}) : /* @__PURE__ */
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
children: [/* @__PURE__ */ S("thead", { children: /* @__PURE__ */ C("tr", {
|
|
233
|
-
className: "border-b border-border text-left text-muted-foreground",
|
|
234
|
-
children: [
|
|
235
|
-
/* @__PURE__ */ S("th", {
|
|
236
|
-
className: "px-3 py-2",
|
|
237
|
-
children: "Period"
|
|
238
|
-
}),
|
|
239
|
-
/* @__PURE__ */ S("th", {
|
|
240
|
-
className: "px-3 py-2",
|
|
241
|
-
children: "Amount"
|
|
242
|
-
}),
|
|
243
|
-
/* @__PURE__ */ S("th", {
|
|
244
|
-
className: "px-3 py-2",
|
|
245
|
-
children: "Status"
|
|
246
|
-
}),
|
|
247
|
-
/* @__PURE__ */ S("th", {
|
|
248
|
-
className: "px-3 py-2",
|
|
249
|
-
children: "Scheduled"
|
|
250
|
-
}),
|
|
251
|
-
/* @__PURE__ */ S("th", {
|
|
252
|
-
className: "px-3 py-2",
|
|
253
|
-
children: "Completed"
|
|
254
|
-
})
|
|
255
|
-
]
|
|
256
|
-
}) }), /* @__PURE__ */ S("tbody", { children: R.payouts.map((e) => /* @__PURE__ */ C("tr", {
|
|
257
|
-
className: "border-b border-border/70 text-foreground",
|
|
258
|
-
children: [
|
|
259
|
-
/* @__PURE__ */ S("td", {
|
|
260
|
-
className: "px-3 py-2 font-medium",
|
|
261
|
-
children: e.periodLabel || "-"
|
|
262
|
-
}),
|
|
263
|
-
/* @__PURE__ */ S("td", {
|
|
264
|
-
className: "px-3 py-2",
|
|
265
|
-
children: o(e.netAmount, e.currency || "USD")
|
|
266
|
-
}),
|
|
267
|
-
/* @__PURE__ */ S("td", {
|
|
268
|
-
className: "px-3 py-2",
|
|
269
|
-
children: e.status
|
|
270
|
-
}),
|
|
271
|
-
/* @__PURE__ */ S("td", {
|
|
272
|
-
className: "px-3 py-2",
|
|
273
|
-
children: e.scheduledAt ? s(e.scheduledAt) : "-"
|
|
274
|
-
}),
|
|
275
|
-
/* @__PURE__ */ S("td", {
|
|
276
|
-
className: "px-3 py-2",
|
|
277
|
-
children: e.completedAt ? s(e.completedAt) : "-"
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
}, e.id)) })]
|
|
281
|
-
})
|
|
274
|
+
}) : /* @__PURE__ */ x(C, {
|
|
275
|
+
data: B.payouts,
|
|
276
|
+
rowKey: (e) => e.id,
|
|
277
|
+
columns: T
|
|
282
278
|
})]
|
|
283
279
|
})
|
|
284
280
|
]
|
|
285
|
-
}) : /* @__PURE__ */
|
|
286
|
-
icon: /* @__PURE__ */
|
|
281
|
+
}) : /* @__PURE__ */ x(r, {
|
|
282
|
+
icon: /* @__PURE__ */ x(g, { className: "size-8" }),
|
|
287
283
|
title: "No developer portal revenue yet",
|
|
288
284
|
description: "Marketplace revenue will appear here once your developer organization records sales."
|
|
289
|
-
}) :
|
|
285
|
+
}) : I ? /* @__PURE__ */ S("div", {
|
|
290
286
|
className: "space-y-4",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ x("div", {
|
|
292
288
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
293
|
-
children:
|
|
289
|
+
children: X.map((e) => /* @__PURE__ */ x(n, {
|
|
294
290
|
label: e.title,
|
|
295
291
|
value: e.value,
|
|
296
292
|
icon: e.icon
|
|
297
293
|
}, e.title))
|
|
298
|
-
}),
|
|
294
|
+
}), Q.length > 0 ? /* @__PURE__ */ x("div", {
|
|
299
295
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
|
|
300
|
-
children:
|
|
301
|
-
className: "rounded-lg border border-border bg-
|
|
296
|
+
children: Q.map((e) => /* @__PURE__ */ S("div", {
|
|
297
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
302
298
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
className: "text-sm text-
|
|
299
|
+
/* @__PURE__ */ x("p", {
|
|
300
|
+
className: "text-sm text-text-secondary",
|
|
305
301
|
children: e.title
|
|
306
302
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
className: "mt-2 text-xl font-semibold text-
|
|
303
|
+
/* @__PURE__ */ x("p", {
|
|
304
|
+
className: "mt-2 text-xl font-semibold text-text-primary",
|
|
309
305
|
children: e.value
|
|
310
306
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
className: "mt-1 text-xs text-
|
|
307
|
+
/* @__PURE__ */ x("p", {
|
|
308
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
313
309
|
children: e.helperText
|
|
314
310
|
})
|
|
315
311
|
]
|
|
316
312
|
}, e.title))
|
|
317
313
|
}) : null]
|
|
318
314
|
}) : null,
|
|
319
|
-
|
|
320
|
-
className: "rounded-lg border border-border bg-
|
|
321
|
-
children:
|
|
315
|
+
K && !s(K) ? /* @__PURE__ */ x("div", {
|
|
316
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
|
|
317
|
+
children: K.message
|
|
322
318
|
}) : null,
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
className: "rounded-lg border border-border bg-
|
|
325
|
-
children: [/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ S("section", {
|
|
320
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
321
|
+
children: [/* @__PURE__ */ S("div", {
|
|
326
322
|
className: "mb-4 flex items-center justify-between",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
328
|
-
className: "text-lg font-semibold text-
|
|
323
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
324
|
+
className: "text-lg font-semibold text-text-primary",
|
|
329
325
|
children: "Ledger"
|
|
330
|
-
}), /* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ S("div", {
|
|
331
327
|
className: "flex items-center gap-3",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
333
|
-
value:
|
|
334
|
-
onChange: (e) =>
|
|
335
|
-
className: "rounded-md border border-border bg-
|
|
328
|
+
children: [/* @__PURE__ */ S("select", {
|
|
329
|
+
value: H,
|
|
330
|
+
onChange: (e) => U(e.target.value),
|
|
331
|
+
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
336
332
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ x("option", {
|
|
338
334
|
value: "ALL",
|
|
339
335
|
children: "All sources"
|
|
340
336
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ x("option", {
|
|
342
338
|
value: "AFFILIATE",
|
|
343
339
|
children: "Affiliate"
|
|
344
340
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ x("option", {
|
|
346
342
|
value: "STORE",
|
|
347
343
|
children: "Store"
|
|
348
344
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ x("option", {
|
|
350
346
|
value: "OTHER",
|
|
351
347
|
children: "Other"
|
|
352
348
|
})
|
|
353
349
|
]
|
|
354
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ S("button", {
|
|
355
351
|
type: "button",
|
|
356
|
-
onClick: () => void
|
|
357
|
-
className: "inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-
|
|
358
|
-
children: [/* @__PURE__ */
|
|
352
|
+
onClick: () => void Y(),
|
|
353
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
|
|
354
|
+
children: [/* @__PURE__ */ x(v, { className: "size-4" }), "Refresh"]
|
|
359
355
|
})]
|
|
360
356
|
})]
|
|
361
|
-
}),
|
|
362
|
-
icon: /* @__PURE__ */
|
|
357
|
+
}), Z.length === 0 && !W ? /* @__PURE__ */ x(r, {
|
|
358
|
+
icon: /* @__PURE__ */ x(g, { className: "size-8" }),
|
|
363
359
|
title: "No earnings yet",
|
|
364
360
|
description: "Eligible affiliate rewards and other earnings will appear here."
|
|
365
|
-
}) : /* @__PURE__ */
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
children: [/* @__PURE__ */ S("thead", { children: /* @__PURE__ */ C("tr", {
|
|
370
|
-
className: "border-b border-border text-left text-muted-foreground",
|
|
371
|
-
children: [
|
|
372
|
-
/* @__PURE__ */ S("th", {
|
|
373
|
-
className: "px-3 py-2",
|
|
374
|
-
children: "Category"
|
|
375
|
-
}),
|
|
376
|
-
/* @__PURE__ */ S("th", {
|
|
377
|
-
className: "px-3 py-2",
|
|
378
|
-
children: "Description"
|
|
379
|
-
}),
|
|
380
|
-
/* @__PURE__ */ S("th", {
|
|
381
|
-
className: "px-3 py-2",
|
|
382
|
-
children: "Unit"
|
|
383
|
-
}),
|
|
384
|
-
/* @__PURE__ */ S("th", {
|
|
385
|
-
className: "px-3 py-2",
|
|
386
|
-
children: "Amount"
|
|
387
|
-
}),
|
|
388
|
-
/* @__PURE__ */ S("th", {
|
|
389
|
-
className: "px-3 py-2",
|
|
390
|
-
children: "Status"
|
|
391
|
-
}),
|
|
392
|
-
/* @__PURE__ */ S("th", {
|
|
393
|
-
className: "px-3 py-2",
|
|
394
|
-
children: "Created"
|
|
395
|
-
})
|
|
396
|
-
]
|
|
397
|
-
}) }), /* @__PURE__ */ S("tbody", { children: Y.map((e) => /* @__PURE__ */ C("tr", {
|
|
398
|
-
className: "border-b border-border/70 text-foreground",
|
|
399
|
-
children: [
|
|
400
|
-
/* @__PURE__ */ S("td", {
|
|
401
|
-
className: "px-3 py-2 font-medium",
|
|
402
|
-
children: e.sourceCategory
|
|
403
|
-
}),
|
|
404
|
-
/* @__PURE__ */ S("td", {
|
|
405
|
-
className: "px-3 py-2",
|
|
406
|
-
children: e.description || e.sourceSubcategory || "-"
|
|
407
|
-
}),
|
|
408
|
-
/* @__PURE__ */ S("td", {
|
|
409
|
-
className: "px-3 py-2",
|
|
410
|
-
children: e.unitType
|
|
411
|
-
}),
|
|
412
|
-
/* @__PURE__ */ S("td", {
|
|
413
|
-
className: "px-3 py-2",
|
|
414
|
-
children: e.unitType === "CREDITS" ? `${e.amount.toLocaleString()} credits` : o(e.amount, e.currency || "USD")
|
|
415
|
-
}),
|
|
416
|
-
/* @__PURE__ */ S("td", {
|
|
417
|
-
className: "px-3 py-2",
|
|
418
|
-
children: e.status
|
|
419
|
-
}),
|
|
420
|
-
/* @__PURE__ */ S("td", {
|
|
421
|
-
className: "px-3 py-2",
|
|
422
|
-
children: s(e.createdAt)
|
|
423
|
-
})
|
|
424
|
-
]
|
|
425
|
-
}, e.id)) })]
|
|
426
|
-
})
|
|
361
|
+
}) : /* @__PURE__ */ x(C, {
|
|
362
|
+
data: Z,
|
|
363
|
+
rowKey: (e) => e.id,
|
|
364
|
+
columns: E
|
|
427
365
|
})]
|
|
428
366
|
})
|
|
429
367
|
]
|
|
430
368
|
});
|
|
431
369
|
};
|
|
432
370
|
//#endregion
|
|
433
|
-
export {
|
|
371
|
+
export { D as EarningsPage };
|
|
434
372
|
|
|
435
373
|
//# sourceMappingURL=EarningsPage.js.map
|