@burdenoff/microfe-devportal 2026.915.7 → 2026.915.8
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.
- package/dist/devportal/components/RegisterPickupLocationModal.d.ts +15 -15
- package/dist/devportal/components/RegisterPickupLocationModal.d.ts.map +1 -1
- package/dist/devportal/components/RegisterPickupLocationModal.js +10 -9
- package/dist/devportal/components/RegisterPickupLocationModal.js.map +1 -1
- package/dist/devportal/hooks/useOrganizationPickupAddresses.d.ts +31 -0
- package/dist/devportal/hooks/useOrganizationPickupAddresses.d.ts.map +1 -0
- package/dist/devportal/hooks/useOrganizationPickupAddresses.js +34 -0
- package/dist/devportal/hooks/useOrganizationPickupAddresses.js.map +1 -0
- package/dist/devportal/pages/CreateOrganizationPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.js +158 -244
- package/dist/devportal/pages/CreateOrganizationPage.js.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.d.ts.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.js +517 -478
- package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,335 +2,249 @@ import { useDevportal as e } from "../providers/DevportalProvider.js";
|
|
|
2
2
|
import { useTr as t } from "../utils/i18n.js";
|
|
3
3
|
import { cn as n } from "../utils/cn.js";
|
|
4
4
|
import { useDevportalEventBus as r } from "../events/index.js";
|
|
5
|
-
import { orgSectionPath as i, useIsSellerSection as
|
|
6
|
-
import { useCreateBillingAccountMutation as
|
|
7
|
-
import { PageLayout as
|
|
8
|
-
import { InputField as
|
|
9
|
-
import {
|
|
10
|
-
import { PermissionGuard as m } from "../components/PermissionGuard.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
|
+
import { PageLayout as d, PageSection as f } from "../components/PageLayout.js";
|
|
8
|
+
import { InputField as p, TextareaField as m } from "../components/FormField.js";
|
|
9
|
+
import { PermissionGuard as h } from "../components/PermissionGuard.js";
|
|
11
10
|
import "../components/index.js";
|
|
12
|
-
import { capitalizeCarrierName as h, useCarrierPickupLocations as g } from "../hooks/useCarrierPickupLocations.js";
|
|
13
11
|
import "../hooks/index.js";
|
|
14
|
-
import { useEffect as
|
|
15
|
-
import { Building2 as
|
|
16
|
-
import { Fragment as
|
|
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";
|
|
17
15
|
//#region src/devportal/pages/CreateOrganizationPage.tsx
|
|
18
|
-
var
|
|
19
|
-
let { navigate:
|
|
16
|
+
var E = () => {
|
|
17
|
+
let { navigate: E, basePath: D, currentUser: O, tenantId: k, setActiveOrgId: A, setActivePhysicalOrgId: te } = e(), j = a(), M = t(), [N, P] = v({}), [F] = s(), [I] = c(), [L] = o(), [R] = u(), z = r(), [B, V] = v("idle"), H = B !== "idle", [U, W] = v("auto"), [G, K] = v(null), { data: q, loading: J } = l({
|
|
20
18
|
fetchPolicy: "cache-and-network",
|
|
21
|
-
context: { headers: { "x-org-id":
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
if (!(
|
|
25
|
-
if (
|
|
26
|
-
|
|
19
|
+
context: { headers: { "x-org-id": k ?? "" } }
|
|
20
|
+
}), Y = _(() => q?.getBillingAccountsByOrg ?? [], [q]);
|
|
21
|
+
g(() => {
|
|
22
|
+
if (!(U !== "existing" || J)) {
|
|
23
|
+
if (Y.length === 0) {
|
|
24
|
+
W("auto");
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
29
|
-
|
|
27
|
+
G || K(Y.find((e) => e.isDefault)?.id ?? Y[0]?.id ?? null);
|
|
30
28
|
}
|
|
31
29
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
U,
|
|
31
|
+
J,
|
|
32
|
+
Y,
|
|
33
|
+
G
|
|
36
34
|
]);
|
|
37
|
-
let [
|
|
35
|
+
let [X, Z] = v({
|
|
38
36
|
name: "",
|
|
39
37
|
slug: "",
|
|
40
38
|
description: "",
|
|
41
39
|
websiteUrl: "",
|
|
42
40
|
contactEmail: "",
|
|
43
|
-
supportEmail: ""
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, ue = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), de = (e) => {
|
|
41
|
+
supportEmail: ""
|
|
42
|
+
}), Q = (e) => {
|
|
43
|
+
E?.(`${D}${e}`);
|
|
44
|
+
}, ne = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), re = (e) => {
|
|
48
45
|
let t = e.target.value;
|
|
49
|
-
|
|
46
|
+
Z((e) => ({
|
|
50
47
|
...e,
|
|
51
48
|
name: t,
|
|
52
|
-
slug: e.slug ||
|
|
53
|
-
})),
|
|
49
|
+
slug: e.slug || ne(t)
|
|
50
|
+
})), N.name && P((e) => ({
|
|
54
51
|
...e,
|
|
55
52
|
name: void 0
|
|
56
53
|
}));
|
|
57
54
|
}, $ = (e, t) => {
|
|
58
|
-
|
|
55
|
+
Z((n) => ({
|
|
59
56
|
...n,
|
|
60
57
|
[e]: t
|
|
61
|
-
})),
|
|
58
|
+
})), N[e] && P((t) => ({
|
|
62
59
|
...t,
|
|
63
60
|
[e]: void 0
|
|
64
61
|
}));
|
|
65
|
-
},
|
|
62
|
+
}, ie = () => {
|
|
66
63
|
let e = {};
|
|
67
|
-
return
|
|
64
|
+
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;
|
|
68
65
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ w(h, {
|
|
70
67
|
authOnly: !0,
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
title:
|
|
73
|
-
description:
|
|
74
|
-
purpose:
|
|
75
|
-
backLink: `${
|
|
76
|
-
backLabel:
|
|
77
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ w(d, {
|
|
69
|
+
title: M("devportal.createOrganization", "Create Organization"),
|
|
70
|
+
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"),
|
|
71
|
+
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."),
|
|
72
|
+
backLink: `${D}${i(j)}`,
|
|
73
|
+
backLabel: M("devportal.backToOrganizations", "Back to Organizations"),
|
|
74
|
+
children: /* @__PURE__ */ T("form", {
|
|
78
75
|
onSubmit: async (e) => {
|
|
79
|
-
if (e.preventDefault(),
|
|
80
|
-
|
|
76
|
+
if (e.preventDefault(), ie()) {
|
|
77
|
+
V("creating-org");
|
|
81
78
|
try {
|
|
82
79
|
let e = {
|
|
83
|
-
name:
|
|
84
|
-
slug:
|
|
85
|
-
description:
|
|
86
|
-
websiteUrl:
|
|
87
|
-
contactEmail:
|
|
88
|
-
supportEmail:
|
|
89
|
-
|
|
90
|
-
}, t = D ? (await M({ variables: { input: e } })).data?.createSellerOrganization?.id : (await j({ variables: { input: e } })).data?.createDeveloperOrganization?.id;
|
|
80
|
+
name: X.name,
|
|
81
|
+
slug: X.slug || void 0,
|
|
82
|
+
description: X.description || void 0,
|
|
83
|
+
websiteUrl: X.websiteUrl || void 0,
|
|
84
|
+
contactEmail: X.contactEmail || void 0,
|
|
85
|
+
supportEmail: X.supportEmail || void 0
|
|
86
|
+
}, t = j ? (await I({ variables: { input: e } })).data?.createSellerOrganization?.id : (await F({ variables: { input: e } })).data?.createDeveloperOrganization?.id;
|
|
91
87
|
if (!t) {
|
|
92
|
-
|
|
88
|
+
V("idle");
|
|
93
89
|
return;
|
|
94
90
|
}
|
|
95
|
-
if (
|
|
91
|
+
if (z.emit("devportal.org.created", {
|
|
96
92
|
organizationId: t,
|
|
97
|
-
name:
|
|
98
|
-
}),
|
|
99
|
-
|
|
93
|
+
name: X.name
|
|
94
|
+
}), j ? te(t) : A(t), U === "existing" && G) {
|
|
95
|
+
V("linking-billing");
|
|
100
96
|
try {
|
|
101
|
-
await
|
|
97
|
+
await R({ variables: {
|
|
102
98
|
organizationId: t,
|
|
103
|
-
billingAccountId:
|
|
99
|
+
billingAccountId: G
|
|
104
100
|
} });
|
|
105
101
|
} catch {}
|
|
106
102
|
} else {
|
|
107
|
-
|
|
103
|
+
V("setting-up-billing");
|
|
108
104
|
try {
|
|
109
|
-
let e = (await
|
|
110
|
-
name:
|
|
111
|
-
email:
|
|
105
|
+
let e = (await L({ variables: { input: {
|
|
106
|
+
name: X.name,
|
|
107
|
+
email: O?.email ?? ""
|
|
112
108
|
} } })).data?.createBillingAccount?.id;
|
|
113
|
-
e && await
|
|
109
|
+
e && await R({ variables: {
|
|
114
110
|
organizationId: t,
|
|
115
111
|
billingAccountId: e
|
|
116
112
|
} });
|
|
117
113
|
} catch {}
|
|
118
114
|
}
|
|
119
|
-
|
|
115
|
+
V("redirecting"), Q(i(j, t));
|
|
120
116
|
} catch (e) {
|
|
121
|
-
console.error("Failed to create organization:", e),
|
|
117
|
+
console.error("Failed to create organization:", e), V("idle");
|
|
122
118
|
}
|
|
123
119
|
}
|
|
124
120
|
},
|
|
125
121
|
className: "space-y-8 max-w-3xl",
|
|
126
122
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
title:
|
|
129
|
-
description:
|
|
130
|
-
children: /* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ w(f, {
|
|
124
|
+
title: M("devportal.organizationDetails", "Organization Details"),
|
|
125
|
+
description: M("devportal.organizationDetailsDescription", "Basic information about your organization"),
|
|
126
|
+
children: /* @__PURE__ */ T("div", {
|
|
131
127
|
className: "space-y-4",
|
|
132
128
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
label:
|
|
135
|
-
value:
|
|
136
|
-
onChange:
|
|
137
|
-
placeholder:
|
|
129
|
+
/* @__PURE__ */ w(p, {
|
|
130
|
+
label: M("devportal.organizationName", "Organization Name"),
|
|
131
|
+
value: X.name,
|
|
132
|
+
onChange: re,
|
|
133
|
+
placeholder: M("devportal.organizationNamePlaceholder", "Acme Development"),
|
|
138
134
|
required: !0,
|
|
139
|
-
error:
|
|
140
|
-
hint:
|
|
135
|
+
error: N.name,
|
|
136
|
+
hint: M("devportal.organizationNameHint", "Your organization's display name")
|
|
141
137
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
label:
|
|
144
|
-
value:
|
|
138
|
+
/* @__PURE__ */ w(p, {
|
|
139
|
+
label: M("devportal.slug", "Slug"),
|
|
140
|
+
value: X.slug,
|
|
145
141
|
onChange: (e) => $("slug", e.target.value.toLowerCase()),
|
|
146
|
-
placeholder:
|
|
142
|
+
placeholder: M("devportal.orgSlugPlaceholder", "acme-dev"),
|
|
147
143
|
required: !0,
|
|
148
|
-
error:
|
|
149
|
-
hint:
|
|
144
|
+
error: N.slug,
|
|
145
|
+
hint: M("devportal.slugHint", "URL-friendly identifier (auto-generated from name)")
|
|
150
146
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
label:
|
|
153
|
-
value:
|
|
147
|
+
/* @__PURE__ */ w(m, {
|
|
148
|
+
label: M("devportal.description", "Description"),
|
|
149
|
+
value: X.description,
|
|
154
150
|
onChange: (e) => $("description", e.target.value),
|
|
155
|
-
placeholder:
|
|
151
|
+
placeholder: M("devportal.orgDescriptionPlaceholder", "Tell us about your organization..."),
|
|
156
152
|
rows: 3
|
|
157
153
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
label:
|
|
154
|
+
/* @__PURE__ */ w(p, {
|
|
155
|
+
label: M("devportal.websiteUrl", "Website URL"),
|
|
160
156
|
type: "url",
|
|
161
|
-
value:
|
|
157
|
+
value: X.websiteUrl,
|
|
162
158
|
onChange: (e) => $("websiteUrl", e.target.value),
|
|
163
159
|
placeholder: "https://example.com"
|
|
164
160
|
}),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */ C("p", {
|
|
171
|
-
className: "text-sm font-medium",
|
|
172
|
-
children: O("devportal.pickupPostalCode", "Pickup address (optional)")
|
|
173
|
-
}),
|
|
174
|
-
e.length === 0 ? /* @__PURE__ */ w("div", {
|
|
175
|
-
className: "rounded-md border border-border-seam bg-bg-sunken p-4",
|
|
176
|
-
children: [/* @__PURE__ */ C("p", {
|
|
177
|
-
className: "text-sm font-medium",
|
|
178
|
-
children: O("devportal.noPickupAddress", "No pickup address set up yet")
|
|
179
|
-
}), /* @__PURE__ */ C("p", {
|
|
180
|
-
className: "mt-1 text-sm text-text-secondary",
|
|
181
|
-
children: O("devportal.pickupPostalCodeHint", "The real address your physical orders ship from — used to quote real carrier shipping rates and register with our shipping carrier, free of charge. You can skip this now and set it up later from organization settings.")
|
|
182
|
-
})]
|
|
183
|
-
}) : t ? /* @__PURE__ */ w("div", {
|
|
184
|
-
className: "rounded-md border border-status-success-border bg-status-success-bg-subtle p-4",
|
|
185
|
-
children: [/* @__PURE__ */ C("p", {
|
|
186
|
-
className: "text-sm font-medium text-status-success-text",
|
|
187
|
-
children: O("devportal.pickupAddressRegistered", "Pickup address registered — ready for automated shipping")
|
|
188
|
-
}), /* @__PURE__ */ w("p", {
|
|
189
|
-
className: "mt-1 text-sm text-text-secondary",
|
|
190
|
-
children: [
|
|
191
|
-
t.label,
|
|
192
|
-
" ·",
|
|
193
|
-
" ",
|
|
194
|
-
t.postalCode,
|
|
195
|
-
" ·",
|
|
196
|
-
" ",
|
|
197
|
-
h(t.carrier)
|
|
198
|
-
]
|
|
199
|
-
})]
|
|
200
|
-
}) : n ? /* @__PURE__ */ w("div", {
|
|
201
|
-
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle p-4",
|
|
202
|
-
children: [/* @__PURE__ */ C("p", {
|
|
203
|
-
className: "text-sm font-medium text-status-error-text",
|
|
204
|
-
children: O("devportal.pickupAddressNotRegistered", "Pickup address not registered")
|
|
205
|
-
}), /* @__PURE__ */ w("p", {
|
|
206
|
-
className: "mt-1 text-sm text-text-secondary",
|
|
207
|
-
children: [
|
|
208
|
-
O("devportal.pickupAddressNotRegisteredHint", "Your saved pincode isn't registered with our shipping carrier yet — physical orders can't auto-ship until it's added."),
|
|
209
|
-
" ",
|
|
210
|
-
"(",
|
|
211
|
-
e,
|
|
212
|
-
")"
|
|
213
|
-
]
|
|
214
|
-
})]
|
|
215
|
-
}) : /* @__PURE__ */ w("div", {
|
|
216
|
-
className: "rounded-md border border-border-seam bg-bg-sunken p-4",
|
|
217
|
-
children: [/* @__PURE__ */ C("p", {
|
|
218
|
-
className: "text-sm font-medium",
|
|
219
|
-
children: e
|
|
220
|
-
}), /* @__PURE__ */ C("p", {
|
|
221
|
-
className: "mt-1 text-sm text-text-secondary",
|
|
222
|
-
children: O("devportal.pickupAddressStatusUnavailable", "Couldn't check registration status right now.")
|
|
223
|
-
})]
|
|
224
|
-
}),
|
|
225
|
-
/* @__PURE__ */ w("div", {
|
|
226
|
-
className: "flex items-center gap-4",
|
|
227
|
-
children: [/* @__PURE__ */ C("button", {
|
|
228
|
-
type: "button",
|
|
229
|
-
onClick: () => Z(!0),
|
|
230
|
-
className: "text-sm font-medium text-action-primary-text hover:underline",
|
|
231
|
-
children: e.length === 0 ? O("devportal.setUpPickupAddressCta", "Set up pickup address") : t ? O("devportal.changePickupAddressCta", "Change pickup address") : O("devportal.registerPickupAddressCta", "Register this address with Shiprocket")
|
|
232
|
-
}), e.length > 0 && /* @__PURE__ */ w("button", {
|
|
233
|
-
type: "button",
|
|
234
|
-
onClick: () => $("pickupPostalCode", ""),
|
|
235
|
-
className: "flex items-center gap-1.5 text-sm text-status-error-text hover:underline",
|
|
236
|
-
children: [/* @__PURE__ */ C(b, { className: "h-3.5 w-3.5" }), O("devportal.removePickupAddressCta", "Remove pickup address")]
|
|
237
|
-
})]
|
|
238
|
-
}),
|
|
239
|
-
X && /* @__PURE__ */ C(p, {
|
|
240
|
-
open: X,
|
|
241
|
-
onOpenChange: Z,
|
|
242
|
-
initialPostalCode: e,
|
|
243
|
-
carrier: "shiprocket",
|
|
244
|
-
onRegistered: (e) => {
|
|
245
|
-
$("pickupPostalCode", e), Y();
|
|
246
|
-
}
|
|
247
|
-
})
|
|
248
|
-
]
|
|
249
|
-
});
|
|
250
|
-
})(),
|
|
251
|
-
/* @__PURE__ */ w("div", {
|
|
161
|
+
j && /* @__PURE__ */ w("p", {
|
|
162
|
+
className: "rounded-md border border-border-seam bg-bg-sunken p-4 text-sm text-text-secondary",
|
|
163
|
+
children: M("devportal.pickupAddressDeferredHint", "You can add and register your real pickup address — and add more than one — right after creating your organization, from its Settings tab.")
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ T("div", {
|
|
252
166
|
className: "grid gap-4 sm:grid-cols-2",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
254
|
-
label:
|
|
167
|
+
children: [/* @__PURE__ */ w(p, {
|
|
168
|
+
label: M("devportal.contactEmail", "Contact Email"),
|
|
255
169
|
type: "email",
|
|
256
|
-
value:
|
|
170
|
+
value: X.contactEmail,
|
|
257
171
|
onChange: (e) => $("contactEmail", e.target.value),
|
|
258
172
|
placeholder: "contact@example.com",
|
|
259
|
-
error:
|
|
260
|
-
}), /* @__PURE__ */
|
|
261
|
-
label:
|
|
173
|
+
error: N.contactEmail
|
|
174
|
+
}), /* @__PURE__ */ w(p, {
|
|
175
|
+
label: M("devportal.supportEmail", "Support Email"),
|
|
262
176
|
type: "email",
|
|
263
|
-
value:
|
|
177
|
+
value: X.supportEmail,
|
|
264
178
|
onChange: (e) => $("supportEmail", e.target.value),
|
|
265
179
|
placeholder: "support@example.com",
|
|
266
|
-
error:
|
|
180
|
+
error: N.supportEmail
|
|
267
181
|
})]
|
|
268
182
|
})
|
|
269
183
|
]
|
|
270
184
|
})
|
|
271
185
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
title:
|
|
274
|
-
description:
|
|
275
|
-
children: /* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ w(f, {
|
|
187
|
+
title: M("devportal.billingAccount", "Billing Account"),
|
|
188
|
+
description: M("devportal.billingAccountSectionDescription", "Revenue from sales will be credited here. You can change this anytime from the Revenue page."),
|
|
189
|
+
children: /* @__PURE__ */ T("div", {
|
|
276
190
|
className: "space-y-3",
|
|
277
191
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ T("button", {
|
|
279
193
|
type: "button",
|
|
280
|
-
onClick: () =>
|
|
281
|
-
disabled:
|
|
282
|
-
className: n("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",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
194
|
+
onClick: () => W("auto"),
|
|
195
|
+
disabled: H,
|
|
196
|
+
className: n("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"),
|
|
197
|
+
children: [/* @__PURE__ */ w(b, {
|
|
284
198
|
size: 16,
|
|
285
|
-
className: n("mt-0.5 flex-shrink-0",
|
|
286
|
-
}), /* @__PURE__ */
|
|
199
|
+
className: n("mt-0.5 flex-shrink-0", U === "auto" ? "opacity-100 text-primary" : "opacity-0")
|
|
200
|
+
}), /* @__PURE__ */ T("div", {
|
|
287
201
|
className: "flex-1 min-w-0",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ w("p", {
|
|
289
203
|
className: "text-sm font-medium",
|
|
290
|
-
children:
|
|
291
|
-
}), /* @__PURE__ */
|
|
204
|
+
children: M("devportal.billingAutoCreate", "Create a new billing account automatically")
|
|
205
|
+
}), /* @__PURE__ */ w("p", {
|
|
292
206
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
293
|
-
children:
|
|
207
|
+
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.")
|
|
294
208
|
})]
|
|
295
209
|
})]
|
|
296
210
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ T("button", {
|
|
298
212
|
type: "button",
|
|
299
|
-
onClick: () =>
|
|
300
|
-
disabled:
|
|
301
|
-
className: n("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",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
213
|
+
onClick: () => W("existing"),
|
|
214
|
+
disabled: H || !J && Y.length === 0,
|
|
215
|
+
className: n("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"),
|
|
216
|
+
children: [/* @__PURE__ */ w(b, {
|
|
303
217
|
size: 16,
|
|
304
|
-
className: n("mt-0.5 flex-shrink-0",
|
|
305
|
-
}), /* @__PURE__ */
|
|
218
|
+
className: n("mt-0.5 flex-shrink-0", U === "existing" ? "opacity-100 text-primary" : "opacity-0")
|
|
219
|
+
}), /* @__PURE__ */ T("div", {
|
|
306
220
|
className: "flex-1 min-w-0",
|
|
307
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ T("p", {
|
|
308
222
|
className: "flex items-center gap-1.5 text-sm font-medium",
|
|
309
|
-
children: [/* @__PURE__ */
|
|
310
|
-
}), /* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ w(x, { size: 14 }), M("devportal.billingLinkExisting", "Link an existing billing account")]
|
|
224
|
+
}), /* @__PURE__ */ w("p", {
|
|
311
225
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
312
|
-
children:
|
|
226
|
+
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 })
|
|
313
227
|
})]
|
|
314
228
|
})]
|
|
315
229
|
}),
|
|
316
|
-
|
|
230
|
+
U === "existing" && Y.length > 0 && /* @__PURE__ */ w("div", {
|
|
317
231
|
className: "ml-8 space-y-2",
|
|
318
|
-
children:
|
|
232
|
+
children: Y.map((e) => /* @__PURE__ */ T("button", {
|
|
319
233
|
type: "button",
|
|
320
|
-
disabled:
|
|
321
|
-
onClick: () =>
|
|
322
|
-
className: n("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",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
234
|
+
disabled: H,
|
|
235
|
+
onClick: () => K(e.id ?? null),
|
|
236
|
+
className: n("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"),
|
|
237
|
+
children: [/* @__PURE__ */ w(b, {
|
|
324
238
|
size: 14,
|
|
325
|
-
className: n("flex-shrink-0",
|
|
326
|
-
}), /* @__PURE__ */
|
|
239
|
+
className: n("flex-shrink-0", G === e.id ? "opacity-100 text-primary" : "opacity-0")
|
|
240
|
+
}), /* @__PURE__ */ T("div", {
|
|
327
241
|
className: "min-w-0 flex-1",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ w("p", {
|
|
329
243
|
className: "truncate font-medium",
|
|
330
244
|
children: e.name
|
|
331
|
-
}), e.isDefault && /* @__PURE__ */
|
|
245
|
+
}), e.isDefault && /* @__PURE__ */ w("p", {
|
|
332
246
|
className: "text-xs text-text-secondary",
|
|
333
|
-
children:
|
|
247
|
+
children: M("devportal.revenue.defaultAccount", "Default")
|
|
334
248
|
})]
|
|
335
249
|
})]
|
|
336
250
|
}, e.id))
|
|
@@ -338,39 +252,39 @@ var T = () => {
|
|
|
338
252
|
]
|
|
339
253
|
})
|
|
340
254
|
}),
|
|
341
|
-
|
|
255
|
+
H && /* @__PURE__ */ T("div", {
|
|
342
256
|
className: "flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3 text-sm text-text-secondary",
|
|
343
257
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ w(S, {
|
|
345
259
|
size: 16,
|
|
346
260
|
className: "flex-shrink-0 animate-spin text-primary"
|
|
347
261
|
}),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
262
|
+
B === "creating-org" && M("devportal.creatingOrgStatus", "Creating your organization..."),
|
|
263
|
+
B === "setting-up-billing" && M("devportal.settingUpBillingStatus", "Setting up your billing account..."),
|
|
264
|
+
B === "linking-billing" && M("devportal.linkingBillingStatus", "Linking your billing account..."),
|
|
265
|
+
B === "redirecting" && M("devportal.redirectingStatus", "All set — redirecting...")
|
|
352
266
|
]
|
|
353
267
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ T("div", {
|
|
355
269
|
className: "flex items-center justify-end gap-3 border-t pt-6",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ T("button", {
|
|
357
271
|
type: "button",
|
|
358
272
|
onClick: () => {
|
|
359
|
-
Q(i(
|
|
273
|
+
Q(i(j));
|
|
360
274
|
},
|
|
361
|
-
disabled:
|
|
275
|
+
disabled: H,
|
|
362
276
|
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",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
364
|
-
}), /* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ w(ee, { size: 16 }), M("devportal.cancel", "Cancel")]
|
|
278
|
+
}), /* @__PURE__ */ w("button", {
|
|
365
279
|
type: "submit",
|
|
366
|
-
disabled:
|
|
280
|
+
disabled: H,
|
|
367
281
|
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",
|
|
368
|
-
children:
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
(
|
|
373
|
-
] }) : /* @__PURE__ */
|
|
282
|
+
children: H ? /* @__PURE__ */ T(C, { children: [
|
|
283
|
+
/* @__PURE__ */ w("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
284
|
+
B === "setting-up-billing" && M("devportal.settingUpBilling", "Setting up billing..."),
|
|
285
|
+
B === "linking-billing" && M("devportal.linkingBilling", "Linking billing..."),
|
|
286
|
+
(B === "creating-org" || B === "redirecting") && M("devportal.creating", "Creating...")
|
|
287
|
+
] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(y, { size: 16 }), M("devportal.createOrganization", "Create Organization")] })
|
|
374
288
|
})]
|
|
375
289
|
})
|
|
376
290
|
]
|
|
@@ -379,6 +293,6 @@ var T = () => {
|
|
|
379
293
|
});
|
|
380
294
|
};
|
|
381
295
|
//#endregion
|
|
382
|
-
export {
|
|
296
|
+
export { E as CreateOrganizationPage };
|
|
383
297
|
|
|
384
298
|
//# sourceMappingURL=CreateOrganizationPage.js.map
|