@burdenoff/microfe-devportal 2026.705.4 → 2026.707.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,23 @@
1
1
  import { useDevportal as e } from "../providers/DevportalProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { EmptyState as n } from "../components/EmptyState.js";
4
- import { useGetApplicationsQuery as r, useGetOrganizationQuery as i, useRequestOrgVerificationMutation as a } from "../../generated/global-operations.js";
5
- import { PageLayout as o, PageSection as s } from "../components/PageLayout.js";
6
- import { ORG_ROLE_LABELS as c } from "../utils/constants.js";
7
- import { AppListItem as l } from "../components/AppCard.js";
8
- import { StatCard as u, StatCardGrid as d } from "../components/StatCard.js";
9
- import { DataTable as f, DetailList as p } from "../components/DataTable.js";
10
- import { DEVPORTAL_PERMISSIONS as m } from "../constants/permissions.js";
11
- import { useDevportalPermission as h } from "../hooks/usePermission.js";
12
- import { useEffect as g, useState as _ } from "react";
13
- import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
- import { AlertCircle as y, AppWindow as b, ArrowRight as x, BarChart3 as S, Building2 as C, CheckCircle as w, DollarSign as T, Edit as E, ExternalLink as D, Loader2 as O, Plus as k, Settings as A, Shield as j, TrendingUp as M, Users as N } from "lucide-react";
15
- import { useParams as P } from "react-router-dom";
16
- import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
17
- import { EmphasisPanel as R, NextSteps as z } from "@burdenoff/fe-libs/ui";
4
+ import { useGetApplicationsQuery as r, useGetOrganizationQuery as i, useRequestOrgVerificationMutation as a, useUpdateOrgLegalInfoMutation as o, useUpdateOrgTaxInfoMutation as s, useUpdateOrganizationMutation as c } from "../../generated/global-operations.js";
5
+ import { PageLayout as l, PageSection as u } from "../components/PageLayout.js";
6
+ import { ORG_ROLE_LABELS as d } from "../utils/constants.js";
7
+ import { AppListItem as f } from "../components/AppCard.js";
8
+ import { StatCard as p, StatCardGrid as m } from "../components/StatCard.js";
9
+ import { DataTable as h, DetailList as g } from "../components/DataTable.js";
10
+ import { InputField as _, TextareaField as v } from "../components/FormField.js";
11
+ import { DEVPORTAL_PERMISSIONS as y } from "../constants/permissions.js";
12
+ import { useDevportalPermission as b } from "../hooks/usePermission.js";
13
+ import { useEffect as x, useState as S } from "react";
14
+ import { useI18n as C } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { AlertCircle as w, AppWindow as T, ArrowRight as E, BarChart3 as D, Building2 as O, CheckCircle as k, DollarSign as A, ExternalLink as j, Loader2 as M, Plus as N, Settings as P, Shield as F, TrendingUp as I, Users as L } from "lucide-react";
16
+ import { useParams as R } from "react-router-dom";
17
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
18
+ import { EmphasisPanel as H, NextSteps as U } from "@burdenoff/fe-libs/ui";
18
19
  //#region src/devportal/pages/OrganizationDetailPage.tsx
