@burdenoff/microfe-billing 2026.1109.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.
Files changed (33) hide show
  1. package/dist/billing/BillingUserRoutes.js +202 -188
  2. package/dist/billing/BillingUserRoutes.js.map +1 -1
  3. package/dist/billing/hooks/useBillingVariant.d.ts +6 -0
  4. package/dist/billing/hooks/useBillingVariant.js +8 -0
  5. package/dist/billing/hooks/useBillingVariant.js.map +1 -0
  6. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +182 -150
  7. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  8. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +169 -140
  9. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  10. package/dist/billing/modules/billing/pages/InvoicesListPage.js +191 -156
  11. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  12. package/dist/billing/modules/billing/pages/UserRefundsPage.js +160 -157
  13. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  14. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +153 -126
  15. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  16. package/dist/billing/modules/credits/pages/CreditsPage.js +110 -109
  17. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  18. package/dist/billing/modules/earnings/pages/PayoutsPage.js +220 -181
  19. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  20. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +4 -1
  21. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  22. package/dist/billing/providers/BillingProvider.js +16 -15
  23. package/dist/billing/providers/BillingProvider.js.map +1 -1
  24. package/dist/billing/shared/components/MoneyActionDialog.d.ts +27 -0
  25. package/dist/billing/shared/components/MoneyActionDialog.js +53 -0
  26. package/dist/billing/shared/components/MoneyActionDialog.js.map +1 -0
  27. package/dist/billing/shared/components/index.d.ts +1 -0
  28. package/dist/billing/shared/components/index.js +2 -1
  29. package/dist/billing/shared/utils/accessRules.d.ts +16 -0
  30. package/dist/billing/shared/utils/accessRules.js +10 -0
  31. package/dist/billing/shared/utils/accessRules.js.map +1 -0
  32. package/dist/billing/types/index.d.ts +6 -0
  33. package/package.json +1 -1
@@ -1,67 +1,70 @@
1
1
  import { PageHeader as e } from "../../../shared/components/PageHeader.js";
2
2
  import { useBillingNavigate as t } from "../../../hooks/useBillingNavigate.js";
3
3
  import { formatCurrency as n, formatDateTime as r } from "../../../shared/utils/format.js";
4
+ import { useBillingPermissions as ee } from "../../../hooks/useBillingPermissions.js";
5
+ import { useIsFluidgridsVariant as te } from "../../../hooks/useBillingVariant.js";
4
6
  import "../../../shared/utils/index.js";
5
7
  import "../../../shared/components/index.js";
