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