@burdenoff/microfe-billing 2026.624.2 → 2026.624.3

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.
@@ -13,280 +13,269 @@ import { useBillingNavigate as f } from "../../../hooks/useBillingNavigate.js";
13
13
  import { useTransactions as p } from "../hooks/useTransactions.js";
14
14
  import "../hooks/index.js";
15
15
  import { useEffect as m, useRef as h, useState as g } from "react";
16
- import { ArrowLeft as _, Calendar as v, CheckCircle as y, ChevronLeft as b, ChevronRight as x, CreditCard as S, Eye as C, FileText as w, Mail as T, MoreHorizontal as E, Wallet as D, X as O, XCircle as k } from "lucide-react";
17
- import { useParams as A } from "react-router-dom";
18
- import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
19
- import { useI18n as P } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
16
+ import { ArrowLeft as _, Calendar as v, CheckCircle as y, ChevronLeft as b, ChevronRight as x, CreditCard as S, Eye as C, FileText as w, Mail as T, MoreHorizontal as E, Wallet as D, XCircle as O } from "lucide-react";
17
+ import { useParams as k } from "react-router-dom";
18
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
19
+ import { useI18n as N } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
20
+ import { Dialog as P, DialogContent as F, DialogFooter as I, DialogHeader as L, DialogTitle as R, ResponsiveTable as z } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/billing/modules/billing/pages/TransactionsPage.tsx
21
- var F = {
22
+ var B = {
22
23
  payment: "Payment",
23
24
  refund: "Refund",
24
25
  adjustment: "Adjustment"
25
- }, I = (e) => F[e.toLowerCase()] ?? e, L = ({ transaction: e, onViewDetails: t, onViewInvoice: n, hasInvoiceUrl: r }) => {
26
+ }, V = (e) => B[e.toLowerCase()] ?? e, H = ({ transaction: e, onViewDetails: t, onViewInvoice: n, hasInvoiceUrl: r }) => {
26
27
  let [i, a] = g(!1), o = h(null);
27
28
  return m(() => {
28
29
  let e = (e) => {
29
30
  o.current && !o.current.contains(e.target) && a(!1);
30
31
  };
31
32
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
32
- }, []), /* @__PURE__ */ N("div", {
33
+ }, []), /* @__PURE__ */ M("div", {
33
34
  className: "relative overflow-visible",
34
35
  ref: o,
35
- children: [/* @__PURE__ */ M("button", {
36
+ children: [/* @__PURE__ */ j("button", {
36
37
  type: "button",
37
38
  onClick: () => a(!i),
38
39
  className: "p-1.5 rounded-md hover:bg-bg-sunken/50 transition-colors",
39
40
  "aria-label": "Transaction actions",
40
- children: /* @__PURE__ */ M(E, { className: "size-4 text-text-secondary" })
41
- }), i && /* @__PURE__ */ N("div", {
41
+ children: /* @__PURE__ */ j(E, { className: "size-4 text-text-secondary" })
42
+ }), i && /* @__PURE__ */ M("div", {
42
43
  className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] bg-popover border border-border-subtle rounded-md shadow-lg py-1",
43
- children: [/* @__PURE__ */ N("button", {
44
+ children: [/* @__PURE__ */ M("button", {
44
45
  type: "button",
45
46
  onClick: () => {
46
47
  t(), a(!1);
47
48
  },
48
49
  className: "w-full flex items-center gap-2 px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken/50 transition-colors whitespace-nowrap",
49
- children: [/* @__PURE__ */ M(C, { className: "size-4" }), "View Details"]
50
- }), e.type === "payment" && r && /* @__PURE__ */ N("button", {
50
+ children: [/* @__PURE__ */ j(C, { className: "size-4" }), "View Details"]
51
+ }), e.type === "payment" && r && /* @__PURE__ */ M("button", {
51
52
  type: "button",
52
53
  onClick: () => {
53
54
  n(), a(!1);
54
55
  },
55
56
  className: "w-full flex items-center gap-2 px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken/50 transition-colors whitespace-nowrap",
56
- children: [/* @__PURE__ */ M(w, { className: "size-4" }), "View Invoice"]
57
+ children: [/* @__PURE__ */ j(w, { className: "size-4" }), "View Invoice"]
57
58
  })]
58
59
  })]
59
60
  });
60
- }, R = ({ transaction: e, onClose: t, onViewInvoice: n, invoiceUrl: r, invoiceProvider: c }) => {
61
+ }, U = ({ transaction: e, onClose: t, onViewInvoice: n, invoiceUrl: r, invoiceProvider: c }) => {
61
62
  if (!e) return null;
62
- let l = e.metadata, f = l?.subtotal, p = l?.taxAmount, m = l?.taxRate, h = l?.taxType, g = l?.total, _ = l?.invoiceNumber, v = l?.invoiceStatus, y = e.type === "refund", b = l?.refundRecordId, x = l?.originalTransactionId, S = l?.creditNoteId, C = l?.creditNoteNumber, T = l?.creditNotePdfUrl, E = l?.reason, D = l?.purchaseType, k = l?.purchaseDetail, A = g && p !== void 0 && p > 0;
63
- return /* @__PURE__ */ N("div", {
64
- className: "fixed inset-0 z-50 flex items-center justify-center",
65
- children: [/* @__PURE__ */ M("div", {
66
- className: "absolute inset-0 bg-overlay-scrim",
67
- onClick: t
68
- }), /* @__PURE__ */ N("div", {
69
- className: "relative bg-bg-surface border border-border-subtle rounded-lg shadow-xl max-w-md w-full mx-4 max-h-[90vh] overflow-auto",
70
- role: "dialog",
71
- "aria-modal": "true",
72
- "aria-labelledby": "transaction-details-title",
63
+ let l = e.metadata, f = l?.subtotal, p = l?.taxAmount, m = l?.taxRate, h = l?.taxType, g = l?.total, _ = l?.invoiceNumber, v = l?.invoiceStatus, y = e.type === "refund", b = l?.refundRecordId, x = l?.originalTransactionId, S = l?.creditNoteId, C = l?.creditNoteNumber, T = l?.creditNotePdfUrl, E = l?.reason, D = l?.purchaseType, O = l?.purchaseDetail, k = g && p !== void 0 && p > 0;
64
+ return /* @__PURE__ */ j(P, {
65
+ open: !!e,
66
+ onOpenChange: (e) => !e && t(),
67
+ children: /* @__PURE__ */ M(F, {
68
+ className: "max-w-md max-h-[90vh] overflow-auto p-0",
73
69
  children: [
74
- /* @__PURE__ */ N("div", {
75
- className: "flex items-center justify-between p-4 border-b border-border-subtle",
76
- children: [/* @__PURE__ */ M("h2", {
77
- id: "transaction-details-title",
70
+ /* @__PURE__ */ j(L, {
71
+ className: "p-4 border-b border-border-subtle",
72
+ children: /* @__PURE__ */ j(R, {
78
73
  className: "text-lg font-semibold",
79
74
  children: "Transaction Details"
80
- }), /* @__PURE__ */ M("button", {
81
- type: "button",
82
- onClick: t,
83
- className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
84
- "aria-label": "Close transaction details",
85
- children: /* @__PURE__ */ M(O, { className: "size-5" })
86
- })]
75
+ })
87
76
  }),
88
- /* @__PURE__ */ N("div", {
77
+ /* @__PURE__ */ M("div", {
89
78
  className: "p-4 space-y-4",
90
79
  children: [
91
- /* @__PURE__ */ N("div", {
80
+ /* @__PURE__ */ M("div", {
92
81
  className: "grid grid-cols-2 gap-4",
93
- children: [/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
82
+ children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
94
83
  className: "text-xs text-text-secondary mb-1",
95
84
  children: "Transaction ID"
96
- }), /* @__PURE__ */ M("p", {
85
+ }), /* @__PURE__ */ j("p", {
97
86
  className: "text-sm font-mono break-all",
98
87
  children: e.id
99
- })] }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
88
+ })] }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
100
89
  className: "text-xs text-text-secondary mb-1",
101
90
  children: "Type"
102
- }), /* @__PURE__ */ M("p", {
91
+ }), /* @__PURE__ */ j("p", {
103
92
  className: "text-sm capitalize",
104
- children: I(e.type)
93
+ children: V(e.type)
105
94
  })] })]
106
95
  }),
107
- /* @__PURE__ */ M("div", {
96
+ /* @__PURE__ */ j("div", {
108
97
  className: "space-y-2",
109
- children: A ? /* @__PURE__ */ N(j, { children: [
110
- /* @__PURE__ */ N("div", {
98
+ children: k ? /* @__PURE__ */ M(A, { children: [
99
+ /* @__PURE__ */ M("div", {
111
100
  className: "flex justify-between text-sm",
112
- children: [/* @__PURE__ */ M("span", {
101
+ children: [/* @__PURE__ */ j("span", {
113
102
  className: "text-text-secondary",
114
103
  children: "Subtotal"
115
- }), /* @__PURE__ */ M("span", { children: i(f || e.amount, e.currency) })]
104
+ }), /* @__PURE__ */ j("span", { children: i(f || e.amount, e.currency) })]
116
105
  }),
117
- p > 0 && /* @__PURE__ */ N("div", {
106
+ p > 0 && /* @__PURE__ */ M("div", {
118
107
  className: "flex justify-between text-sm",
119
- children: [/* @__PURE__ */ N("span", {
108
+ children: [/* @__PURE__ */ M("span", {
120
109
  className: "text-text-secondary",
121
110
  children: [
122
111
  h || "Tax",
123
112
  " ",
124
113
  m ? `(${(m * 100).toFixed(0)}%)` : ""
125
114
  ]
126
- }), /* @__PURE__ */ M("span", { children: i(p, e.currency) })]
115
+ }), /* @__PURE__ */ j("span", { children: i(p, e.currency) })]
127
116
  }),
128
- /* @__PURE__ */ N("div", {
117
+ /* @__PURE__ */ M("div", {
129
118
  className: "flex justify-between text-sm font-semibold border-t border-border-subtle pt-2",
130
- children: [/* @__PURE__ */ M("span", { children: "Total" }), /* @__PURE__ */ N("span", {
119
+ children: [/* @__PURE__ */ j("span", { children: "Total" }), /* @__PURE__ */ M("span", {
131
120
  className: e.type === "refund" ? "text-status-error-text" : "",
132
121
  children: [e.type === "refund" ? "-" : "", i(g, e.currency)]
133
122
  })]
134
123
  })
135
- ] }) : /* @__PURE__ */ N("div", {
124
+ ] }) : /* @__PURE__ */ M("div", {
136
125
  className: "grid grid-cols-2 gap-4",
137
- children: [/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
126
+ children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
138
127
  className: "text-xs text-text-secondary mb-1",
139
128
  children: "Amount"
140
- }), /* @__PURE__ */ N("p", {
129
+ }), /* @__PURE__ */ M("p", {
141
130
  className: `text-sm font-medium ${e.type === "refund" ? "text-status-error-text" : ""}`,
142
131
  children: [e.type === "refund" ? "-" : "", i(g || e.amount, e.currency)]
143
- })] }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
132
+ })] }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
144
133
  className: "text-xs text-text-secondary mb-1",
145
134
  children: "Status"
146
- }), /* @__PURE__ */ M("span", {
135
+ }), /* @__PURE__ */ j("span", {
147
136
  className: `px-2 py-0.5 text-xs font-medium rounded ${o(s(e.status))}`,
148
137
  children: e.status
149
138
  })] })]
150
139
  })
151
140
  }),
152
- A && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
141
+ k && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
153
142
  className: "text-xs text-text-secondary mb-1",
154
143
  children: "Status"
155
- }), /* @__PURE__ */ M("span", {
144
+ }), /* @__PURE__ */ j("span", {
156
145
  className: `px-2 py-0.5 text-xs font-medium rounded ${o(s(e.status))}`,
157
146
  children: e.status
158
147
  })] }),
159
- /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
148
+ /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
160
149
  className: "text-xs text-text-secondary mb-1",
161
150
  children: "Date & Time"
162
- }), /* @__PURE__ */ M("p", {
151
+ }), /* @__PURE__ */ j("p", {
163
152
  className: "text-sm",
164
153
  children: a(e.createdAt)
165
154
  })] }),
166
- e.description && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
155
+ e.description && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
167
156
  className: "text-xs text-text-secondary mb-1",
168
157
  children: "Description"
169
- }), /* @__PURE__ */ M("p", {
158
+ }), /* @__PURE__ */ j("p", {
170
159
  className: "text-sm",
171
160
  children: e.description
172
161
  })] }),