19
- function B(e) {
20
+ function W(e) {
20
21
  return {
21
22
  id: e.id,
22
23
  name: e.name,
@@ -59,7 +60,7 @@ function B(e) {
59
60
  updatedAt: e.updatedAt
60
61
  };
61
62
  }
62
- function V(e) {
63
+ function G(e) {
63
64
  return {
64
65
  id: e.id,
65
66
  organizationId: e.organizationId,
@@ -71,7 +72,6 @@ function V(e) {
71
72
  suspendedAt: e.suspendedAt ?? void 0,
72
73
  suspendedReason: e.suspendedReason ?? void 0,
73
74
  joinedAt: e.joinedAt,
74
- lastActiveAt: e.lastActiveAt ?? void 0,
75
75
  permissions: e.permissions ?? void 0,
76
76
  invitedBy: e.invitedBy ?? void 0,
77
77
  invitationId: e.invitationId ?? void 0,
@@ -79,430 +79,405 @@ function V(e) {
79
79
  updatedAt: e.updatedAt
80
80
  };
81
81
  }
82
- var H = () => {
83
- let { navigate: n, basePath: a, setActiveOrgId: s } = e(), { orgId: c } = P(), { t: l } = v(), u = (e, t) => {
84
- let n = l(e);
82
+ var K = {
83
+ VIEWER: 0,
84
+ DEVELOPER: 1,
85
+ ADMIN: 2,
86
+ OWNER: 3
87
+ }, q = () => {
88
+ let { navigate: n, basePath: a, setActiveOrgId: o, currentUser: s } = e(), { orgId: c } = R(), { t: u } = C(), d = (e, t) => {
89
+ let n = u(e);
85
90
  return n === e ? t : n;
86
- }, { allowed: d } = h(m.ORG_UPDATE), [f, p] = _("overview"), x = [
91
+ }, [f, p] = S("overview"), m = [
87
92
  {
88
93
  id: "overview",
89
- label: u("devportal.overview", "Overview"),
90
- icon: C
94
+ label: d("devportal.overview", "Overview"),
95
+ icon: O
91
96
  },
92
97
  {
93
98
  id: "apps",
94
- label: u("devportal.applications", "Applications"),
95
- icon: b
99
+ label: d("devportal.applications", "Applications"),
100
+ icon: T
96
101
  },
97
102
  {
98
103
  id: "members",
99
- label: u("devportal.members", "Members"),
100
- icon: N
104
+ label: d("devportal.members", "Members"),
105
+ icon: L
101
106
  },
102
107
  {
103
108
  id: "settings",
104
- label: u("devportal.settings", "Settings"),
105
- icon: A
109
+ label: d("devportal.settings", "Settings"),
110
+ icon: P
106
111
  }
107
- ], { data: S, previousData: w, loading: D, error: k } = i({
112
+ ], { data: h, previousData: g, loading: _, error: v } = i({
108
113
  variables: { id: c },
109
114
  skip: !c
110
- }), j = S ?? w, { data: M } = r({
115
+ }), y = h ?? g, { data: b } = r({
111
116
  variables: {
112
117
  limit: 50,
113
118
  organizationId: c
114
119
  },
115
120
  skip: !c,
116
121
  fetchPolicy: "cache-and-network"
117
- }), F = (e) => {
122
+ }), E = (y?.developerOrganization?.members ?? []).map(G), D = (s ? E.find((e) => e.userId === s.id) : void 0)?.role, k = D !== void 0 && K[D] >= K.DEVELOPER, j = D !== void 0 && K[D] >= K.ADMIN, N = j, F = j, I = m.filter((e) => e.id !== "settings" || j), z = (e) => {
118
123
  n?.(`${a}${e}`);
119
124
  };
120
- if (g(() => {
121
- c && s(c);
122
- }, [c, s]), g(() => {
123
- let e = j?.developerOrganization?.name;
125
+ if (x(() => {
126
+ c && o(c);
127
+ }, [c, o]), x(() => {
128
+ f === "settings" && !j && p("overview");
129
+ }, [f, j]), x(() => {
130
+ let e = y?.developerOrganization?.name;
124
131
  if (!c || !e) return;
125
132
  let t = window.__breadcrumbRegistry;
126
133
  return t?.register(c, e), () => t?.unregister(c);
127
- }, [c, S?.developerOrganization?.name]), D && !j) return /* @__PURE__ */ I(o, {
128
- title: u("devportal.loadingDots", "Loading..."),
134
+ }, [c, h?.developerOrganization?.name]), _ && !y) return /* @__PURE__ */ B(l, {
135
+ title: d("devportal.loadingDots", "Loading..."),
129
136
  backLink: `${a}/organizations`,
130
- backLabel: u("devportal.backToOrganizations", "Back to Organizations"),
131
- children: /* @__PURE__ */ I("div", {
137
+ backLabel: d("devportal.backToOrganizations", "Back to Organizations"),
138
+ children: /* @__PURE__ */ B("div", {
132
139
  className: "flex items-center justify-center py-12",
133
- children: /* @__PURE__ */ I(O, { className: "h-8 w-8 animate-spin text-text-secondary" })
140
+ children: /* @__PURE__ */ B(M, { className: "h-8 w-8 animate-spin text-text-secondary" })
134
141
  })
135
142
  });
136
- if (k || !j?.developerOrganization) return /* @__PURE__ */ I(o, {
137
- title: u("devportal.organizationNotFound", "Organization Not Found"),
143
+ if (v || !y?.developerOrganization) return /* @__PURE__ */ B(l, {
144
+ title: d("devportal.organizationNotFound", "Organization Not Found"),
138
145
  backLink: `${a}/organizations`,
139
- backLabel: u("devportal.backToOrganizations", "Back to Organizations"),
140
- children: /* @__PURE__ */ L("div", {
146
+ backLabel: d("devportal.backToOrganizations", "Back to Organizations"),
147
+ children: /* @__PURE__ */ V("div", {
141
148
  className: "flex flex-col items-center justify-center py-12 gap-4",
142
149
  children: [
143
- /* @__PURE__ */ I(y, { className: "h-12 w-12 text-status-error-text" }),
144
- /* @__PURE__ */ I("h2", {
150
+ /* @__PURE__ */ B(w, { className: "h-12 w-12 text-status-error-text" }),
151
+ /* @__PURE__ */ B("h2", {
145
152
  className: "text-lg font-semibold",
146
- children: u("devportal.organizationNotFoundLower", "Organization not found")
153
+ children: d("devportal.organizationNotFoundLower", "Organization not found")
147
154
  }),
148
- /* @__PURE__ */ I("p", {
155
+ /* @__PURE__ */ B("p", {
149
156
  className: "text-text-secondary",
150
- children: k?.message || u("devportal.organizationNotFoundDescription", "The organization you're looking for doesn't exist or you don't have access to it.")
157
+ children: v?.message || d("devportal.organizationNotFoundDescription", "The organization you're looking for doesn't exist or you don't have access to it.")
151
158
  }),
152
- /* @__PURE__ */ I("button", {
153
- onClick: () => F("/organizations"),
159
+ /* @__PURE__ */ B("button", {
160
+ onClick: () => z("/organizations"),
154
161
  className: "mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
155
- children: u("devportal.backToOrganizations", "Back to Organizations")
162
+ children: d("devportal.backToOrganizations", "Back to Organizations")
156
163
  })
157
164
  ]
158
165
  })
159
166
  });
160
- let R = B(j.developerOrganization), H = (j.developerOrganization.members ?? []).map(V), q = M?.applications?.edges?.map((e) => e.node) ?? [], J = parseInt(R.apiCallsUsed) / R.apiCallsLimit * 100, Y = parseInt(R.storageUsed) / parseInt(R.storageLimit) * 100;
161
- return /* @__PURE__ */ L(o, {
162
- title: R.name,
163
- description: R.description,
164
- purpose: u("devportal.orgDetailPurpose", "This is the home for one organization — the apps it owns, the people who can work on them, and its store and billing settings. Invite teammates, add apps, and verify the org so your published listings look trustworthy."),
167
+ let H = W(y.developerOrganization), q = E, Q = b?.applications?.edges?.map((e) => e.node) ?? [];
168
+ return /* @__PURE__ */ V(l, {
169
+ title: H.name,
170
+ description: H.description,
171
+ purpose: d("devportal.orgDetailPurpose", "This is the home for one organization — the apps it owns, the people who can work on them, and its store and billing settings. Invite teammates, add apps, and verify the org so your published listings look trustworthy."),
165
172
  backLink: `${a}/organizations`,
166
- backLabel: u("devportal.backToOrganizations", "Back to Organizations"),
167
- actions: /* @__PURE__ */ L("div", {
173
+ backLabel: d("devportal.backToOrganizations", "Back to Organizations"),
174
+ actions: /* @__PURE__ */ B("div", {
168
175
  className: "flex items-center gap-2",
169
- children: [/* @__PURE__ */ L("button", {
170
- onClick: () => n?.(`/billing/earnings?developerOrgId=${encodeURIComponent(R.id)}&developerOrgName=${encodeURIComponent(R.name)}`),
176
+ children: N ? /* @__PURE__ */ V("button", {
177
+ onClick: () => n?.(`/billing/earnings?developerOrgId=${encodeURIComponent(H.id)}&developerOrgName=${encodeURIComponent(H.name)}`),
171
178
  className: "inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm font-medium hover:bg-bg-sunken transition-colors",
172
- children: [/* @__PURE__ */ I(T, { size: 16 }), u("devportal.revenue", "Revenue")]
173
- }), /* @__PURE__ */ L("button", {
174
- onClick: () => p("settings"),
175
- disabled: !d,
176
- "aria-disabled": !d,
177
- className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
178
- children: [/* @__PURE__ */ I(E, { size: 16 }), u("devportal.settings", "Settings")]
179
- })]
179
+ children: [/* @__PURE__ */ B(A, { size: 16 }), d("devportal.revenue", "Revenue")]
180
+ }) : null
180
181
  }),
181
182
  children: [
182
- /* @__PURE__ */ I("div", {
183
+ /* @__PURE__ */ B("div", {
183
184
  className: "border-b",
184
- children: /* @__PURE__ */ I("nav", {
185
+ children: /* @__PURE__ */ B("nav", {
185
186
  className: "-mb-px flex gap-4 overflow-x-auto",
186
187
  role: "tablist",
187
- "aria-label": u("devportal.organizationSections", "Organization sections"),
188
- children: x.map((e) => {
188
+ "aria-label": d("devportal.organizationSections", "Organization sections"),
189
+ children: I.map((e) => {
189
190
  let n = e.icon;
190
- return /* @__PURE__ */ L("button", {
191
+ return /* @__PURE__ */ V("button", {
191
192
  id: `organization-tab-${e.id}`,
192
193
  role: "tab",
193
194
  "aria-selected": f === e.id,
194
195
  "aria-controls": `organization-panel-${e.id}`,
195
196
  onClick: () => p(e.id),
196
197
  className: t("flex items-center gap-2 border-b-2 px-1 py-3 text-sm font-medium transition-colors", f === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary hover:border-muted-foreground"),
197
- children: [/* @__PURE__ */ I(n, { size: 16 }), e.label]
198
+ children: [/* @__PURE__ */ B(n, { size: 16 }), e.label]
198
199
  }, e.id);
199
200
  })
200
201
  })
201
202
  }),
202
- /* @__PURE__ */ I(z, {
203
+ /* @__PURE__ */ B(U, {
203
204
  className: "mt-6",
204
- storageKey: `devportal-org-${R.id}`,
205
+ storageKey: `devportal-org-${H.id}`,
205
206
  steps: [
206
- {
207
+ ...F ? [{
207
208
  id: "invite-members",
208
- label: u("devportal.inviteMembers", "Invite members"),
209
- description: u("devportal.orgStepInvite", "Add teammates so they can build alongside you"),
210
- icon: /* @__PURE__ */ I(N, { size: 16 }),
209
+ label: d("devportal.inviteMembers", "Invite members"),
210
+ description: d("devportal.orgStepInvite", "Add teammates so they can build alongside you"),
211
+ icon: /* @__PURE__ */ B(L, { size: 16 }),
211
212
  onClick: () => p("members")
212
- },
213
- {
213
+ }] : [],
214
+ ...k ? [{
214
215
  id: "create-app",
215
- label: u("devportal.createApp", "Create App"),
216
- description: u("devportal.orgStepCreateApp", "Build a new application under this organization"),
217
- icon: /* @__PURE__ */ I(b, { size: 16 }),
218
- onClick: () => F("/apps/new")
219
- },
220
- {
216
+ label: d("devportal.createApp", "Create App"),
217
+ description: d("devportal.orgStepCreateApp", "Build a new application under this organization"),
218
+ icon: /* @__PURE__ */ B(T, { size: 16 }),
219
+ onClick: () => z("/apps/new")
220
+ }] : [],
221
+ ...j ? [{
221
222
  id: "settings",
222
- label: u("devportal.orgStepVerify", "Complete organization profile"),
223
- description: u("devportal.orgStepVerifyDesc", "Add a logo and details, then request verification"),
224
- icon: /* @__PURE__ */ I(E, { size: 16 }),
223
+ label: d("devportal.orgStepVerify", "Complete organization profile"),
224
+ description: d("devportal.orgStepVerifyDesc", "Add a logo and details, then request verification"),
225
+ icon: /* @__PURE__ */ B(P, { size: 16 }),
225
226
  onClick: () => p("settings"),
226
- done: !!R.isVerified
227
- }
227
+ done: !!H.isVerified
228
+ }] : []
228
229
  ]
229
230
  }),
230
- /* @__PURE__ */ L("div", {
231
+ /* @__PURE__ */ V("div", {
231
232
  className: "mt-6",
232
233
  id: `organization-panel-${f}`,
233
234
  role: "tabpanel",
234
235
  "aria-labelledby": `organization-tab-${f}`,
235
236
  tabIndex: 0,
236
237
  children: [
237
- f === "overview" && /* @__PURE__ */ I(U, {
238
- org: R,
239
- apps: q,
240
- members: H,
241
- apiCallsPercent: J,
242
- storagePercent: Y,
243
- onNavigate: F,
238
+ f === "overview" && /* @__PURE__ */ B(J, {
239
+ org: H,
240
+ apps: Q,
241
+ members: q,
242
+ canCreateApps: k,
243
+ canViewRevenue: N,
244
+ onNavigate: z,
244
245
  onShowApps: () => p("apps")
245
246
  }),
246
- f === "apps" && /* @__PURE__ */ I(W, {
247
- apps: q,
248
- onNavigate: F
247
+ f === "apps" && /* @__PURE__ */ B(Y, {
248
+ apps: Q,
249
+ onNavigate: z,
250
+ canCreateApps: k
249
251
  }),
250
- f === "members" && /* @__PURE__ */ I(G, {
251
- members: H,
252
- onNavigate: F,
253
- orgId: R.id
252
+ f === "members" && /* @__PURE__ */ B(X, {
253
+ members: q,
254
+ onNavigate: z,
255
+ orgId: H.id,
256
+ canInviteMembers: F
254
257
  }),
255
- f === "settings" && /* @__PURE__ */ I(K, { org: R })
258
+ f === "settings" && j && /* @__PURE__ */ B(Z, { org: H })
256
259
  ]
257
260
  })
258
261
  ]
259
262
  });
260
- }, U = ({ org: e, apps: t, members: r, apiCallsPercent: i, storagePercent: a, onNavigate: o, onShowApps: f }) => {
261
- let { t: m } = v(), h = (e, t) => {
262
- let n = m(e);
263
+ }, J = ({ org: e, apps: t, members: r, canCreateApps: i, canViewRevenue: a, onNavigate: o, onShowApps: s }) => {
264
+ let { t: c } = C(), l = (e, t) => {
265
+ let n = c(e);
263
266
  return n === e ? t : n;
264
267
  };
265
- return /* @__PURE__ */ L("div", {
268
+ return /* @__PURE__ */ V("div", {
266
269
  className: "grid gap-6 lg:grid-cols-3",
267
- children: [/* @__PURE__ */ L("div", {
270
+ children: [/* @__PURE__ */ V("div", {
268
271
  className: "lg:col-span-2 space-y-6",
269
- children: [
270
- /* @__PURE__ */ I(R, { children: /* @__PURE__ */ L(d, {
271
- columns: 4,
272
- children: [
273
- /* @__PURE__ */ I(u, {
274
- title: h("devportal.publishedApps", "Published Apps"),
275
- value: `${e.publishedApps}/${e.totalApps}`,
276
- icon: /* @__PURE__ */ I(b, { size: 20 })
277
- }),
278
- /* @__PURE__ */ I(u, {
279
- title: h("devportal.totalInstalls", "Total Installs"),
280
- value: e.totalInstalls.toLocaleString(),
281
- icon: /* @__PURE__ */ I(M, { size: 20 }),
282
- trend: {
283
- value: 12,
284
- label: h("devportal.thisMonth", "this month")
285
- }
286
- }),
287
- /* @__PURE__ */ I(u, {
288
- title: h("devportal.totalRevenue", "Total Revenue"),
289
- value: `$${e.totalRevenue.toLocaleString()}`,
290
- icon: /* @__PURE__ */ I(T, { size: 20 })
291
- }),
292
- /* @__PURE__ */ I(u, {
293
- title: h("devportal.avgRating", "Avg Rating"),
294
- value: e.averageRating ? `${e.averageRating.toFixed(1)} ★` : h("devportal.notAvailable", "N/A"),
295
- icon: /* @__PURE__ */ I(S, { size: 20 })
296
- })
297
- ]
298
- }) }),
299
- /* @__PURE__ */ I(s, {
300
- title: h("devportal.recentApplications", "Recent Applications"),
301
- actions: /* @__PURE__ */ L("button", {
302
- onClick: f,
303
- className: "text-sm text-primary hover:underline flex items-center gap-1",
304
- children: [
305
- h("devportal.viewAll", "View all"),
306
- " ",
307
- /* @__PURE__ */ I(x, { size: 14 })
308
- ]
272
+ children: [/* @__PURE__ */ B(H, { children: /* @__PURE__ */ V(m, {
273
+ columns: a ? 4 : 3,
274
+ children: [
275
+ /* @__PURE__ */ B(p, {
276
+ title: l("devportal.publishedApps", "Published Apps"),
277
+ value: `${e.publishedApps}/${e.totalApps}`,
278
+ icon: /* @__PURE__ */ B(T, { size: 20 })
309
279
  }),
310
- children: t.length > 0 ? /* @__PURE__ */ I("div", {
311
- className: "space-y-2",
312
- children: t.slice(0, 3).map((e) => /* @__PURE__ */ I(l, {
313
- app: e,
314
- onClick: () => o(`/apps/${e.id}`)
315
- }, e.id))
316
- }) : /* @__PURE__ */ I(n, {
317
- illustration: "empty-data",
318
- icon: /* @__PURE__ */ I(b, { size: 24 }),
319
- title: h("devportal.noApplications", "No applications"),
320
- description: h("devportal.createYourFirstApplication", "Create your first application")
280
+ /* @__PURE__ */ B(p, {
281
+ title: l("devportal.totalInstalls", "Total Installs"),
282
+ value: e.totalInstalls.toLocaleString(),
283
+ icon: /* @__PURE__ */ B(I, { size: 20 })
284
+ }),
285
+ a ? /* @__PURE__ */ B(p, {
286
+ title: l("devportal.totalRevenue", "Total Revenue"),
287
+ value: `$${e.totalRevenue.toLocaleString()}`,
288
+ icon: /* @__PURE__ */ B(A, { size: 20 })
289
+ }) : null,
290
+ /* @__PURE__ */ B(p, {
291
+ title: l("devportal.avgRating", "Avg Rating"),
292
+ value: e.averageRating ? `${e.averageRating.toFixed(1)} ★` : l("devportal.notAvailable", "N/A"),
293
+ icon: /* @__PURE__ */ B(D, { size: 20 })
321
294
  })
295
+ ]
296
+ }) }), /* @__PURE__ */ B(u, {
297
+ title: l("devportal.recentApplications", "Recent Applications"),
298
+ actions: /* @__PURE__ */ V("button", {
299
+ onClick: s,
300
+ className: "text-sm text-primary hover:underline flex items-center gap-1",
301
+ children: [
302
+ l("devportal.viewAll", "View all"),
303
+ " ",
304
+ /* @__PURE__ */ B(E, { size: 14 })
305
+ ]
322
306
  }),
323
- /* @__PURE__ */ L(s, {
324
- title: h("devportal.usageAndQuotas", "Usage & Quotas"),
325
- children: [/* @__PURE__ */ L("div", {
326
- className: "grid gap-4 sm:grid-cols-2",
327
- children: [/* @__PURE__ */ I(q, {
328
- label: h("devportal.apiCalls", "API Calls"),
329
- used: parseInt(e.apiCallsUsed),
330
- limit: e.apiCallsLimit,
331
- percent: i,
332
- format: "number"
333
- }), /* @__PURE__ */ I(q, {
334
- label: h("devportal.storage", "Storage"),
335
- used: parseInt(e.storageUsed),
336
- limit: parseInt(e.storageLimit),
337
- percent: a,
338
- format: "bytes"
339
- })]
340
- }), e.quotaResetAt && /* @__PURE__ */ L("p", {
341
- className: "text-xs text-text-secondary mt-2",
342
- children: [
343
- h("devportal.quotasResetOn", "Quotas reset on"),
344
- " ",
345
- new Date(e.quotaResetAt).toLocaleDateString()
346
- ]
347
- })]
307
+ children: t.length > 0 ? /* @__PURE__ */ B("div", {
308
+ className: "space-y-2",
309
+ children: t.slice(0, 3).map((e) => /* @__PURE__ */ B(f, {
310
+ app: e,
311
+ onClick: () => o(`/apps/${e.id}`)
312
+ }, e.id))
313
+ }) : /* @__PURE__ */ B(n, {
314
+ illustration: "empty-data",
315
+ icon: /* @__PURE__ */ B(T, { size: 24 }),
316
+ title: l("devportal.noApplications", "No applications"),
317
+ description: l("devportal.createYourFirstApplication", "Create your first application"),
318
+ action: i ? /* @__PURE__ */ V("button", {
319
+ onClick: () => o("/apps/new"),
320
+ className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
321
+ children: [/* @__PURE__ */ B(N, { size: 16 }), l("devportal.createApp", "Create App")]
322
+ }) : void 0
348
323
  })
349
- ]
350
- }), /* @__PURE__ */ L("div", {
324
+ })]
325
+ }), /* @__PURE__ */ V("div", {
351
326
  className: "space-y-6",
352
327
  children: [
353
- /* @__PURE__ */ I(s, {
354
- title: h("devportal.revenueSummary", "Revenue Summary"),
355
- children: /* @__PURE__ */ I(p, { items: [
328
+ a ? /* @__PURE__ */ B(u, {
329
+ title: l("devportal.revenueSummary", "Revenue Summary"),
330
+ children: /* @__PURE__ */ B(g, { items: [
356
331
  {
357
- label: h("devportal.totalRevenue", "Total Revenue"),
332
+ label: l("devportal.totalRevenue", "Total Revenue"),
358
333
  value: `$${e.totalRevenue.toLocaleString()}`
359
334
  },
360
335
  {
361
- label: h("devportal.platformFees", "Platform Fees"),
336
+ label: l("devportal.platformFees", "Platform Fees"),
362
337
  value: `$${e.totalPlatformFees.toLocaleString()}`
363
338
  },
364
339
  {
365
- label: h("devportal.netPayouts", "Net Payouts"),
340
+ label: l("devportal.netPayouts", "Net Payouts"),
366
341
  value: `$${e.totalPayouts.toLocaleString()}`
367
342
  },
368
343
  {
369
- label: h("devportal.pendingBalance", "Pending Balance"),
344
+ label: l("devportal.pendingBalance", "Pending Balance"),
370
345
  value: `$${e.pendingBalance.toLocaleString()}`
371
346
  },
372
347
  {
373
- label: h("devportal.lifetimeRevenue", "Lifetime Revenue"),
348
+ label: l("devportal.lifetimeRevenue", "Lifetime Revenue"),
374
349
  value: `$${e.lifetimeRevenue.toLocaleString()}`
375
350
  }
376
351
  ] })
377
- }),
378
- /* @__PURE__ */ I(s, {
379
- title: h("devportal.teamMembers", "Team Members"),
380
- actions: /* @__PURE__ */ I("button", {
352
+ }) : null,
353
+ /* @__PURE__ */ B(u, {
354
+ title: l("devportal.teamMembers", "Team Members"),
355
+ actions: /* @__PURE__ */ B("button", {
381
356
  onClick: () => o(`/organizations/${e.id}/members`),
382
357
  className: "text-sm text-primary hover:underline",
383
- children: h("devportal.manage", "Manage")
358
+ children: l("devportal.manage", "Manage")
384
359
  }),
385
- children: /* @__PURE__ */ L("div", {
360
+ children: /* @__PURE__ */ V("div", {
386
361
  className: "space-y-2",
387
- children: [r.slice(0, 3).map((e) => /* @__PURE__ */ I("div", {
362
+ children: [r.slice(0, 3).map((e) => /* @__PURE__ */ B("div", {
388
363
  className: "flex items-center justify-between py-2",
389
- children: /* @__PURE__ */ L("div", {
364
+ children: /* @__PURE__ */ V("div", {
390
365
  className: "flex items-center gap-3",
391
- children: [/* @__PURE__ */ I("div", {
366
+ children: [/* @__PURE__ */ B("div", {
392
367
  className: "h-8 w-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-sm font-medium text-primary",
393
368
  children: e.email?.charAt(0).toUpperCase() || "U"
394
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
369
+ }), /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
395
370
  className: "text-sm font-medium",
396
371
  children: e.email
397
- }), /* @__PURE__ */ I("p", {
372
+ }), /* @__PURE__ */ B("p", {
398
373
  className: "text-xs text-text-secondary",
399
- children: c[e.role]
374
+ children: d[e.role]
400
375
  })] })]
401
376
  })
402
- }, e.id)), r.length > 3 && /* @__PURE__ */ L("p", {
377
+ }, e.id)), r.length > 3 && /* @__PURE__ */ V("p", {
403
378
  className: "text-xs text-text-secondary",
404
379
  children: [
405
380
  "+",
406
381
  r.length - 3,
407
382
  " ",
408
- h("devportal.moreMembers", "more members")
383
+ l("devportal.moreMembers", "more members")
409
384
  ]
410
385
  })]
411
386
  })
412
387
  }),
413
- /* @__PURE__ */ I(s, {
414
- title: h("devportal.links", "Links"),
415
- children: /* @__PURE__ */ L("div", {
388
+ /* @__PURE__ */ B(u, {
389
+ title: l("devportal.links", "Links"),
390
+ children: /* @__PURE__ */ V("div", {
416
391
  className: "space-y-2",
417
- children: [e.websiteUrl && /* @__PURE__ */ L("a", {
392
+ children: [e.websiteUrl && /* @__PURE__ */ V("a", {
418
393
  href: e.websiteUrl,
419
394
  target: "_blank",
420
395
  rel: "noopener noreferrer",
421
396
  className: "flex items-center gap-2 text-sm text-primary hover:underline",
422
- children: [/* @__PURE__ */ I(D, { size: 14 }), h("devportal.website", "Website")]
423
- }), e.contactEmail && /* @__PURE__ */ L("a", {
397
+ children: [/* @__PURE__ */ B(j, { size: 14 }), l("devportal.website", "Website")]
398
+ }), e.contactEmail && /* @__PURE__ */ V("a", {
424
399
  href: `mailto:${e.contactEmail}`,
425
400
  className: "flex items-center gap-2 text-sm text-primary hover:underline",
426
- children: [/* @__PURE__ */ I(D, { size: 14 }), e.contactEmail]
401
+ children: [/* @__PURE__ */ B(j, { size: 14 }), e.contactEmail]
427
402
  })]
428
403
  })
429
404
  })
430
405
  ]
431
406
  })]
432
407
  });
433
- }, W = ({ apps: e, onNavigate: t }) => {
434
- let { t: r } = v(), i = (e, t) => {
435
- let n = r(e);
408
+ }, Y = ({ apps: e, onNavigate: t, canCreateApps: r }) => {
409
+ let { t: i } = C(), a = (e, t) => {
410
+ let n = i(e);
436
411
  return n === e ? t : n;
437
412
  };
438
- return /* @__PURE__ */ L("div", {
413
+ return /* @__PURE__ */ V("div", {
439
414
  className: "space-y-6",
440
- children: [/* @__PURE__ */ L("div", {
415
+ children: [/* @__PURE__ */ V("div", {
441
416
  className: "flex items-center justify-between",
442
- children: [/* @__PURE__ */ L("p", {
417
+ children: [/* @__PURE__ */ V("p", {
443
418
  className: "text-sm text-text-secondary",
444
419
  children: [
445
420
  e.length,
446
421
  " ",
447
- e.length === 1 ? i("devportal.application", "application") : i("devportal.applications", "applications")
422
+ e.length === 1 ? a("devportal.application", "application") : a("devportal.applications", "applications")
448
423
  ]
449
- }), /* @__PURE__ */ L("button", {
424
+ }), r ? /* @__PURE__ */ V("button", {
450
425
  onClick: () => t("/apps/new"),
451
426
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
452
- children: [/* @__PURE__ */ I(k, { size: 16 }), i("devportal.createApp", "Create App")]
453
- })]
454
- }), e.length > 0 ? /* @__PURE__ */ I("div", {
427
+ children: [/* @__PURE__ */ B(N, { size: 16 }), a("devportal.createApp", "Create App")]
428
+ }) : null]
429
+ }), e.length > 0 ? /* @__PURE__ */ B("div", {
455
430
  className: "space-y-2",
456
- children: e.map((e) => /* @__PURE__ */ I(l, {
431
+ children: e.map((e) => /* @__PURE__ */ B(f, {
457
432
  app: e,
458
433
  onClick: () => t(`/apps/${e.id}`)
459
434
  }, e.id))
460
- }) : /* @__PURE__ */ I(n, {
435
+ }) : /* @__PURE__ */ B(n, {
461
436
  illustration: "empty-data",
462
- icon: /* @__PURE__ */ I(b, { size: 32 }),
463
- title: i("devportal.noApplications", "No applications"),
464
- description: i("devportal.createFirstAppForOrg", "Create your first application for this organization"),
465
- action: /* @__PURE__ */ L("button", {
437
+ icon: /* @__PURE__ */ B(T, { size: 32 }),
438
+ title: a("devportal.noApplications", "No applications"),
439
+ description: a("devportal.createFirstAppForOrg", "Create your first application for this organization"),
440
+ action: r ? /* @__PURE__ */ V("button", {
466
441
  onClick: () => t("/apps/new"),
467
442
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
468
- children: [/* @__PURE__ */ I(k, { size: 16 }), i("devportal.createApp", "Create App")]
469
- })
443
+ children: [/* @__PURE__ */ B(N, { size: 16 }), a("devportal.createApp", "Create App")]
444
+ }) : void 0
470
445
  })]
471
446
  });
472
- }, G = ({ members: e, onNavigate: n, orgId: r }) => {
473
- let { t: i } = v(), a = (e, t) => {
474
- let n = i(e);
447
+ }, X = ({ members: e, onNavigate: n, orgId: r, canInviteMembers: i }) => {
448
+ let { t: a } = C(), o = (e, t) => {
449
+ let n = a(e);
475
450
  return n === e ? t : n;
476
451
  };
477
- return /* @__PURE__ */ L("div", {
452
+ return /* @__PURE__ */ V("div", {
478
453
  className: "space-y-6",
479
- children: [/* @__PURE__ */ L("div", {
454
+ children: [/* @__PURE__ */ V("div", {
480
455
  className: "flex items-center justify-between",
481
- children: [/* @__PURE__ */ L("p", {
456
+ children: [/* @__PURE__ */ V("p", {
482
457
  className: "text-sm text-text-secondary",
483
458
  children: [
484
459
  e.length,
485
460
  " ",
486
- e.length === 1 ? a("devportal.memberLower", "member") : a("devportal.membersLower", "members")
461
+ e.length === 1 ? o("devportal.memberLower", "member") : o("devportal.membersLower", "members")
487
462
  ]
488
- }), /* @__PURE__ */ L("button", {
463
+ }), i ? /* @__PURE__ */ V("button", {
489
464
  onClick: () => n(`/organizations/${r}/members`),
490
465
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
491
- children: [/* @__PURE__ */ I(k, { size: 16 }), a("devportal.inviteMember", "Invite Member")]
492
- })]
493
- }), /* @__PURE__ */ I(f, {
466
+ children: [/* @__PURE__ */ B(N, { size: 16 }), o("devportal.inviteMember", "Invite Member")]
467
+ }) : null]
468
+ }), /* @__PURE__ */ B(h, {
494
469
  data: e,
495
470
  keyField: "id",
496
471
  columns: [
497
472
  {
498
473
  key: "email",
499
- header: a("devportal.memberColumn", "Member"),
500
- render: (e) => /* @__PURE__ */ L("div", {
474
+ header: o("devportal.memberColumn", "Member"),
475
+ render: (e) => /* @__PURE__ */ V("div", {
501
476
  className: "flex items-center gap-3",
502
- children: [/* @__PURE__ */ I("div", {
477
+ children: [/* @__PURE__ */ B("div", {
503
478
  className: "h-8 w-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-sm font-medium text-primary",
504
479
  children: e.email?.charAt(0).toUpperCase() || "U"
505
- }), /* @__PURE__ */ I("span", {
480
+ }), /* @__PURE__ */ B("span", {
506
481
  className: "font-medium",
507
482
  children: e.email
508
483
  })]
@@ -510,209 +485,395 @@ var H = () => {
510
485
  },
511
486
  {
512
487
  key: "role",
513
- header: a("devportal.roleColumn", "Role"),
514
- render: (e) => /* @__PURE__ */ I("span", {
488
+ header: o("devportal.roleColumn", "Role"),
489
+ render: (e) => /* @__PURE__ */ B("span", {
515
490
  className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", e.role === "OWNER" ? "bg-accent-purple-subtle text-accent-purple" : e.role === "ADMIN" ? "bg-status-info-bg-subtle text-status-info-text" : e.role === "DEVELOPER" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-primary"),
516
- children: c[e.role]
491
+ children: d[e.role]
517
492
  })
518
493
  },
519
494
  {
520
495
  key: "joinedAt",
521
- header: a("devportal.joinedColumn", "Joined"),
496
+ header: o("devportal.joinedColumn", "Joined"),
522
497
  render: (e) => new Date(e.joinedAt).toLocaleDateString()
523
- },
524
- {
525
- key: "lastActiveAt",
526
- header: a("devportal.lastActiveColumn", "Last Active"),
527
- render: (e) => e.lastActiveAt ? new Date(e.lastActiveAt).toLocaleDateString() : a("devportal.never", "Never")
528
498
  }
529
499
  ]
530
500
  })]
531
501
  });
532
- }, K = ({ org: e }) => {
533
- let { t } = v(), n = (e, n) => {
502
+ }, Z = ({ org: e }) => {
503
+ let { t } = C(), { allowed: n } = b(y.ORG_UPDATE), r = (e, n) => {
534
504
  let r = t(e);
535
505
  return r === e ? n : r;
536
- }, [r, i] = _("manual"), [o, c] = _(!1), [l, { loading: u }] = a({ onCompleted: () => c(!0) });
537
- return /* @__PURE__ */ L("div", {
506
+ }, [i, l] = S({
507
+ name: e.name,
508
+ description: e.description ?? "",
509
+ websiteUrl: e.websiteUrl ?? "",
510
+ contactEmail: e.contactEmail ?? "",
511
+ supportEmail: e.supportEmail ?? "",
512
+ logoUrl: e.logoUrl ?? "",
513
+ bannerUrl: e.bannerUrl ?? ""
514
+ }), [d, f] = S({
515
+ legalEntityName: e.legalEntityName ?? "",
516
+ legalEntityType: e.legalEntityType ?? ""
517
+ }), [p, m] = S({
518
+ taxId: e.taxId ?? "",
519
+ taxCountry: e.taxCountry ?? ""
520
+ }), [h, w] = S(null), [T, E] = S(null), [D, O] = S("manual"), [A, j] = S(!1), [N, { loading: I }] = c({ refetchQueries: ["GetOrganization"] }), [L, { loading: R }] = o({ refetchQueries: ["GetOrganization"] }), [H, { loading: U }] = s({ refetchQueries: ["GetOrganization"] }), [W, { loading: G }] = a({ onCompleted: () => j(!0) });
521
+ x(() => {
522
+ l({
523
+ name: e.name,
524
+ description: e.description ?? "",
525
+ websiteUrl: e.websiteUrl ?? "",
526
+ contactEmail: e.contactEmail ?? "",
527
+ supportEmail: e.supportEmail ?? "",
528
+ logoUrl: e.logoUrl ?? "",
529
+ bannerUrl: e.bannerUrl ?? ""
530
+ }), f({
531
+ legalEntityName: e.legalEntityName ?? "",
532
+ legalEntityType: e.legalEntityType ?? ""
533
+ }), m({
534
+ taxId: e.taxId ?? "",
535
+ taxCountry: e.taxCountry ?? ""
536
+ });
537
+ }, [e]);
538
+ let K = async () => {
539
+ E(null), w(null);
540
+ try {
541
+ await N({ variables: {
542
+ id: e.id,
543
+ input: {
544
+ name: i.name.trim() || void 0,
545
+ description: i.description.trim() || null,
546
+ websiteUrl: i.websiteUrl.trim() || null,
547
+ contactEmail: i.contactEmail.trim() || null,
548
+ supportEmail: i.supportEmail.trim() || null,
549
+ logoUrl: i.logoUrl.trim() || null,
550
+ bannerUrl: i.bannerUrl.trim() || null
551
+ }
552
+ } }), w(r("devportal.organizationUpdated", "Organization details updated"));
553
+ } catch (e) {
554
+ E(e instanceof Error ? e.message : r("devportal.failedToUpdateOrganization", "Failed to update organization"));
555
+ }
556
+ }, q = async () => {
557
+ E(null), w(null);
558
+ try {
559
+ await L({ variables: {
560
+ id: e.id,
561
+ input: {
562
+ legalEntityName: d.legalEntityName.trim() || null,
563
+ legalEntityType: d.legalEntityType.trim() || null
564
+ }
565
+ } }), w(r("devportal.legalInfoUpdated", "Legal information updated"));
566
+ } catch (e) {
567
+ E(e instanceof Error ? e.message : r("devportal.failedToUpdateLegalInfo", "Failed to update legal information"));
568
+ }
569
+ }, J = async () => {
570
+ E(null), w(null);
571
+ try {
572
+ await H({ variables: {
573
+ id: e.id,
574
+ input: {
575
+ taxId: p.taxId.trim() || null,
576
+ taxCountry: p.taxCountry.trim() || null
577
+ }
578
+ } }), w(r("devportal.taxInfoUpdated", "Tax information updated"));
579
+ } catch (e) {
580
+ E(e instanceof Error ? e.message : r("devportal.failedToUpdateTaxInfo", "Failed to update tax information"));
581
+ }
582
+ };
583
+ return /* @__PURE__ */ V("div", {
538
584
  className: "space-y-6 max-w-2xl",
539
585
  children: [
540
- /* @__PURE__ */ I(s, {
541
- title: n("devportal.organizationDetails", "Organization Details"),
542
- children: /* @__PURE__ */ I(p, { items: [
543
- {
544
- label: n("devportal.organizationId", "Organization ID"),
545
- value: /* @__PURE__ */ I("code", {
546
- className: "text-xs",
547
- children: e.id
586
+ T && /* @__PURE__ */ B("div", {
587
+ className: "rounded-md border border-status-error-bg bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
588
+ children: T
589
+ }),
590
+ h && /* @__PURE__ */ B("div", {
591
+ className: "rounded-md border border-status-success-bg bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
592
+ children: h
593
+ }),
594
+ /* @__PURE__ */ B(u, {
595
+ title: r("devportal.organizationDetails", "Organization Details"),
596
+ children: /* @__PURE__ */ V("div", {
597
+ className: "space-y-4",
598
+ children: [
599
+ /* @__PURE__ */ V("div", {
600
+ className: "grid gap-4 sm:grid-cols-2",
601
+ children: [/* @__PURE__ */ B(_, {
602
+ label: r("devportal.organizationName", "Organization Name"),
603
+ value: i.name,
604
+ onChange: (e) => l((t) => ({
605
+ ...t,
606
+ name: e.target.value
607
+ })),
608
+ disabled: !n,
609
+ required: !0
610
+ }), /* @__PURE__ */ B(_, {
611
+ label: r("devportal.slug", "Slug"),
612
+ value: e.slug,
613
+ disabled: !0,
614
+ hint: r("devportal.slugReadOnly", "Slug cannot be changed here")
615
+ })]
616
+ }),
617
+ /* @__PURE__ */ B(v, {
618
+ label: r("devportal.description", "Description"),
619
+ value: i.description,
620
+ onChange: (e) => l((t) => ({
621
+ ...t,
622
+ description: e.target.value
623
+ })),
624
+ disabled: !n,
625
+ rows: 4
626
+ }),
627
+ /* @__PURE__ */ V("div", {
628
+ className: "grid gap-4 sm:grid-cols-2",
629
+ children: [
630
+ /* @__PURE__ */ B(_, {
631
+ label: r("devportal.website", "Website"),
632
+ type: "url",
633
+ value: i.websiteUrl,
634
+ onChange: (e) => l((t) => ({
635
+ ...t,
636
+ websiteUrl: e.target.value
637
+ })),
638
+ disabled: !n
639
+ }),
640
+ /* @__PURE__ */ B(_, {
641
+ label: r("devportal.contactEmail", "Contact Email"),
642
+ type: "email",
643
+ value: i.contactEmail,
644
+ onChange: (e) => l((t) => ({
645
+ ...t,
646
+ contactEmail: e.target.value
647
+ })),
648
+ disabled: !n
649
+ }),
650
+ /* @__PURE__ */ B(_, {
651
+ label: r("devportal.supportEmail", "Support Email"),
652
+ type: "email",
653
+ value: i.supportEmail,
654
+ onChange: (e) => l((t) => ({
655
+ ...t,
656
+ supportEmail: e.target.value
657
+ })),
658
+ disabled: !n
659
+ }),
660
+ /* @__PURE__ */ B(_, {
661
+ label: r("devportal.logoUrl", "Logo URL"),
662
+ type: "url",
663
+ value: i.logoUrl,
664
+ onChange: (e) => l((t) => ({
665
+ ...t,
666
+ logoUrl: e.target.value
667
+ })),
668
+ disabled: !n
669
+ })
670
+ ]
671
+ }),
672
+ /* @__PURE__ */ B(_, {
673
+ label: r("devportal.bannerUrl", "Banner URL"),
674
+ type: "url",
675
+ value: i.bannerUrl,
676
+ onChange: (e) => l((t) => ({
677
+ ...t,
678
+ bannerUrl: e.target.value
679
+ })),
680
+ disabled: !n
681
+ }),
682
+ /* @__PURE__ */ B(g, { items: [
683
+ {
684
+ label: r("devportal.organizationId", "Organization ID"),
685
+ value: /* @__PURE__ */ B("code", {
686
+ className: "text-xs",
687
+ children: e.id
688
+ })
689
+ },
690
+ {
691
+ label: r("devportal.tier", "Tier"),
692
+ value: e.tier
693
+ },
694
+ {
695
+ label: r("devportal.partnerTier", "Partner Tier"),
696
+ value: e.partnerTier || r("devportal.none", "None")
697
+ },
698
+ {
699
+ label: r("devportal.created", "Created"),
700
+ value: new Date(e.createdAt).toLocaleDateString()
701
+ },
702
+ {
703
+ label: r("devportal.platformFeeRate", "Platform Fee Rate"),
704
+ value: `${(e.platformFeeRate * 100).toFixed(0)}%`
705
+ }
706
+ ] }),
707
+ /* @__PURE__ */ B("div", {
708
+ className: "flex justify-end",
709
+ children: /* @__PURE__ */ V("button", {
710
+ type: "button",
711
+ disabled: !n || I,
712
+ onClick: () => void K(),
713
+ className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
714
+ children: [I ? /* @__PURE__ */ B(M, {
715
+ size: 14,
716
+ className: "animate-spin"
717
+ }) : /* @__PURE__ */ B(P, { size: 14 }), r("devportal.saveChanges", "Save Changes")]
718
+ })
548
719
  })
549
- },
550
- {
551
- label: n("devportal.slug", "Slug"),
552
- value: e.slug
553
- },
554
- {
555
- label: n("devportal.tier", "Tier"),
556
- value: e.tier
557
- },
558
- {
559
- label: n("devportal.partnerTier", "Partner Tier"),
560
- value: e.partnerTier || n("devportal.none", "None")
561
- },
562
- {
563
- label: n("devportal.created", "Created"),
564
- value: new Date(e.createdAt).toLocaleDateString()
565
- },
566
- {
567
- label: n("devportal.platformFeeRate", "Platform Fee Rate"),
568
- value: `${(e.platformFeeRate * 100).toFixed(0)}%`
569
- }
570
- ] })
720
+ ]
721
+ })
571
722
  }),
572
- /* @__PURE__ */ I(s, {
573
- title: n("devportal.legalInformation", "Legal Information"),
574
- children: /* @__PURE__ */ I(p, { items: [
575
- {
576
- label: n("devportal.legalEntityName", "Legal Entity Name"),
577
- value: e.legalEntityName || n("devportal.notProvided", "Not provided")
578
- },
579
- {
580
- label: n("devportal.entityType", "Entity Type"),
581
- value: e.legalEntityType || n("devportal.notProvided", "Not provided")
582
- },
583
- {
584
- label: n("devportal.taxId", "Tax ID"),
585
- value: e.taxId ? `•••••${e.taxId.slice(-4)}` : n("devportal.notProvided", "Not provided")
586
- },
587
- {
588
- label: n("devportal.taxCountry", "Tax Country"),
589
- value: e.taxCountry || n("devportal.notProvided", "Not provided")
590
- },
591
- {
592
- label: n("devportal.taxForm", "Tax Form"),
593
- value: e.taxFormType || n("devportal.notSubmitted", "Not submitted")
594
- },
595
- {
596
- label: n("devportal.taxFormStatus", "Tax Form Status"),
597
- value: e.taxFormVerified ? /* @__PURE__ */ L("span", {
598
- className: "text-status-success-text flex items-center gap-1",
723
+ /* @__PURE__ */ B(u, {
724
+ title: r("devportal.legalInformation", "Legal Information"),
725
+ children: /* @__PURE__ */ V("div", {
726
+ className: "space-y-4",
727
+ children: [
728
+ /* @__PURE__ */ V("div", {
729
+ className: "grid gap-4 sm:grid-cols-2",
599
730
  children: [
600
- /* @__PURE__ */ I(w, { size: 14 }),
601
- " ",
602
- n("devportal.verified", "Verified")
731
+ /* @__PURE__ */ B(_, {
732
+ label: r("devportal.legalEntityName", "Legal Entity Name"),
733
+ value: d.legalEntityName,
734
+ onChange: (e) => f((t) => ({
735
+ ...t,
736
+ legalEntityName: e.target.value
737
+ })),
738
+ disabled: !n
739
+ }),
740
+ /* @__PURE__ */ B(_, {
741
+ label: r("devportal.entityType", "Entity Type"),
742
+ value: d.legalEntityType,
743
+ onChange: (e) => f((t) => ({
744
+ ...t,
745
+ legalEntityType: e.target.value
746
+ })),
747
+ disabled: !n
748
+ }),
749
+ /* @__PURE__ */ B(_, {
750
+ label: r("devportal.taxId", "Tax ID"),
751
+ value: p.taxId,
752
+ onChange: (e) => m((t) => ({
753
+ ...t,
754
+ taxId: e.target.value
755
+ })),
756
+ disabled: !n
757
+ }),
758
+ /* @__PURE__ */ B(_, {
759
+ label: r("devportal.taxCountry", "Tax Country"),
760
+ value: p.taxCountry,
761
+ onChange: (e) => m((t) => ({
762
+ ...t,
763
+ taxCountry: e.target.value.toUpperCase()
764
+ })),
765
+ disabled: !n
766
+ })
603
767
  ]
604
- }) : n("devportal.pendingVerification", "Pending verification")
605
- }
606
- ] })
768
+ }),
769
+ /* @__PURE__ */ B(g, { items: [{
770
+ label: r("devportal.taxForm", "Tax Form"),
771
+ value: e.taxFormType || r("devportal.notSubmitted", "Not submitted")
772
+ }, {
773
+ label: r("devportal.taxFormStatus", "Tax Form Status"),
774
+ value: e.taxFormVerified ? /* @__PURE__ */ V("span", {
775
+ className: "text-status-success-text flex items-center gap-1",
776
+ children: [
777
+ /* @__PURE__ */ B(k, { size: 14 }),
778
+ " ",
779
+ r("devportal.verified", "Verified")
780
+ ]
781
+ }) : r("devportal.pendingVerification", "Pending verification")
782
+ }] }),
783
+ /* @__PURE__ */ V("div", {
784
+ className: "flex justify-end gap-2",
785
+ children: [/* @__PURE__ */ V("button", {
786
+ type: "button",
787
+ disabled: !n || R,
788
+ onClick: () => void q(),
789
+ className: "inline-flex items-center gap-2 rounded-md border border-border-seam px-4 py-2 text-sm font-medium hover:bg-bg-sunken disabled:opacity-50",
790
+ children: [R ? /* @__PURE__ */ B(M, {
791
+ size: 14,
792
+ className: "animate-spin"
793
+ }) : null, r("devportal.saveLegalInfo", "Save Legal Info")]
794
+ }), /* @__PURE__ */ V("button", {
795
+ type: "button",
796
+ disabled: !n || U,
797
+ onClick: () => void J(),
798
+ className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
799
+ children: [U ? /* @__PURE__ */ B(M, {
800
+ size: 14,
801
+ className: "animate-spin"
802
+ }) : null, r("devportal.saveTaxInfo", "Save Tax Info")]
803
+ })]
804
+ })
805
+ ]
806
+ })
607
807
  }),
608
- /* @__PURE__ */ L(s, {
609
- title: n("devportal.verificationStatus", "Verification Status"),
610
- children: [/* @__PURE__ */ I(p, { items: [{
611
- label: n("devportal.verifiedLabel", "Verified"),
612
- value: e.isVerified ? /* @__PURE__ */ L("span", {
808
+ /* @__PURE__ */ V(u, {
809
+ title: r("devportal.verificationStatus", "Verification Status"),
810
+ children: [/* @__PURE__ */ B(g, { items: [{
811
+ label: r("devportal.verifiedLabel", "Verified"),
812
+ value: e.isVerified ? /* @__PURE__ */ V("span", {
613
813
  className: "text-status-success-text flex items-center gap-1",
614
814
  children: [
615
- /* @__PURE__ */ I(w, { size: 14 }),
815
+ /* @__PURE__ */ B(k, { size: 14 }),
616
816
  " ",
617
- n("devportal.verifiedVia", "Verified via"),
817
+ r("devportal.verifiedVia", "Verified via"),
618
818
  " ",
619
819
  e.verificationMethod
620
820
  ]
621
- }) : n("devportal.notVerified", "Not verified")
821
+ }) : r("devportal.notVerified", "Not verified")
622
822
  }, {
623
- label: n("devportal.certifiedLabel", "Certified"),
624
- value: e.isCertified ? /* @__PURE__ */ L("span", {
823
+ label: r("devportal.certifiedLabel", "Certified"),
824
+ value: e.isCertified ? /* @__PURE__ */ V("span", {
625
825
  className: "text-accent-blue flex items-center gap-1",
626
826
  children: [
627
- /* @__PURE__ */ I(j, { size: 14 }),
827
+ /* @__PURE__ */ B(F, { size: 14 }),
628
828
  " ",
629
- n("devportal.certifiedUntil", "Certified until"),
829
+ r("devportal.certifiedUntil", "Certified until"),
630
830
  " ",
631
831
  e.certificationExpiry ? new Date(e.certificationExpiry).toLocaleDateString() : "N/A"
632
832
  ]
633
- }) : n("devportal.notCertified", "Not certified")
634
- }] }), !e.isVerified && /* @__PURE__ */ I("div", {
833
+ }) : r("devportal.notCertified", "Not certified")
834
+ }] }), !e.isVerified && /* @__PURE__ */ B("div", {
635
835
  className: "mt-4 rounded-md border border-border-subtle p-4 space-y-3",
636
- children: o ? /* @__PURE__ */ L("p", {
836
+ children: A ? /* @__PURE__ */ V("p", {
637
837
  className: "text-sm text-status-success-text flex items-center gap-2",
638
- children: [/* @__PURE__ */ I(w, { size: 14 }), n("devportal.verificationRequested", "Verification request submitted. Our team will review and contact you.")]
639
- }) : /* @__PURE__ */ L(F, { children: [
640
- /* @__PURE__ */ I("p", {
838
+ children: [/* @__PURE__ */ B(k, { size: 14 }), r("devportal.verificationRequested", "Verification request submitted. Our team will review and contact you.")]
839
+ }) : /* @__PURE__ */ V(z, { children: [
840
+ /* @__PURE__ */ B("p", {
641
841
  className: "text-sm text-text-secondary",
642
- children: n("devportal.requestVerificationHint", "Get your organization verified to build trust with users. Choose a verification method:")
842
+ children: r("devportal.requestVerificationHint", "Get your organization verified to build trust with users. Choose a verification method:")
643
843
  }),
644
- /* @__PURE__ */ I("div", {
844
+ /* @__PURE__ */ B("div", {
645
845
  className: "flex gap-2 flex-wrap",
646
846
  children: [
647
847
  "domain",
648
848
  "document",
649
849
  "manual"
650
- ].map((e) => /* @__PURE__ */ I("button", {
850
+ ].map((e) => /* @__PURE__ */ B("button", {
651
851
  type: "button",
652
- onClick: () => i(e),
653
- className: `rounded-md border px-3 py-1 text-xs font-medium transition-colors ${r === e ? "bg-action-primary-bg text-action-primary-text border-primary" : "border-border-subtle hover:bg-bg-sunken"}`,
654
- children: e === "domain" ? n("devportal.domainVerification", "Domain") : e === "document" ? n("devportal.documentVerification", "Document") : n("devportal.manualVerification", "Manual review")
852
+ onClick: () => O(e),
853
+ className: `rounded-md border px-3 py-1 text-xs font-medium transition-colors ${D === e ? "bg-action-primary-bg text-action-primary-text border-primary" : "border-border-subtle hover:bg-bg-sunken"}`,
854
+ children: e === "domain" ? r("devportal.domainVerification", "Domain") : e === "document" ? r("devportal.documentVerification", "Document") : r("devportal.manualVerification", "Manual review")
655
855
  }, e))
656
856
  }),
657
- /* @__PURE__ */ L("button", {
857
+ /* @__PURE__ */ V("button", {
658
858
  type: "button",
659
- disabled: u,
660
- onClick: () => l({ variables: {
859
+ disabled: G,
860
+ onClick: () => W({ variables: {
661
861
  id: e.id,
662
- method: r
862
+ method: D
663
863
  } }),
664
864
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
665
- children: [u ? /* @__PURE__ */ I(O, {
865
+ children: [G ? /* @__PURE__ */ B(M, {
666
866
  size: 14,
667
867
  className: "animate-spin"
668
- }) : /* @__PURE__ */ I(j, { size: 14 }), n("devportal.requestVerification", "Request Verification")]
868
+ }) : /* @__PURE__ */ B(F, { size: 14 }), r("devportal.requestVerification", "Request Verification")]
669
869
  })
670
870
  ] })
671
871
  })]
672
872
  })
673
873
  ]
674
874
  });
675
- }, q = ({ label: e, used: n, limit: r, percent: i, format: a }) => {
676
- let { t: o } = v(), s = (e, t) => {
677
- let n = o(e);
678
- return n === e ? t : n;
679
- }, c = (e) => a === "bytes" ? `${(e / (1024 * 1024 * 1024)).toFixed(1)} GB` : e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : e.toLocaleString();
680
- return /* @__PURE__ */ L("div", {
681
- className: "rounded-card border border-border-seam p-4",
682
- children: [
683
- /* @__PURE__ */ L("div", {
684
- className: "flex items-center justify-between mb-2",
685
- children: [/* @__PURE__ */ I("span", {
686
- className: "text-sm font-medium",
687
- children: e
688
- }), /* @__PURE__ */ L("span", {
689
- className: "text-xs text-text-secondary",
690
- children: [
691
- c(n),
692
- " / ",
693
- c(r)
694
- ]
695
- })]
696
- }),
697
- /* @__PURE__ */ I("div", {
698
- className: "h-2 rounded-full bg-bg-sunken overflow-hidden",
699
- children: /* @__PURE__ */ I("div", {
700
- className: t("h-full rounded-full transition-all", i > 90 ? "bg-status-error-bg-subtle" : i > 70 ? "bg-status-warning-bg-subtle" : "bg-action-primary-bg"),
701
- style: { width: `${Math.min(i, 100)}%` }
702
- })
703
- }),
704
- /* @__PURE__ */ L("p", {
705
- className: "text-xs text-text-secondary mt-1",
706
- children: [
707
- i.toFixed(1),
708
- "% ",
709
- s("devportal.used", "used")
710
- ]
711
- })
712
- ]
713
- });
714
875
  };
715
876
  //#endregion
716
- export { H as OrganizationDetailPage };
877
+ export { q as OrganizationDetailPage };
717
878
 
718
879
  //# sourceMappingURL=OrganizationDetailPage.js.map