@burdenoff/microfe-devportal 2026.1110.2 → 2026.1112.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export declare function isStrictPermission(permission: string): boolean;
@@ -0,0 +1,13 @@
1
+ // src/devportal/hooks/permissionRules.ts
2
+ var e = /* @__PURE__ */ new Set([
3
+ "devportal-revenue",
4
+ "devportal-payout",
5
+ "devportal-analytics",
6
+ "devportal-audit-log"
7
+ ]);
8
+ function t(t) {
9
+ return e.has(t.split(":")[0] ?? "");
10
+ }
11
+ export { t as isStrictPermission };
12
+
13
+ //# sourceMappingURL=permissionRules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissionRules.js","names":["STRICT_RESOURCES","isStrictPermission","permission"],"sources":["../../../src/devportal/hooks/permissionRules.ts"],"sourcesContent":["/**\n * Resource types whose actions must never fall back to \"allowed\" in the\n * FluidGrids variant: revenue, payouts, analytics and the audit log.\n */\nconst STRICT_RESOURCES: ReadonlySet<string> = new Set([\n \"devportal-revenue\",\n \"devportal-payout\",\n \"devportal-analytics\",\n \"devportal-audit-log\",\n]);\n\nexport function isStrictPermission(permission: string): boolean {\n return STRICT_RESOURCES.has(permission.split(\":\")[0] ?? \"\");\n}\n"],"mappings":";AAIA,IAAMA,oBAAwC,IAAI,IAAI;CACpD;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgBC,EAAmB,GAA6B;CAC9D,OAAOD,EAAiB,IAAIE,EAAW,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE;AAC5D"}
@@ -1,11 +1,14 @@
1
- import { usePermissions as e } from "@burdenoff/fe-libs/shared/providers/shell";
1
+ import { useIsFluidgridsVariant as e } from "../providers/DevportalProvider.js";
2
+ import { isStrictPermission as t } from "./permissionRules.js";
3
+ import { usePermissions as n } from "@burdenoff/fe-libs/shared/providers/shell";
2
4
  // src/devportal/hooks/usePermission.ts