173
- _ && /* @__PURE__ */ N("div", {
162
+ _ && /* @__PURE__ */ M("div", {
174
163
  className: "p-3 bg-bg-sunken/50 rounded-lg space-y-2",
175
164
  children: [
176
- /* @__PURE__ */ N("div", {
165
+ /* @__PURE__ */ M("div", {
177
166
  className: "flex items-center justify-between",
178
- children: [/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
167
+ children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
179
168
  className: "text-xs text-text-secondary mb-1",
180
169
  children: "Invoice"
181
- }), /* @__PURE__ */ M("p", {
170
+ }), /* @__PURE__ */ j("p", {
182
171
  className: "text-sm font-mono",
183
172
  children: _
184
- })] }), v && /* @__PURE__ */ M("span", {
173
+ })] }), v && /* @__PURE__ */ j("span", {
185
174
  className: `px-2 py-0.5 text-xs font-medium rounded ${v === "PAID" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-warning-bg-subtle text-status-warning-text"}`,
186
175
  children: v
187
176
  })]
188
177
  }),
189
- c && /* @__PURE__ */ N("p", {
178
+ c && /* @__PURE__ */ M("p", {
190
179
  className: "text-xs text-text-secondary",
191
180
  children: ["Provider: ", c]
192
181
  }),
193
- r && n && /* @__PURE__ */ N("button", {
182
+ r && n && /* @__PURE__ */ M("button", {
194
183
  type: "button",
195
184
  onClick: () => n(e),
196
185
  className: "flex items-center gap-2 text-sm text-primary hover:underline",
197
- children: [/* @__PURE__ */ M(w, { className: "size-4" }), "View Invoice"]
186
+ children: [/* @__PURE__ */ j(w, { className: "size-4" }), "View Invoice"]
198
187
  })
199
188
  ]
200
189
  }),
201
- !_ && r && n && /* @__PURE__ */ M("div", {
190
+ !_ && r && n && /* @__PURE__ */ j("div", {
202
191
  className: "p-3 bg-bg-sunken/50 rounded-lg",
203
- children: /* @__PURE__ */ N("button", {
192
+ children: /* @__PURE__ */ M("button", {
204
193
  type: "button",
205
194
  onClick: () => n(e),
206
195
  className: "flex items-center gap-2 text-sm text-primary hover:underline",
207
196
  children: [
208
- /* @__PURE__ */ M(w, { className: "size-4" }),
197
+ /* @__PURE__ */ j(w, { className: "size-4" }),
209
198
  "View Invoice ",
210
199
  c && `(${c})`
211
200
  ]
212
201
  })
213
202
  }),
214
- y && (S || E || D) && /* @__PURE__ */ N("div", {
203
+ y && (S || E || D) && /* @__PURE__ */ M("div", {
215
204
  className: "p-3 bg-status-error-bg-subtle/20 border border-border-subtle rounded-lg space-y-3",
216
205
  children: [
217
- /* @__PURE__ */ N("div", {
206
+ /* @__PURE__ */ M("div", {
218
207
  className: "flex items-center gap-2",
219
- children: [/* @__PURE__ */ M("div", { className: "size-1.5 rounded-full bg-status-error-bg" }), /* @__PURE__ */ M("p", {
208
+ children: [/* @__PURE__ */ j("div", { className: "size-1.5 rounded-full bg-status-error-bg" }), /* @__PURE__ */ j("p", {
220
209
  className: "text-sm font-semibold text-status-error-text",
221
210
  children: "Refund Information"
222
211
  })]
223
212
  }),
224
- C && /* @__PURE__ */ N("div", {
213
+ C && /* @__PURE__ */ M("div", {
225
214
  className: "space-y-2",
226
- children: [/* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
215
+ children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
227
216
  className: "text-xs text-status-error-text mb-1",
228
217
  children: "Credit Note"
229
- }), /* @__PURE__ */ M("p", {
218
+ }), /* @__PURE__ */ j("p", {
230
219
  className: "text-sm font-mono text-status-error-text",
231
220
  children: C
232
- })] }), T && /* @__PURE__ */ N("button", {
221
+ })] }), T && /* @__PURE__ */ M("button", {
233
222
  type: "button",
234
223
  onClick: () => {
235
224
  u("light"), d(T);
236
225
  },
237
226
  className: "flex items-center gap-2 text-sm text-status-error-text hover:underline",
238
- children: [/* @__PURE__ */ M(w, { className: "size-4" }), "Download Credit Note PDF"]
227
+ children: [/* @__PURE__ */ j(w, { className: "size-4" }), "Download Credit Note PDF"]
239
228
  })]
240
229
  }),
241
- D && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
230
+ D && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
242
231
  className: "text-xs text-status-error-text mb-1",
243
232
  children: "Purchase Type"
244
- }), /* @__PURE__ */ N("p", {
233
+ }), /* @__PURE__ */ M("p", {
245
234
  className: "text-sm text-status-error-text",
246
- children: [D, k && ` - ${k}`]
235
+ children: [D, O && ` - ${O}`]
247
236
  })] }),
248
- E && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
237
+ E && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
249
238
  className: "text-xs text-status-error-text mb-1",
250
239
  children: "Reason"
251
- }), /* @__PURE__ */ M("p", {
240
+ }), /* @__PURE__ */ j("p", {
252
241
  className: "text-sm text-status-error-text",
253
242
  children: E
254
243
  })] }),
255
- x && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
244
+ x && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
256
245
  className: "text-xs text-status-error-text mb-1",
257
246
  children: "Original Transaction"
258
- }), /* @__PURE__ */ M("p", {
247
+ }), /* @__PURE__ */ j("p", {
259
248
  className: "text-sm font-mono text-status-error-text break-all",
260
249
  children: x
261
250
  })] }),
