@burdenoff/microfe-billing 2026.1113.2 → 2026.1113.4
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/BillingRoot.js +83 -77
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
- package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
- package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/index.js +14 -14
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
- package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +187 -164
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +123 -110
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +215 -157
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
- package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +100 -100
- package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
- package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
- package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
- package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
- package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
- package/dist/billing/shared/components/EmptyState.js +3 -3
- package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
- package/dist/billing/shared/ui/MetricCard.js +13 -13
- package/dist/billing/shared/utils/format.js +16 -4
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/index.js +8 -8
- package/dist/generated/global-operations.js +294 -286
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useBilling as e } from "../../../providers/BillingProvider.js";
|
|
2
2
|
import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
|
|
3
3
|
import { PageHeader as n } from "../../../shared/components/PageHeader.js";
|
|
4
|
-
import { StatCard as
|
|
5
|
-
import { ServerError as
|
|
6
|
-
import { MoneyActionDialog as
|
|
7
|
-
import { useBillingEventEmitter as
|
|
4
|
+
import { StatCard as r } from "../../../shared/components/StatCard.js";
|
|
5
|
+
import { ServerError as i } from "../../../shared/components/ServerError.js";
|
|
6
|
+
import { MoneyActionDialog as a } from "../../../shared/components/MoneyActionDialog.js";
|
|
7
|
+
import { useBillingEventEmitter as ee } from "../../../hooks/useBillingEventEmitter.js";
|
|
8
8
|
import { useBillingPermissions as te } from "../../../hooks/useBillingPermissions.js";
|
|
9
9
|
import { formatCurrency as o, formatDateTime as s } from "../../../shared/utils/format.js";
|
|
10
10
|
import { isServerError as c } from "../../../shared/utils/error.js";
|
|
@@ -13,11 +13,11 @@ import "../../../shared/components/index.js";
|
|
|
13
13
|
import "../../../shared/utils/index.js";
|
|
14
14
|
import { addAffiliateCodeNote as u, createAffiliateCode as d, deactivateAffiliateCode as f, fetchMyAffiliateAnalytics as p, fetchMyAffiliateCodes as m, fetchMyAffiliateJourneys as h, updateAffiliateCode as g } from "../api.js";
|
|
15
15
|
import { useCallback as _, useEffect as v, useMemo as y, useState as b } from "react";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { CTAOverflowMenu as ne, EmphasisPanel as re, IllustratedEmptyState as x, PagePurpose as ie, ResponsiveTable as ae } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
import { Link2 as oe, Plus as se, RefreshCw as ce, StickyNote as le, Ticket as ue, TrendingUp as de, Users as S } from "lucide-react";
|
|
18
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
19
19
|
// src/billing/modules/affiliate/pages/AffiliateDashboardPage.tsx
|
|
20
|
-
var
|
|
20
|
+
var T = [
|
|
21
21
|
{
|
|
22
22
|
key: "code",
|
|
23
23
|
header: "Code",
|
|
@@ -49,88 +49,88 @@ var E = [
|
|
|
49
49
|
header: "Visited",
|
|
50
50
|
cell: (e) => s(e.lastVisitedAt)
|
|
51
51
|
}
|
|
52
|
-
],
|
|
53
|
-
let s = te(),
|
|
52
|
+
], E = () => {
|
|
53
|
+
let s = te(), E = l(), [D, O] = b(null), [k, A] = b(!1), [j, M] = b(null), { emit: N } = ee(), { apiGatewayUrl: P, authToken: F, orgId: I } = e(), [L, fe] = b([]), [R, z] = b([]), [B, V] = b(null), [H, U] = b(!0), [W, G] = b(null), [pe, K] = b(null), [q, J] = b({
|
|
54
54
|
label: "",
|
|
55
55
|
description: "",
|
|
56
56
|
notes: "",
|
|
57
57
|
productSlug: "",
|
|
58
58
|
destinationPath: "",
|
|
59
59
|
destinationUrl: ""
|
|
60
|
-
}),
|
|
61
|
-
apiGatewayUrl:
|
|
62
|
-
authToken:
|
|
63
|
-
orgId:
|
|
60
|
+
}), Y = y(() => ({
|
|
61
|
+
apiGatewayUrl: P,
|
|
62
|
+
authToken: F,
|
|
63
|
+
orgId: I
|
|
64
64
|
}), [
|
|
65
|
+
P,
|
|
65
66
|
F,
|
|
66
|
-
I
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
W(!0), K(null);
|
|
67
|
+
I
|
|
68
|
+
]), X = _(async () => {
|
|
69
|
+
U(!0), G(null);
|
|
70
70
|
try {
|
|
71
71
|
let [e, t, n] = await Promise.all([
|
|
72
|
-
m(
|
|
73
|
-
p(
|
|
74
|
-
h(
|
|
72
|
+
m(Y),
|
|
73
|
+
p(Y),
|
|
74
|
+
h(Y)
|
|
75
75
|
]);
|
|
76
|
-
|
|
76
|
+
fe(e), V(t), z(n);
|
|
77
77
|
} catch (e) {
|
|
78
|
-
|
|
78
|
+
G(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load affiliate dashboard"));
|
|
79
79
|
} finally {
|
|
80
|
-
|
|
80
|
+
U(!1);
|
|
81
81
|
}
|
|
82
|
-
}, [
|
|
82
|
+
}, [Y]);
|
|
83
83
|
if (v(() => {
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
if (
|
|
84
|
+
X();
|
|
85
|
+
}, [X]), !s.canViewBillingAccount) return /* @__PURE__ */ C(t, { message: "You don't have permission to view affiliate analytics." });
|
|
86
|
+
if (W && c(W)) return /* @__PURE__ */ C(i, {
|
|
87
87
|
title: "Affiliate service unavailable",
|
|
88
|
-
message:
|
|
89
|
-
onRetry: () => void
|
|
88
|
+
message: W.message,
|
|
89
|
+
onRetry: () => void X(),
|
|
90
90
|
showRetry: !0
|
|
91
91
|
});
|
|
92
|
-
let
|
|
93
|
-
if (!
|
|
92
|
+
let Z = L.find((e) => e.id === pe) ?? null, me = async () => {
|
|
93
|
+
if (!q.productSlug.trim()) G(/* @__PURE__ */ Error("Product slug is required"));
|
|
94
94
|
else try {
|
|
95
|
-
if (
|
|
96
|
-
label:
|
|
97
|
-
description:
|
|
98
|
-
notes:
|
|
99
|
-
destinationPath:
|
|
100
|
-
destinationUrl:
|
|
101
|
-
},
|
|
95
|
+
if (Z) await g(Z.id, {
|
|
96
|
+
label: q.label,
|
|
97
|
+
description: q.description,
|
|
98
|
+
notes: q.notes,
|
|
99
|
+
destinationPath: q.destinationPath,
|
|
100
|
+
destinationUrl: q.destinationUrl
|
|
101
|
+
}, Y), N("billing.affiliate_code.updated", {
|
|
102
102
|
route: "/billing/affiliate",
|
|
103
|
-
entityId:
|
|
103
|
+
entityId: Z.id,
|
|
104
104
|
source: "affiliate-dashboard"
|
|
105
105
|
});
|
|
106
106
|
else {
|
|
107
107
|
let e = await d({
|
|
108
|
-
label:
|
|
109
|
-
description:
|
|
110
|
-
notes:
|
|
111
|
-
productSlug:
|
|
112
|
-
destinationPath:
|
|
113
|
-
destinationUrl:
|
|
114
|
-
},
|
|
115
|
-
|
|
108
|
+
label: q.label,
|
|
109
|
+
description: q.description,
|
|
110
|
+
notes: q.notes,
|
|
111
|
+
productSlug: q.productSlug,
|
|
112
|
+
destinationPath: q.destinationPath,
|
|
113
|
+
destinationUrl: q.destinationUrl
|
|
114
|
+
}, Y);
|
|
115
|
+
N("billing.affiliate_code.created", {
|
|
116
116
|
route: "/billing/affiliate",
|
|
117
117
|
entityId: e.id,
|
|
118
118
|
source: "affiliate-dashboard"
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
K(null), J({
|
|
122
122
|
label: "",
|
|
123
123
|
description: "",
|
|
124
124
|
notes: "",
|
|
125
125
|
productSlug: "",
|
|
126
126
|
destinationPath: "",
|
|
127
127
|
destinationUrl: ""
|
|
128
|
-
}), await
|
|
128
|
+
}), await X();
|
|
129
129
|
} catch (e) {
|
|
130
|
-
|
|
130
|
+
G(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save affiliate code"));
|
|
131
131
|
}
|
|
132
|
-
},
|
|
133
|
-
|
|
132
|
+
}, he = (e) => {
|
|
133
|
+
K(e.id), J({
|
|
134
134
|
label: e.label ?? "",
|
|
135
135
|
description: e.description ?? "",
|
|
136
136
|
notes: e.notes ?? "",
|
|
@@ -138,168 +138,168 @@ var E = [
|
|
|
138
138
|
destinationPath: e.destinationPath ?? "",
|
|
139
139
|
destinationUrl: e.destinationUrl ?? ""
|
|
140
140
|
});
|
|
141
|
-
},
|
|
142
|
-
if (
|
|
143
|
-
|
|
141
|
+
}, ge = async () => {
|
|
142
|
+
if (D) {
|
|
143
|
+
A(!0), M(null);
|
|
144
144
|
try {
|
|
145
|
-
await
|
|
145
|
+
await Q(D.id), O(null);
|
|
146
146
|
} catch (e) {
|
|
147
|
-
|
|
147
|
+
M(e instanceof Error ? e.message : "Could not deactivate this code.");
|
|
148
148
|
} finally {
|
|
149
|
-
|
|
149
|
+
A(!1);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
},
|
|
153
|
-
await f(e,
|
|
152
|
+
}, Q = async (e) => {
|
|
153
|
+
await f(e, Y), N("billing.affiliate_code.deactivated", {
|
|
154
154
|
route: "/billing/affiliate",
|
|
155
155
|
entityId: e,
|
|
156
156
|
source: "affiliate-dashboard"
|
|
157
|
-
}), await
|
|
158
|
-
},
|
|
157
|
+
}), await X();
|
|
158
|
+
}, $ = async (e) => {
|
|
159
159
|
let t = window.prompt("Add an internal note for this affiliate code");
|
|
160
|
-
t && (await u(e, t,
|
|
160
|
+
t && (await u(e, t, Y), N("billing.affiliate_code.note_added", {
|
|
161
161
|
route: "/billing/affiliate",
|
|
162
162
|
entityId: e,
|
|
163
163
|
source: "affiliate-dashboard"
|
|
164
|
-
}), await
|
|
165
|
-
}, _e =
|
|
164
|
+
}), await X());
|
|
165
|
+
}, _e = B ? [
|
|
166
166
|
{
|
|
167
167
|
title: "Codes",
|
|
168
|
-
value:
|
|
169
|
-
icon: /* @__PURE__ */
|
|
168
|
+
value: B.totalCodes,
|
|
169
|
+
icon: /* @__PURE__ */ C(ue, { className: "size-5" })
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
title: "Visits",
|
|
173
|
-
value:
|
|
174
|
-
icon: /* @__PURE__ */
|
|
173
|
+
value: B.totalVisits,
|
|
174
|
+
icon: /* @__PURE__ */ C(S, { className: "size-5" })
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
title: "Journeys",
|
|
178
|
-
value:
|
|
179
|
-
icon: /* @__PURE__ */
|
|
178
|
+
value: B.totalJourneys,
|
|
179
|
+
icon: /* @__PURE__ */ C(oe, { className: "size-5" })
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
title: "Revenue influenced",
|
|
183
|
-
value: o(
|
|
184
|
-
icon: /* @__PURE__ */
|
|
183
|
+
value: o(B.totalRevenueAmount, "USD"),
|
|
184
|
+
icon: /* @__PURE__ */ C(de, { className: "size-5" })
|
|
185
185
|
}
|
|
186
186
|
] : [];
|
|
187
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ w("div", {
|
|
188
188
|
className: "space-y-6 p-6",
|
|
189
189
|
children: [
|
|
190
|
-
|
|
191
|
-
open:
|
|
190
|
+
E && /* @__PURE__ */ C(a, {
|
|
191
|
+
open: D !== null,
|
|
192
192
|
tone: "danger",
|
|
193
193
|
title: "Deactivate this affiliate code?",
|
|
194
194
|
description: "The code stops tracking new visits straight away. Visits and journeys already recorded are kept.",
|
|
195
195
|
details: [{
|
|
196
196
|
label: "Code",
|
|
197
|
-
value:
|
|
197
|
+
value: D?.label ?? ""
|
|
198
198
|
}],
|
|
199
199
|
confirmLabel: "Deactivate code",
|
|
200
200
|
busyLabel: "Deactivating…",
|
|
201
|
-
isBusy:
|
|
202
|
-
error:
|
|
203
|
-
onConfirm: () => void
|
|
204
|
-
onCancel: () =>
|
|
201
|
+
isBusy: k,
|
|
202
|
+
error: j,
|
|
203
|
+
onConfirm: () => void ge(),
|
|
204
|
+
onCancel: () => O(null)
|
|
205
205
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ C(n, {
|
|
207
207
|
title: "Affiliate codes",
|
|
208
208
|
description: "Create referral codes, add internal notes, and monitor attributed journeys.",
|
|
209
|
-
actions: /* @__PURE__ */
|
|
209
|
+
actions: /* @__PURE__ */ C(ne, { actions: [{
|
|
210
210
|
label: "Refresh",
|
|
211
|
-
onSelect: () => void
|
|
212
|
-
icon: /* @__PURE__ */
|
|
211
|
+
onSelect: () => void X(),
|
|
212
|
+
icon: /* @__PURE__ */ C(ce, { className: "size-4" })
|
|
213
213
|
}] })
|
|
214
214
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
|
|
215
|
+
/* @__PURE__ */ C(ie, { children: "Generate referral links for any product, share them, and see exactly what they drive — visits, signups, paid conversions and the rewards you have earned. Create and manage your codes on the left and watch attributed visitor journeys on the right." }),
|
|
216
|
+
H ? /* @__PURE__ */ C("div", {
|
|
217
217
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
218
218
|
children: [
|
|
219
219
|
1,
|
|
220
220
|
2,
|
|
221
221
|
3,
|
|
222
222
|
4
|
|
223
|
-
].map((e) => /* @__PURE__ */
|
|
224
|
-
}) :
|
|
223
|
+
].map((e) => /* @__PURE__ */ C("div", { className: "h-28 animate-pulse rounded-lg border border-border-subtle bg-bg-surface" }, e))
|
|
224
|
+
}) : B ? /* @__PURE__ */ C(re, {
|
|
225
225
|
className: "p-4 sm:p-5",
|
|
226
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ C("div", {
|
|
227
227
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
228
|
-
children: _e.map((e) => /* @__PURE__ */
|
|
228
|
+
children: _e.map((e) => /* @__PURE__ */ C(r, {
|
|
229
229
|
label: e.title,
|
|
230
230
|
value: e.value,
|
|
231
231
|
icon: e.icon
|
|
232
232
|
}, e.title))
|
|
233
233
|
})
|
|
234
234
|
}) : null,
|
|
235
|
-
|
|
235
|
+
W && !c(W) ? /* @__PURE__ */ C("div", {
|
|
236
236
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
|
|
237
|
-
children:
|
|
237
|
+
children: W.message
|
|
238
238
|
}) : null,
|
|
239
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ w("div", {
|
|
240
240
|
className: "grid gap-6 xl:grid-cols-[1.1fr,1.9fr]",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ w("section", {
|
|
242
242
|
className: "rounded-lg border border-border-seam bg-bg-surface p-4 xl:sticky xl:top-6 xl:self-start",
|
|
243
243
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ w("div", {
|
|
245
245
|
className: "mb-4 flex items-center justify-between",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
247
247
|
className: "text-lg font-semibold text-text-primary",
|
|
248
|
-
children:
|
|
249
|
-
}),
|
|
248
|
+
children: Z ? "Update affiliate code" : "Create affiliate code"
|
|
249
|
+
}), Z ? null : /* @__PURE__ */ C(se, { className: "size-4 text-text-secondary" })]
|
|
250
250
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ w("div", {
|
|
252
252
|
className: "space-y-3",
|
|
253
253
|
children: [
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
value:
|
|
256
|
-
onChange: (e) =>
|
|
254
|
+
/* @__PURE__ */ C("input", {
|
|
255
|
+
value: q.label,
|
|
256
|
+
onChange: (e) => J((t) => ({
|
|
257
257
|
...t,
|
|
258
258
|
label: e.target.value
|
|
259
259
|
})),
|
|
260
260
|
placeholder: "Label",
|
|
261
261
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
262
262
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
value:
|
|
265
|
-
onChange: (e) =>
|
|
263
|
+
/* @__PURE__ */ C("input", {
|
|
264
|
+
value: q.productSlug,
|
|
265
|
+
onChange: (e) => J((t) => ({
|
|
266
266
|
...t,
|
|
267
267
|
productSlug: e.target.value
|
|
268
268
|
})),
|
|
269
269
|
placeholder: "Product slug (eg. bigconsole)",
|
|
270
270
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
271
|
-
disabled: !!
|
|
271
|
+
disabled: !!Z
|
|
272
272
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
value:
|
|
275
|
-
onChange: (e) =>
|
|
273
|
+
/* @__PURE__ */ C("input", {
|
|
274
|
+
value: q.destinationPath,
|
|
275
|
+
onChange: (e) => J((t) => ({
|
|
276
276
|
...t,
|
|
277
277
|
destinationPath: e.target.value
|
|
278
278
|
})),
|
|
279
279
|
placeholder: "Destination path (eg. /pricing)",
|
|
280
280
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
281
281
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
value:
|
|
284
|
-
onChange: (e) =>
|
|
282
|
+
/* @__PURE__ */ C("input", {
|
|
283
|
+
value: q.destinationUrl,
|
|
284
|
+
onChange: (e) => J((t) => ({
|
|
285
285
|
...t,
|
|
286
286
|
destinationUrl: e.target.value
|
|
287
287
|
})),
|
|
288
288
|
placeholder: "Absolute destination URL (optional)",
|
|
289
289
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
290
290
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
value:
|
|
293
|
-
onChange: (e) =>
|
|
291
|
+
/* @__PURE__ */ C("textarea", {
|
|
292
|
+
value: q.description,
|
|
293
|
+
onChange: (e) => J((t) => ({
|
|
294
294
|
...t,
|
|
295
295
|
description: e.target.value
|
|
296
296
|
})),
|
|
297
297
|
placeholder: "Description",
|
|
298
298
|
className: "min-h-24 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
299
299
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
value:
|
|
302
|
-
onChange: (e) =>
|
|
300
|
+
/* @__PURE__ */ C("textarea", {
|
|
301
|
+
value: q.notes,
|
|
302
|
+
onChange: (e) => J((t) => ({
|
|
303
303
|
...t,
|
|
304
304
|
notes: e.target.value
|
|
305
305
|
})),
|
|
@@ -308,17 +308,17 @@ var E = [
|
|
|
308
308
|
})
|
|
309
309
|
]
|
|
310
310
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ w("div", {
|
|
312
312
|
className: "mt-4 flex flex-wrap gap-3",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ C("button", {
|
|
314
314
|
type: "button",
|
|
315
|
-
onClick: () => void
|
|
315
|
+
onClick: () => void me(),
|
|
316
316
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
|
|
317
|
-
children:
|
|
318
|
-
}),
|
|
317
|
+
children: Z ? "Save changes" : "Create code"
|
|
318
|
+
}), Z ? /* @__PURE__ */ C("button", {
|
|
319
319
|
type: "button",
|
|
320
320
|
onClick: () => {
|
|
321
|
-
|
|
321
|
+
K(null), J({
|
|
322
322
|
label: "",
|
|
323
323
|
description: "",
|
|
324
324
|
notes: "",
|
|
@@ -332,32 +332,32 @@ var E = [
|
|
|
332
332
|
}) : null]
|
|
333
333
|
})
|
|
334
334
|
]
|
|
335
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ w("section", {
|
|
336
336
|
className: "space-y-4",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ w("div", {
|
|
338
338
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
340
340
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
341
341
|
children: "My codes"
|
|
342
|
-
}),
|
|
342
|
+
}), L.length === 0 && !H ? /* @__PURE__ */ C(x, {
|
|
343
343
|
illustration: "empty-data",
|
|
344
344
|
title: "No affiliate codes yet",
|
|
345
345
|
description: "Create your first code to start tracking attributable journeys."
|
|
346
|
-
}) : /* @__PURE__ */
|
|
346
|
+
}) : /* @__PURE__ */ C("div", {
|
|
347
347
|
className: "space-y-4",
|
|
348
|
-
children:
|
|
348
|
+
children: L.map((e) => {
|
|
349
349
|
let t = e.destinationUrl || `https://${e.productSlug}.com${e.destinationPath || ""}?ref=${e.code}`;
|
|
350
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ w("div", {
|
|
351
351
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
352
352
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ w("div", {
|
|
354
354
|
className: "flex flex-wrap items-start justify-between gap-4",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ w("div", { children: [
|
|
356
|
+
/* @__PURE__ */ C("p", {
|
|
357
357
|
className: "text-sm font-semibold text-text-primary",
|
|
358
358
|
children: e.label || e.code
|
|
359
359
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ w("p", {
|
|
361
361
|
className: "text-xs text-text-secondary",
|
|
362
362
|
children: [
|
|
363
363
|
e.code,
|
|
@@ -365,83 +365,83 @@ var E = [
|
|
|
365
365
|
e.productSlug
|
|
366
366
|
]
|
|
367
367
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ C("p", {
|
|
369
369
|
className: "mt-1 break-all text-xs text-text-secondary",
|
|
370
370
|
children: t
|
|
371
371
|
})
|
|
372
|
-
] }), /* @__PURE__ */
|
|
372
|
+
] }), /* @__PURE__ */ w("div", {
|
|
373
373
|
className: "flex flex-wrap gap-2",
|
|
374
374
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ C("button", {
|
|
376
376
|
type: "button",
|
|
377
|
-
onClick: () =>
|
|
377
|
+
onClick: () => he(e),
|
|
378
378
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
379
379
|
children: "Edit"
|
|
380
380
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ w("button", {
|
|
382
382
|
type: "button",
|
|
383
|
-
onClick: () => void
|
|
383
|
+
onClick: () => void $(e.id),
|
|
384
384
|
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ C(le, { className: "size-3.5" }), "Note"]
|
|
386
386
|
}),
|
|
387
|
-
e.status === "ACTIVE" ? /* @__PURE__ */
|
|
387
|
+
e.status === "ACTIVE" ? /* @__PURE__ */ C("button", {
|
|
388
388
|
type: "button",
|
|
389
|
-
onClick: () =>
|
|
389
|
+
onClick: () => E ? (M(null), O({
|
|
390
390
|
id: e.id,
|
|
391
391
|
label: e.label || e.code
|
|
392
|
-
})) : void
|
|
392
|
+
})) : void Q(e.id),
|
|
393
393
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
|
|
394
394
|
children: "Deactivate"
|
|
395
395
|
}) : null
|
|
396
396
|
]
|
|
397
397
|
})]
|
|
398
398
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ w("div", {
|
|
400
400
|
className: "mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",
|
|
401
401
|
children: [
|
|
402
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ w("div", {
|
|
403
403
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ C("p", {
|
|
405
405
|
className: "text-xs text-text-secondary",
|
|
406
406
|
children: "Visits"
|
|
407
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ C("p", {
|
|
408
408
|
className: "text-lg font-semibold text-text-primary",
|
|
409
409
|
children: e.totalVisits
|
|
410
410
|
})]
|
|
411
411
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ w("div", {
|
|
413
413
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ C("p", {
|
|
415
415
|
className: "text-xs text-text-secondary",
|
|
416
416
|
children: "Signups"
|
|
417
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ C("p", {
|
|
418
418
|
className: "text-lg font-semibold text-text-primary",
|
|
419
419
|
children: e.totalSignups
|
|
420
420
|
})]
|
|
421
421
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ w("div", {
|
|
423
423
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ C("p", {
|
|
425
425
|
className: "text-xs text-text-secondary",
|
|
426
426
|
children: "Paid conversions"
|
|
427
|
-
}), /* @__PURE__ */
|
|
427
|
+
}), /* @__PURE__ */ C("p", {
|
|
428
428
|
className: "text-lg font-semibold text-text-primary",
|
|
429
429
|
children: e.totalPaidConversions + e.totalStorePurchases
|
|
430
430
|
})]
|
|
431
431
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ w("div", {
|
|
433
433
|
className: "rounded-md border border-border-subtle bg-bg-surface p-3",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ C("p", {
|
|
435
435
|
className: "text-xs text-text-secondary",
|
|
436
436
|
children: "Rewards earned"
|
|
437
|
-
}), /* @__PURE__ */
|
|
437
|
+
}), /* @__PURE__ */ C("p", {
|
|
438
438
|
className: "text-lg font-semibold text-text-primary",
|
|
439
439
|
children: o(e.totalRewardAmount, "USD")
|
|
440
440
|
})]
|
|
441
441
|
})
|
|
442
442
|
]
|
|
443
443
|
}),
|
|
444
|
-
e.notes ? /* @__PURE__ */
|
|
444
|
+
e.notes ? /* @__PURE__ */ C("p", {
|
|
445
445
|
className: "mt-3 text-sm text-text-secondary",
|
|
446
446
|
children: e.notes
|
|
447
447
|
}) : null
|
|
@@ -449,19 +449,19 @@ var E = [
|
|
|
449
449
|
}, e.id);
|
|
450
450
|
})
|
|
451
451
|
})]
|
|
452
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ w("div", {
|
|
453
453
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
454
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
455
455
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
456
456
|
children: "Recent attributed journeys"
|
|
457
|
-
}),
|
|
457
|
+
}), R.length === 0 ? /* @__PURE__ */ C(x, {
|
|
458
458
|
illustration: "empty-people",
|
|
459
459
|
title: "No journeys yet",
|
|
460
460
|
description: "Journeys will appear as visitors land on your affiliate links."
|
|
461
|
-
}) : /* @__PURE__ */
|
|
462
|
-
data:
|
|
461
|
+
}) : /* @__PURE__ */ C(ae, {
|
|
462
|
+
data: R,
|
|
463
463
|
rowKey: (e) => e.id,
|
|
464
|
-
columns:
|
|
464
|
+
columns: T
|
|
465
465
|
})]
|
|
466
466
|
})]
|
|
467
467
|
})]
|
|
@@ -469,6 +469,6 @@ var E = [
|
|
|
469
469
|
]
|
|
470
470
|
});
|
|
471
471
|
};
|
|
472
|
-
export {
|
|
472
|
+
export { E as AffiliateDashboardPage };
|
|
473
473
|
|
|
474
474
|
//# sourceMappingURL=AffiliateDashboardPage.js.map
|