3
- var t = (t) => {
5
+ var r = (r) => {
6
+ let i = e();
4
7
  try {
5
- let n = e(), r = n.isLoading, i = n.permissions?.permissions?.some((e) => e.resourceType === "rbac" && e.level === "ADMIN") ?? !1, a = t.split(":")[0], o = n.permissions?.permissions?.some((e) => e.resourceType === a && e.level === "ADMIN") ?? !1, s = n.hasPermission, c = n.permissions?.permissions?.some((e) => e.resourceType.startsWith("devportal-")) ?? !1, l = !r && !!n.permissions && !c;
8
+ let e = n(), a = e.isLoading, o = e.permissions?.permissions?.some((e) => e.resourceType === "rbac" && e.level === "ADMIN") ?? !1, s = r.split(":")[0], c = e.permissions?.permissions?.some((e) => e.resourceType === s && e.level === "ADMIN") ?? !1, l = e.hasPermission, u = e.permissions?.permissions?.some((e) => e.resourceType.startsWith("devportal-")) ?? !1, d = !a && !!e.permissions && !u;
6
9
  return {
7
- allowed: i || o || !s || s(t) || l,
8
- loading: r
10
+ allowed: i && t(r) ? !a && (o || c || (l ? l(r) : !1)) : o || c || !l || l(r) || d,
11
+ loading: a
9
12
  };
10
13
  } catch {
11
14
  return {
@@ -14,6 +17,6 @@ var t = (t) => {
14
17
  };
15
18
  }
16
19
  };
17
- export { t as useDevportalPermission };
20
+ export { r as useDevportalPermission };
18
21
 
19
22
  //# sourceMappingURL=usePermission.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePermission.js","names":["useDevportalPermission","ctx","usePermissions","isLoading","isRbacAdmin","entry","resourceType","permission","hasResourceAdmin","has","hasAnyDevportalPermission","noDevportalInfoYet"],"sources":["../../../src/devportal/hooks/usePermission.ts"],"sourcesContent":["import { usePermissions } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport type { DevportalPermission } from \"../constants/permissions\";\n\ninterface PermissionResult {\n /** True when the actor has the permission (or is RBAC admin / standalone). */\n allowed: boolean;\n /** True while the permissions request is still in flight. */\n loading: boolean;\n}\n\n/**\n * Button-level permission gate for devportal mutations.\n *\n * Wraps the shell `usePermissions` hook with the same standalone /\n * admin-bypass semantics as `PermissionGuard`. Use to gate individual\n * mutation buttons (Create / Edit / Delete / Publish / Submit / Approve /\n * Reject / Generate) so disabled state is server-driven, not just\n * page-level.\n *\n * Standalone mode (no shell provider) -> `allowed: true` so dev mode\n * stays usable. The page-level `PermissionGuard` is the coarse-grained\n * gate; this hook is the fine-grained one.\n */\nexport const useDevportalPermission = (\n permission: DevportalPermission,\n): PermissionResult => {\n try {\n const ctx = usePermissions();\n const isLoading = ctx.isLoading;\n const isRbacAdmin =\n ctx.permissions?.permissions?.some(\n (entry) => entry.resourceType === \"rbac\" && entry.level === \"ADMIN\",\n ) ?? false;\n\n // Extract the resource type from the permission string (e.g. \"devportal-app:submit\" → \"devportal-app\")\n const resourceType = permission.split(\":\")[0];\n const hasResourceAdmin =\n ctx.permissions?.permissions?.some(\n (entry) =>\n entry.resourceType === resourceType && entry.level === \"ADMIN\",\n ) ?? false;\n\n const has = ctx.hasPermission as (p: DevportalPermission) => boolean;\n\n // If the user is authenticated but the permissions API returned nothing about devportal\n // resources at all, fall back to true — the backend enforces real auth.\n const hasAnyDevportalPermission =\n ctx.permissions?.permissions?.some((entry) =>\n entry.resourceType.startsWith(\"devportal-\"),\n ) ?? false;\n const isAuthenticated = !isLoading && !!ctx.permissions;\n const noDevportalInfoYet = isAuthenticated && !hasAnyDevportalPermission;\n\n return {\n allowed:\n isRbacAdmin ||\n hasResourceAdmin ||\n (has ? has(permission) : true) ||\n noDevportalInfoYet,\n loading: isLoading,\n };\n } catch {\n // Standalone / dev mode: no shell provider mounted.\n return { allowed: true, loading: false };\n }\n};\n"],"mappings":";;AAuBA,IAAaA,KACX,MACqB;CACrB,IAAI;EACF,IAAMC,IAAMC,EAAe,GACrBC,IAAYF,EAAI,WAChBG,IACJH,EAAI,aAAa,aAAa,MAC3B,MAAUI,EAAM,iBAAiB,UAAUA,EAAM,UAAU,OAC9D,KAAK,IAGDC,IAAeC,EAAW,MAAM,GAAG,CAAC,CAAC,IACrCC,IACJP,EAAI,aAAa,aAAa,MAC3B,MACCI,EAAM,iBAAiBC,KAAgBD,EAAM,UAAU,OAC3D,KAAK,IAEDI,IAAMR,EAAI,eAIVS,IACJT,EAAI,aAAa,aAAa,MAAM,MAClCI,EAAM,aAAa,WAAW,YAAY,CAC5C,KAAK,IAEDM,IADkB,CAACR,KAAa,CAAC,CAACF,EAAI,eACE,CAACS;EAE/C,OAAO;GACL,SACEN,KACAI,KACC,MAAMC,EAAIF,CAAU,KACrBI;GACF,SAASR;EACX;CACF,QAAQ;EAEN,OAAO;GAAE,SAAS;GAAM,SAAS;EAAM;CACzC;AACF"}
1
+ {"version":3,"file":"usePermission.js","names":["useDevportalPermission","isFluidgrids","useIsFluidgridsVariant","ctx","usePermissions","isLoading","isRbacAdmin","entry","resourceType","permission","hasResourceAdmin","has","hasAnyDevportalPermission","noDevportalInfoYet","isStrictPermission"],"sources":["../../../src/devportal/hooks/usePermission.ts"],"sourcesContent":["import { usePermissions } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport type { DevportalPermission } from \"../constants/permissions\";\nimport { useIsFluidgridsVariant } from \"../providers/DevportalProvider\";\nimport { isStrictPermission } from \"./permissionRules\";\n\ninterface PermissionResult {\n /** True when the actor has the permission (or is RBAC admin / standalone). */\n allowed: boolean;\n /** True while the permissions request is still in flight. */\n loading: boolean;\n}\n\n/**\n * Button-level permission gate for devportal mutations.\n *\n * Wraps the shell `usePermissions` hook with the same standalone /\n * admin-bypass semantics as `PermissionGuard`. Use to gate individual\n * mutation buttons (Create / Edit / Delete / Publish / Submit / Approve /\n * Reject / Generate) so disabled state is server-driven, not just\n * page-level.\n *\n * Standalone mode (no shell provider) -> `allowed: true` so dev mode\n * stays usable. The page-level `PermissionGuard` is the coarse-grained\n * gate; this hook is the fine-grained one.\n */\nexport const useDevportalPermission = (\n permission: DevportalPermission,\n): PermissionResult => {\n const isFluidgrids = useIsFluidgridsVariant();\n try {\n const ctx = usePermissions();\n const isLoading = ctx.isLoading;\n const isRbacAdmin =\n ctx.permissions?.permissions?.some(\n (entry) => entry.resourceType === \"rbac\" && entry.level === \"ADMIN\",\n ) ?? false;\n\n // Extract the resource type from the permission string (e.g. \"devportal-app:submit\" → \"devportal-app\")\n const resourceType = permission.split(\":\")[0];\n const hasResourceAdmin =\n ctx.permissions?.permissions?.some(\n (entry) =>\n entry.resourceType === resourceType && entry.level === \"ADMIN\",\n ) ?? false;\n\n const has = ctx.hasPermission as (p: DevportalPermission) => boolean;\n\n // If the user is authenticated but the permissions API returned nothing about devportal\n // resources at all, fall back to true — the backend enforces real auth.\n const hasAnyDevportalPermission =\n ctx.permissions?.permissions?.some((entry) =>\n entry.resourceType.startsWith(\"devportal-\"),\n ) ?? false;\n const isAuthenticated = !isLoading && !!ctx.permissions;\n const noDevportalInfoYet = isAuthenticated && !hasAnyDevportalPermission;\n\n // FluidGrids: money, analytics and audit-log actions check the permission the\n // backend defines instead of defaulting to allowed when it cannot tell (BOFF-11863).\n const strict = isFluidgrids && isStrictPermission(permission);\n\n return {\n allowed: strict\n ? !isLoading &&\n (isRbacAdmin || hasResourceAdmin || (has ? has(permission) : false))\n : isRbacAdmin ||\n hasResourceAdmin ||\n (has ? has(permission) : true) ||\n noDevportalInfoYet,\n loading: isLoading,\n };\n } catch {\n // Standalone / dev mode: no shell provider mounted.\n return { allowed: true, loading: false };\n }\n};\n"],"mappings":";;;;AAyBA,IAAaA,KACX,MACqB;CACrB,IAAMC,IAAeC,EAAuB;CAC5C,IAAI;EACF,IAAMC,IAAMC,EAAe,GACrBC,IAAYF,EAAI,WAChBG,IACJH,EAAI,aAAa,aAAa,MAC3B,MAAUI,EAAM,iBAAiB,UAAUA,EAAM,UAAU,OAC9D,KAAK,IAGDC,IAAeC,EAAW,MAAM,GAAG,CAAC,CAAC,IACrCC,IACJP,EAAI,aAAa,aAAa,MAC3B,MACCI,EAAM,iBAAiBC,KAAgBD,EAAM,UAAU,OAC3D,KAAK,IAEDI,IAAMR,EAAI,eAIVS,IACJT,EAAI,aAAa,aAAa,MAAM,MAClCI,EAAM,aAAa,WAAW,YAAY,CAC5C,KAAK,IAEDM,IADkB,CAACR,KAAa,CAAC,CAACF,EAAI,eACE,CAACS;EAM/C,OAAO;GACL,SAHaX,KAAgBa,EAAmBL,CAAU,IAItD,CAACJ,MACAC,KAAeI,MAAqBC,IAAMA,EAAIF,CAAU,IAAI,OAC7DH,KACAI,KACC,MAAMC,EAAIF,CAAU,KACrBI;GACJ,SAASR;EACX;CACF,QAAQ;EAEN,OAAO;GAAE,SAAS;GAAM,SAAS;EAAM;CACzC;AACF"}
@@ -1,24 +1,25 @@
1
1
  import { PageLayout as e, PageSection as t } from "../components/PageLayout.js";
2
2
  import { InputField as n, TextareaField as r } from "../components/FormField.js";
3
- import { useDevportal as i } from "../providers/DevportalProvider.js";
3
+ import { useDevportal as ee } from "../providers/DevportalProvider.js";
4
4
  import "../components/index.js";
5
- import { orgSectionPath as a, useIsSellerSection as o } from "../hooks/useIsSellerSection.js";
6
- import { useCreateBillingAccountMutation as s, useCreateOrganizationMutation as c, useCreateSellerOrganizationMutation as l, useGetBillingAccountsByOrgQuery as u, useLinkDevOrgBillingAccountMutation as d } from "../../generated/global-operations.js";
5
+ import { orgSectionPath as i, useIsSellerSection as a } from "../hooks/useIsSellerSection.js";
6
+ import { useCreateBillingAccountMutation as o, useCreateOrganizationMutation as s, useCreateSellerOrganizationMutation as c, useGetBillingAccountsByOrgQuery as l, useLinkDevOrgBillingAccountMutation as u } from "../../generated/global-operations.js";
7
7
  import "../hooks/index.js";
8
- import { useDevportalEventBus as f } from "../events/index.js";
9
- import { PermissionGuard as p } from "../components/PermissionGuard.js";
10
- import { cn as m } from "../utils/cn.js";
11
- import { useTr as h } from "../utils/i18n.js";
12
- import { useEffect as g, useMemo as _, useState as v } from "react";
13
- import { Building2 as y, Check as b, Link2 as x, Loader2 as S, X as ee } from "lucide-react";
14
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
8
+ import { useDevportalEventBus as d } from "../events/index.js";
9
+ import { PermissionGuard as f } from "../components/PermissionGuard.js";
10
+ import { cn as p } from "../utils/cn.js";
11
+ import { useTr as m } from "../utils/i18n.js";
12
+ import { errorMessage as h } from "../utils/errorMessage.js";
13
+ import { useEffect as te, useMemo as ne, useState as g } from "react";
14
+ import { Building2 as _, Check as v, Link2 as y, Loader2 as b, X as x } from "lucide-react";
15
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
15
16
  // src/devportal/pages/CreateOrganizationPage.tsx
16
- var E = () => {
17
- let { navigate: E, basePath: D, currentUser: O, tenantId: k, setActiveOrgId: te, setActivePhysicalOrgId: A } = i(), j = o(), M = h(), [N, P] = v({}), [F] = c(), [I] = l(), [L] = s(), [R] = d(), z = f(), [B, V] = v("idle"), H = B !== "idle", [U, W] = v("auto"), [G, K] = v(null), { data: q, loading: J } = u({
17
+ var T = () => {
18
+ let { navigate: T, basePath: E, currentUser: D, tenantId: O, setActiveOrgId: re, setActivePhysicalOrgId: ie } = ee(), k = a(), A = m(), [j, M] = g({}), [N, P] = g(null), [F] = s(), [I] = c(), [L] = o(), [R] = u(), z = d(), [B, V] = g("idle"), H = B !== "idle", [U, W] = g("auto"), [G, K] = g(null), { data: q, loading: J } = l({
18
19
  fetchPolicy: "cache-and-network",
19
- context: { headers: { "x-org-id": k ?? "" } }
20
- }), Y = _(() => q?.getBillingAccountsByOrg ?? [], [q]);
21
- g(() => {
20
+ context: { headers: { "x-org-id": O ?? "" } }
21
+ }), Y = ne(() => q?.getBillingAccountsByOrg ?? [], [q]);
22
+ te(() => {
22
23
  U !== "existing" || J || (Y.length === 0 ? W("auto") : G || K(Y.find((e) => e.isDefault)?.id ?? Y[0]?.id ?? null));
23
24
  }, [
24
25
  U,
@@ -26,7 +27,7 @@ var E = () => {
26
27
  Y,
27
28
  G
28
29
  ]);
29
- let [X, Z] = v({
30
+ let [X, Z] = g({
30
31
  name: "",
31
32
  slug: "",
32
33
  description: "",
@@ -34,14 +35,14 @@ var E = () => {
34
35
  contactEmail: "",
35
36
  supportEmail: ""
36
37
  }), Q = (e) => {
37
- E?.(`${D}${e}`);
38
- }, ne = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), re = (e) => {
38
+ T?.(`${E}${e}`);
39
+ }, ae = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), oe = (e) => {
39
40
  let t = e.target.value;
40
41
  Z((e) => ({
41
42
  ...e,
42
43
  name: t,
43
- slug: e.slug || ne(t)
44
- })), N.name && P((e) => ({
44
+ slug: e.slug || ae(t)
45
+ })), j.name && M((e) => ({
45
46
  ...e,
46
47
  name: void 0
47
48
  }));
@@ -49,26 +50,26 @@ var E = () => {
49
50
  Z((n) => ({
50
51
  ...n,
51
52
  [e]: t
52
- })), N[e] && P((t) => ({
53
+ })), j[e] && M((t) => ({
53
54
  ...t,
54
55
  [e]: void 0
55
56
  }));
56
- }, ie = () => {
57
+ }, se = () => {
57
58
  let e = {};
58
- return X.name.trim() ? X.name.length < 2 ? e.name = M("devportal.orgNameTooShort", "Name must be at least 2 characters") : X.name.length > 100 && (e.name = M("devportal.nameTooLong", "Name must be less than 100 characters")) : e.name = M("devportal.orgNameRequired", "Organization name is required"), X.slug.trim() ? /^[a-z0-9-]+$/.test(X.slug) || (e.slug = M("devportal.slugInvalid", "Slug can only contain lowercase letters, numbers, and hyphens")) : e.slug = M("devportal.slugRequired", "Slug is required"), X.contactEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(X.contactEmail) && (e.contactEmail = M("devportal.invalidEmailAddress", "Invalid email address")), X.supportEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(X.supportEmail) && (e.supportEmail = M("devportal.invalidEmailAddress", "Invalid email address")), P(e), Object.keys(e).length === 0;
59
+ return X.name.trim() ? X.name.length < 2 ? e.name = A("devportal.orgNameTooShort", "Name must be at least 2 characters") : X.name.length > 100 && (e.name = A("devportal.nameTooLong", "Name must be less than 100 characters")) : e.name = A("devportal.orgNameRequired", "Organization name is required"), X.slug.trim() ? /^[a-z0-9-]+$/.test(X.slug) || (e.slug = A("devportal.slugInvalid", "Slug can only contain lowercase letters, numbers, and hyphens")) : e.slug = A("devportal.slugRequired", "Slug is required"), X.contactEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(X.contactEmail) && (e.contactEmail = A("devportal.invalidEmailAddress", "Invalid email address")), X.supportEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(X.supportEmail) && (e.supportEmail = A("devportal.invalidEmailAddress", "Invalid email address")), M(e), Object.keys(e).length === 0;
59
60
  };
60
- return /* @__PURE__ */ w(p, {
61
+ return /* @__PURE__ */ C(f, {
61
62
  authOnly: !0,
62
- children: /* @__PURE__ */ w(e, {
63
- title: M("devportal.createOrganization", "Create Organization"),
64
- description: j ? M("devportal.createSellerOrganizationDescription", "Set up a seller organization to start selling physical products") : M("devportal.createOrganizationDescription", "Set up a developer organization to collaborate with your team"),
65
- purpose: j ? M("devportal.createSellerOrganizationPurpose", "A seller organization is the shared owner of your physical listings, orders, and revenue. Create one here — you can invite members and complete legal/tax details afterwards.") : M("devportal.createOrganizationPurpose", "An organization is the shared owner of your apps, members, and revenue. Create one here so your team works under a single identity — pick a name and tier now; you can invite members and verify it afterwards."),
66
- backLink: `${D}${a(j)}`,
67
- backLabel: M("devportal.backToOrganizations", "Back to Organizations"),
68
- children: /* @__PURE__ */ T("form", {
63
+ children: /* @__PURE__ */ C(e, {
64
+ title: A("devportal.createOrganization", "Create Organization"),
65
+ description: k ? A("devportal.createSellerOrganizationDescription", "Set up a seller organization to start selling physical products") : A("devportal.createOrganizationDescription", "Set up a developer organization to collaborate with your team"),
66
+ purpose: k ? A("devportal.createSellerOrganizationPurpose", "A seller organization is the shared owner of your physical listings, orders, and revenue. Create one here — you can invite members and complete legal/tax details afterwards.") : A("devportal.createOrganizationPurpose", "An organization is the shared owner of your apps, members, and revenue. Create one here so your team works under a single identity — pick a name and tier now; you can invite members and verify it afterwards."),
67
+ backLink: `${E}${i(k)}`,
68
+ backLabel: A("devportal.backToOrganizations", "Back to Organizations"),
69
+ children: /* @__PURE__ */ w("form", {
69
70
  onSubmit: async (e) => {
70
- if (e.preventDefault(), ie()) {
71
- V("creating-org");
71
+ if (e.preventDefault(), se()) {
72
+ P(null), V("creating-org");
72
73
  try {
73
74
  let e = {
74
75
  name: X.name,
@@ -77,7 +78,7 @@ var E = () => {
77
78
  websiteUrl: X.websiteUrl || void 0,
78
79
  contactEmail: X.contactEmail || void 0,
79
80
  supportEmail: X.supportEmail || void 0
80
- }, t = j ? (await I({ variables: { input: e } })).data?.createSellerOrganization?.id : (await F({ variables: { input: e } })).data?.createDeveloperOrganization?.id;
81
+ }, t = k ? (await I({ variables: { input: e } })).data?.createSellerOrganization?.id : (await F({ variables: { input: e } })).data?.createDeveloperOrganization?.id;
81
82
  if (!t) {
82
83
  V("idle");
83
84
  return;
@@ -85,7 +86,7 @@ var E = () => {
85
86
  if (z.emit("devportal.org.created", {
86
87
  organizationId: t,
87
88
  name: X.name
88
- }), j ? A(t) : te(t), U === "existing" && G) {
89
+ }), k ? ie(t) : re(t), U === "existing" && G) {
89
90
  V("linking-billing");
90
91
  try {
91
92
  await R({ variables: {
@@ -98,7 +99,7 @@ var E = () => {
98
99
  try {
99
100
  let e = (await L({ variables: { input: {
100
101
  name: X.name,
101
- email: O?.email ?? ""
102
+ email: D?.email ?? ""
102
103
  } } })).data?.createBillingAccount?.id;
103
104
  e && await R({ variables: {
104
105
  organizationId: t,
@@ -106,135 +107,140 @@ var E = () => {
106
107
  } });
107
108
  } catch {}
108
109
  }
109
- V("redirecting"), Q(a(j, t));
110
+ V("redirecting"), Q(i(k, t));
110
111
  } catch (e) {
111
- console.error("Failed to create organization:", e), V("idle");
112
+ console.error("Failed to create organization:", e), P(h(e, A("devportal.createOrganizationFailed", "We could not create your organization. Your details are still here, so you can try again."))), V("idle");
112
113
  }
113
114
  }
114
115
  },
115
116
  className: "space-y-8 max-w-3xl",
116
117
  children: [
117
- /* @__PURE__ */ w(t, {
118
- title: M("devportal.organizationDetails", "Organization Details"),
119
- description: M("devportal.organizationDetailsDescription", "Basic information about your organization"),
120
- children: /* @__PURE__ */ T("div", {
118
+ N && /* @__PURE__ */ C("div", {
119
+ role: "alert",
120
+ className: "rounded-md bg-status-error-bg px-3 py-2 text-sm text-status-error-text",
121
+ children: N
122
+ }),
123
+ /* @__PURE__ */ C(t, {
124
+ title: A("devportal.organizationDetails", "Organization Details"),
125
+ description: A("devportal.organizationDetailsDescription", "Basic information about your organization"),
126
+ children: /* @__PURE__ */ w("div", {
121
127
  className: "space-y-4",
122
128
  children: [
123
- /* @__PURE__ */ w(n, {
124
- label: M("devportal.organizationName", "Organization Name"),
129
+ /* @__PURE__ */ C(n, {
130
+ label: A("devportal.organizationName", "Organization Name"),
125
131
  value: X.name,
126
- onChange: re,
127
- placeholder: M("devportal.organizationNamePlaceholder", "Acme Development"),
132
+ onChange: oe,
133
+ placeholder: A("devportal.organizationNamePlaceholder", "Acme Development"),
128
134
  required: !0,
129
- error: N.name,
130
- hint: M("devportal.organizationNameHint", "Your organization's display name")
135
+ error: j.name,
136
+ hint: A("devportal.organizationNameHint", "Your organization's display name")
131
137
  }),
132
- /* @__PURE__ */ w(n, {
133
- label: M("devportal.slug", "Slug"),
138
+ /* @__PURE__ */ C(n, {
139
+ label: A("devportal.slug", "Slug"),
134
140
  value: X.slug,
135
141
  onChange: (e) => $("slug", e.target.value.toLowerCase()),
136
- placeholder: M("devportal.orgSlugPlaceholder", "acme-dev"),
142
+ placeholder: A("devportal.orgSlugPlaceholder", "acme-dev"),
137
143
  required: !0,
138
- error: N.slug,
139
- hint: M("devportal.slugHint", "URL-friendly identifier (auto-generated from name)")
144
+ error: j.slug,
145
+ hint: A("devportal.slugHint", "URL-friendly identifier (auto-generated from name)")
140
146
  }),
141
- /* @__PURE__ */ w(r, {
142
- label: M("devportal.description", "Description"),
147
+ /* @__PURE__ */ C(r, {
148
+ label: A("devportal.description", "Description"),
143
149
  value: X.description,
144
150
  onChange: (e) => $("description", e.target.value),
145
- placeholder: M("devportal.orgDescriptionPlaceholder", "Tell us about your organization..."),
151
+ placeholder: A("devportal.orgDescriptionPlaceholder", "Tell us about your organization..."),
146
152
  rows: 3
147
153
  }),
148
- /* @__PURE__ */ w(n, {
149
- label: M("devportal.websiteUrl", "Website URL"),
154
+ /* @__PURE__ */ C(n, {
155
+ label: A("devportal.websiteUrl", "Website URL"),
150
156
  type: "url",
151
157
  value: X.websiteUrl,
152
158
  onChange: (e) => $("websiteUrl", e.target.value),
153
159
  placeholder: "https://example.com"
154
160
  }),
155
- /* @__PURE__ */ T("div", {
161
+ /* @__PURE__ */ w("div", {
156
162
  className: "grid gap-4 sm:grid-cols-2",
157
- children: [/* @__PURE__ */ w(n, {
158
- label: M("devportal.contactEmail", "Contact Email"),
163
+ children: [/* @__PURE__ */ C(n, {
164
+ label: A("devportal.contactEmail", "Contact Email"),
159
165
  type: "email",
160
166
  value: X.contactEmail,
161
167
  onChange: (e) => $("contactEmail", e.target.value),
162
168
  placeholder: "contact@example.com",
163
- error: N.contactEmail
164
- }), /* @__PURE__ */ w(n, {
165
- label: M("devportal.supportEmail", "Support Email"),
169
+ error: j.contactEmail
170
+ }), /* @__PURE__ */ C(n, {
171
+ label: A("devportal.supportEmail", "Support Email"),
166
172
  type: "email",
167
173
  value: X.supportEmail,
168
174
  onChange: (e) => $("supportEmail", e.target.value),
169
175
  placeholder: "support@example.com",
170
- error: N.supportEmail
176
+ error: j.supportEmail
171
177
  })]
172
178
  })
173
179
  ]
174
180
  })
175
181
  }),
176
- /* @__PURE__ */ w(t, {
177
- title: M("devportal.billingAccount", "Billing Account"),
178
- description: M("devportal.billingAccountSectionDescription", "Revenue from sales will be credited here. You can change this anytime from the Revenue page."),
179
- children: /* @__PURE__ */ T("div", {
182
+ /* @__PURE__ */ C(t, {
183
+ title: A("devportal.billingAccount", "Billing Account"),
184
+ description: A("devportal.billingAccountSectionDescription", "Revenue from sales will be credited here. You can change this anytime from the Revenue page."),
185
+ children: /* @__PURE__ */ w("div", {
180
186
  className: "space-y-3",
181
187
  children: [
182
- /* @__PURE__ */ T("button", {
188
+ /* @__PURE__ */ w("button", {
183
189
  type: "button",
184
190
  onClick: () => W("auto"),
185
191
  disabled: H,
186
- className: m("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50", U === "auto" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
187
- children: [/* @__PURE__ */ w(b, {
192
+ className: p("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50", U === "auto" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
193
+ children: [/* @__PURE__ */ C(v, {
188
194
  size: 16,
189
- className: m("mt-0.5 flex-shrink-0", U === "auto" ? "opacity-100 text-primary" : "opacity-0")
190
- }), /* @__PURE__ */ T("div", {
195
+ className: p("mt-0.5 flex-shrink-0", U === "auto" ? "opacity-100 text-primary" : "opacity-0")
196
+ }), /* @__PURE__ */ w("div", {
191
197
  className: "flex-1 min-w-0",
192
- children: [/* @__PURE__ */ w("p", {
198
+ children: [/* @__PURE__ */ C("p", {
193
199
  className: "text-sm font-medium",
194
- children: M("devportal.billingAutoCreate", "Create a new billing account automatically")
195
- }), /* @__PURE__ */ w("p", {
200
+ children: A("devportal.billingAutoCreate", "Create a new billing account automatically")
201
+ }), /* @__PURE__ */ C("p", {
196
202
  className: "mt-0.5 text-xs text-text-secondary",
197
- children: M("devportal.billingAutoCreateHint", "We'll set one up using your organization name and account email. You can complete legal and tax details for payouts later in Organization Settings.")
203
+ children: A("devportal.billingAutoCreateHint", "We'll set one up using your organization name and account email. You can complete legal and tax details for payouts later in Organization Settings.")
198
204
  })]
199
205
  })]
200
206
  }),
201
- /* @__PURE__ */ T("button", {
207
+ /* @__PURE__ */ w("button", {
202
208
  type: "button",
203
209
  onClick: () => W("existing"),
204
210
  disabled: H || !J && Y.length === 0,
205
- className: m("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50", U === "existing" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
206
- children: [/* @__PURE__ */ w(b, {
211
+ className: p("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50", U === "existing" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
212
+ children: [/* @__PURE__ */ C(v, {
207
213
  size: 16,
208
- className: m("mt-0.5 flex-shrink-0", U === "existing" ? "opacity-100 text-primary" : "opacity-0")
209
- }), /* @__PURE__ */ T("div", {
214
+ className: p("mt-0.5 flex-shrink-0", U === "existing" ? "opacity-100 text-primary" : "opacity-0")
215
+ }), /* @__PURE__ */ w("div", {
210
216
  className: "flex-1 min-w-0",
211
- children: [/* @__PURE__ */ T("p", {
217
+ children: [/* @__PURE__ */ w("p", {
212
218
  className: "flex items-center gap-1.5 text-sm font-medium",
213
- children: [/* @__PURE__ */ w(x, { size: 14 }), M("devportal.billingLinkExisting", "Link an existing billing account")]
214
- }), /* @__PURE__ */ w("p", {
219
+ children: [/* @__PURE__ */ C(y, { size: 14 }), A("devportal.billingLinkExisting", "Link an existing billing account")]
220
+ }), /* @__PURE__ */ C("p", {
215
221
  className: "mt-0.5 text-xs text-text-secondary",
216
- children: J ? M("devportal.billingAccountsLoading", "Loading your billing accounts...") : Y.length === 0 ? M("devportal.noBillingAccountsYet", "You don't have any billing accounts yet — create one from account billing settings first.") : M("devportal.billingAccountsAvailable", "{{count}} billing account(s) available to link", { count: Y.length })
222
+ children: J ? A("devportal.billingAccountsLoading", "Loading your billing accounts...") : Y.length === 0 ? A("devportal.noBillingAccountsYet", "You don't have any billing accounts yet — create one from account billing settings first.") : A("devportal.billingAccountsAvailable", "{{count}} billing account(s) available to link", { count: Y.length })
217
223
  })]
218
224
  })]
219
225
  }),
220
- U === "existing" && Y.length > 0 && /* @__PURE__ */ w("div", {
226
+ U === "existing" && Y.length > 0 && /* @__PURE__ */ C("div", {
221
227
  className: "ml-8 space-y-2",
222
- children: Y.map((e) => /* @__PURE__ */ T("button", {
228
+ children: Y.map((e) => /* @__PURE__ */ w("button", {
223
229
  type: "button",
224
230
  disabled: H,
225
231
  onClick: () => K(e.id ?? null),
226
- className: m("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50", G === e.id ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
227
- children: [/* @__PURE__ */ w(b, {
232
+ className: p("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50", G === e.id ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
233
+ children: [/* @__PURE__ */ C(v, {
228
234
  size: 14,
229
- className: m("flex-shrink-0", G === e.id ? "opacity-100 text-primary" : "opacity-0")
230
- }), /* @__PURE__ */ T("div", {
235
+ className: p("flex-shrink-0", G === e.id ? "opacity-100 text-primary" : "opacity-0")
236
+ }), /* @__PURE__ */ w("div", {
231
237
  className: "min-w-0 flex-1",
232
- children: [/* @__PURE__ */ w("p", {
238
+ children: [/* @__PURE__ */ C("p", {
233
239
  className: "truncate font-medium",
234
240
  children: e.name
235
- }), e.isDefault && /* @__PURE__ */ w("p", {
241
+ }), e.isDefault && /* @__PURE__ */ C("p", {
236
242
  className: "text-xs text-text-secondary",
237
- children: M("devportal.revenue.defaultAccount", "Default")
243
+ children: A("devportal.revenue.defaultAccount", "Default")
238
244
  })]
239
245
  })]
240
246
  }, e.id))
@@ -242,39 +248,39 @@ var E = () => {
242
248
  ]
243
249
  })
244
250
  }),
245
- H && /* @__PURE__ */ T("div", {
251
+ H && /* @__PURE__ */ w("div", {
246
252
  className: "flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3 text-sm text-text-secondary",
247
253
  children: [
248
- /* @__PURE__ */ w(S, {
254
+ /* @__PURE__ */ C(b, {
249
255
  size: 16,
250
256
  className: "flex-shrink-0 animate-spin text-primary"
251
257
  }),
252
- B === "creating-org" && M("devportal.creatingOrgStatus", "Creating your organization..."),
253
- B === "setting-up-billing" && M("devportal.settingUpBillingStatus", "Setting up your billing account..."),
254
- B === "linking-billing" && M("devportal.linkingBillingStatus", "Linking your billing account..."),
255
- B === "redirecting" && M("devportal.redirectingStatus", "All set — redirecting...")
258
+ B === "creating-org" && A("devportal.creatingOrgStatus", "Creating your organization..."),
259
+ B === "setting-up-billing" && A("devportal.settingUpBillingStatus", "Setting up your billing account..."),
260
+ B === "linking-billing" && A("devportal.linkingBillingStatus", "Linking your billing account..."),
261
+ B === "redirecting" && A("devportal.redirectingStatus", "All set — redirecting...")
256
262
  ]
257
263
  }),
258
- /* @__PURE__ */ T("div", {
264
+ /* @__PURE__ */ w("div", {
259
265
  className: "flex items-center justify-end gap-3 border-t pt-6",
260
- children: [/* @__PURE__ */ T("button", {
266
+ children: [/* @__PURE__ */ w("button", {
261
267
  type: "button",
262
268
  onClick: () => {
263
- Q(a(j));
269
+ Q(i(k));
264
270
  },
265
271
  disabled: H,
266
272
  className: "inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm font-medium hover:bg-bg-sunken transition-colors disabled:opacity-50",
267
- children: [/* @__PURE__ */ w(ee, { size: 16 }), M("devportal.cancel", "Cancel")]
268
- }), /* @__PURE__ */ w("button", {
273
+ children: [/* @__PURE__ */ C(x, { size: 16 }), A("devportal.cancel", "Cancel")]
274
+ }), /* @__PURE__ */ C("button", {
269
275
  type: "submit",
270
276
  disabled: H,
271
277
  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",
272
- children: H ? /* @__PURE__ */ T(C, { children: [
273
- /* @__PURE__ */ w("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
274
- B === "setting-up-billing" && M("devportal.settingUpBilling", "Setting up billing..."),
275
- B === "linking-billing" && M("devportal.linkingBilling", "Linking billing..."),
276
- (B === "creating-org" || B === "redirecting") && M("devportal.creating", "Creating...")
277
- ] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(y, { size: 16 }), M("devportal.createOrganization", "Create Organization")] })
278
+ children: H ? /* @__PURE__ */ w(S, { children: [
279
+ /* @__PURE__ */ C("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
280
+ B === "setting-up-billing" && A("devportal.settingUpBilling", "Setting up billing..."),
281
+ B === "linking-billing" && A("devportal.linkingBilling", "Linking billing..."),
282
+ (B === "creating-org" || B === "redirecting") && A("devportal.creating", "Creating...")
283
+ ] }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(_, { size: 16 }), A("devportal.createOrganization", "Create Organization")] })
278
284
  })]
279
285
  })
280
286
  ]
@@ -282,6 +288,6 @@ var E = () => {
282
288
  })
283
289
  });
284
290
  };
285
- export { E as CreateOrganizationPage };
291
+ export { T as CreateOrganizationPage };
286
292
 
287
293
  //# sourceMappingURL=CreateOrganizationPage.js.map