@burdenoff/microfe-devportal 2026.915.10 → 2026.915.12

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.
@@ -6,51 +6,59 @@ import { useIsSellerSection as ee } from "../hooks/useIsSellerSection.js";
6
6
  import { useAddPaymentMethodMutation as te, useGetBillingAccountsByOrgQuery as ne, useGetMyOrganizationsQuery as re, useGetPaymentMethodsQuery as ie, useGetRevenueDashboardDataQuery as ae, useLinkDevOrgBillingAccountMutation as oe, useRequestPayoutMutation as se } from "../../generated/global-operations.js";
7
7
  import { getErrorMessage as ce } from "../hooks/useGraphQL.js";
8
8
  import { PageLayout as i, PageSection as a } from "../components/PageLayout.js";
9
- import { StatusBadge as o } from "../components/StatusBadge.js";
10
- import { StatCard as s, StatCardGrid as le } from "../components/StatCard.js";
11
- import { DataTable as c } from "../components/DataTable.js";
9
+ import { StatusBadge as le } from "../components/StatusBadge.js";
10
+ import { StatCard as o, StatCardGrid as ue } from "../components/StatCard.js";
11
+ import { DataTable as s } from "../components/DataTable.js";
12
12
  import "../hooks/index.js";
13
- import { Tooltip as l } from "../../node_modules/recharts/es6/component/Tooltip.js";
14
- import { ResponsiveContainer as ue } from "../../node_modules/recharts/es6/component/ResponsiveContainer.js";
13
+ import { Tooltip as c } from "../../node_modules/recharts/es6/component/Tooltip.js";
14
+ import { ResponsiveContainer as l } from "../../node_modules/recharts/es6/component/ResponsiveContainer.js";
15
15
  import { Bar as de } from "../../node_modules/recharts/es6/cartesian/Bar.js";
16
- import { CartesianGrid as fe } from "../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
17
- import { Line as pe } from "../../node_modules/recharts/es6/cartesian/Line.js";
18
- import { XAxis as me } from "../../node_modules/recharts/es6/cartesian/XAxis.js";
19
- import { YAxis as he } from "../../node_modules/recharts/es6/cartesian/YAxis.js";
20
- import { LineChart as ge } from "../../node_modules/recharts/es6/chart/LineChart.js";
21
- import { BarChart as _e } from "../../node_modules/recharts/es6/chart/BarChart.js";
22
- import { DevPortalPaymentMethodType as u } from "../../generated/global-types.js";
23
- import { useMemo as d, useState as f } from "react";
24
- import { AlertCircle as ve, ArrowDownToLine as ye, Banknote as be, Building2 as xe, Check as p, CreditCard as m, DollarSign as h, Link2 as g, Loader2 as _, Send as Se, Wallet as Ce } from "lucide-react";
25
- import { useSearchParams as we } from "react-router";
26
- import { Fragment as Te, jsx as v, jsxs as y } from "react/jsx-runtime";
27
- import { EmphasisPanel as Ee, GlassCard as b } from "@burdenoff/fe-libs/ui";
16
+ import { CartesianGrid as u } from "../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
17
+ import { Line as fe } from "../../node_modules/recharts/es6/cartesian/Line.js";
18
+ import { XAxis as pe } from "../../node_modules/recharts/es6/cartesian/XAxis.js";
19
+ import { YAxis as me } from "../../node_modules/recharts/es6/cartesian/YAxis.js";
20
+ import { LineChart as he } from "../../node_modules/recharts/es6/chart/LineChart.js";
21
+ import { BarChart as ge } from "../../node_modules/recharts/es6/chart/BarChart.js";
22
+ import { DevPortalPaymentMethodType as d } from "../../generated/global-types.js";
23
+ import { useMemo as f, useState as p } from "react";
24
+ import { AlertCircle as _e, ArrowDownToLine as ve, Banknote as ye, Building2 as be, Check as m, CreditCard as xe, DollarSign as Se, Link2 as h, Loader2 as g, Send as Ce, Wallet as we } from "lucide-react";
25
+ import { useSearchParams as Te } from "react-router";
26
+ import { Fragment as Ee, jsx as _, jsxs as v } from "react/jsx-runtime";
27
+ import { EmphasisPanel as De, GlassCard as y } from "@burdenoff/fe-libs/ui";
28
28
  //#region src/devportal/pages/RevenueDashboardPage.tsx