262
- b && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
251
+ b && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
263
252
  className: "text-xs text-status-error-text mb-1",
264
253
  children: "Refund Record ID"
265
- }), /* @__PURE__ */ M("p", {
254
+ }), /* @__PURE__ */ j("p", {
266
255
  className: "text-sm font-mono text-status-error-text break-all",
267
256
  children: b
268
257
  })] })
269
258
  ]
270
259
  }),
271
- e.stripePaymentId && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
260
+ e.stripePaymentId && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
272
261
  className: "text-xs text-text-secondary mb-1",
273
262
  children: "Stripe Payment ID"
274
- }), /* @__PURE__ */ M("p", {
263
+ }), /* @__PURE__ */ j("p", {
275
264
  className: "text-sm font-mono break-all",
276
265
  children: e.stripePaymentId
277
266
  })] }),
278
- e.razorpayPaymentId && /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
267
+ e.razorpayPaymentId && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
279
268
  className: "text-xs text-text-secondary mb-1",
280
269
  children: "Razorpay Payment ID"
281
- }), /* @__PURE__ */ M("p", {
270
+ }), /* @__PURE__ */ j("p", {
282
271
  className: "text-sm font-mono break-all",
283
272
  children: e.razorpayPaymentId
284
273
  })] })