6
- import { useCreateRefundRecordMutation as ee, useGetBillingAccountsCheckoutQuery as te, useGetRefundRecordsQuery as i, useGetTransactionLazyQuery as a } from "../../../../generated/global-operations.js";
7
- import { RefundRecordStatus as o } from "../../../../generated/global-types.js";
8
- import { useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
9
- import { CheckCircle as d, Clock as f, CreditCard as ne, Loader2 as p, PlusCircle as m, Search as h, X as g, XCircle as _ } from "lucide-react";
10
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
11
- import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
- import { IllustratedEmptyState as re, PagePurpose as ie } from "@burdenoff/fe-libs/ui";
8
+ import { canShowRefundRequest as i } from "../../../shared/utils/accessRules.js";
9
+ import { useCreateRefundRecordMutation as a, useGetBillingAccountsCheckoutQuery as o, useGetRefundRecordsQuery as ne, useGetTransactionLazyQuery as re } from "../../../../generated/global-operations.js";
10
+ import { RefundRecordStatus as s } from "../../../../generated/global-types.js";
11
+ import { useEffect as c, useMemo as ie, useRef as l, useState as u } from "react";
12
+ import { CheckCircle as d, Clock as f, CreditCard as ae, Loader2 as p, PlusCircle as oe, Search as se, X as m, XCircle as h } from "lucide-react";
13
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { IllustratedEmptyState as le, PagePurpose as v } from "@burdenoff/fe-libs/ui";
13
16
  // src/billing/modules/billing/pages/UserRefundsPage.tsx
14
- var x = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, S = {
15
- [o.Pending]: {
17
+ var y = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, b = {
18
+ [s.Pending]: {
16
19
  label: "In Review",
17
20
  className: "bg-status-warning-bg/20 text-status-warning-text border-status-warning-border",
18
- icon: ({ className: e }) => /* @__PURE__ */ v(f, { className: e })
21
+ icon: ({ className: e }) => /* @__PURE__ */ g(f, { className: e })
19
22
  },
20
- [o.Processing]: {
23
+ [s.Processing]: {
21
24
  label: "Processing",
22
25
  className: "bg-action-primary-bg/15 text-action-primary-bg border-action-primary-bg/30",
23
- icon: ({ className: e }) => /* @__PURE__ */ v(p, { className: `${e} animate-spin` })
26
+ icon: ({ className: e }) => /* @__PURE__ */ g(p, { className: `${e} animate-spin` })
24
27
  },
25
- [o.Completed]: {
28
+ [s.Completed]: {
26
29
  label: "Refunded",
27
30
  className: "bg-status-success-bg/20 text-status-success-text border-status-success-border",
28
- icon: ({ className: e }) => /* @__PURE__ */ v(d, { className: e })
31
+ icon: ({ className: e }) => /* @__PURE__ */ g(d, { className: e })
29
32
  },
30
- [o.Failed]: {
33
+ [s.Failed]: {
31
34
  label: "Failed",
32
35
  className: "bg-status-error-bg/20 text-status-error-text border-status-error-border",
33
- icon: ({ className: e }) => /* @__PURE__ */ v(_, { className: e })
36
+ icon: ({ className: e }) => /* @__PURE__ */ g(h, { className: e })
34
37
  },
35
- [o.Skipped]: {
38
+ [s.Skipped]: {
36
39
  label: "Closed",
37
40
  className: "bg-bg-sunken text-text-secondary border-border-subtle",
38
- icon: ({ className: e }) => /* @__PURE__ */ v(_, { className: e })
41
+ icon: ({ className: e }) => /* @__PURE__ */ g(h, { className: e })
39
42
  }
40
43
  };
41
- function ae({ status: e }) {
42
- let t = S[e] ?? {
44
+ function x({ status: e }) {
45
+ let t = b[e] ?? {
43
46
  label: e,
44
47
  className: "bg-bg-sunken text-text-secondary border-border-subtle",
45
- icon: ({ className: e }) => /* @__PURE__ */ v(f, { className: e })
48
+ icon: ({ className: e }) => /* @__PURE__ */ g(f, { className: e })
46
49
  }, n = t.icon;
47
- return /* @__PURE__ */ y("span", {
50
+ return /* @__PURE__ */ _("span", {
48
51
  className: `inline-flex items-center gap-1 px-2 py-0.5 rounded-full border text-xs font-medium ${t.className}`,
49
- children: [/* @__PURE__ */ v(n, { className: "size-3" }), t.label]
52
+ children: [/* @__PURE__ */ g(n, { className: "size-3" }), t.label]
50
53
  });
51
54
  }
52
- var C = () => {
53
- let { t: f } = b(), _ = (e, t) => {
55
+ var S = () => {
56
+ let { t: f } = ce(), h = (e, t) => {
54
57
  let n = f(e);
55
58
  return n === e ? t : n;
56
- }, S = t(), [C, w] = u(!1), [T, E] = u(""), [D, O] = u(null), [k, A] = u(!1), [j, M] = u(""), [N, P] = u(""), [F, I] = u(null), [oe, L] = u(!1), { data: R, loading: z } = te({ fetchPolicy: "cache-and-network" }), B = c(() => R?.getBillingAccountsByOrg ?? [], [R]), [V, H] = u(void 0);
57
- s(() => {
58
- !V && B.length > 0 && H(B[0].id);
59
- }, [B, V]);
60
- let U = B.find((e) => e.id === V), [W, { data: G, loading: K, error: q }] = a({ fetchPolicy: "network-only" }), se = l("");
61
- s(() => {
59
+ }, b = t(), S = ee(), C = i(te(), S.canProcessRefund), [w, T] = u(!1), [E, D] = u(""), [O, k] = u(null), [ue, A] = u(!1), [j, M] = u(""), [N, P] = u(""), [F, I] = u(null), [L, R] = u(!1), { data: z, loading: B } = o({ fetchPolicy: "cache-and-network" }), V = ie(() => z?.getBillingAccountsByOrg ?? [], [z]), [H, U] = u(void 0);
60
+ c(() => {
61
+ !H && V.length > 0 && U(V[0].id);
62
+ }, [V, H]);
63
+ let W = V.find((e) => e.id === H), [de, { data: G, loading: K, error: q }] = re({ fetchPolicy: "network-only" }), fe = l("");
64
+ c(() => {
62
65
  if (K) return;
63
66
  let e = G?.getTransaction;
64
- e ? (O(e), A(!1), P(String(e.amount))) : (G !== void 0 || q) && (O(null), A(!0), P(""));
67
+ e ? (k(e), A(!1), P(String(e.amount))) : (G !== void 0 || q) && (k(null), A(!0), P(""));
65
68
  }, [
66
69
  G,
67
70
  K,
@@ -69,91 +72,91 @@ var C = () => {
69
72
  ]);
70
73
  let J = (e, t) => {
71
74
  let n = `${e}::${t}`;
72
- se.current = n, O(null), A(!1), P(""), W({ variables: {
75
+ fe.current = n, k(null), A(!1), P(""), de({ variables: {
73
76
  id: e,
74
77
  billingAccountId: t
75
78
  } });
76
- }, ce = (e) => {
77
- E(e), O(null), A(!1), P(""), x.test(e.trim()) && V && J(e.trim(), V);
78
- }, le = (e) => {
79
- H(e), O(null), A(!1), P(""), x.test(T.trim()) && J(T.trim(), e);
80
- }, { data: ue, loading: de, refetch: fe } = i({
79
+ }, pe = (e) => {
80
+ D(e), k(null), A(!1), P(""), y.test(e.trim()) && H && J(e.trim(), H);
81
+ }, me = (e) => {
82
+ U(e), k(null), A(!1), P(""), y.test(E.trim()) && J(E.trim(), e);
83
+ }, { data: he, loading: ge, refetch: _e } = ne({
81
84
  variables: {
82
- billingAccountId: V,
85
+ billingAccountId: H,
83
86
  pageSize: 20,
84
87
  page: 1
85
88
  },
86
- skip: !V,
89
+ skip: !H,
87
90
  fetchPolicy: "cache-and-network"
88
- }), Y = ue?.getRefundRecords.records ?? [], [X, { loading: Z }] = ee({ refetchQueries: ["GetRefundRecords"] }), pe = (e) => e ? e.stripePaymentId ? {
91
+ }), Y = he?.getRefundRecords.records ?? [], [ve, { loading: X }] = a({ refetchQueries: ["GetRefundRecords"] }), Z = (e) => e ? e.stripePaymentId ? {
89
92
  provider: "STRIPE",
90
93
  gatewayPaymentId: e.stripePaymentId
91
94
  } : e.razorpayPaymentId ? {
92
95
  provider: "RAZORPAY",
93
96
  gatewayPaymentId: e.razorpayPaymentId
94
- } : null : null, me = async (e) => {
95
- if (e.preventDefault(), I(null), !D || !j.trim() || !N) {
97
+ } : null : null, ye = async (e) => {
98
+ if (e.preventDefault(), I(null), !O || !j.trim() || !N) {
96
99
  I("Enter a valid transaction ID, an amount, and a reason.");
97
100
  return;
98
101
  }
99
- let t = pe(D);
102
+ let t = Z(O);
100
103
  if (!t) {
101
104
  I("No payment gateway info found for this transaction. Please contact support.");
102
105
  return;
103
106
  }
104
107
  let r = parseFloat(N);
105
108
  if (isNaN(r) || r <= 0) I("Please enter a valid amount greater than 0.");
106
- else if (r > D.amount) I(`Cannot exceed the original payment amount (${n(D.amount, D.currency)}).`);
109
+ else if (r > O.amount) I(`Cannot exceed the original payment amount (${n(O.amount, O.currency)}).`);
107
110
  else try {
108
- await X({ variables: {
109
- billingAccountId: V,
111
+ await ve({ variables: {
112
+ billingAccountId: H,
110
113
  provider: t.provider,
111
114
  gatewayPaymentId: t.gatewayPaymentId,
112
115
  amount: r,
113
- currency: D.currency ?? U?.currency ?? "USD",
114
- transactionId: D.id,
116
+ currency: O.currency ?? W?.currency ?? "USD",
117
+ transactionId: O.id,
115
118
  reason: j.trim(),
116
119
  notes: "Requested by user via billing portal"
117
- } }), L(!0), w(!1), Q(), await fe();
120
+ } }), R(!0), T(!1), Q(), await _e();
118
121
  } catch (e) {
119
122
  I(e instanceof Error ? e.message : "Failed to submit refund request.");
120
123
  }
121
124
  }, Q = () => {
122
- E(""), O(null), A(!1), M(""), P(""), I(null);
125
+ D(""), k(null), A(!1), M(""), P(""), I(null);
123
126
  }, $ = () => {
124
- w(!1), L(!1), Q();
127
+ T(!1), R(!1), Q();
125
128
  };
126
- return /* @__PURE__ */ y("div", {
129
+ return /* @__PURE__ */ _("div", {
127
130
  className: "space-y-6 p-6 max-w-3xl",
128
131
  children: [
129
- /* @__PURE__ */ v(e, {
130
- title: _("billing.refunds.title", "Refunds"),
131
- description: _("billing.refunds.description", "View your refund requests and submit new ones"),
132
- actions: C ? void 0 : /* @__PURE__ */ y("button", {
132
+ /* @__PURE__ */ g(e, {
133
+ title: h("billing.refunds.title", "Refunds"),
134
+ description: h("billing.refunds.description", "View your refund requests and submit new ones"),
135
+ actions: !w && C ? /* @__PURE__ */ _("button", {
133
136
  type: "button",
134
137
  onClick: () => {
135
- w(!0), L(!1);
138
+ T(!0), R(!1);
136
139
  },
137
140
  className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
138
- children: [/* @__PURE__ */ v(m, { className: "size-4" }), _("billing.refunds.requestRefund", "Request Refund")]
139
- })
141
+ children: [/* @__PURE__ */ g(oe, { className: "size-4" }), h("billing.refunds.requestRefund", "Request Refund")]
142
+ }) : void 0
140
143
  }),
141
- /* @__PURE__ */ v(ie, { children: _("billing.refunds.userPurpose", "Request money back for a payment and follow where each request stands. Paste the transaction ID of the charge you want refunded, tell us how much and why, and track every request here from \"In Review\" through to \"Refunded\".") }),
142
- !z && B.length > 1 && /* @__PURE__ */ y("div", {
144
+ /* @__PURE__ */ g(v, { children: h("billing.refunds.userPurpose", "Request money back for a payment and follow where each request stands. Paste the transaction ID of the charge you want refunded, tell us how much and why, and track every request here from \"In Review\" through to \"Refunded\".") }),
145
+ !B && V.length > 1 && /* @__PURE__ */ _("div", {
143
146
  className: "flex items-center gap-3",
144
147
  children: [
145
- /* @__PURE__ */ v(ne, { className: "size-4 text-text-secondary shrink-0" }),
146
- /* @__PURE__ */ v("label", {
148
+ /* @__PURE__ */ g(ae, { className: "size-4 text-text-secondary shrink-0" }),
149
+ /* @__PURE__ */ g("label", {
147
150
  htmlFor: "accountSwitch",
148
151
  className: "text-sm text-text-secondary shrink-0",
149
- children: _("billing.refunds.account", "Billing account")
152
+ children: h("billing.refunds.account", "Billing account")
150
153
  }),
151
- /* @__PURE__ */ v("select", {
154
+ /* @__PURE__ */ g("select", {
152
155
  id: "accountSwitch",
153
- value: V ?? "",
154
- onChange: (e) => le(e.target.value),
156
+ value: H ?? "",
157
+ onChange: (e) => me(e.target.value),
155
158
  className: "flex-1 px-3 py-1.5 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
156
- children: B.map((e) => /* @__PURE__ */ y("option", {
159
+ children: V.map((e) => /* @__PURE__ */ _("option", {
157
160
  value: e.id,
158
161
  children: [
159
162
  e.name,
@@ -166,216 +169,216 @@ var C = () => {
166
169
  })
167
170
  ]
168
171
  }),
169
- oe && /* @__PURE__ */ y("div", {
172
+ L && /* @__PURE__ */ _("div", {
170
173
  className: "flex items-center justify-between p-4 rounded-lg border border-status-success-border bg-status-success-bg/10",
171
- children: [/* @__PURE__ */ y("div", {
174
+ children: [/* @__PURE__ */ _("div", {
172
175
  className: "flex items-center gap-2",
173
- children: [/* @__PURE__ */ v(d, { className: "size-4 text-status-success-text" }), /* @__PURE__ */ v("p", {
176
+ children: [/* @__PURE__ */ g(d, { className: "size-4 text-status-success-text" }), /* @__PURE__ */ g("p", {
174
177
  className: "text-sm text-status-success-text font-medium",
175
- children: _("billing.refunds.submitted", "Refund request submitted. Our team will review it shortly.")
178
+ children: h("billing.refunds.submitted", "Refund request submitted. Our team will review it shortly.")
176
179
  })]
177
- }), /* @__PURE__ */ v("button", {
180
+ }), /* @__PURE__ */ g("button", {
178
181
  type: "button",
179
- onClick: () => L(!1),
182
+ onClick: () => R(!1),
180
183
  className: "text-status-success-text hover:opacity-70",
181
- children: /* @__PURE__ */ v(g, { className: "size-4" })
184
+ children: /* @__PURE__ */ g(m, { className: "size-4" })
182
185
  })]
183
186
  }),
184
- C && /* @__PURE__ */ y("div", {
187
+ w && /* @__PURE__ */ _("div", {
185
188
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
186
- children: [/* @__PURE__ */ y("div", {
189
+ children: [/* @__PURE__ */ _("div", {
187
190
  className: "flex items-center justify-between p-4 border-b border-border-subtle bg-bg-sunken",
188
- children: [/* @__PURE__ */ v("h2", {
191
+ children: [/* @__PURE__ */ g("h2", {
189
192
  className: "font-semibold text-text-primary",
190
- children: _("billing.refunds.newRequest", "New Refund Request")
191
- }), /* @__PURE__ */ v("button", {
193
+ children: h("billing.refunds.newRequest", "New Refund Request")
194
+ }), /* @__PURE__ */ g("button", {
192
195
  type: "button",
193
196
  onClick: $,
194
197
  className: "p-1 rounded hover:bg-bg-sunken transition-colors",
195
- children: /* @__PURE__ */ v(g, { className: "size-4 text-text-secondary" })
198
+ children: /* @__PURE__ */ g(m, { className: "size-4 text-text-secondary" })
196
199
  })]
197
- }), /* @__PURE__ */ y("form", {
198
- onSubmit: me,
200
+ }), /* @__PURE__ */ _("form", {
201
+ onSubmit: ye,
199
202
  className: "p-4 space-y-4",
200
203
  children: [
201
- F && /* @__PURE__ */ v("div", {
204
+ F && /* @__PURE__ */ g("div", {
202
205
  className: "p-3 rounded-lg border border-status-error-border bg-status-error-bg/10",
203
- children: /* @__PURE__ */ v("p", {
206
+ children: /* @__PURE__ */ g("p", {
204
207
  className: "text-sm text-status-error-text",
205
208
  children: F
206
209
  })
207
210
  }),
208
- /* @__PURE__ */ y("div", { children: [
209
- /* @__PURE__ */ y("label", {
211
+ /* @__PURE__ */ _("div", { children: [
212
+ /* @__PURE__ */ _("label", {
210
213
  htmlFor: "txnId",
211
214
  className: "block text-sm font-medium text-text-primary mb-1",
212
- children: [_("billing.refunds.transactionId", "Transaction ID"), " *"]
215
+ children: [h("billing.refunds.transactionId", "Transaction ID"), " *"]
213
216
  }),
214
- /* @__PURE__ */ y("div", {
217
+ /* @__PURE__ */ _("div", {
215
218
  className: "relative",
216
- children: [/* @__PURE__ */ v("input", {
219
+ children: [/* @__PURE__ */ g("input", {
217
220
  id: "txnId",
218
221
  type: "text",
219
- value: T,
220
- onChange: (e) => ce(e.target.value),
222
+ value: E,
223
+ onChange: (e) => pe(e.target.value),
221
224
  placeholder: "Paste your transaction ID...",
222
225
  className: "w-full pl-3 pr-9 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm font-mono"
223
- }), /* @__PURE__ */ v("div", {
226
+ }), /* @__PURE__ */ g("div", {
224
227
  className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary",
225
- children: K ? /* @__PURE__ */ v(p, { className: "size-4 animate-spin" }) : /* @__PURE__ */ v(h, { className: "size-4" })
228
+ children: K ? /* @__PURE__ */ g(p, { className: "size-4 animate-spin" }) : /* @__PURE__ */ g(se, { className: "size-4" })
226
229
  })]
227
230
  }),
228
- D && /* @__PURE__ */ y("div", {
231
+ O && /* @__PURE__ */ _("div", {
229
232
  className: "mt-2 p-3 rounded-button border border-status-success-border bg-status-success-bg/10 text-sm space-y-0.5",
230
- children: [/* @__PURE__ */ y("div", {
233
+ children: [/* @__PURE__ */ _("div", {
231
234
  className: "flex items-center gap-2",
232
235
  children: [
233
- /* @__PURE__ */ v(d, { className: "size-3.5 text-status-success-text shrink-0" }),
234
- /* @__PURE__ */ v("span", {
236
+ /* @__PURE__ */ g(d, { className: "size-3.5 text-status-success-text shrink-0" }),
237
+ /* @__PURE__ */ g("span", {
235
238
  className: "font-medium text-text-primary",
236
- children: n(D.amount, D.currency)
239
+ children: n(O.amount, O.currency)
237
240
  }),
238
- /* @__PURE__ */ v("span", {
241
+ /* @__PURE__ */ g("span", {
239
242
  className: "text-text-secondary",
240
243
  children: "·"
241
244
  }),
242
- /* @__PURE__ */ v("span", {
245
+ /* @__PURE__ */ g("span", {
243
246
  className: "text-text-secondary",
244
- children: r(D.createdAt)
247
+ children: r(O.createdAt)
245
248
  }),
246
- D.stripePaymentId && /* @__PURE__ */ v("span", {
249
+ O.stripePaymentId && /* @__PURE__ */ g("span", {
247
250
  className: "text-xs text-text-secondary",
248
251
  children: "Stripe"
249
252
  }),
250
- D.razorpayPaymentId && /* @__PURE__ */ v("span", {
253
+ O.razorpayPaymentId && /* @__PURE__ */ g("span", {
251
254
  className: "text-xs text-text-secondary",
252
255
  children: "Razorpay"
253
256
  })
254
257
  ]
255
- }), D.description && /* @__PURE__ */ v("p", {
258
+ }), O.description && /* @__PURE__ */ g("p", {
256
259
  className: "text-xs text-text-secondary pl-5",
257
- children: D.description
260
+ children: O.description
258
261
  })]
259
262
  }),
260
- k && T.length > 0 && !K && /* @__PURE__ */ v("p", {
263
+ ue && E.length > 0 && !K && /* @__PURE__ */ g("p", {
261
264
  className: "mt-1 text-xs text-status-error-text",
262
- children: _("billing.refunds.txnNotFound", "Transaction not found in this billing account.")
265
+ children: h("billing.refunds.txnNotFound", "Transaction not found in this billing account.")
263
266
  }),
264
- !x.test(T.trim()) && T.length > 4 && /* @__PURE__ */ v("p", {
267
+ !y.test(E.trim()) && E.length > 4 && /* @__PURE__ */ g("p", {
265
268
  className: "mt-1 text-xs text-text-secondary",
266
- children: _("billing.refunds.txnIdHint", "Transaction IDs look like: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
269
+ children: h("billing.refunds.txnIdHint", "Transaction IDs look like: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
267
270
  })
268
271
  ] }),
269
- D && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
272
+ O && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
270
273
  htmlFor: "refundAmount",
271
274
  className: "block text-sm font-medium text-text-primary mb-1",
272
- children: [_("billing.refunds.amount", "Refund Amount"), " *"]
273
- }), /* @__PURE__ */ y("div", {
275
+ children: [h("billing.refunds.amount", "Refund Amount"), " *"]
276
+ }), /* @__PURE__ */ _("div", {
274
277
  className: "flex items-center gap-2",
275
278
  children: [
276
- /* @__PURE__ */ v("input", {
279
+ /* @__PURE__ */ g("input", {
277
280
  id: "refundAmount",
278
281
  type: "number",
279
282
  step: "0.01",
280
283
  min: "0.01",
281
- max: D.amount,
284
+ max: O.amount,
282
285
  value: N,
283
286
  onChange: (e) => P(e.target.value),
284
287
  required: !0,
285
288
  className: "w-40 px-3 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm",
286
289
  placeholder: "0.00"
287
290
  }),
288
- /* @__PURE__ */ v("span", {
291
+ /* @__PURE__ */ g("span", {
289
292
  className: "text-sm text-text-secondary",
290
- children: D.currency ?? U?.currency ?? "USD"
293
+ children: O.currency ?? W?.currency ?? "USD"
291
294
  }),
292
- /* @__PURE__ */ y("span", {
295
+ /* @__PURE__ */ _("span", {
293
296
  className: "text-xs text-text-secondary",
294
- children: ["max ", n(D.amount, D.currency)]
297
+ children: ["max ", n(O.amount, O.currency)]
295
298
  })
296
299
  ]
297
300
  })] }),
298
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
301
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
299
302
  htmlFor: "reason",
300
303
  className: "block text-sm font-medium text-text-primary mb-1",
301
- children: [_("billing.refunds.reason", "Reason for refund"), " *"]
302
- }), /* @__PURE__ */ v("textarea", {
304
+ children: [h("billing.refunds.reason", "Reason for refund"), " *"]
305
+ }), /* @__PURE__ */ g("textarea", {
303
306
  id: "reason",
304
307
  value: j,
305
308
  onChange: (e) => M(e.target.value),
306
309
  required: !0,
307
310
  rows: 3,
308
311
  className: "w-full px-3 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm resize-none",
309
- placeholder: _("billing.refunds.reasonPlaceholder", "Describe why you are requesting a refund...")
312
+ placeholder: h("billing.refunds.reasonPlaceholder", "Describe why you are requesting a refund...")
310
313
  })] }),
311
- /* @__PURE__ */ y("div", {
314
+ /* @__PURE__ */ _("div", {
312
315
  className: "flex items-center gap-3 pt-1",
313
- children: [/* @__PURE__ */ v("button", {
316
+ children: [/* @__PURE__ */ g("button", {
314
317
  type: "submit",
315
- disabled: Z || !D || !j.trim() || !N,
318
+ disabled: X || !O || !j.trim() || !N,
316
319
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
317
- children: Z ? _("billing.refunds.submitting", "Submitting...") : _("billing.refunds.submitRequest", "Submit Request")
318
- }), /* @__PURE__ */ v("button", {
320
+ children: X ? h("billing.refunds.submitting", "Submitting...") : h("billing.refunds.submitRequest", "Submit Request")
321
+ }), /* @__PURE__ */ g("button", {
319
322
  type: "button",
320
323
  onClick: $,
321
324
  className: "px-4 py-2 text-sm border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
322
- children: _("billing.common.cancel", "Cancel")
325
+ children: h("billing.common.cancel", "Cancel")
323
326
  })]
324
327
  })
325
328
  ]
326
329
  })]
327
330
  }),
328
- /* @__PURE__ */ y("div", {
331
+ /* @__PURE__ */ _("div", {
329
332
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
330
- children: [/* @__PURE__ */ v("div", {
333
+ children: [/* @__PURE__ */ g("div", {
331
334
  className: "p-4 border-b border-border-subtle bg-bg-sunken",
332
- children: /* @__PURE__ */ v("h2", {
335
+ children: /* @__PURE__ */ g("h2", {
333
336
  className: "font-semibold text-text-primary",
334
- children: _("billing.refunds.history", "Refund History")
337
+ children: h("billing.refunds.history", "Refund History")
335
338
  })
336
- }), z || de ? /* @__PURE__ */ v("div", {
339
+ }), B || ge ? /* @__PURE__ */ g("div", {
337
340
  className: "p-8 flex items-center justify-center",
338
- children: /* @__PURE__ */ v(p, { className: "size-5 animate-spin text-text-secondary" })
339
- }) : Y.length === 0 ? /* @__PURE__ */ v(re, {
341
+ children: /* @__PURE__ */ g(p, { className: "size-5 animate-spin text-text-secondary" })
342
+ }) : Y.length === 0 ? /* @__PURE__ */ g(le, {
340
343
  illustration: "empty-data",
341
- title: _("billing.refunds.noRefunds", "No refund requests yet"),
342
- description: _("billing.refunds.noRefundsHint", "If you have an issue with a payment, click \"Request Refund\" to get started.")
343
- }) : /* @__PURE__ */ v("ul", {
344
+ title: h("billing.refunds.noRefunds", "No refund requests yet"),
345
+ description: h("billing.refunds.noRefundsHint", "If you have an issue with a payment, click \"Request Refund\" to get started.")
346
+ }) : /* @__PURE__ */ g("ul", {
344
347
  className: "divide-y divide-border-subtle",
345
- children: Y.map((e) => /* @__PURE__ */ y("li", {
348
+ children: Y.map((e) => /* @__PURE__ */ _("li", {
346
349
  className: "flex items-start gap-4 p-4 hover:bg-bg-sunken transition-colors",
347
- children: [/* @__PURE__ */ y("div", {
350
+ children: [/* @__PURE__ */ _("div", {
348
351
  className: "flex-1 min-w-0",
349
352
  children: [
350
- /* @__PURE__ */ y("div", {
353
+ /* @__PURE__ */ _("div", {
351
354
  className: "flex items-center gap-2 flex-wrap",
352
355
  children: [
353
- /* @__PURE__ */ v("span", {
356
+ /* @__PURE__ */ g("span", {
354
357
  className: "text-sm font-medium text-text-primary",
355
358
  children: n(e.amount, e.currency)
356
359
  }),
357
- /* @__PURE__ */ v(ae, { status: e.status }),
358
- e.purchaseDetail && /* @__PURE__ */ v("span", {
360
+ /* @__PURE__ */ g(x, { status: e.status }),
361
+ e.purchaseDetail && /* @__PURE__ */ g("span", {
359
362
  className: "text-xs text-text-secondary truncate",
360
363
  children: e.purchaseDetail
361
364
  })
362
365
  ]
363
366
  }),
364
- e.reason && /* @__PURE__ */ v("p", {
367
+ e.reason && /* @__PURE__ */ g("p", {
365
368
  className: "text-xs text-text-secondary mt-1 line-clamp-2",
366
369
  children: e.reason
367
370
  }),
368
- e.errorMessage && e.status === o.Failed && /* @__PURE__ */ v("p", {
371
+ e.errorMessage && e.status === s.Failed && /* @__PURE__ */ g("p", {
369
372
  className: "text-xs text-status-error-text mt-1",
370
373
  children: e.errorMessage
371
374
  })
372
375
  ]
373
- }), /* @__PURE__ */ y("div", {
376
+ }), /* @__PURE__ */ _("div", {
374
377
  className: "text-right shrink-0",
375
- children: [/* @__PURE__ */ v("p", {
378
+ children: [/* @__PURE__ */ g("p", {
376
379
  className: "text-xs text-text-secondary",
377
380
  children: r(e.createdAt)
378
- }), e.processedAt && /* @__PURE__ */ y("p", {
381
+ }), e.processedAt && /* @__PURE__ */ _("p", {
379
382
  className: "text-xs text-text-secondary mt-0.5",
380
383
  children: ["Processed ", r(e.processedAt)]
381
384
  })]
@@ -383,22 +386,22 @@ var C = () => {
383
386
  }, e.id))
384
387
  })]
385
388
  }),
386
- /* @__PURE__ */ y("p", {
389
+ /* @__PURE__ */ _("p", {
387
390
  className: "text-xs text-text-secondary",
388
391
  children: [
389
- _("billing.refunds.footer", "Refund requests are reviewed by our team within 3–5 business days. For urgent issues, contact support."),
392
+ h("billing.refunds.footer", "Refund requests are reviewed by our team within 3–5 business days. For urgent issues, contact support."),
390
393
  " ",
391
- /* @__PURE__ */ v("button", {
394
+ /* @__PURE__ */ g("button", {
392
395
  type: "button",
393
- onClick: () => S("/transactions/" + V),
396
+ onClick: () => b("/transactions/" + H),
394
397
  className: "underline hover:no-underline",
395
- children: _("billing.refunds.viewTransactions", "View all transactions")
398
+ children: h("billing.refunds.viewTransactions", "View all transactions")
396
399
  })
397
400
  ]
398
401
  })
399
402
  ]
400
403
  });
401
404
  };
402
- export { C as UserRefundsPage };
405
+ export { S as UserRefundsPage };
403
406
 
404
407
  //# sourceMappingURL=UserRefundsPage.js.map