29
- var x = 100, S = {
29
+ var b = 100, x = {
30
30
  primary: "var(--color-chart-1)",
31
31
  secondary: "var(--color-chart-2)",
32
32
  tertiary: "var(--color-chart-4)"
33
- }, De = {
33
+ }, Oe = {
34
34
  "30d": 30,
35
35
  "90d": 90,
36
36
  "12m": 365
37
- }, C = () => {
38
- let C = t(), { activeOrgId: Oe, activePhysicalOrgId: ke, tenantId: Ae } = e(), w = ee() ? ke : Oe, [T, je] = f("90d"), [E, D] = f(!1), [O, k] = f(null), [Me] = oe(), [A, j] = f(!1), [M, N] = f(null), [Ne] = we(), P = d(() => /* @__PURE__ */ new Date(), []), [Pe, F] = f(!1), [Fe, I] = f(null), [L, R] = f(null), [Ie, z] = f(!1), [B, Le] = f(u.BankAccount), [Re, ze] = f(""), [V, Be] = f(""), [Ve, He] = f(""), [H, Ue] = f(""), [We, U] = f(null), { data: Ge, loading: Ke } = ie({
37
+ };
38
+ function S(e, t) {
39
+ return new Intl.NumberFormat("en-US", {
40
+ style: "currency",
41
+ currency: t || "USD",
42
+ minimumFractionDigits: 2
43
+ }).format(e);
44
+ }
45
+ var C = () => {
46
+ let C = t(), { activeOrgId: ke, activePhysicalOrgId: Ae, tenantId: je } = e(), w = ee() ? Ae : ke, [T, Me] = p("90d"), [E, Ne] = p(!1), [D, O] = p(null), [Pe] = oe(), [k, A] = p(!1), [j, M] = p(null), [Fe] = Te(), N = f(() => /* @__PURE__ */ new Date(), []), [Ie, P] = p(!1), [Le, F] = p(null), [I, L] = p(null), [Re, R] = p(!1), [z, ze] = p(d.BankAccount), [Be, Ve] = p(""), [B, He] = p(""), [Ue, We] = p(""), [V, Ge] = p(""), [Ke, H] = p(null), { data: qe, loading: Je } = ie({
39
47
  variables: { organizationId: w ?? "" },
40
48
  skip: !w,
41
49
  fetchPolicy: "cache-and-network"
42
- }), [qe, { loading: Je }] = te(), [Ye, { loading: Xe }] = se(), { data: Ze, loading: W } = ne({
50
+ }), [Ye, { loading: Xe }] = te(), [Ze, { loading: Qe }] = se(), { data: $e, loading: U } = ne({
43
51
  fetchPolicy: "cache-and-network",
44
- context: { headers: { "x-org-id": Ae ?? "" } }
45
- }), Qe = d(() => {
46
- let e = new Date(P);
47
- return e.setDate(e.getDate() - De[T]), e.toISOString();
48
- }, [P, T]), { data: G, loading: $e, error: et } = re({ fetchPolicy: "cache-and-network" }), { data: K, loading: tt, error: nt } = ae({
52
+ context: { headers: { "x-org-id": je ?? "" } }
53
+ }), et = f(() => {
54
+ let e = new Date(N);
55
+ return e.setDate(e.getDate() - Oe[T]), e.toISOString();
56
+ }, [N, T]), { data: W, loading: tt, error: nt } = re({ fetchPolicy: "cache-and-network" }), { data: G, loading: rt, error: it } = ae({
49
57
  variables: {
50
58
  organizationId: w ?? "",
51
59
  period: "monthly",
52
- startDate: Qe,
53
- endDate: P.toISOString(),
60
+ startDate: et,
61
+ endDate: N.toISOString(),
54
62
  salesLimit: 10,
55
63
  salesOffset: 0,
56
64
  payoutsLimit: 10,
@@ -58,67 +66,67 @@ var x = 100, S = {
58
66
  },
59
67
  skip: !w,
60
68
  fetchPolicy: "cache-and-network"
61
- }), q = d(() => G?.myDeveloperOrganizations?.map((e) => e) ?? [], [G?.myDeveloperOrganizations]).find((e) => e.id === w), J = Ze?.getBillingAccountsByOrg ?? [], Y = J.find((e) => e.id === q?.billingAccountId) ?? null, rt = () => {
62
- N(q?.billingAccountId ?? J.find((e) => e.isDefault)?.id ?? J[0]?.id ?? null), j(!0);
63
- }, it = async () => {
64
- if (!(!w || !M)) {
65
- D(!0), k(null);
69
+ }), K = f(() => W?.myDeveloperOrganizations?.map((e) => e) ?? [], [W?.myDeveloperOrganizations]).find((e) => e.id === w), q = $e?.getBillingAccountsByOrg ?? [], J = q.find((e) => e.id === K?.billingAccountId) ?? null, at = () => {
70
+ M(K?.billingAccountId ?? q.find((e) => e.isDefault)?.id ?? q[0]?.id ?? null), A(!0);
71
+ }, Y = async () => {
72
+ if (!(!w || !j)) {
73
+ Ne(!0), O(null);
66
74
  try {
67
- await Me({
75
+ await Pe({
68
76
  variables: {
69
77
  organizationId: w,
70
- billingAccountId: M
78
+ billingAccountId: j
71
79
  },
72
80
  refetchQueries: ["GetMyOrganizations"]
73
- }), j(!1);
81
+ }), A(!1);
74
82
  } catch (e) {
75
- k(e instanceof Error ? e.message : "Failed to link billing account");
83
+ O(e instanceof Error ? e.message : "Failed to link billing account");
76
84
  } finally {
77
- D(!1);
85
+ Ne(!1);
78
86
  }
79
87
  }
80
- }, X = (Ge?.developerOrgPaymentMethods ?? []).filter((e) => e.isActive), at = () => {
81
- R((X.find((e) => e.isDefault) ?? X[0])?.id ?? null), z(X.length === 0), U(null), I(null), F(!0);
82
- }, ot = async () => {
88
+ }, X = (qe?.developerOrgPaymentMethods ?? []).filter((e) => e.isActive), ot = () => {
89
+ L((X.find((e) => e.isDefault) ?? X[0])?.id ?? null), R(X.length === 0), H(null), F(null), P(!0);
90
+ }, st = async () => {
83
91
  if (!w) return;
84
- U(null);
85
- let e = B === u.Paypal, t = e ? { email: H } : {
86
- accountNumber: V,
87
- routingNumber: Ve
92
+ H(null);
93
+ let e = z === d.Paypal, t = e ? { email: V } : {
94
+ accountNumber: B,
95
+ routingNumber: Ue
88
96
  };
89
97
  try {
90
- let n = (await qe({
98
+ let n = (await Ye({
91
99
  variables: {
92
100
  organizationId: w,
93
101
  input: {
94
- type: B,
95
- name: Re || (e ? "PayPal" : "Bank Account"),
102
+ type: z,
103
+ name: Be || (e ? "PayPal" : "Bank Account"),
96
104
  accountDetails: t,
97
105
  isDefault: X.length === 0
98
106
  }
99
107
  },
100
108
  refetchQueries: ["GetPaymentMethods"]
101
109
  })).data?.addDeveloperOrgPaymentMethod;
102
- n && R(n.id), z(!1), ze(""), Be(""), He(""), Ue("");
110
+ n && L(n.id), R(!1), Ve(""), He(""), We(""), Ge("");
103
111
  } catch (e) {
104
- U(e instanceof Error ? e.message : "Failed to add payout method");
112
+ H(e instanceof Error ? e.message : "Failed to add payout method");
105
113
  }
106
- }, st = async () => {
107
- if (!(!w || !L)) {
108
- I(null);
114
+ }, ct = async () => {
115
+ if (!(!w || !I)) {
116
+ F(null);
109
117
  try {
110
- await Ye({
118
+ await Ze({
111
119
  variables: {
112
120
  organizationId: w,
113
- paymentMethodId: L
121
+ paymentMethodId: I
114
122
  },
115
123
  refetchQueries: ["GetRevenueDashboardData"]
116
- }), F(!1);
124
+ }), P(!1);
117
125
  } catch (e) {
118
- I(e instanceof Error ? e.message : "Failed to request withdrawal");
126
+ F(e instanceof Error ? e.message : "Failed to request withdrawal");
119
127
  }
120
128
  }
121
- }, Z = K?.developerOrgRevenueSummary, Q = (Z?.pendingBalance ?? 0) >= x, ct = [...K?.developerOrgRevenueAnalytics ?? []].sort((e, t) => new Date(e.date).getTime() - new Date(t.date).getTime()), lt = K?.developerOrgSales?.edges?.map((e) => e.node) ?? [], ut = K?.developerOrgPayouts?.edges?.map((e) => e.node) ?? [], $ = ct.map((e) => ({
129
+ }, Z = G?.developerOrgRevenueSummary, Q = (Z?.pendingBalance ?? 0) >= b, lt = [...G?.developerOrgRevenueAnalytics ?? []].sort((e, t) => new Date(e.date).getTime() - new Date(t.date).getTime()), ut = G?.developerOrgSales?.edges?.map((e) => e.node) ?? [], dt = G?.developerOrgPayouts?.edges?.map((e) => e.node) ?? [], $ = lt.map((e) => ({
122
130
  date: new Date(e.date).toLocaleDateString(void 0, {
123
131
  month: "short",
124
132
  day: "numeric"
@@ -129,56 +137,56 @@ var x = 100, S = {
129
137
  refunds: e.refunds,
130
138
  salesCount: e.salesCount
131
139
  }));
132
- return $e && !G ? /* @__PURE__ */ v(i, {
140
+ return tt && !W ? /* @__PURE__ */ _(i, {
133
141
  title: C("devportal.revenue.title", "Revenue"),
134
142
  description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
135
- children: /* @__PURE__ */ v("div", {
143
+ children: /* @__PURE__ */ _("div", {
136
144
  className: "flex items-center justify-center py-16 text-text-secondary",
137
- children: /* @__PURE__ */ v(_, { className: "h-8 w-8 animate-spin" })
145
+ children: /* @__PURE__ */ _(g, { className: "h-8 w-8 animate-spin" })
138
146
  })
139
- }) : et ? /* @__PURE__ */ v(i, {
147
+ }) : nt ? /* @__PURE__ */ _(i, {
140
148
  title: C("devportal.revenue.title", "Revenue"),
141
149
  description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
142
- children: /* @__PURE__ */ v(r, {
143
- icon: /* @__PURE__ */ v(ve, {
150
+ children: /* @__PURE__ */ _(r, {
151
+ icon: /* @__PURE__ */ _(_e, {
144
152
  size: 32,
145
153
  className: "text-status-error-text"
146
154
  }),
147
155
  title: C("devportal.revenue.errorLoadOrgs", "Unable to load organizations"),
148
- description: ce(et)
156
+ description: ce(nt)
149
157
  })
150
- }) : w ? nt ? /* @__PURE__ */ v(i, {
158
+ }) : w ? it ? /* @__PURE__ */ _(i, {
151
159
  title: C("devportal.revenue.title", "Revenue"),
152
160
  description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
153
- children: /* @__PURE__ */ v(r, {
154
- icon: /* @__PURE__ */ v(ve, {
161
+ children: /* @__PURE__ */ _(r, {
162
+ icon: /* @__PURE__ */ _(_e, {
155
163
  size: 32,
156
164
  className: "text-status-error-text"
157
165
  }),
158
166
  title: C("devportal.revenue.errorLoadData", "Unable to load revenue data"),
159
- description: ce(nt)
167
+ description: ce(it)
160
168
  })
161
- }) : /* @__PURE__ */ y(i, {
169
+ }) : /* @__PURE__ */ v(i, {
162
170
  title: C("devportal.revenue.title", "Revenue"),
163
- description: q ? `${C("devportal.revenue.financialPerformanceFor", "Financial performance for")} ${q.name}` : C("devportal.revenue.shortDescription", "Track revenue, sales, and payouts"),
171
+ description: K ? `${C("devportal.revenue.financialPerformanceFor", "Financial performance for")} ${K.name}` : C("devportal.revenue.shortDescription", "Track revenue, sales, and payouts"),
164
172
  purpose: C("devportal.revenue.purpose", "Revenue tracks the money your paid apps earn — gross sales, platform fees, and what gets paid out to your organization. Link a billing account, then use this to reconcile payouts and watch growth across time ranges."),
165
- actions: /* @__PURE__ */ v("div", {
173
+ actions: /* @__PURE__ */ _("div", {
166
174
  className: "flex flex-wrap gap-2",
167
- children: /* @__PURE__ */ y("select", {
175
+ children: /* @__PURE__ */ v("select", {
168
176
  value: T,
169
- onChange: (e) => je(e.target.value),
177
+ onChange: (e) => Me(e.target.value),
170
178
  "aria-label": C("devportal.revenue.selectRangeAria", "Select time range"),
171
179
  className: "rounded-md border bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",
172
180
  children: [
173
- /* @__PURE__ */ v("option", {
181
+ /* @__PURE__ */ _("option", {
174
182
  value: "30d",
175
183
  children: C("devportal.revenue.range.30d", "Last 30 days")
176
184
  }),
177
- /* @__PURE__ */ v("option", {
185
+ /* @__PURE__ */ _("option", {
178
186
  value: "90d",
179
187
  children: C("devportal.revenue.range.90d", "Last 90 days")
180
188
  }),
181
- /* @__PURE__ */ v("option", {
189
+ /* @__PURE__ */ _("option", {
182
190
  value: "12m",
183
191
  children: C("devportal.revenue.range.12m", "Last 12 months")
184
192
  })
@@ -186,318 +194,318 @@ var x = 100, S = {
186
194
  })
187
195
  }),
188
196
  children: [
189
- q && !q.billingAccountId && /* @__PURE__ */ y("div", {
197
+ K && !K.billingAccountId && /* @__PURE__ */ v("div", {
190
198
  className: "mb-6 rounded-card border border-border-seam bg-status-info-bg-subtle p-4 flex flex-col gap-3",
191
199
  children: [
192
- /* @__PURE__ */ y("div", {
200
+ /* @__PURE__ */ v("div", {
193
201
  className: "flex items-start gap-3",
194
202
  children: [
195
- /* @__PURE__ */ v(g, {
203
+ /* @__PURE__ */ _(h, {
196
204
  size: 20,
197
205
  className: "text-accent-blue flex-shrink-0 mt-0.5"
198
206
  }),
199
- /* @__PURE__ */ y("div", {
207
+ /* @__PURE__ */ v("div", {
200
208
  className: "flex-1 min-w-0",
201
209
  children: [
202
- /* @__PURE__ */ v("p", {
210
+ /* @__PURE__ */ _("p", {
203
211
  className: "text-sm font-medium text-status-info-text",
204
212
  children: C("devportal.revenue.billingNotLinkedTitle", "Link a billing account to receive store revenue")
205
213
  }),
206
- /* @__PURE__ */ v("p", {
214
+ /* @__PURE__ */ _("p", {
207
215
  className: "mt-1 text-sm text-status-info-text",
208
216
  children: C("devportal.revenue.billingNotLinkedDesc", "Once linked, net earnings from app sales will appear in your billing credits — you can spend them on platform services or withdraw to your bank.")
209
217
  }),
210
- O && /* @__PURE__ */ v("p", {
218
+ D && /* @__PURE__ */ _("p", {
211
219
  className: "mt-2 text-sm text-status-error-text",
212
- children: O
220
+ children: D
213
221
  })
214
222
  ]
215
223
  }),
216
- /* @__PURE__ */ y("button", {
224
+ /* @__PURE__ */ v("button", {
217
225
  type: "button",
218
- onClick: rt,
219
- disabled: E || W,
226
+ onClick: at,
227
+ disabled: E || U,
220
228
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 flex-shrink-0",
221
- children: [E || W ? /* @__PURE__ */ v(_, {
229
+ children: [E || U ? /* @__PURE__ */ _(g, {
222
230
  size: 14,
223
231
  className: "animate-spin"
224
- }) : /* @__PURE__ */ v(g, { size: 14 }), E ? C("devportal.revenue.linking", "Linking...") : C("devportal.revenue.linkBillingAccount", "Link Billing Account")]
232
+ }) : /* @__PURE__ */ _(h, { size: 14 }), E ? C("devportal.revenue.linking", "Linking...") : C("devportal.revenue.linkBillingAccount", "Link Billing Account")]
225
233
  })
226
234
  ]
227
235
  }),
228
- A && J.length === 0 && /* @__PURE__ */ v("div", {
236
+ k && q.length === 0 && /* @__PURE__ */ _("div", {
229
237
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 ml-8 text-sm text-text-secondary",
230
238
  children: C("devportal.revenue.noBillingAccounts", "You don't have any billing accounts yet. Create one from your account billing settings first.")
231
239
  }),
232
- A && J.length > 0 && /* @__PURE__ */ y("div", {
240
+ k && q.length > 0 && /* @__PURE__ */ v("div", {
233
241
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 ml-8 space-y-3",
234
242
  children: [
235
- /* @__PURE__ */ v("p", {
243
+ /* @__PURE__ */ _("p", {
236
244
  className: "text-sm font-medium",
237
245
  children: C("devportal.revenue.chooseBillingAccount", "Choose a billing account to link")
238
246
  }),
239
- /* @__PURE__ */ v("div", {
247
+ /* @__PURE__ */ _("div", {
240
248
  className: "space-y-2",
241
- children: J.map((e) => /* @__PURE__ */ y("button", {
249
+ children: q.map((e) => /* @__PURE__ */ v("button", {
242
250
  type: "button",
243
- onClick: () => N(e.id ?? null),
244
- className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", M === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
245
- children: [/* @__PURE__ */ v(p, {
251
+ onClick: () => M(e.id ?? null),
252
+ className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", j === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
253
+ children: [/* @__PURE__ */ _(m, {
246
254
  size: 14,
247
- className: n("flex-shrink-0", M === e.id ? "opacity-100 text-primary" : "opacity-0")
248
- }), /* @__PURE__ */ y("div", {
255
+ className: n("flex-shrink-0", j === e.id ? "opacity-100 text-primary" : "opacity-0")
256
+ }), /* @__PURE__ */ v("div", {
249
257
  className: "flex-1 min-w-0",
250
- children: [/* @__PURE__ */ v("p", {
258
+ children: [/* @__PURE__ */ _("p", {
251
259
  className: "font-medium truncate",
252
260
  children: e.name
253
- }), e.isDefault && /* @__PURE__ */ v("p", {
261
+ }), e.isDefault && /* @__PURE__ */ _("p", {
254
262
  className: "text-xs text-text-secondary",
255
263
  children: C("devportal.revenue.defaultAccount", "Default")
256
264
  })]
257
265
  })]
258
266
  }, e.id))
259
267
  }),
260
- /* @__PURE__ */ y("div", {
268
+ /* @__PURE__ */ v("div", {
261
269
  className: "flex items-center justify-end gap-2 pt-1",
262
- children: [/* @__PURE__ */ v("button", {
270
+ children: [/* @__PURE__ */ _("button", {
263
271
  type: "button",
264
272
  onClick: () => {
265
- j(!1), k(null);
273
+ A(!1), O(null);
266
274
  },
267
275
  className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
268
276
  children: C("devportal.cancel", "Cancel")
269
- }), /* @__PURE__ */ y("button", {
277
+ }), /* @__PURE__ */ v("button", {
270
278
  type: "button",
271
- disabled: E || !M,
272
- onClick: () => void it(),
279
+ disabled: E || !j,
280
+ onClick: () => void Y(),
273
281
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
274
- children: [E ? /* @__PURE__ */ v(_, {
282
+ children: [E ? /* @__PURE__ */ _(g, {
275
283
  size: 13,
276
284
  className: "animate-spin"
277
- }) : /* @__PURE__ */ v(g, { size: 13 }), C("devportal.revenue.confirm", "Confirm")]
285
+ }) : /* @__PURE__ */ _(h, { size: 13 }), C("devportal.revenue.confirm", "Confirm")]
278
286
  })]
279
287
  })
280
288
  ]
281
289
  })
282
290
  ]
283
291
  }),
284
- q?.billingAccountId && /* @__PURE__ */ y("div", {
292
+ K?.billingAccountId && /* @__PURE__ */ v("div", {
285
293
  className: "mb-6 rounded-lg border border-border-subtle bg-bg-surface p-3 flex flex-col gap-3",
286
- children: [/* @__PURE__ */ y("div", {
294
+ children: [/* @__PURE__ */ v("div", {
287
295
  className: "flex items-center gap-3",
288
296
  children: [
289
- /* @__PURE__ */ v(m, {
297
+ /* @__PURE__ */ _(xe, {
290
298
  size: 16,
291
299
  className: "text-text-secondary flex-shrink-0"
292
300
  }),
293
- /* @__PURE__ */ y("div", {
301
+ /* @__PURE__ */ v("div", {
294
302
  className: "flex-1 min-w-0",
295
- children: [/* @__PURE__ */ v("p", {
303
+ children: [/* @__PURE__ */ _("p", {
296
304
  className: "text-sm font-medium truncate",
297
- children: Y?.name ?? C("devportal.revenue.billingAccount", "Billing account")
298
- }), /* @__PURE__ */ v("p", {
305
+ children: J?.name ?? C("devportal.revenue.billingAccount", "Billing account")
306
+ }), /* @__PURE__ */ _("p", {
299
307
  className: "text-xs text-text-secondary truncate",
300
- children: Y ? `${Y.currency}${Y.email ? ` · ${Y.email}` : ""}` : q.billingAccountId
308
+ children: J ? `${J.currency}${J.email ? ` · ${J.email}` : ""}` : K.billingAccountId
301
309
  })]
302
310
  }),
303
- !A && /* @__PURE__ */ v("button", {
311
+ !k && /* @__PURE__ */ _("button", {
304
312
  type: "button",
305
- onClick: rt,
306
- disabled: W,
313
+ onClick: at,
314
+ disabled: U,
307
315
  className: "text-xs text-text-secondary hover:text-text-primary transition-colors flex-shrink-0 disabled:opacity-50",
308
316
  children: C("devportal.revenue.changeBillingAccount", "Change")
309
317
  })
310
318
  ]
311
- }), A && J.length > 0 && /* @__PURE__ */ y("div", {
319
+ }), k && q.length > 0 && /* @__PURE__ */ v("div", {
312
320
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-3",
313
321
  children: [
314
- /* @__PURE__ */ v("p", {
322
+ /* @__PURE__ */ _("p", {
315
323
  className: "text-sm font-medium",
316
324
  children: C("devportal.revenue.chooseBillingAccount", "Choose a billing account to link")
317
325
  }),
318
- /* @__PURE__ */ v("div", {
326
+ /* @__PURE__ */ _("div", {
319
327
  className: "space-y-2",
320
- children: J.map((e) => /* @__PURE__ */ y("button", {
328
+ children: q.map((e) => /* @__PURE__ */ v("button", {
321
329
  type: "button",
322
- onClick: () => N(e.id ?? null),
323
- className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", M === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
324
- children: [/* @__PURE__ */ v(p, {
330
+ onClick: () => M(e.id ?? null),
331
+ className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", j === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
332
+ children: [/* @__PURE__ */ _(m, {
325
333
  size: 14,
326
- className: n("flex-shrink-0", M === e.id ? "opacity-100 text-primary" : "opacity-0")
327
- }), /* @__PURE__ */ y("div", {
334
+ className: n("flex-shrink-0", j === e.id ? "opacity-100 text-primary" : "opacity-0")
335
+ }), /* @__PURE__ */ v("div", {
328
336
  className: "flex-1 min-w-0",
329
- children: [/* @__PURE__ */ v("p", {
337
+ children: [/* @__PURE__ */ _("p", {
330
338
  className: "font-medium truncate",
331
339
  children: e.name
332
- }), e.isDefault && /* @__PURE__ */ v("p", {
340
+ }), e.isDefault && /* @__PURE__ */ _("p", {
333
341
  className: "text-xs text-text-secondary",
334
342
  children: C("devportal.revenue.defaultAccount", "Default")
335
343
  })]
336
344
  })]
337
345
  }, e.id))
338
346
  }),
339
- /* @__PURE__ */ y("div", {
347
+ /* @__PURE__ */ v("div", {
340
348
  className: "flex items-center justify-end gap-2 pt-1",
341
- children: [/* @__PURE__ */ v("button", {
349
+ children: [/* @__PURE__ */ _("button", {
342
350
  type: "button",
343
351
  onClick: () => {
344
- j(!1), k(null);
352
+ A(!1), O(null);
345
353
  },
346
354
  className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
347
355
  children: C("devportal.cancel", "Cancel")
348
- }), /* @__PURE__ */ y("button", {
356
+ }), /* @__PURE__ */ v("button", {
349
357
  type: "button",
350
- disabled: E || !M,
351
- onClick: () => void it(),
358
+ disabled: E || !j,
359
+ onClick: () => void Y(),
352
360
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
353
- children: [E ? /* @__PURE__ */ v(_, {
361
+ children: [E ? /* @__PURE__ */ _(g, {
354
362
  size: 13,
355
363
  className: "animate-spin"
356
- }) : /* @__PURE__ */ v(g, { size: 13 }), C("devportal.revenue.confirm", "Confirm")]
364
+ }) : /* @__PURE__ */ _(h, { size: 13 }), C("devportal.revenue.confirm", "Confirm")]
357
365
  })]
358
366
  }),
359
- O && /* @__PURE__ */ v("p", {
367
+ D && /* @__PURE__ */ _("p", {
360
368
  className: "text-xs text-status-error-text",
361
- children: O
369
+ children: D
362
370
  })
363
371
  ]
364
372
  })]
365
373
  }),
366
- q?.billingAccountId && Z && /* @__PURE__ */ y("div", {
374
+ K?.billingAccountId && Z && /* @__PURE__ */ v("div", {
367
375
  className: "mb-6 rounded-lg border border-border-subtle bg-bg-surface p-3 flex flex-col gap-3",
368
- children: [/* @__PURE__ */ y("div", {
376
+ children: [/* @__PURE__ */ v("div", {
369
377
  className: "flex items-center gap-3",
370
378
  children: [
371
- /* @__PURE__ */ v(be, {
379
+ /* @__PURE__ */ _(ye, {
372
380
  size: 16,
373
381
  className: "text-text-secondary flex-shrink-0"
374
382
  }),
375
- /* @__PURE__ */ y("div", {
383
+ /* @__PURE__ */ v("div", {
376
384
  className: "flex-1 min-w-0",
377
- children: [/* @__PURE__ */ v("p", {
385
+ children: [/* @__PURE__ */ _("p", {
378
386
  className: "text-sm font-medium",
379
387
  children: C("devportal.revenue.withdrawTitle", "Withdraw earned credits")
380
- }), /* @__PURE__ */ v("p", {
388
+ }), /* @__PURE__ */ _("p", {
381
389
  className: "text-xs text-text-secondary",
382
- children: Q ? `${C("devportal.revenue.available", "Available")}: $${Z.pendingBalance.toLocaleString()}` : `${C("devportal.revenue.belowMinimum", "Minimum payout is")} $${x} — ${C("devportal.revenue.youHave", "you have")} $${Z.pendingBalance.toLocaleString()} ${C("devportal.revenue.pending", "pending")}.`
390
+ children: Q ? `${C("devportal.revenue.available", "Available")}: ${S(Z.pendingBalance, Z.currency)}` : `${C("devportal.revenue.belowMinimum", "Minimum payout is")} $${b} — ${C("devportal.revenue.youHave", "you have")} ${S(Z.pendingBalance, Z.currency)} ${C("devportal.revenue.pending", "pending")}.`
383
391
  })]
384
392
  }),
385
- !Pe && /* @__PURE__ */ y("button", {
393
+ !Ie && /* @__PURE__ */ v("button", {
386
394
  type: "button",
387
- onClick: at,
395
+ onClick: ot,
388
396
  disabled: !Q,
389
- title: Q ? void 0 : C("devportal.revenue.belowMinimumHint", `Payouts require a pending balance of at least $${x}.`),
397
+ title: Q ? void 0 : C("devportal.revenue.belowMinimumHint", `Payouts require a pending balance of at least $${b}.`),
390
398
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0",
391
- children: [/* @__PURE__ */ v(Se, { size: 14 }), C("devportal.revenue.requestWithdrawal", "Request Withdrawal")]
399
+ children: [/* @__PURE__ */ _(Ce, { size: 14 }), C("devportal.revenue.requestWithdrawal", "Request Withdrawal")]
392
400
  })
393
401
  ]
394
- }), Pe && /* @__PURE__ */ v("div", {
402
+ }), Ie && /* @__PURE__ */ _("div", {
395
403
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 ml-8 space-y-3",
396
- children: Ke ? /* @__PURE__ */ y("div", {
404
+ children: Je ? /* @__PURE__ */ v("div", {
397
405
  className: "flex items-center gap-2 text-sm text-text-secondary",
398
- children: [/* @__PURE__ */ v(_, {
406
+ children: [/* @__PURE__ */ _(g, {
399
407
  size: 14,
400
408
  className: "animate-spin"
401
409
  }), C("devportal.revenue.loadingMethods", "Loading payout methods...")]
402
- }) : Ie ? /* @__PURE__ */ y("div", {
410
+ }) : Re ? /* @__PURE__ */ v("div", {
403
411
  className: "space-y-3",
404
412
  children: [
405
- /* @__PURE__ */ v("p", {
413
+ /* @__PURE__ */ _("p", {
406
414
  className: "text-sm font-medium",
407
415
  children: C("devportal.revenue.addPayoutMethod", "Add a payout method")
408
416
  }),
409
- /* @__PURE__ */ y("div", {
417
+ /* @__PURE__ */ v("div", {
410
418
  className: "grid grid-cols-2 gap-2",
411
- children: [/* @__PURE__ */ v("button", {
419
+ children: [/* @__PURE__ */ _("button", {
412
420
  type: "button",
413
- onClick: () => Le(u.BankAccount),
414
- className: n("rounded-md border px-3 py-2 text-sm text-left transition-colors", B === u.BankAccount ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-accent"),
421
+ onClick: () => ze(d.BankAccount),
422
+ className: n("rounded-md border px-3 py-2 text-sm text-left transition-colors", z === d.BankAccount ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-accent"),
415
423
  children: C("devportal.revenue.bankAccount", "Bank Account")
416
- }), /* @__PURE__ */ v("button", {
424
+ }), /* @__PURE__ */ _("button", {
417
425
  type: "button",
418
- onClick: () => Le(u.Paypal),
419
- className: n("rounded-md border px-3 py-2 text-sm text-left transition-colors", B === u.Paypal ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-accent"),
426
+ onClick: () => ze(d.Paypal),
427
+ className: n("rounded-md border px-3 py-2 text-sm text-left transition-colors", z === d.Paypal ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-accent"),
420
428
  children: C("devportal.revenue.paypal", "PayPal")
421
429
  })]
422
430
  }),
423
- /* @__PURE__ */ v("input", {
431
+ /* @__PURE__ */ _("input", {
424
432
  type: "text",
425
- value: Re,
426
- onChange: (e) => ze(e.target.value),
433
+ value: Be,
434
+ onChange: (e) => Ve(e.target.value),
427
435
  placeholder: C("devportal.revenue.methodNamePlaceholder", "Label (e.g. \"Primary account\")"),
428
436
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
429
437
  }),
430
- B === u.Paypal ? /* @__PURE__ */ v("input", {
438
+ z === d.Paypal ? /* @__PURE__ */ _("input", {
431
439
  type: "email",
432
- value: H,
433
- onChange: (e) => Ue(e.target.value),
440
+ value: V,
441
+ onChange: (e) => Ge(e.target.value),
434
442
  placeholder: C("devportal.revenue.paypalEmailPlaceholder", "PayPal email"),
435
443
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
436
- }) : /* @__PURE__ */ y(Te, { children: [/* @__PURE__ */ v("input", {
444
+ }) : /* @__PURE__ */ v(Ee, { children: [/* @__PURE__ */ _("input", {
437
445
  type: "text",
438
- value: V,
439
- onChange: (e) => Be(e.target.value),
446
+ value: B,
447
+ onChange: (e) => He(e.target.value),
440
448
  placeholder: C("devportal.revenue.accountNumberPlaceholder", "Account number"),
441
449
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
442
- }), /* @__PURE__ */ v("input", {
450
+ }), /* @__PURE__ */ _("input", {
443
451
  type: "text",
444
- value: Ve,
445
- onChange: (e) => He(e.target.value),
452
+ value: Ue,
453
+ onChange: (e) => We(e.target.value),
446
454
  placeholder: C("devportal.revenue.routingNumberPlaceholder", "Routing number"),
447
455
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
448
456
  })] }),
449
- We && /* @__PURE__ */ v("p", {
457
+ Ke && /* @__PURE__ */ _("p", {
450
458
  className: "text-xs text-status-error-text",
451
- children: We
459
+ children: Ke
452
460
  }),
453
- /* @__PURE__ */ y("div", {
461
+ /* @__PURE__ */ v("div", {
454
462
  className: "flex items-center justify-end gap-2 pt-1",
455
- children: [/* @__PURE__ */ v("button", {
463
+ children: [/* @__PURE__ */ _("button", {
456
464
  type: "button",
457
- onClick: () => F(!1),
465
+ onClick: () => P(!1),
458
466
  className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
459
467
  children: C("devportal.cancel", "Cancel")
460
- }), /* @__PURE__ */ y("button", {
468
+ }), /* @__PURE__ */ v("button", {
461
469
  type: "button",
462
- disabled: Je || (B === u.Paypal ? !H : !V),
463
- onClick: () => void ot(),
470
+ disabled: Xe || (z === d.Paypal ? !V : !B),
471
+ onClick: () => void st(),
464
472
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
465
- children: [Je ? /* @__PURE__ */ v(_, {
473
+ children: [Xe ? /* @__PURE__ */ _(g, {
466
474
  size: 13,
467
475
  className: "animate-spin"
468
- }) : /* @__PURE__ */ v(p, { size: 13 }), C("devportal.revenue.saveMethod", "Save method")]
476
+ }) : /* @__PURE__ */ _(m, { size: 13 }), C("devportal.revenue.saveMethod", "Save method")]
469
477
  })]
470
478
  })
471
479
  ]
472
- }) : /* @__PURE__ */ y("div", {
480
+ }) : /* @__PURE__ */ v("div", {
473
481
  className: "space-y-3",
474
482
  children: [
475
- /* @__PURE__ */ v("p", {
483
+ /* @__PURE__ */ _("p", {
476
484
  className: "text-sm font-medium",
477
485
  children: C("devportal.revenue.chooseMethod", "Choose where to send this payout")
478
486
  }),
479
- /* @__PURE__ */ y("div", {
487
+ /* @__PURE__ */ v("div", {
480
488
  className: "space-y-2",
481
- children: [X.map((e) => /* @__PURE__ */ y("button", {
489
+ children: [X.map((e) => /* @__PURE__ */ v("button", {
482
490
  type: "button",
483
- onClick: () => R(e.id),
484
- className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", L === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
485
- children: [/* @__PURE__ */ v(p, {
491
+ onClick: () => L(e.id),
492
+ className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-sm text-left transition-colors", I === e.id ? "border-primary bg-action-primary-bg/5 text-text-primary" : "border-border-subtle hover:bg-accent text-text-primary"),
493
+ children: [/* @__PURE__ */ _(m, {
486
494
  size: 14,
487
- className: n("flex-shrink-0", L === e.id ? "opacity-100 text-primary" : "opacity-0")
488
- }), /* @__PURE__ */ y("div", {
495
+ className: n("flex-shrink-0", I === e.id ? "opacity-100 text-primary" : "opacity-0")
496
+ }), /* @__PURE__ */ v("div", {
489
497
  className: "flex-1 min-w-0",
490
- children: [/* @__PURE__ */ v("p", {
498
+ children: [/* @__PURE__ */ _("p", {
491
499
  className: "font-medium truncate",
492
500
  children: e.displayName ?? e.name
493
- }), e.isDefault && /* @__PURE__ */ v("p", {
501
+ }), e.isDefault && /* @__PURE__ */ _("p", {
494
502
  className: "text-xs text-text-secondary",
495
503
  children: C("devportal.revenue.defaultAccount", "Default")
496
504
  })]
497
505
  })]
498
- }, e.id)), /* @__PURE__ */ y("button", {
506
+ }, e.id)), /* @__PURE__ */ v("button", {
499
507
  type: "button",
500
- onClick: () => z(!0),
508
+ onClick: () => R(!0),
501
509
  className: "w-full rounded-md border border-dashed border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-accent transition-colors",
502
510
  children: [
503
511
  "+",
@@ -506,30 +514,30 @@ var x = 100, S = {
506
514
  ]
507
515
  })]
508
516
  }),
509
- Fe && /* @__PURE__ */ v("p", {
517
+ Le && /* @__PURE__ */ _("p", {
510
518
  className: "text-xs text-status-error-text",
511
- children: Fe
519
+ children: Le
512
520
  }),
513
- /* @__PURE__ */ y("div", {
521
+ /* @__PURE__ */ v("div", {
514
522
  className: "flex items-center justify-end gap-2 pt-1",
515
- children: [/* @__PURE__ */ v("button", {
523
+ children: [/* @__PURE__ */ _("button", {
516
524
  type: "button",
517
- onClick: () => F(!1),
525
+ onClick: () => P(!1),
518
526
  className: "rounded-md px-3 py-1.5 text-xs font-medium text-text-secondary hover:bg-accent transition-colors",
519
527
  children: C("devportal.cancel", "Cancel")
520
- }), /* @__PURE__ */ y("button", {
528
+ }), /* @__PURE__ */ v("button", {
521
529
  type: "button",
522
- disabled: Xe || !L,
523
- onClick: () => void st(),
530
+ disabled: Qe || !I,
531
+ onClick: () => void ct(),
524
532
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
525
533
  children: [
526
- Xe ? /* @__PURE__ */ v(_, {
534
+ Qe ? /* @__PURE__ */ _(g, {
527
535
  size: 13,
528
536
  className: "animate-spin"
529
- }) : /* @__PURE__ */ v(Se, { size: 13 }),
537
+ }) : /* @__PURE__ */ _(Ce, { size: 13 }),
530
538
  C("devportal.revenue.confirmWithdrawal", "Request"),
531
- " $",
532
- Z.pendingBalance.toLocaleString()
539
+ " ",
540
+ S(Z.pendingBalance, Z.currency)
533
541
  ]
534
542
  })]
535
543
  })
@@ -537,173 +545,173 @@ var x = 100, S = {
537
545
  })
538
546
  })]
539
547
  }),
540
- tt && !Z ? /* @__PURE__ */ v("div", {
548
+ rt && !Z ? /* @__PURE__ */ _("div", {
541
549
  className: "flex items-center justify-center py-16 text-text-secondary",
542
- children: /* @__PURE__ */ v(_, { className: "h-8 w-8 animate-spin" })
543
- }) : Z ? /* @__PURE__ */ y(Te, { children: [
544
- /* @__PURE__ */ v(Ee, {
550
+ children: /* @__PURE__ */ _(g, { className: "h-8 w-8 animate-spin" })
551
+ }) : Z ? /* @__PURE__ */ v(Ee, { children: [
552
+ /* @__PURE__ */ _(De, {
545
553
  className: "mb-6",
546
- children: /* @__PURE__ */ y(le, {
554
+ children: /* @__PURE__ */ v(ue, {
547
555
  columns: 4,
548
556
  children: [
549
- /* @__PURE__ */ v(s, {
557
+ /* @__PURE__ */ _(o, {
550
558
  title: C("devportal.revenue.grossRevenue", "Gross Revenue"),
551
- value: `$${Z.totalGrossRevenue.toLocaleString()}`,
552
- icon: /* @__PURE__ */ v(h, { size: 20 })
559
+ value: S(Z.totalGrossRevenue, Z.currency),
560
+ icon: /* @__PURE__ */ _(Se, { size: 20 })
553
561
  }),
554
- /* @__PURE__ */ v(s, {
562
+ /* @__PURE__ */ _(o, {
555
563
  title: C("devportal.revenue.netRevenue", "Net Revenue"),
556
- value: `$${Z.totalNetRevenue.toLocaleString()}`,
557
- icon: /* @__PURE__ */ v(Ce, { size: 20 })
564
+ value: S(Z.totalNetRevenue, Z.currency),
565
+ icon: /* @__PURE__ */ _(we, { size: 20 })
558
566
  }),
559
- /* @__PURE__ */ v(s, {
567
+ /* @__PURE__ */ _(o, {
560
568
  title: C("devportal.revenue.pendingBalance", "Pending Balance"),
561
- value: `$${Z.pendingBalance.toLocaleString()}`,
562
- icon: /* @__PURE__ */ v(m, { size: 20 }),
569
+ value: S(Z.pendingBalance, Z.currency),
570
+ icon: /* @__PURE__ */ _(xe, { size: 20 }),
563
571
  description: Z.nextPayoutDate ? `${C("devportal.revenue.nextPayout", "Next payout")} ${new Date(Z.nextPayoutDate).toLocaleDateString()}` : C("devportal.revenue.noPayoutScheduled", "No payout scheduled")
564
572
  }),
565
- /* @__PURE__ */ v(s, {
573
+ /* @__PURE__ */ _(o, {
566
574
  title: C("devportal.revenue.platformFees", "Platform Fees"),
567
- value: `$${Z.totalPlatformFees.toLocaleString()}`,
568
- icon: /* @__PURE__ */ v(ye, { size: 20 }),
575
+ value: S(Z.totalPlatformFees, Z.currency),
576
+ icon: /* @__PURE__ */ _(ve, { size: 20 }),
569
577
  description: `${Z.totalRefundsCount} ${C("devportal.revenue.refunds", "refunds")}`
570
578
  })
571
579
  ]
572
580
  })
573
581
  }),
574
- /* @__PURE__ */ y("div", {
582
+ /* @__PURE__ */ v("div", {
575
583
  className: "grid gap-6 xl:grid-cols-2",
576
- children: [/* @__PURE__ */ v(a, {
584
+ children: [/* @__PURE__ */ _(a, {
577
585
  title: C("devportal.revenue.revenueTrend", "Revenue trend"),
578
- children: /* @__PURE__ */ v(b, {
586
+ children: /* @__PURE__ */ _(y, {
579
587
  treatment: "insight",
580
588
  className: "p-4",
581
- children: $.length > 0 ? /* @__PURE__ */ v(ue, {
589
+ children: $.length > 0 ? /* @__PURE__ */ _(l, {
582
590
  width: "100%",
583
591
  height: 300,
584
- children: /* @__PURE__ */ y(ge, {
592
+ children: /* @__PURE__ */ v(he, {
585
593
  data: $,
586
594
  children: [
587
- /* @__PURE__ */ v(fe, {
595
+ /* @__PURE__ */ _(u, {
588
596
  strokeDasharray: "3 3",
589
597
  stroke: "var(--color-chart-grid)"
590
598
  }),
591
- /* @__PURE__ */ v(me, {
599
+ /* @__PURE__ */ _(pe, {
592
600
  dataKey: "date",
593
601
  stroke: "var(--color-chart-axis)",
594
602
  fontSize: 12
595
603
  }),
596
- /* @__PURE__ */ v(he, {
604
+ /* @__PURE__ */ _(me, {
597
605
  stroke: "var(--color-chart-axis)",
598
606
  fontSize: 12
599
607
  }),
600
- /* @__PURE__ */ v(l, { contentStyle: {
608
+ /* @__PURE__ */ _(c, { contentStyle: {
601
609
  backgroundColor: "var(--color-card)",
602
610
  border: "1px solid var(--color-border-default)",
603
611
  borderRadius: 12
604
612
  } }),
605
- /* @__PURE__ */ v(pe, {
613
+ /* @__PURE__ */ _(fe, {
606
614
  type: "monotone",
607
615
  dataKey: "grossRevenue",
608
- stroke: S.primary,
616
+ stroke: x.primary,
609
617
  strokeWidth: 2,
610
618
  dot: !1
611
619
  }),
612
- /* @__PURE__ */ v(pe, {
620
+ /* @__PURE__ */ _(fe, {
613
621
  type: "monotone",
614
622
  dataKey: "netRevenue",
615
- stroke: S.secondary,
623
+ stroke: x.secondary,
616
624
  strokeWidth: 2,
617
625
  dot: !1
618
626
  })
619
627
  ]
620
628
  })
621
- }) : /* @__PURE__ */ y("div", {
629
+ }) : /* @__PURE__ */ v("div", {
622
630
  className: "flex h-[300px] flex-col items-center justify-center gap-2 text-text-secondary",
623
- children: [/* @__PURE__ */ v("p", {
631
+ children: [/* @__PURE__ */ _("p", {
624
632
  className: "text-sm font-medium",
625
633
  children: C("devportal.revenue.noTrendData", "No trend data yet")
626
- }), /* @__PURE__ */ v("p", {
634
+ }), /* @__PURE__ */ _("p", {
627
635
  className: "text-xs text-text-tertiary",
628
636
  children: C("devportal.revenue.noTrendDataHint", "Revenue trend appears once daily analytics have been aggregated.")
629
637
  })]
630
638
  })
631
639
  })
632
- }), /* @__PURE__ */ v(a, {
640
+ }), /* @__PURE__ */ _(a, {
633
641
  title: C("devportal.revenue.topApps", "Top applications by revenue"),
634
- children: Z.topApps.length > 0 ? /* @__PURE__ */ v("div", {
642
+ children: Z.topApps.length > 0 ? /* @__PURE__ */ _("div", {
635
643
  className: "space-y-2",
636
- children: Z.topApps.map((e) => /* @__PURE__ */ v(b, {
644
+ children: Z.topApps.map((e) => /* @__PURE__ */ _(y, {
637
645
  treatment: "insight",
638
646
  className: "border-border-seam p-4",
639
- children: /* @__PURE__ */ y("div", {
647
+ children: /* @__PURE__ */ v("div", {
640
648
  className: "flex items-start justify-between gap-3",
641
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
649
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
642
650
  className: "font-medium",
643
651
  children: e.applicationName
644
- }), /* @__PURE__ */ y("p", {
652
+ }), /* @__PURE__ */ v("p", {
645
653
  className: "text-sm text-text-secondary",
646
654
  children: [
647
655
  e.salesCount,
648
656
  " ",
649
657
  C("devportal.revenue.sales", "sales")
650
658
  ]
651
- })] }), /* @__PURE__ */ y("div", {
659
+ })] }), /* @__PURE__ */ v("div", {
652
660
  className: "text-right",
653
- children: [/* @__PURE__ */ y("p", {
661
+ children: [/* @__PURE__ */ _("p", {
654
662
  className: "font-semibold",
655
- children: ["$", e.grossRevenue.toLocaleString()]
656
- }), /* @__PURE__ */ y("p", {
663
+ children: S(e.grossRevenue, e.currency)
664
+ }), /* @__PURE__ */ v("p", {
657
665
  className: "text-sm text-text-secondary",
658
666
  children: [
659
667
  C("devportal.revenue.net", "Net"),
660
- " $",
661
- e.netRevenue.toLocaleString()
668
+ " ",
669
+ S(e.netRevenue, e.currency)
662
670
  ]
663
671
  })]
664
672
  })]
665
673
  })
666
674
  }, e.applicationId))
667
- }) : /* @__PURE__ */ v(r, {
675
+ }) : /* @__PURE__ */ _(r, {
668
676
  illustration: "empty-data",
669
- icon: /* @__PURE__ */ v(xe, { size: 24 }),
677
+ icon: /* @__PURE__ */ _(be, { size: 24 }),
670
678
  title: C("devportal.revenue.noLeadersTitle", "No revenue leaders yet"),
671
679
  description: C("devportal.revenue.noLeadersDescription", "Top-performing applications will appear here once revenue is recorded.")
672
680
  })
673
681
  })]
674
682
  }),
675
- /* @__PURE__ */ v(a, {
683
+ /* @__PURE__ */ _(a, {
676
684
  title: C("devportal.revenue.salesVolume", "Sales volume"),
677
- children: /* @__PURE__ */ v(b, {
685
+ children: /* @__PURE__ */ _(y, {
678
686
  treatment: "insight",
679
687
  className: "p-4",
680
- children: $.length > 0 ? /* @__PURE__ */ v(ue, {
688
+ children: $.length > 0 ? /* @__PURE__ */ _(l, {
681
689
  width: "100%",
682
690
  height: 280,
683
- children: /* @__PURE__ */ y(_e, {
691
+ children: /* @__PURE__ */ v(ge, {
684
692
  data: $,
685
693
  children: [
686
- /* @__PURE__ */ v(fe, {
694
+ /* @__PURE__ */ _(u, {
687
695
  strokeDasharray: "3 3",
688
696
  stroke: "var(--color-chart-grid)"
689
697
  }),
690
- /* @__PURE__ */ v(me, {
698
+ /* @__PURE__ */ _(pe, {
691
699
  dataKey: "date",
692
700
  stroke: "var(--color-chart-axis)",
693
701
  fontSize: 12
694
702
  }),
695
- /* @__PURE__ */ v(he, {
703
+ /* @__PURE__ */ _(me, {
696
704
  stroke: "var(--color-chart-axis)",
697
705
  fontSize: 12
698
706
  }),
699
- /* @__PURE__ */ v(l, { contentStyle: {
707
+ /* @__PURE__ */ _(c, { contentStyle: {
700
708
  backgroundColor: "var(--color-card)",
701
709
  border: "1px solid var(--color-border-default)",
702
710
  borderRadius: 12
703
711
  } }),
704
- /* @__PURE__ */ v(de, {
712
+ /* @__PURE__ */ _(de, {
705
713
  dataKey: "salesCount",
706
- fill: S.tertiary,
714
+ fill: x.tertiary,
707
715
  radius: [
708
716
  6,
709
717
  6,
@@ -713,24 +721,24 @@ var x = 100, S = {
713
721
  })
714
722
  ]
715
723
  })
716
- }) : /* @__PURE__ */ y("div", {
724
+ }) : /* @__PURE__ */ v("div", {
717
725
  className: "flex h-[280px] flex-col items-center justify-center gap-2 text-text-secondary",
718
- children: [/* @__PURE__ */ v("p", {
726
+ children: [/* @__PURE__ */ _("p", {
719
727
  className: "text-sm font-medium",
720
728
  children: C("devportal.revenue.noVolumeData", "No sales volume data yet")
721
- }), /* @__PURE__ */ v("p", {
729
+ }), /* @__PURE__ */ _("p", {
722
730
  className: "text-xs text-text-tertiary",
723
731
  children: C("devportal.revenue.noVolumeDataHint", "Sales volume by period appears once analytics have been aggregated.")
724
732
  })]
725
733
  })
726
734
  })
727
735
  }),
728
- /* @__PURE__ */ y("div", {
736
+ /* @__PURE__ */ v("div", {
729
737
  className: "grid gap-6 xl:grid-cols-2",
730
- children: [/* @__PURE__ */ v(a, {
738
+ children: [/* @__PURE__ */ _(a, {
731
739
  title: C("devportal.revenue.recentSales", "Recent sales"),
732
- children: /* @__PURE__ */ v(c, {
733
- data: lt,
740
+ children: /* @__PURE__ */ _(s, {
741
+ data: ut,
734
742
  keyField: "id",
735
743
  columns: [
736
744
  {
@@ -741,27 +749,27 @@ var x = 100, S = {
741
749
  {
742
750
  key: "grossAmount",
743
751
  header: C("devportal.revenue.gross", "Gross"),
744
- render: (e) => `$${e.grossAmount.toLocaleString()}`
752
+ render: (e) => S(e.grossAmount, e.currency)
745
753
  },
746
754
  {
747
755
  key: "netAmount",
748
756
  header: C("devportal.revenue.net", "Net"),
749
- render: (e) => `$${e.netAmount.toLocaleString()}`
757
+ render: (e) => S(e.netAmount, e.currency)
750
758
  },
751
759
  {
752
760
  key: "status",
753
761
  header: C("devportal.revenue.status", "Status"),
754
- render: (e) => /* @__PURE__ */ v(o, {
762
+ render: (e) => /* @__PURE__ */ _(le, {
755
763
  status: e.status,
756
764
  type: "app"
757
765
  })
758
766
  }
759
767
  ]
760
768
  })
761
- }), /* @__PURE__ */ v(a, {
769
+ }), /* @__PURE__ */ _(a, {
762
770
  title: C("devportal.revenue.payoutHistory", "Payout history"),
763
- children: /* @__PURE__ */ v(c, {
764
- data: ut,
771
+ children: /* @__PURE__ */ _(s, {
772
+ data: dt,
765
773
  keyField: "id",
766
774
  columns: [
767
775
  {
@@ -772,12 +780,12 @@ var x = 100, S = {
772
780
  {
773
781
  key: "netAmount",
774
782
  header: C("devportal.revenue.netPayout", "Net payout"),
775
- render: (e) => `$${e.netAmount.toLocaleString()}`
783
+ render: (e) => S(e.netAmount, e.currency)
776
784
  },
777
785
  {
778
786
  key: "status",
779
787
  header: C("devportal.revenue.status", "Status"),
780
- render: (e) => /* @__PURE__ */ v(o, {
788
+ render: (e) => /* @__PURE__ */ _(le, {
781
789
  status: e.status,
782
790
  type: "app"
783
791
  })
@@ -786,19 +794,19 @@ var x = 100, S = {
786
794
  })
787
795
  })]
788
796
  })
789
- ] }) : /* @__PURE__ */ v(r, {
797
+ ] }) : /* @__PURE__ */ _(r, {
790
798
  illustration: "empty-data",
791
- icon: /* @__PURE__ */ v(h, { size: 32 }),
799
+ icon: /* @__PURE__ */ _(Se, { size: 32 }),
792
800
  title: C("devportal.revenue.noDataTitle", "No revenue data yet"),
793
801
  description: C("devportal.revenue.noDataDescription", "Revenue metrics will appear after this organization starts recording marketplace sales.")
794
802
  })
795
803
  ]
796
- }) : /* @__PURE__ */ v(i, {
804
+ }) : /* @__PURE__ */ _(i, {
797
805
  title: C("devportal.revenue.title", "Revenue"),
798
806
  description: C("devportal.revenue.description", "Track real revenue, sales, and payout activity for your developer organizations"),
799
- children: /* @__PURE__ */ v(r, {
807
+ children: /* @__PURE__ */ _(r, {
800
808
  illustration: "empty-people",
801
- icon: /* @__PURE__ */ v(xe, {
809
+ icon: /* @__PURE__ */ _(be, {
802
810
  size: 32,
803
811
  className: "text-text-secondary"
804
812
  }),