@burdenoff/microfe-devportal 2026.915.1 → 2026.915.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/devportal/hooks/index.d.ts +1 -0
- package/dist/devportal/hooks/index.d.ts.map +1 -1
- package/dist/devportal/hooks/index.js +1 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.d.ts +28 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.d.ts.map +1 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.js +32 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.js.map +1 -0
- package/dist/devportal/pages/CreateOrganizationPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.js +141 -129
- 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 +312 -299
- package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
export { apolloClient, parseGraphQLError, getErrorMessage, isAuthError, isValidationError, clearApolloCache, resetApolloStore, type GraphQLErrorInfo, } from './useGraphQL';
|
|
7
7
|
export { DevPortalProvider } from './DevPortalProvider';
|
|
8
8
|
export { useDevportalPermission } from './usePermission';
|
|
9
|
+
export { useCarrierPickupLocations, capitalizeCarrierName, type CarrierPickupLocation, type UseCarrierPickupLocationsResult, } from './useCarrierPickupLocations';
|
|
9
10
|
export * from '../../generated/global-operations';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/devportal/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/devportal/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,GACrC,MAAM,6BAA6B,CAAC;AAGrC,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One of a shipping carrier's own registered pickup/warehouse addresses.
|
|
3
|
+
* Not organization-scoped — a pickup location belongs to whichever carrier
|
|
4
|
+
* account it's registered with (Shiprocket today; more carriers may be
|
|
5
|
+
* added later, each contributing their own locations).
|
|
6
|
+
*
|
|
7
|
+
* Backs the "Pickup Pincode" selector on the org creation form and the
|
|
8
|
+
* Fulfillment settings tab — sellers pick one of these instead of typing an
|
|
9
|
+
* arbitrary pincode that checkout would later refuse to ship (see
|
|
10
|
+
* global-store-svc's CarrierPickupUnavailableError / BOFF-7192).
|
|
11
|
+
*/
|
|
12
|
+
export interface CarrierPickupLocation {
|
|
13
|
+
label: string;
|
|
14
|
+
postalCode: string;
|
|
15
|
+
/** Which carrier this address is registered with, e.g. "shiprocket". */
|
|
16
|
+
carrier: string;
|
|
17
|
+
}
|
|
18
|
+
/** "shiprocket" -> "Shiprocket" — for display in the pickup-location dropdown. */
|
|
19
|
+
export declare function capitalizeCarrierName(carrier: string): string;
|
|
20
|
+
export interface UseCarrierPickupLocationsResult {
|
|
21
|
+
/** Registered pickup locations, or [] when Shiprocket isn't configured, the
|
|
22
|
+
* lookup fails, or the actor isn't authenticated yet — callers should fall
|
|
23
|
+
* back to a free-text pincode field in that case, never block on it. */
|
|
24
|
+
locations: CarrierPickupLocation[];
|
|
25
|
+
loading: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function useCarrierPickupLocations(): UseCarrierPickupLocationsResult;
|
|
28
|
+
//# sourceMappingURL=useCarrierPickupLocations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCarrierPickupLocations.d.ts","sourceRoot":"","sources":["../../../src/devportal/hooks/useCarrierPickupLocations.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;CACjB;AAYD,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED,MAAM,WAAW,+BAA+B;IAC9C;;4EAEwE;IACxE,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,yBAAyB,IAAI,+BAA+B,CA4B3E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
import { graphqlFetch as n } from "@burdenoff/fe-libs/shared/graphql";
|
|
3
|
+
//#region src/devportal/hooks/useCarrierPickupLocations.ts
|
|
4
|
+
var r = "\n query DevportalCarrierPickupLocations {\n carrierPickupLocations {\n label\n postalCode\n carrier\n }\n }\n";
|
|
5
|
+
function i(e) {
|
|
6
|
+
return e.length > 0 ? e[0].toUpperCase() + e.slice(1) : e;
|
|
7
|
+
}
|
|
8
|
+
function a() {
|
|
9
|
+
let [i, a] = t([]), [o, s] = t(!0);
|
|
10
|
+
return e(() => {
|
|
11
|
+
let e = !1;
|
|
12
|
+
return n({
|
|
13
|
+
gateway: "global",
|
|
14
|
+
query: r
|
|
15
|
+
}).then((t) => {
|
|
16
|
+
e || a(t.data?.carrierPickupLocations ?? []);
|
|
17
|
+
}).catch(() => {
|
|
18
|
+
e || a([]);
|
|
19
|
+
}).finally(() => {
|
|
20
|
+
e || s(!1);
|
|
21
|
+
}), () => {
|
|
22
|
+
e = !0;
|
|
23
|
+
};
|
|
24
|
+
}, []), {
|
|
25
|
+
locations: i,
|
|
26
|
+
loading: o
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { i as capitalizeCarrierName, a as useCarrierPickupLocations };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=useCarrierPickupLocations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCarrierPickupLocations.js","names":[],"sources":["../../../src/devportal/hooks/useCarrierPickupLocations.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { graphqlFetch } from \"@burdenoff/fe-libs/shared/graphql\";\n\n/**\n * One of a shipping carrier's own registered pickup/warehouse addresses.\n * Not organization-scoped — a pickup location belongs to whichever carrier\n * account it's registered with (Shiprocket today; more carriers may be\n * added later, each contributing their own locations).\n *\n * Backs the \"Pickup Pincode\" selector on the org creation form and the\n * Fulfillment settings tab — sellers pick one of these instead of typing an\n * arbitrary pincode that checkout would later refuse to ship (see\n * global-store-svc's CarrierPickupUnavailableError / BOFF-7192).\n */\nexport interface CarrierPickupLocation {\n label: string;\n postalCode: string;\n /** Which carrier this address is registered with, e.g. \"shiprocket\". */\n carrier: string;\n}\n\nconst CARRIER_PICKUP_LOCATIONS_QUERY = `\n query DevportalCarrierPickupLocations {\n carrierPickupLocations {\n label\n postalCode\n carrier\n }\n }\n`;\n\n/** \"shiprocket\" -> \"Shiprocket\" — for display in the pickup-location dropdown. */\nexport function capitalizeCarrierName(carrier: string): string {\n return carrier.length > 0\n ? carrier[0].toUpperCase() + carrier.slice(1)\n : carrier;\n}\n\nexport interface UseCarrierPickupLocationsResult {\n /** Registered pickup locations, or [] when Shiprocket isn't configured, the\n * lookup fails, or the actor isn't authenticated yet — callers should fall\n * back to a free-text pincode field in that case, never block on it. */\n locations: CarrierPickupLocation[];\n loading: boolean;\n}\n\nexport function useCarrierPickupLocations(): UseCarrierPickupLocationsResult {\n const [locations, setLocations] = useState<CarrierPickupLocation[]>([]);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n let cancelled = false;\n\n graphqlFetch<{ carrierPickupLocations: CarrierPickupLocation[] }>({\n gateway: \"global\",\n query: CARRIER_PICKUP_LOCATIONS_QUERY,\n })\n .then((result) => {\n if (cancelled) return;\n setLocations(result.data?.carrierPickupLocations ?? []);\n })\n .catch(() => {\n if (!cancelled) setLocations([]);\n })\n .finally(() => {\n if (!cancelled) setLoading(false);\n });\n\n return () => {\n cancelled = true;\n };\n }, []);\n\n return { locations, loading };\n}\n"],"mappings":";;;AAqBA,IAAM,IAAiC;AAWvC,SAAgB,EAAsB,GAAyB;AAC7D,QAAO,EAAQ,SAAS,IACpB,EAAQ,GAAG,aAAa,GAAG,EAAQ,MAAM,EAAE,GAC3C;;AAWN,SAAgB,IAA6D;CAC3E,IAAM,CAAC,GAAW,KAAgB,EAAkC,EAAE,CAAC,EACjE,CAAC,GAAS,KAAc,EAAS,GAAK;AAyB5C,QAvBA,QAAgB;EACd,IAAI,IAAY;AAiBhB,SAfA,EAAkE;GAChE,SAAS;GACT,OAAO;GACR,CAAC,CACC,MAAM,MAAW;AACZ,QACJ,EAAa,EAAO,MAAM,0BAA0B,EAAE,CAAC;IACvD,CACD,YAAY;AACX,GAAK,KAAW,EAAa,EAAE,CAAC;IAChC,CACD,cAAc;AACb,GAAK,KAAW,EAAW,GAAM;IACjC,QAES;AACX,OAAY;;IAEb,EAAE,CAAC,EAEC;EAAE;EAAW;EAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrganizationPage.d.ts","sourceRoot":"","sources":["../../../src/devportal/pages/CreateOrganizationPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateOrganizationPage.d.ts","sourceRoot":"","sources":["../../../src/devportal/pages/CreateOrganizationPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAuDhC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAqmBpC,CAAC"}
|
|
@@ -3,36 +3,37 @@ 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
5
|
import { orgSectionPath as i, useIsSellerSection as a } from "../hooks/useIsSellerSection.js";
|
|
6
|
-
import { useCreateBillingAccountMutation as
|
|
7
|
-
import { PageLayout as
|
|
8
|
-
import { InputField as
|
|
9
|
-
import { PermissionGuard as
|
|
6
|
+
import { useCreateBillingAccountMutation as ee, useCreateOrganizationMutation as te, useCreateSellerOrganizationMutation as o, useGetBillingAccountsByOrgQuery as s, useLinkDevOrgBillingAccountMutation as c } from "../../generated/global-operations.js";
|
|
7
|
+
import { PageLayout as l, PageSection as u } from "../components/PageLayout.js";
|
|
8
|
+
import { InputField as d, SelectField as f, TextareaField as p } from "../components/FormField.js";
|
|
9
|
+
import { PermissionGuard as m } from "../components/PermissionGuard.js";
|
|
10
10
|
import "../components/index.js";
|
|
11
|
+
import { capitalizeCarrierName as h, useCarrierPickupLocations as g } from "../hooks/useCarrierPickupLocations.js";
|
|
11
12
|
import "../hooks/index.js";
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { Building2 as
|
|
13
|
+
import { useEffect as _, useMemo as v, useState as y } from "react";
|
|
14
|
+
import { Building2 as ne, Check as b, Link2 as re, Loader2 as x, X as S } from "lucide-react";
|
|
14
15
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
15
16
|
//#region src/devportal/pages/CreateOrganizationPage.tsx
|
|
16
17
|
var E = () => {
|
|
17
|
-
let { navigate: E, basePath: D, currentUser: O, tenantId:
|
|
18
|
+
let { navigate: E, basePath: D, currentUser: O, tenantId: ie, setActiveOrgId: ae, setActivePhysicalOrgId: k } = e(), A = a(), j = t(), [M, N] = y({}), [P] = te(), [F] = o(), [I] = ee(), [L] = c(), R = r(), [z, B] = y("idle"), V = z !== "idle", [H, U] = y("auto"), [W, G] = y(null), { data: K, loading: q } = s({
|
|
18
19
|
fetchPolicy: "cache-and-network",
|
|
19
|
-
context: { headers: { "x-org-id":
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
if (!(
|
|
23
|
-
if (
|
|
24
|
-
|
|
20
|
+
context: { headers: { "x-org-id": ie ?? "" } }
|
|
21
|
+
}), J = v(() => K?.getBillingAccountsByOrg ?? [], [K]);
|
|
22
|
+
_(() => {
|
|
23
|
+
if (!(H !== "existing" || q)) {
|
|
24
|
+
if (J.length === 0) {
|
|
25
|
+
U("auto");
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
W || G(J.find((e) => e.isDefault)?.id ?? J[0]?.id ?? null);
|
|
28
29
|
}
|
|
29
30
|
}, [
|
|
30
|
-
|
|
31
|
+
H,
|
|
32
|
+
q,
|
|
31
33
|
J,
|
|
32
|
-
|
|
33
|
-
G
|
|
34
|
+
W
|
|
34
35
|
]);
|
|
35
|
-
let [
|
|
36
|
+
let [Y, X] = y({
|
|
36
37
|
name: "",
|
|
37
38
|
slug: "",
|
|
38
39
|
description: "",
|
|
@@ -40,208 +41,219 @@ var E = () => {
|
|
|
40
41
|
contactEmail: "",
|
|
41
42
|
supportEmail: "",
|
|
42
43
|
pickupPostalCode: ""
|
|
43
|
-
}), Q = (e) => {
|
|
44
|
+
}), { locations: Z } = g(), Q = (e) => {
|
|
44
45
|
E?.(`${D}${e}`);
|
|
45
|
-
},
|
|
46
|
+
}, oe = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), se = (e) => {
|
|
46
47
|
let t = e.target.value;
|
|
47
|
-
|
|
48
|
+
X((e) => ({
|
|
48
49
|
...e,
|
|
49
50
|
name: t,
|
|
50
|
-
slug: e.slug ||
|
|
51
|
-
})),
|
|
51
|
+
slug: e.slug || oe(t)
|
|
52
|
+
})), M.name && N((e) => ({
|
|
52
53
|
...e,
|
|
53
54
|
name: void 0
|
|
54
55
|
}));
|
|
55
56
|
}, $ = (e, t) => {
|
|
56
|
-
|
|
57
|
+
X((n) => ({
|
|
57
58
|
...n,
|
|
58
59
|
[e]: t
|
|
59
|
-
})),
|
|
60
|
+
})), M[e] && N((t) => ({
|
|
60
61
|
...t,
|
|
61
62
|
[e]: void 0
|
|
62
63
|
}));
|
|
63
|
-
},
|
|
64
|
+
}, ce = () => {
|
|
64
65
|
let e = {};
|
|
65
|
-
return
|
|
66
|
+
return Y.name.trim() ? Y.name.length < 2 ? e.name = j("devportal.orgNameTooShort", "Name must be at least 2 characters") : Y.name.length > 100 && (e.name = j("devportal.nameTooLong", "Name must be less than 100 characters")) : e.name = j("devportal.orgNameRequired", "Organization name is required"), Y.slug.trim() ? /^[a-z0-9-]+$/.test(Y.slug) || (e.slug = j("devportal.slugInvalid", "Slug can only contain lowercase letters, numbers, and hyphens")) : e.slug = j("devportal.slugRequired", "Slug is required"), Y.contactEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Y.contactEmail) && (e.contactEmail = j("devportal.invalidEmailAddress", "Invalid email address")), Y.supportEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Y.supportEmail) && (e.supportEmail = j("devportal.invalidEmailAddress", "Invalid email address")), N(e), Object.keys(e).length === 0;
|
|
66
67
|
};
|
|
67
|
-
return /* @__PURE__ */ w(
|
|
68
|
+
return /* @__PURE__ */ w(m, {
|
|
68
69
|
authOnly: !0,
|
|
69
|
-
children: /* @__PURE__ */ w(
|
|
70
|
-
title:
|
|
71
|
-
description:
|
|
72
|
-
purpose:
|
|
73
|
-
backLink: `${D}${i(
|
|
74
|
-
backLabel:
|
|
70
|
+
children: /* @__PURE__ */ w(l, {
|
|
71
|
+
title: j("devportal.createOrganization", "Create Organization"),
|
|
72
|
+
description: A ? j("devportal.createSellerOrganizationDescription", "Set up a seller organization to start selling physical products") : j("devportal.createOrganizationDescription", "Set up a developer organization to collaborate with your team"),
|
|
73
|
+
purpose: A ? j("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.") : j("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."),
|
|
74
|
+
backLink: `${D}${i(A)}`,
|
|
75
|
+
backLabel: j("devportal.backToOrganizations", "Back to Organizations"),
|
|
75
76
|
children: /* @__PURE__ */ T("form", {
|
|
76
77
|
onSubmit: async (e) => {
|
|
77
|
-
if (e.preventDefault(),
|
|
78
|
-
|
|
78
|
+
if (e.preventDefault(), ce()) {
|
|
79
|
+
B("creating-org");
|
|
79
80
|
try {
|
|
80
81
|
let e = {
|
|
81
|
-
name:
|
|
82
|
-
slug:
|
|
83
|
-
description:
|
|
84
|
-
websiteUrl:
|
|
85
|
-
contactEmail:
|
|
86
|
-
supportEmail:
|
|
87
|
-
pickupPostalCode:
|
|
88
|
-
}, t =
|
|
82
|
+
name: Y.name,
|
|
83
|
+
slug: Y.slug || void 0,
|
|
84
|
+
description: Y.description || void 0,
|
|
85
|
+
websiteUrl: Y.websiteUrl || void 0,
|
|
86
|
+
contactEmail: Y.contactEmail || void 0,
|
|
87
|
+
supportEmail: Y.supportEmail || void 0,
|
|
88
|
+
pickupPostalCode: A && Y.pickupPostalCode.trim() || void 0
|
|
89
|
+
}, t = A ? (await F({ variables: { input: e } })).data?.createSellerOrganization?.id : (await P({ variables: { input: e } })).data?.createDeveloperOrganization?.id;
|
|
89
90
|
if (!t) {
|
|
90
|
-
|
|
91
|
+
B("idle");
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
|
-
if (
|
|
94
|
+
if (R.emit("devportal.org.created", {
|
|
94
95
|
organizationId: t,
|
|
95
|
-
name:
|
|
96
|
-
}),
|
|
97
|
-
|
|
96
|
+
name: Y.name
|
|
97
|
+
}), A ? k(t) : ae(t), H === "existing" && W) {
|
|
98
|
+
B("linking-billing");
|
|
98
99
|
try {
|
|
99
|
-
await
|
|
100
|
+
await L({ variables: {
|
|
100
101
|
organizationId: t,
|
|
101
|
-
billingAccountId:
|
|
102
|
+
billingAccountId: W
|
|
102
103
|
} });
|
|
103
104
|
} catch {}
|
|
104
105
|
} else {
|
|
105
|
-
|
|
106
|
+
B("setting-up-billing");
|
|
106
107
|
try {
|
|
107
|
-
let e = (await
|
|
108
|
-
name:
|
|
108
|
+
let e = (await I({ variables: { input: {
|
|
109
|
+
name: Y.name,
|
|
109
110
|
email: O?.email ?? ""
|
|
110
111
|
} } })).data?.createBillingAccount?.id;
|
|
111
|
-
e && await
|
|
112
|
+
e && await L({ variables: {
|
|
112
113
|
organizationId: t,
|
|
113
114
|
billingAccountId: e
|
|
114
115
|
} });
|
|
115
116
|
} catch {}
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
+
B("redirecting"), Q(i(A, t));
|
|
118
119
|
} catch (e) {
|
|
119
|
-
console.error("Failed to create organization:", e),
|
|
120
|
+
console.error("Failed to create organization:", e), B("idle");
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
},
|
|
123
124
|
className: "space-y-8 max-w-3xl",
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */ w(
|
|
126
|
-
title:
|
|
127
|
-
description:
|
|
126
|
+
/* @__PURE__ */ w(u, {
|
|
127
|
+
title: j("devportal.organizationDetails", "Organization Details"),
|
|
128
|
+
description: j("devportal.organizationDetailsDescription", "Basic information about your organization"),
|
|
128
129
|
children: /* @__PURE__ */ T("div", {
|
|
129
130
|
className: "space-y-4",
|
|
130
131
|
children: [
|
|
131
|
-
/* @__PURE__ */ w(
|
|
132
|
-
label:
|
|
133
|
-
value:
|
|
134
|
-
onChange:
|
|
135
|
-
placeholder:
|
|
132
|
+
/* @__PURE__ */ w(d, {
|
|
133
|
+
label: j("devportal.organizationName", "Organization Name"),
|
|
134
|
+
value: Y.name,
|
|
135
|
+
onChange: se,
|
|
136
|
+
placeholder: j("devportal.organizationNamePlaceholder", "Acme Development"),
|
|
136
137
|
required: !0,
|
|
137
|
-
error:
|
|
138
|
-
hint:
|
|
138
|
+
error: M.name,
|
|
139
|
+
hint: j("devportal.organizationNameHint", "Your organization's display name")
|
|
139
140
|
}),
|
|
140
|
-
/* @__PURE__ */ w(
|
|
141
|
-
label:
|
|
142
|
-
value:
|
|
141
|
+
/* @__PURE__ */ w(d, {
|
|
142
|
+
label: j("devportal.slug", "Slug"),
|
|
143
|
+
value: Y.slug,
|
|
143
144
|
onChange: (e) => $("slug", e.target.value.toLowerCase()),
|
|
144
|
-
placeholder:
|
|
145
|
+
placeholder: j("devportal.orgSlugPlaceholder", "acme-dev"),
|
|
145
146
|
required: !0,
|
|
146
|
-
error:
|
|
147
|
-
hint:
|
|
147
|
+
error: M.slug,
|
|
148
|
+
hint: j("devportal.slugHint", "URL-friendly identifier (auto-generated from name)")
|
|
148
149
|
}),
|
|
149
|
-
/* @__PURE__ */ w(
|
|
150
|
-
label:
|
|
151
|
-
value:
|
|
150
|
+
/* @__PURE__ */ w(p, {
|
|
151
|
+
label: j("devportal.description", "Description"),
|
|
152
|
+
value: Y.description,
|
|
152
153
|
onChange: (e) => $("description", e.target.value),
|
|
153
|
-
placeholder:
|
|
154
|
+
placeholder: j("devportal.orgDescriptionPlaceholder", "Tell us about your organization..."),
|
|
154
155
|
rows: 3
|
|
155
156
|
}),
|
|
156
|
-
/* @__PURE__ */ w(
|
|
157
|
-
label:
|
|
157
|
+
/* @__PURE__ */ w(d, {
|
|
158
|
+
label: j("devportal.websiteUrl", "Website URL"),
|
|
158
159
|
type: "url",
|
|
159
|
-
value:
|
|
160
|
+
value: Y.websiteUrl,
|
|
160
161
|
onChange: (e) => $("websiteUrl", e.target.value),
|
|
161
162
|
placeholder: "https://example.com"
|
|
162
163
|
}),
|
|
163
|
-
|
|
164
|
-
label:
|
|
165
|
-
value:
|
|
164
|
+
A && Z.length > 0 && /* @__PURE__ */ w(f, {
|
|
165
|
+
label: j("devportal.pickupPostalCode", "Pickup Pincode (optional)"),
|
|
166
|
+
value: Y.pickupPostalCode,
|
|
167
|
+
onChange: (e) => $("pickupPostalCode", e.target.value),
|
|
168
|
+
placeholder: j("devportal.pickupPostalCodeUseBilling", "Use billing account address"),
|
|
169
|
+
options: Z.map((e) => ({
|
|
170
|
+
value: e.postalCode,
|
|
171
|
+
label: `${e.label} — ${e.postalCode} · ${h(e.carrier)}`
|
|
172
|
+
})),
|
|
173
|
+
hint: j("devportal.pickupPostalCodeHint", "The postal code your physical orders actually ship from — used to quote real carrier shipping rates. You can skip this now and set it later from organization settings.")
|
|
174
|
+
}),
|
|
175
|
+
A && Z.length === 0 && /* @__PURE__ */ w(d, {
|
|
176
|
+
label: j("devportal.pickupPostalCode", "Pickup Pincode (optional)"),
|
|
177
|
+
value: Y.pickupPostalCode,
|
|
166
178
|
onChange: (e) => $("pickupPostalCode", e.target.value),
|
|
167
179
|
placeholder: "560001",
|
|
168
|
-
hint:
|
|
180
|
+
hint: j("devportal.pickupPostalCodeHintFallback", "The postal code your physical orders actually ship from — used to quote real carrier shipping rates. You can skip this now and set it later from organization settings. (Live pickup-location list unavailable — enter your pincode manually.)")
|
|
169
181
|
}),
|
|
170
182
|
/* @__PURE__ */ T("div", {
|
|
171
183
|
className: "grid gap-4 sm:grid-cols-2",
|
|
172
|
-
children: [/* @__PURE__ */ w(
|
|
173
|
-
label:
|
|
184
|
+
children: [/* @__PURE__ */ w(d, {
|
|
185
|
+
label: j("devportal.contactEmail", "Contact Email"),
|
|
174
186
|
type: "email",
|
|
175
|
-
value:
|
|
187
|
+
value: Y.contactEmail,
|
|
176
188
|
onChange: (e) => $("contactEmail", e.target.value),
|
|
177
189
|
placeholder: "contact@example.com",
|
|
178
|
-
error:
|
|
179
|
-
}), /* @__PURE__ */ w(
|
|
180
|
-
label:
|
|
190
|
+
error: M.contactEmail
|
|
191
|
+
}), /* @__PURE__ */ w(d, {
|
|
192
|
+
label: j("devportal.supportEmail", "Support Email"),
|
|
181
193
|
type: "email",
|
|
182
|
-
value:
|
|
194
|
+
value: Y.supportEmail,
|
|
183
195
|
onChange: (e) => $("supportEmail", e.target.value),
|
|
184
196
|
placeholder: "support@example.com",
|
|
185
|
-
error:
|
|
197
|
+
error: M.supportEmail
|
|
186
198
|
})]
|
|
187
199
|
})
|
|
188
200
|
]
|
|
189
201
|
})
|
|
190
202
|
}),
|
|
191
|
-
/* @__PURE__ */ w(
|
|
192
|
-
title:
|
|
193
|
-
description:
|
|
203
|
+
/* @__PURE__ */ w(u, {
|
|
204
|
+
title: j("devportal.billingAccount", "Billing Account"),
|
|
205
|
+
description: j("devportal.billingAccountSectionDescription", "Revenue from sales will be credited here. You can change this anytime from the Revenue page."),
|
|
194
206
|
children: /* @__PURE__ */ T("div", {
|
|
195
207
|
className: "space-y-3",
|
|
196
208
|
children: [
|
|
197
209
|
/* @__PURE__ */ T("button", {
|
|
198
210
|
type: "button",
|
|
199
|
-
onClick: () =>
|
|
200
|
-
disabled:
|
|
201
|
-
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",
|
|
211
|
+
onClick: () => U("auto"),
|
|
212
|
+
disabled: V,
|
|
213
|
+
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", H === "auto" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
|
|
202
214
|
children: [/* @__PURE__ */ w(b, {
|
|
203
215
|
size: 16,
|
|
204
|
-
className: n("mt-0.5 flex-shrink-0",
|
|
216
|
+
className: n("mt-0.5 flex-shrink-0", H === "auto" ? "opacity-100 text-primary" : "opacity-0")
|
|
205
217
|
}), /* @__PURE__ */ T("div", {
|
|
206
218
|
className: "flex-1 min-w-0",
|
|
207
219
|
children: [/* @__PURE__ */ w("p", {
|
|
208
220
|
className: "text-sm font-medium",
|
|
209
|
-
children:
|
|
221
|
+
children: j("devportal.billingAutoCreate", "Create a new billing account automatically")
|
|
210
222
|
}), /* @__PURE__ */ w("p", {
|
|
211
223
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
212
|
-
children:
|
|
224
|
+
children: j("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.")
|
|
213
225
|
})]
|
|
214
226
|
})]
|
|
215
227
|
}),
|
|
216
228
|
/* @__PURE__ */ T("button", {
|
|
217
229
|
type: "button",
|
|
218
|
-
onClick: () =>
|
|
219
|
-
disabled:
|
|
220
|
-
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",
|
|
230
|
+
onClick: () => U("existing"),
|
|
231
|
+
disabled: V || !q && J.length === 0,
|
|
232
|
+
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", H === "existing" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
|
|
221
233
|
children: [/* @__PURE__ */ w(b, {
|
|
222
234
|
size: 16,
|
|
223
|
-
className: n("mt-0.5 flex-shrink-0",
|
|
235
|
+
className: n("mt-0.5 flex-shrink-0", H === "existing" ? "opacity-100 text-primary" : "opacity-0")
|
|
224
236
|
}), /* @__PURE__ */ T("div", {
|
|
225
237
|
className: "flex-1 min-w-0",
|
|
226
238
|
children: [/* @__PURE__ */ T("p", {
|
|
227
239
|
className: "flex items-center gap-1.5 text-sm font-medium",
|
|
228
|
-
children: [/* @__PURE__ */ w(
|
|
240
|
+
children: [/* @__PURE__ */ w(re, { size: 14 }), j("devportal.billingLinkExisting", "Link an existing billing account")]
|
|
229
241
|
}), /* @__PURE__ */ w("p", {
|
|
230
242
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
231
|
-
children:
|
|
243
|
+
children: q ? j("devportal.billingAccountsLoading", "Loading your billing accounts...") : J.length === 0 ? j("devportal.noBillingAccountsYet", "You don't have any billing accounts yet — create one from account billing settings first.") : j("devportal.billingAccountsAvailable", "{{count}} billing account(s) available to link", { count: J.length })
|
|
232
244
|
})]
|
|
233
245
|
})]
|
|
234
246
|
}),
|
|
235
|
-
|
|
247
|
+
H === "existing" && J.length > 0 && /* @__PURE__ */ w("div", {
|
|
236
248
|
className: "ml-8 space-y-2",
|
|
237
|
-
children:
|
|
249
|
+
children: J.map((e) => /* @__PURE__ */ T("button", {
|
|
238
250
|
type: "button",
|
|
239
|
-
disabled:
|
|
240
|
-
onClick: () =>
|
|
241
|
-
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",
|
|
251
|
+
disabled: V,
|
|
252
|
+
onClick: () => G(e.id ?? null),
|
|
253
|
+
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", W === e.id ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
|
|
242
254
|
children: [/* @__PURE__ */ w(b, {
|
|
243
255
|
size: 14,
|
|
244
|
-
className: n("flex-shrink-0",
|
|
256
|
+
className: n("flex-shrink-0", W === e.id ? "opacity-100 text-primary" : "opacity-0")
|
|
245
257
|
}), /* @__PURE__ */ T("div", {
|
|
246
258
|
className: "min-w-0 flex-1",
|
|
247
259
|
children: [/* @__PURE__ */ w("p", {
|
|
@@ -249,7 +261,7 @@ var E = () => {
|
|
|
249
261
|
children: e.name
|
|
250
262
|
}), e.isDefault && /* @__PURE__ */ w("p", {
|
|
251
263
|
className: "text-xs text-text-secondary",
|
|
252
|
-
children:
|
|
264
|
+
children: j("devportal.revenue.defaultAccount", "Default")
|
|
253
265
|
})]
|
|
254
266
|
})]
|
|
255
267
|
}, e.id))
|
|
@@ -257,17 +269,17 @@ var E = () => {
|
|
|
257
269
|
]
|
|
258
270
|
})
|
|
259
271
|
}),
|
|
260
|
-
|
|
272
|
+
V && /* @__PURE__ */ T("div", {
|
|
261
273
|
className: "flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3 text-sm text-text-secondary",
|
|
262
274
|
children: [
|
|
263
|
-
/* @__PURE__ */ w(
|
|
275
|
+
/* @__PURE__ */ w(x, {
|
|
264
276
|
size: 16,
|
|
265
277
|
className: "flex-shrink-0 animate-spin text-primary"
|
|
266
278
|
}),
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
279
|
+
z === "creating-org" && j("devportal.creatingOrgStatus", "Creating your organization..."),
|
|
280
|
+
z === "setting-up-billing" && j("devportal.settingUpBillingStatus", "Setting up your billing account..."),
|
|
281
|
+
z === "linking-billing" && j("devportal.linkingBillingStatus", "Linking your billing account..."),
|
|
282
|
+
z === "redirecting" && j("devportal.redirectingStatus", "All set — redirecting...")
|
|
271
283
|
]
|
|
272
284
|
}),
|
|
273
285
|
/* @__PURE__ */ T("div", {
|
|
@@ -275,21 +287,21 @@ var E = () => {
|
|
|
275
287
|
children: [/* @__PURE__ */ T("button", {
|
|
276
288
|
type: "button",
|
|
277
289
|
onClick: () => {
|
|
278
|
-
Q(i(
|
|
290
|
+
Q(i(A));
|
|
279
291
|
},
|
|
280
|
-
disabled:
|
|
292
|
+
disabled: V,
|
|
281
293
|
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",
|
|
282
|
-
children: [/* @__PURE__ */ w(
|
|
294
|
+
children: [/* @__PURE__ */ w(S, { size: 16 }), j("devportal.cancel", "Cancel")]
|
|
283
295
|
}), /* @__PURE__ */ w("button", {
|
|
284
296
|
type: "submit",
|
|
285
|
-
disabled:
|
|
297
|
+
disabled: V,
|
|
286
298
|
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",
|
|
287
|
-
children:
|
|
299
|
+
children: V ? /* @__PURE__ */ T(C, { children: [
|
|
288
300
|
/* @__PURE__ */ w("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
(
|
|
292
|
-
] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(
|
|
301
|
+
z === "setting-up-billing" && j("devportal.settingUpBilling", "Setting up billing..."),
|
|
302
|
+
z === "linking-billing" && j("devportal.linkingBilling", "Linking billing..."),
|
|
303
|
+
(z === "creating-org" || z === "redirecting") && j("devportal.creating", "Creating...")
|
|
304
|
+
] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(ne, { size: 16 }), j("devportal.createOrganization", "Create Organization")] })
|
|
293
305
|
})]
|
|
294
306
|
})
|
|
295
307
|
]
|