285
274
  ]
286
275
  }),
287
- /* @__PURE__ */ M("div", {
276
+ /* @__PURE__ */ j(I, {
288
277
  className: "p-4 border-t border-border-subtle",
289
- children: /* @__PURE__ */ M("button", {
278
+ children: /* @__PURE__ */ j("button", {
290
279
  type: "button",
291
280
  onClick: t,
292
281
  className: "w-full py-2 px-4 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors",
@@ -294,35 +283,35 @@ var F = {
294
283
  })
295
284
  })
296
285
  ]
297
- })]
286
+ })
298
287
  });
299
- }, z = () => {
300
- let { t: m } = P(), h = (e, t) => {
288
+ }, W = () => {
289
+ let { t: m } = N(), h = (e, t) => {
301
290
  let n = m(e);
302
291
  return n === e ? t : n;
303
- }, { billingAccountId: C } = A(), E = l(), O = f(), { billingAccount: j, transactions: z, pagination: B, isLoading: V, error: H, refetch: U, goToNextPage: W, goToPreviousPage: G } = p(C), [K, q] = g("all"), [J, Y] = g(null), X = (e) => {
292
+ }, { billingAccountId: C } = k(), E = l(), A = f(), { billingAccount: P, transactions: F, pagination: I, isLoading: L, error: R, refetch: W, goToNextPage: G, goToPreviousPage: K } = p(C), [q, J] = g("all"), [Y, X] = g(null), Z = (e) => {
304
293
  let t = e.metadata;
305
294
  return t?.zohoBooksInvoiceUrl ? t.zohoBooksInvoiceUrl : t?.invoiceUrl ? t.invoiceUrl : t?.invoicePdf ? t.invoicePdf : null;
306
- }, Z = (e) => {
295
+ }, ee = (e) => {
307
296
  let t = e.metadata;
308
297
  return t?.total && typeof t.total == "number" ? t.total : e.amount;
309
- }, ee = (e) => {
298
+ }, te = (e) => {
310
299
  let t = e.metadata;
311
300
  return t?.zohoBooksInvoiceUrl ? "Zoho Books" : t?.invoiceUrl || t?.invoicePdf ? "Stripe" : null;
312
301
  }, Q = (e) => {
313
- let t = X(e);
302
+ let t = Z(e);
314
303
  t && (u("light"), d(t));
315
304
  };
316
- if (!E.canViewPayments) return /* @__PURE__ */ M(e, { message: h("billing.transactions.noPermission", "You don't have permission to view transaction history.") });
317
- if (!C) return /* @__PURE__ */ M("div", {
305
+ if (!E.canViewPayments) return /* @__PURE__ */ j(e, { message: h("billing.transactions.noPermission", "You don't have permission to view transaction history.") });
306
+ if (!C) return /* @__PURE__ */ j("div", {
318
307
  className: "p-6",
319
- children: /* @__PURE__ */ M(n, {
320
- icon: /* @__PURE__ */ M("svg", {
308
+ children: /* @__PURE__ */ j(n, {
309
+ icon: /* @__PURE__ */ j("svg", {
321
310
  className: "size-6 text-text-secondary",
322
311
  fill: "none",
323
312
  viewBox: "0 0 24 24",
324
313
  stroke: "currentColor",
325
- children: /* @__PURE__ */ M("path", {
314
+ children: /* @__PURE__ */ j("path", {
326
315
  strokeLinecap: "round",
327
316
  strokeLinejoin: "round",
328
317
  strokeWidth: 2,
@@ -333,19 +322,19 @@ var F = {
333
322
  description: h("billing.transactions.noAccountSelectedDesc", "Please select a billing account from the overview page to view transactions.")
334
323
  })
335
324
  });
336
- if (H && c(H)) return /* @__PURE__ */ M("div", {
325
+ if (R && c(R)) return /* @__PURE__ */ j("div", {
337
326
  className: "p-6",
338
- children: /* @__PURE__ */ M(r, {
327
+ children: /* @__PURE__ */ j(r, {
339
328
  title: h("billing.transactions.serverUnavailable", "Server Unavailable"),
340
329
  message: h("billing.transactions.serverUnavailableMessage", "Unable to load transactions. The server might be down or experiencing issues."),
341
- onRetry: () => U(),
330
+ onRetry: () => W(),
342
331
  showRetry: !0
343
332
  })
344
333
  });
345
- let $ = K === "all" ? z : z.filter((e) => e.type === K);
346
- return V ? /* @__PURE__ */ N("div", {
334
+ let $ = q === "all" ? F : F.filter((e) => e.type === q);
335
+ return L ? /* @__PURE__ */ M("div", {
347
336
  className: "space-y-6 p-6",
348
- children: [/* @__PURE__ */ M("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ M("div", {
337
+ children: [/* @__PURE__ */ j("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ j("div", {
349
338
  className: "space-y-2",
350
339
  children: [
351
340
  1,
@@ -353,113 +342,113 @@ var F = {
353
342
  3,
354
343
  4,
355
344
  5
356
- ].map((e) => /* @__PURE__ */ M("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
345
+ ].map((e) => /* @__PURE__ */ j("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
357
346
  })]
358
- }) : /* @__PURE__ */ N("div", {
347
+ }) : /* @__PURE__ */ M("div", {
359
348
  className: "space-y-6 p-6",
360
349
  children: [
361
- /* @__PURE__ */ N("button", {
350
+ /* @__PURE__ */ M("button", {
362
351
  type: "button",
363
- onClick: () => O("/overview"),
352
+ onClick: () => A("/overview"),
364
353
  className: "inline-flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary transition-colors",
365
- children: [/* @__PURE__ */ M(_, { className: "size-4" }), "Back to Overview"]
354
+ children: [/* @__PURE__ */ j(_, { className: "size-4" }), "Back to Overview"]
366
355
  }),
367
- /* @__PURE__ */ M(t, {
356
+ /* @__PURE__ */ j(t, {
368
357
  title: h("billing.transactions.title", "Transaction History"),
369
- description: j ? `Transactions for ${j.name}` : "View all your billing transactions"
358
+ description: P ? `Transactions for ${P.name}` : "View all your billing transactions"
370
359
  }),
371
- j && /* @__PURE__ */ M("div", {
360
+ P && /* @__PURE__ */ j("div", {
372
361
  className: "border border-border-subtle rounded-lg p-4 bg-bg-surface",
373
- children: /* @__PURE__ */ N("div", {
362
+ children: /* @__PURE__ */ M("div", {
374
363
  className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",
375
364
  children: [
376
- /* @__PURE__ */ N("div", {
365
+ /* @__PURE__ */ M("div", {
377
366
  className: "flex items-start gap-2",
378
- children: [/* @__PURE__ */ M(S, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ N("div", { children: [
379
- /* @__PURE__ */ M("p", {
367
+ children: [/* @__PURE__ */ j(S, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ M("div", { children: [
368
+ /* @__PURE__ */ j("p", {
380
369
  className: "text-xs text-text-secondary mb-0.5",
381
370
  children: "Account"
382
371
  }),
383
- /* @__PURE__ */ M("p", {
372
+ /* @__PURE__ */ j("p", {
384
373
  className: "text-sm font-medium",
385
- children: j.name
374
+ children: P.name
386
375
  }),
387
- j.isActive ? /* @__PURE__ */ N("span", {
376
+ P.isActive ? /* @__PURE__ */ M("span", {
388
377
  className: "inline-flex items-center gap-1 mt-1 px-1.5 py-0.5 text-xs font-medium rounded bg-status-success-bg-subtle text-status-success-text",
389
- children: [/* @__PURE__ */ M(y, { className: "size-3" }), "Active"]
390
- }) : /* @__PURE__ */ N("span", {
378
+ children: [/* @__PURE__ */ j(y, { className: "size-3" }), "Active"]
379
+ }) : /* @__PURE__ */ M("span", {
391
380
  className: "inline-flex items-center gap-1 mt-1 px-1.5 py-0.5 text-xs font-medium rounded bg-status-error-bg-subtle text-status-error-text",
392
- children: [/* @__PURE__ */ M(k, { className: "size-3" }), "Inactive"]
381
+ children: [/* @__PURE__ */ j(O, { className: "size-3" }), "Inactive"]
393
382
  })
394
383
  ] })]
395
384
  }),
396
- /* @__PURE__ */ N("div", {
385
+ /* @__PURE__ */ M("div", {
397
386
  className: "flex items-start gap-2",
398
- children: [/* @__PURE__ */ M(T, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
387
+ children: [/* @__PURE__ */ j(T, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
399
388
  className: "text-xs text-text-secondary mb-0.5",
400
389
  children: "Email"
401
- }), /* @__PURE__ */ M("p", {
390
+ }), /* @__PURE__ */ j("p", {
402
391
  className: "text-sm font-medium break-all",
403
- children: j.billingEmail || j.email
392
+ children: P.billingEmail || P.email
404
393
  })] })]
405
394
  }),
406
- /* @__PURE__ */ N("div", {
395
+ /* @__PURE__ */ M("div", {
407
396
  className: "flex items-start gap-2",
408
- children: [/* @__PURE__ */ M(D, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
397
+ children: [/* @__PURE__ */ j(D, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
409
398
  className: "text-xs text-text-secondary mb-0.5",
410
399
  children: "Credits Balance"
411
- }), /* @__PURE__ */ N("p", {
400
+ }), /* @__PURE__ */ M("p", {
412
401
  className: "text-sm font-semibold text-text-primary",
413
- children: [(j.creditAmount || 0).toLocaleString(), " Credits"]
402
+ children: [(P.creditAmount || 0).toLocaleString(), " Credits"]
414
403
  })] })]
415
404
  }),
416
- /* @__PURE__ */ N("div", {
405
+ /* @__PURE__ */ M("div", {
417
406
  className: "flex items-start gap-2",
418
- children: [/* @__PURE__ */ M(w, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
407
+ children: [/* @__PURE__ */ j(w, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
419
408
  className: "text-xs text-text-secondary mb-0.5",
420
409
  children: "Tax ID"
421
- }), /* @__PURE__ */ M("p", {
410
+ }), /* @__PURE__ */ j("p", {
422
411
  className: "text-sm font-medium",
423
- children: j.taxId || "-"
412
+ children: P.taxId || "-"
424
413
  })] })]
425
414
  }),
426
- /* @__PURE__ */ N("div", {
415
+ /* @__PURE__ */ M("div", {
427
416
  className: "flex items-start gap-2",
428
- children: [/* @__PURE__ */ M(v, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
417
+ children: [/* @__PURE__ */ j(v, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
429
418
  className: "text-xs text-text-secondary mb-0.5",
430
419
  children: "Member Since"
431
- }), /* @__PURE__ */ M("p", {
420
+ }), /* @__PURE__ */ j("p", {
432
421
  className: "text-sm font-medium",
433
- children: j.createdAt ? a(j.createdAt) : "-"
422
+ children: P.createdAt ? a(P.createdAt) : "-"
434
423
  })] })]
435
424
  })
436
425
  ]
437
426
  })
438
427
  }),
439
- /* @__PURE__ */ M("div", {
428
+ /* @__PURE__ */ j("div", {
440
429
  className: "flex items-center gap-4",
441
- children: /* @__PURE__ */ M("div", {
430
+ children: /* @__PURE__ */ j("div", {
442
431
  className: "inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken/50",
443
432
  children: [
444
433
  "all",
445
434
  "payment",
446
435
  "refund",
447
436
  "adjustment"
448
- ].map((e) => /* @__PURE__ */ M("button", {
437
+ ].map((e) => /* @__PURE__ */ j("button", {
449
438
  type: "button",
450
- onClick: () => q(e),
451
- className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${K === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
452
- children: e === "all" ? "All" : F[e]
439
+ onClick: () => J(e),
440
+ className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${q === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
441
+ children: e === "all" ? "All" : B[e]
453
442
  }, e))
454
443
  })
455
444
  }),
456
- $.length === 0 ? /* @__PURE__ */ M(n, {
457
- icon: /* @__PURE__ */ M("svg", {
445
+ $.length === 0 ? /* @__PURE__ */ j(n, {
446
+ icon: /* @__PURE__ */ j("svg", {
458
447
  className: "size-6 text-text-secondary",
459
448
  fill: "none",
460
449
  viewBox: "0 0 24 24",
461
450
  stroke: "currentColor",
462
- children: /* @__PURE__ */ M("path", {
451
+ children: /* @__PURE__ */ j("path", {
463
452
  strokeLinecap: "round",
464
453
  strokeLinejoin: "round",
465
454
  strokeWidth: 2,
@@ -467,133 +456,124 @@ var F = {
467
456
  })
468
457
  }),
469
458
  title: h("billing.transactions.noTransactionsFound", "No transactions found"),
470
- description: K === "all" ? h("billing.transactions.noTransactionsYet", "Your transaction history will appear here.") : h("billing.transactions.noTransactionsFiltered", "No transactions match your filter.")
471
- }) : /* @__PURE__ */ M("div", {
459
+ description: q === "all" ? h("billing.transactions.noTransactionsYet", "Your transaction history will appear here.") : h("billing.transactions.noTransactionsFiltered", "No transactions match your filter.")
460
+ }) : /* @__PURE__ */ j("div", {
472
461
  className: "border border-border-subtle rounded-lg overflow-visible",
473
- children: /* @__PURE__ */ N("table", {
474
- className: "w-full",
475
- children: [/* @__PURE__ */ M("thead", {
476
- className: "bg-bg-sunken/50",
477
- children: /* @__PURE__ */ N("tr", { children: [
478
- /* @__PURE__ */ M("th", {
479
- className: "text-left text-sm font-medium text-text-secondary px-3 py-2 whitespace-nowrap",
480
- children: "Date"
481
- }),
482
- /* @__PURE__ */ M("th", {
483
- className: "text-left text-sm font-medium text-text-secondary px-3 py-2 whitespace-nowrap",
484
- children: "Type"
485
- }),
486
- /* @__PURE__ */ M("th", {
487
- className: "text-left text-sm font-medium text-text-secondary px-3 py-2 whitespace-nowrap",
488
- children: "Description"
489
- }),
490
- /* @__PURE__ */ M("th", {
491
- className: "text-right text-sm font-medium text-text-secondary px-3 py-2 whitespace-nowrap",
492
- children: "Amount"
493
- }),
494
- /* @__PURE__ */ M("th", {
495
- className: "text-center text-sm font-medium text-text-secondary px-3 py-2 whitespace-nowrap",
496
- children: "Status"
497
- }),
498
- /* @__PURE__ */ M("th", { className: "p-2 w-10" })
499
- ] })
500
- }), /* @__PURE__ */ M("tbody", {
501
- className: "divide-y divide-border",
502
- children: $.map((e) => /* @__PURE__ */ N("tr", {
503
- className: "hover:bg-bg-sunken/30 transition-colors",
504
- children: [
505
- /* @__PURE__ */ M("td", {
506
- className: "px-3 py-2 text-sm text-text-primary whitespace-nowrap",
507
- children: a(e.createdAt)
508
- }),
509
- /* @__PURE__ */ M("td", {
510
- className: "px-3 py-2 text-sm text-text-primary capitalize whitespace-nowrap",
511
- children: I(e.type)
512
- }),
513
- /* @__PURE__ */ M("td", {
514
- className: "px-3 py-2 text-sm text-text-secondary",
515
- children: e.description ?? "-"
516
- }),
517
- /* @__PURE__ */ N("td", {
518
- className: `px-3 py-2 text-sm text-right font-medium whitespace-nowrap ${e.type === "refund" ? "text-status-error-text" : "text-text-primary"}`,
519
- children: [e.type === "refund" ? "-" : "", i(Z(e), e.currency)]
520
- }),
521
- /* @__PURE__ */ M("td", {
522
- className: "px-3 py-2 text-center whitespace-nowrap",
523
- children: /* @__PURE__ */ M("span", {
524
- className: `px-1.5 py-0.5 text-xs font-medium rounded ${o(s(e.status))}`,
525
- children: e.status
526
- })
527
- }),
528
- /* @__PURE__ */ M("td", {
529
- className: "p-2 text-center",
530
- children: /* @__PURE__ */ M(L, {
531
- transaction: e,
532
- onViewDetails: () => Y(e),
533
- onViewInvoice: () => Q(e),
534
- hasInvoiceUrl: !!X(e)
535
- })
536
- })
537
- ]
538
- }, e.id))
539
- })]
462
+ children: /* @__PURE__ */ j(z, {
463
+ columns: [
464
+ {
465
+ key: "date",
466
+ header: "Date",
467
+ priority: "primary",
468
+ cellClassName: "whitespace-nowrap",
469
+ cell: (e) => /* @__PURE__ */ j("span", {
470
+ className: "text-sm text-text-primary",
471
+ children: a(e.createdAt)
472
+ })
473
+ },
474
+ {
475
+ key: "type",
476
+ header: "Type",
477
+ cellClassName: "whitespace-nowrap",
478
+ cell: (e) => /* @__PURE__ */ j("span", {
479
+ className: "text-sm text-text-primary capitalize",
480
+ children: V(e.type)
481
+ })
482
+ },
483
+ {
484
+ key: "description",
485
+ header: "Description",
486
+ cell: (e) => /* @__PURE__ */ j("span", {
487
+ className: "text-sm text-text-secondary",
488
+ children: e.description ?? "-"
489
+ })
490
+ },
491
+ {
492
+ key: "amount",
493
+ header: "Amount",
494
+ headerClassName: "text-right",
495
+ cellClassName: "text-right whitespace-nowrap",
496
+ cell: (e) => /* @__PURE__ */ M("span", {
497
+ className: `text-sm font-medium tabular-nums ${e.type === "refund" ? "text-status-error-text" : "text-text-primary"}`,
498
+ children: [e.type === "refund" ? "-" : "", i(ee(e), e.currency)]
499
+ })
500
+ },
501
+ {
502
+ key: "status",
503
+ header: "Status",
504
+ headerClassName: "text-center",
505
+ cellClassName: "text-center whitespace-nowrap",
506
+ cell: (e) => /* @__PURE__ */ j("span", {
507
+ className: `px-1.5 py-0.5 text-xs font-medium rounded ${o(s(e.status))}`,
508
+ children: e.status
509
+ })
510
+ }
511
+ ],
512
+ data: $,
513
+ rowKey: (e) => e.id,
514
+ rowActions: (e) => /* @__PURE__ */ j(H, {
515
+ transaction: e,
516
+ onViewDetails: () => X(e),
517
+ onViewInvoice: () => Q(e),
518
+ hasInvoiceUrl: !!Z(e)
519
+ })
540
520
  })
541
521
  }),
542
- B.totalCount > 0 && /* @__PURE__ */ N("div", {
522
+ I.totalCount > 0 && /* @__PURE__ */ M("div", {
543
523
  className: "flex items-center justify-between border-t border-border-subtle pt-4",
544
- children: [/* @__PURE__ */ N("p", {
524
+ children: [/* @__PURE__ */ M("p", {
545
525
  className: "text-sm text-text-secondary",
546
526
  children: [
547
527
  "Showing ",
548
- B.page * B.pageSize + 1,
528
+ I.page * I.pageSize + 1,
549
529
  " to",
550
530
  " ",
551
- Math.min((B.page + 1) * B.pageSize, B.totalCount),
531
+ Math.min((I.page + 1) * I.pageSize, I.totalCount),
552
532
  " of",
553
533
  " ",
554
- B.totalCount,
534
+ I.totalCount,
555
535
  " transactions"
556
536
  ]
557
- }), /* @__PURE__ */ N("div", {
537
+ }), /* @__PURE__ */ M("div", {
558
538
  className: "flex items-center gap-2",
559
539
  children: [
560
- /* @__PURE__ */ N("button", {
540
+ /* @__PURE__ */ M("button", {
561
541
  type: "button",
562
- onClick: G,
563
- disabled: !B.hasPrevious,
542
+ onClick: K,
543
+ disabled: !I.hasPrevious,
564
544
  className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
565
- children: [/* @__PURE__ */ M(b, { className: "size-4" }), "Previous"]
545
+ children: [/* @__PURE__ */ j(b, { className: "size-4" }), "Previous"]
566
546
  }),
567
- /* @__PURE__ */ N("span", {
547
+ /* @__PURE__ */ M("span", {
568
548
  className: "text-sm text-text-secondary px-2",
569
549
  children: [
570
550
  "Page ",
571
- B.page + 1,
551
+ I.page + 1,
572
552
  " of ",
573
- Math.ceil(B.totalCount / B.pageSize)
553
+ Math.ceil(I.totalCount / I.pageSize)
574
554
  ]
575
555
  }),
576
- /* @__PURE__ */ N("button", {
556
+ /* @__PURE__ */ M("button", {
577
557
  type: "button",
578
- onClick: W,
579
- disabled: !B.hasMore,
558
+ onClick: G,
559
+ disabled: !I.hasMore,
580
560
  className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
581
- children: ["Next", /* @__PURE__ */ M(x, { className: "size-4" })]
561
+ children: ["Next", /* @__PURE__ */ j(x, { className: "size-4" })]
582
562
  })
583
563
  ]
584
564
  })]
585
565
  }),
586
- /* @__PURE__ */ M(R, {
587
- transaction: J,
588
- onClose: () => Y(null),
566
+ /* @__PURE__ */ j(U, {
567
+ transaction: Y,
568
+ onClose: () => X(null),
589
569
  onViewInvoice: Q,
590
- invoiceUrl: J ? X(J) : null,
591
- invoiceProvider: J ? ee(J) : null
570
+ invoiceUrl: Y ? Z(Y) : null,
571
+ invoiceProvider: Y ? te(Y) : null
592
572
  })
593
573
  ]
594
574
  });
595
575
  };
596
576
  //#endregion
597
- export { z as TransactionsPage };
577
+ export { W as TransactionsPage };
598
578
 
599
579
  //# sourceMappingURL=TransactionsPage.js.map