@mercurjs/vendor 2.0.2 → 2.1.0-canary.4

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.
Files changed (95) hide show
  1. package/dist/{[id]-TLZZ53G7.js → [id]-2HRWUMSJ.js} +2 -2
  2. package/dist/{[id]-DCCF7277.js → [id]-57VYN5YF.js} +2 -3
  3. package/dist/{[id]-UAOAQVEM.js → [id]-FWI6NCSF.js} +3 -4
  4. package/dist/{[id]-6WYSWXWC.js → [id]-IQNYVYZU.js} +1 -2
  5. package/dist/{[id]-LZPT5Y55.js → [id]-KCUHMQWF.js} +1 -2
  6. package/dist/{[id]-PHS2WYFX.js → [id]-LCMQBEOS.js} +2 -3
  7. package/dist/{[id]-OGHRZ2VY.js → [id]-LJJPLKJ6.js} +5 -4
  8. package/dist/{[id]-VKG2WEIR.js → [id]-M3PNP527.js} +1 -2
  9. package/dist/{[id]-EJAHMOOE.js → [id]-MZOT4GAO.js} +2 -3
  10. package/dist/{[id]-ENTJSLN2.js → [id]-RKEN7EEY.js} +3 -3
  11. package/dist/{[province_id]-XGA44S7P.js → [province_id]-2MRNXHKU.js} +1 -2
  12. package/dist/{add-7ZTE42IE.js → add-BVR3LDPH.js} +2 -2
  13. package/dist/{add-AKC7LTK3.js → add-W7ATBCKS.js} +2 -3
  14. package/dist/{add-customer-groups-BRC3DKQ2.js → add-customer-groups-ZZVSJJH3.js} +1 -2
  15. package/dist/{add-products-ZSULNZVI.js → add-products-PINICUAZ.js} +2 -3
  16. package/dist/{add-promotions-TNFVT5ST.js → add-promotions-2DFXTDEJ.js} +3 -3
  17. package/dist/{address-3DSJESKM.js → address-RNB2WQPM.js} +1 -2
  18. package/dist/{breadcrumb-ZMVHXCOX.js → breadcrumb-A3XUO3R2.js} +2 -3
  19. package/dist/{breadcrumb-UH7FAYU2.js → breadcrumb-MPXARU5F.js} +1 -2
  20. package/dist/{breadcrumb-D6QNYOAO.js → breadcrumb-Q5KJBAPD.js} +1 -2
  21. package/dist/{chunk-JRT2U4UI.js → chunk-2DUMXTKS.js} +107 -18
  22. package/dist/{chunk-CUMY2VZ5.js → chunk-5LKZCG77.js} +1 -96
  23. package/dist/{chunk-RV5UTYBG.js → chunk-EQQ3BLQ3.js} +2 -2
  24. package/dist/{chunk-RMBCBXWD.js → chunk-GQFNE5VL.js} +1 -1
  25. package/dist/chunk-HFRHHT36.js +98 -0
  26. package/dist/{chunk-O7E4KQAK.js → chunk-HFW7IIO2.js} +1 -1
  27. package/dist/{chunk-T7LEJIIM.js → chunk-PT3UQCSN.js} +1 -1
  28. package/dist/{chunk-LA6XSPQG.js → chunk-QDSNLU6X.js} +287 -309
  29. package/dist/chunk-TLE6YHGH.js +26 -0
  30. package/dist/{chunk-ASEVHHCT.js → chunk-UDG47AEE.js} +1 -1
  31. package/dist/{chunk-573EQEW2.js → chunk-V4SZIX7Q.js} +1 -1
  32. package/dist/{chunk-7XC7ZRG7.js → chunk-VTHSHOX4.js} +1 -1
  33. package/dist/{chunk-XZG2HZYW.js → chunk-WFE6CT6M.js} +1 -1
  34. package/dist/{chunk-N2WKLVUX.js → chunk-XF3W2U3Q.js} +1 -1
  35. package/dist/{chunk-NYRRRCJS.js → chunk-ZCJ737TR.js} +66 -21
  36. package/dist/{chunk-FNG7ZA7N.js → chunk-ZCUUV464.js} +1 -1
  37. package/dist/{collections-2M4RFH4P.js → collections-NNFGWUTW.js} +2 -3
  38. package/dist/{create-6IRE6AMF.js → create-2BPTTXLB.js} +8 -7
  39. package/dist/{create-D4F457BD.js → create-GCSVAMEH.js} +1 -2
  40. package/dist/{create-2TUWGQ2D.js → create-N3WNCW7U.js} +1 -2
  41. package/dist/{create-QK2SSLZK.js → create-T73PSKIV.js} +3 -4
  42. package/dist/{create-OF2OZ7EI.js → create-TXBY6W3X.js} +1 -2
  43. package/dist/{create-IFMEEHN4.js → create-VPG7P53M.js} +2 -3
  44. package/dist/{create-YITFTHMA.js → create-WY4KXB66.js} +1 -2
  45. package/dist/{create-3WUTLUJO.js → create-YCOR6HY3.js} +1 -2
  46. package/dist/{edit-SGEECDCR.js → edit-2QUFOE5S.js} +1 -2
  47. package/dist/{edit-Z7EZRPUP.js → edit-A5ZBINLU.js} +1 -1
  48. package/dist/{edit-QRJIWTU2.js → edit-B245OLC7.js} +1 -2
  49. package/dist/{edit-PIE7Y73J.js → edit-CPVFMQEI.js} +3 -4
  50. package/dist/{edit-ONSN756P.js → edit-CZOV6HBW.js} +1 -1
  51. package/dist/{edit-J5SC7GHQ.js → edit-KWSXWWOA.js} +1 -2
  52. package/dist/{edit-ZEIL7EQW.js → edit-QYKH2ZZA.js} +1 -2
  53. package/dist/{edit-UQAQVEUI.js → edit-U5VL2UQY.js} +4 -5
  54. package/dist/{edit-stocks-and-prices-543AYFDJ.js → edit-stocks-and-prices-Y233WVZ3.js} +1 -2
  55. package/dist/{fulfillment-5LNFBSBS.js → fulfillment-FBF3MITY.js} +1 -2
  56. package/dist/{fulfillment-providers-U7Z7QMOQ.js → fulfillment-providers-Y2YOREHX.js} +2 -3
  57. package/dist/index.css +32 -26
  58. package/dist/index.js +86 -87
  59. package/dist/invite-G7WOO5RZ.js +368 -0
  60. package/dist/{invite-SI2KIPWI.js → invite-Y2TACGCW.js} +3 -5
  61. package/dist/{login-QDS5UXKV.js → login-JU7R2RNN.js} +1 -2
  62. package/dist/{media-RDXCLPKQ.js → media-TXY3WBR3.js} +2 -2
  63. package/dist/{metadata-7JKDCVYY.js → metadata-7RA6MXW7.js} +1 -2
  64. package/dist/{metadata-ZV5RYLKR.js → metadata-GSBDSRNM.js} +1 -2
  65. package/dist/{metadata-X4UIPNL6.js → metadata-JXRXW6UQ.js} +1 -2
  66. package/dist/{metadata-W5XIPFVU.js → metadata-QM4UGMX5.js} +1 -2
  67. package/dist/{metadata-UKBRUFH2.js → metadata-RODKLIDO.js} +1 -2
  68. package/dist/onboarding-VF7EQAAA.js +893 -0
  69. package/dist/{orders-IAL3JNPU.js → orders-HKUVFCTQ.js} +2 -3
  70. package/dist/pages/index.d.ts +140 -140
  71. package/dist/pages/index.js +14 -13
  72. package/dist/{payment-details-ATUYMVJX.js → payment-details-VWR2S32W.js} +1 -2
  73. package/dist/{pricing-RBESFX5P.js → pricing-6UZ6SXIE.js} +1 -2
  74. package/dist/{product-tags-W4BL6RWV.js → product-tags-YXVFIPGQ.js} +3 -4
  75. package/dist/{product-variant-detail-KU5OCL7E.js → product-variant-detail-O2NOUFFC.js} +1 -2
  76. package/dist/{products-3VVYJUH7.js → products-3NIIOQBB.js} +2 -3
  77. package/dist/{products-YYLVCOOY.js → products-Z6MD665K.js} +10 -9
  78. package/dist/{professional-details-6Y5K6GBL.js → professional-details-SJ4AF5TM.js} +1 -2
  79. package/dist/{promotions-NBJTFP6N.js → promotions-PJABWGCP.js} +4 -4
  80. package/dist/{register-ZLE6MNPF.js → register-PSBM4NCS.js} +3 -4
  81. package/dist/{reset-password-PLCDLFL4.js → reset-password-4RE5TXQ5.js} +1 -1
  82. package/dist/{sales-channels-UIDLFCX6.js → sales-channels-2OVI6RTV.js} +3 -2
  83. package/dist/{sales-channels-UWPEFKAO.js → sales-channels-BKOYQXVC.js} +3 -2
  84. package/dist/{settings-5MNWE5CR.js → settings-F6KJREHK.js} +3 -4
  85. package/dist/{shipping-profiles-O7XB2DTE.js → shipping-profiles-AQMJSXDB.js} +1 -2
  86. package/dist/{stock-VJAAYYW5.js → stock-4G4WQIR7.js} +1 -2
  87. package/dist/{stock-2CGEFBXO.js → stock-NJADHNRP.js} +1 -2
  88. package/dist/{store-ZBSMNWFT.js → store-HJGETE33.js} +225 -105
  89. package/dist/{store-closure-43FK32AQ.js → store-closure-QPK4LBBZ.js} +35 -19
  90. package/dist/{store-select-Q2HE572R.js → store-select-XS2APMBI.js} +1 -2
  91. package/dist/{team-ZLZJJWIY.js → team-DZ5CV3LG.js} +1 -2
  92. package/package.json +5 -5
  93. package/dist/chunk-STBCWNZQ.js +0 -57
  94. package/dist/invite-P6HTOEIV.js +0 -301
  95. package/dist/onboarding-DLIBZRKE.js +0 -873
@@ -0,0 +1,893 @@
1
+ import {
2
+ HandleInput
3
+ } from "./chunk-TLE6YHGH.js";
4
+ import {
5
+ CountrySelect
6
+ } from "./chunk-V74Y5NIV.js";
7
+ import {
8
+ Form
9
+ } from "./chunk-3QSRE5LS.js";
10
+ import "./chunk-JRTZWK77.js";
11
+ import {
12
+ useCreateSellerAccount,
13
+ useSellers
14
+ } from "./chunk-ZCJ737TR.js";
15
+ import {
16
+ useLogout
17
+ } from "./chunk-F4OJN2F2.js";
18
+ import "./chunk-LRARA622.js";
19
+ import "./chunk-M6N4ISXL.js";
20
+ import "./chunk-S7EKBD2C.js";
21
+ import "./chunk-VXMOPVRH.js";
22
+ import "./chunk-IQWK723D.js";
23
+ import "./chunk-VV6IKGCN.js";
24
+ import "./chunk-PCMNEUMV.js";
25
+ import "./chunk-BOZJOOGW.js";
26
+ import "./chunk-RL7SFZOF.js";
27
+ import "./chunk-LWJF63JW.js";
28
+ import "./chunk-NBPMNUKZ.js";
29
+ import "./chunk-GCSQEJMD.js";
30
+ import "./chunk-VXWN37PT.js";
31
+ import "./chunk-UL4O5M4S.js";
32
+ import {
33
+ retrieveActiveStore,
34
+ storeQueryKeys,
35
+ useStore
36
+ } from "./chunk-FX4V5JCF.js";
37
+ import "./chunk-3B34B2M2.js";
38
+ import "./chunk-RUE5BPC2.js";
39
+ import "./chunk-ZEVYT6IX.js";
40
+ import "./chunk-A5DJIOHN.js";
41
+ import {
42
+ queryClient
43
+ } from "./chunk-RHKRREUU.js";
44
+ import "./chunk-ZA2KFUFR.js";
45
+ import "./chunk-RIN4CBRB.js";
46
+ import "./chunk-NBMM2TZK.js";
47
+
48
+ // src/pages/onboarding/loader.ts
49
+ var storeDetailQuery = () => ({
50
+ queryKey: storeQueryKeys.details(),
51
+ queryFn: async () => retrieveActiveStore()
52
+ });
53
+ var onboardingLoader = async () => {
54
+ const query = storeDetailQuery();
55
+ return queryClient.ensureQueryData(query);
56
+ };
57
+
58
+ // src/pages/onboarding/onboarding.tsx
59
+ import { useEffect as useEffect2 } from "react";
60
+ import { Navigate, useLocation } from "react-router-dom";
61
+
62
+ // src/components/onboarding-wizard/onboarding-wizard.tsx
63
+ import { AnimatePresence } from "motion/react";
64
+ import { useNavigate as useNavigate2 } from "react-router-dom";
65
+
66
+ // src/components/onboarding-wizard/wizard-sidebar.tsx
67
+ import { ChevronLeft } from "@medusajs/icons";
68
+ import { Text } from "@medusajs/ui";
69
+ import { useTranslation } from "react-i18next";
70
+
71
+ // src/components/onboarding-wizard/constants.ts
72
+ var WIZARD_STEPS = [
73
+ {
74
+ id: "store",
75
+ number: 1,
76
+ labelKey: "onboarding.wizard.steps.store"
77
+ },
78
+ {
79
+ id: "address",
80
+ number: 2,
81
+ labelKey: "onboarding.wizard.steps.address"
82
+ },
83
+ {
84
+ id: "company",
85
+ number: 3,
86
+ labelKey: "onboarding.wizard.steps.company"
87
+ },
88
+ {
89
+ id: "payment",
90
+ number: 4,
91
+ labelKey: "onboarding.wizard.steps.payment"
92
+ }
93
+ ];
94
+ var TOTAL_STEPS = WIZARD_STEPS.length;
95
+
96
+ // src/components/onboarding-wizard/wizard-sidebar.tsx
97
+ import { jsx, jsxs } from "react/jsx-runtime";
98
+ var WizardSidebar = ({
99
+ currentStep,
100
+ onBack,
101
+ showBack,
102
+ children
103
+ }) => {
104
+ const { t } = useTranslation();
105
+ return /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col lg:w-[584px] lg:shrink-0 h-full bg-ui-bg-base border-r border-ui-border-base overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col p-8 lg:px-14 lg:py-12", children: [
106
+ showBack && onBack && /* @__PURE__ */ jsxs(
107
+ "button",
108
+ {
109
+ type: "button",
110
+ onClick: onBack,
111
+ className: "txt-compact-small text-ui-fg-base flex items-center gap-x-0.5 font-medium transition-colors hover:text-ui-fg-subtle self-start mb-6",
112
+ children: [
113
+ /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" }),
114
+ /* @__PURE__ */ jsx("span", { children: t("actions.back") })
115
+ ]
116
+ }
117
+ ),
118
+ /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle mb-1", children: t("onboarding.wizard.stepOf", {
119
+ current: currentStep + 1,
120
+ total: TOTAL_STEPS
121
+ }) }),
122
+ children
123
+ ] }) });
124
+ };
125
+
126
+ // src/components/onboarding-wizard/wizard-preview.tsx
127
+ import { useEffect } from "react";
128
+ import { jsx as jsx2 } from "react/jsx-runtime";
129
+ var STEP_IMAGES = {
130
+ 0: "/onboarding/1.png",
131
+ 1: "/onboarding/2.png",
132
+ 2: "/onboarding/3.png",
133
+ 3: "/onboarding/4.png"
134
+ };
135
+ var preloadImages = () => {
136
+ Object.values(STEP_IMAGES).forEach((src) => {
137
+ const img = new Image();
138
+ img.src = src;
139
+ });
140
+ };
141
+ var WizardPreview = ({ currentStep }) => {
142
+ useEffect(preloadImages, []);
143
+ const image = STEP_IMAGES[currentStep];
144
+ return /* @__PURE__ */ jsx2(
145
+ "div",
146
+ {
147
+ className: "hidden lg:flex flex-1 relative overflow-hidden items-center justify-center",
148
+ style: { backgroundImage: "url(/onboarding/bg.svg)", backgroundSize: "cover", backgroundPosition: "center" },
149
+ children: /* @__PURE__ */ jsx2(
150
+ "img",
151
+ {
152
+ src: image,
153
+ alt: "",
154
+ className: "w-[75%] max-h-[75%] object-contain"
155
+ }
156
+ )
157
+ }
158
+ );
159
+ };
160
+
161
+ // src/components/onboarding-wizard/wizard-step.tsx
162
+ import { motion } from "motion/react";
163
+ import { jsx as jsx3 } from "react/jsx-runtime";
164
+ var stepVariants = {
165
+ initial: { opacity: 0, y: 12, filter: "blur(4px)" },
166
+ animate: { opacity: 1, y: 0, filter: "blur(0px)" },
167
+ exit: {
168
+ opacity: 0,
169
+ y: -8,
170
+ filter: "blur(4px)",
171
+ transition: { duration: 0.2, ease: [0.23, 1, 0.32, 1] }
172
+ }
173
+ };
174
+ var WizardStep = ({ children }) => {
175
+ return /* @__PURE__ */ jsx3(
176
+ motion.div,
177
+ {
178
+ variants: stepVariants,
179
+ initial: "initial",
180
+ animate: "animate",
181
+ exit: "exit",
182
+ transition: { duration: 0.35, ease: [0.23, 1, 0.32, 1] },
183
+ className: "flex flex-col",
184
+ children
185
+ }
186
+ );
187
+ };
188
+
189
+ // src/components/onboarding-wizard/hooks/use-onboarding.ts
190
+ import { useState, useCallback, useRef } from "react";
191
+ import { useNavigate } from "react-router-dom";
192
+ import { toast } from "@medusajs/ui";
193
+ var useOnboarding = (memberEmail) => {
194
+ const navigate = useNavigate();
195
+ const [currentStep, setCurrentStep] = useState(0);
196
+ const [isSubmitting, setIsSubmitting] = useState(false);
197
+ const sellerIdRef = useRef(null);
198
+ const [sellerIdState, setSellerIdState] = useState(null);
199
+ const setSellerId = (id) => {
200
+ sellerIdRef.current = id;
201
+ setSellerIdState(id);
202
+ };
203
+ const storeDataRef = useRef(null);
204
+ const addressDataRef = useRef(null);
205
+ const companyDataRef = useRef(null);
206
+ const { mutateAsync: createSeller, isPending: isCreating } = useCreateSellerAccount();
207
+ const isPending = isCreating || isSubmitting;
208
+ const submitStoreStep = useCallback(async (data) => {
209
+ storeDataRef.current = data;
210
+ setCurrentStep(1);
211
+ }, []);
212
+ const submitAddressStep = useCallback(async (data) => {
213
+ addressDataRef.current = data;
214
+ setCurrentStep(2);
215
+ }, []);
216
+ const skipAddressStep = useCallback(() => {
217
+ addressDataRef.current = null;
218
+ setCurrentStep(2);
219
+ }, []);
220
+ const submitCompanyStep = useCallback(async (data) => {
221
+ companyDataRef.current = data;
222
+ setCurrentStep(3);
223
+ }, []);
224
+ const skipCompanyStep = useCallback(() => {
225
+ companyDataRef.current = null;
226
+ setCurrentStep(3);
227
+ }, []);
228
+ const createSellerWithAllData = useCallback(
229
+ async (paymentData) => {
230
+ const storeData = storeDataRef.current;
231
+ if (!storeData) return;
232
+ if (sellerIdRef.current) {
233
+ navigate("/store-select", { replace: true });
234
+ return;
235
+ }
236
+ const addressData = addressDataRef.current;
237
+ const companyData = companyDataRef.current;
238
+ const hasCompanyData = companyData?.corporate_name || companyData?.registration_number || companyData?.tax_id;
239
+ const isUS = paymentData?.country_code === "us";
240
+ try {
241
+ setIsSubmitting(true);
242
+ const result = await createSeller({
243
+ name: storeData.name,
244
+ handle: storeData.handle || void 0,
245
+ email: storeData.email,
246
+ member_email: memberEmail,
247
+ currency_code: storeData.currency_code.toLowerCase(),
248
+ description: storeData.description || void 0,
249
+ address: addressData ? {
250
+ address_1: addressData.address_1 || void 0,
251
+ address_2: addressData.address_2 || void 0,
252
+ postal_code: addressData.postal_code || void 0,
253
+ city: addressData.city || void 0,
254
+ country_code: addressData.country_code,
255
+ province: addressData.province || void 0
256
+ } : void 0,
257
+ professional_details: hasCompanyData ? {
258
+ corporate_name: companyData.corporate_name || void 0,
259
+ registration_number: companyData.registration_number || void 0,
260
+ tax_id: companyData.tax_id || void 0
261
+ } : void 0,
262
+ payment_details: paymentData ? {
263
+ country_code: paymentData.country_code,
264
+ holder_name: paymentData.holder_name,
265
+ iban: isUS ? null : paymentData.iban || null,
266
+ bic: isUS ? null : paymentData.bic || null,
267
+ routing_number: isUS ? paymentData.routing_number || null : null,
268
+ account_number: isUS ? null : paymentData.account_number || null
269
+ } : void 0
270
+ });
271
+ const newSellerId = result.seller.id;
272
+ setSellerId(newSellerId);
273
+ navigate("/store-select", { replace: true });
274
+ } catch (error) {
275
+ toast.error(error.message);
276
+ } finally {
277
+ setIsSubmitting(false);
278
+ }
279
+ },
280
+ [createSeller, memberEmail, navigate]
281
+ );
282
+ const submitPaymentStep = useCallback(
283
+ async (data) => {
284
+ await createSellerWithAllData(data);
285
+ },
286
+ [createSellerWithAllData]
287
+ );
288
+ const skipPaymentStep = useCallback(async () => {
289
+ await createSellerWithAllData();
290
+ }, [createSellerWithAllData]);
291
+ const goBack = useCallback(() => {
292
+ if (currentStep > 0) {
293
+ setCurrentStep((prev) => prev - 1);
294
+ }
295
+ }, [currentStep]);
296
+ return {
297
+ currentStep,
298
+ totalSteps: TOTAL_STEPS,
299
+ sellerId: sellerIdState,
300
+ isPending,
301
+ canGoBack: currentStep > 0,
302
+ goBack,
303
+ submitStoreStep,
304
+ submitAddressStep,
305
+ skipAddressStep,
306
+ submitCompanyStep,
307
+ skipCompanyStep,
308
+ submitPaymentStep,
309
+ skipPaymentStep
310
+ };
311
+ };
312
+
313
+ // src/components/onboarding-wizard/steps/store-step.tsx
314
+ import { zodResolver } from "@hookform/resolvers/zod";
315
+ import { Button, Heading, Input, Select, Textarea } from "@medusajs/ui";
316
+ import i18n from "i18next";
317
+ import { useForm } from "react-hook-form";
318
+ import { useTranslation as useTranslation2 } from "react-i18next";
319
+ import { useLoaderData } from "react-router-dom";
320
+ import * as z from "zod";
321
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
322
+ var StoreStepSchema = z.object({
323
+ name: z.string().min(1, i18n.t("onboarding.wizard.validation.nameRequired")),
324
+ email: z.string().email(i18n.t("onboarding.wizard.validation.emailInvalid")),
325
+ currency_code: z.string().min(1, i18n.t("onboarding.wizard.validation.currencyRequired")),
326
+ description: z.string().optional(),
327
+ handle: z.string().optional()
328
+ });
329
+ var StoreStep = ({ onSubmit, isPending }) => {
330
+ const { t } = useTranslation2();
331
+ const initialData = useLoaderData();
332
+ const { store } = useStore(void 0, { initialData });
333
+ const form = useForm({
334
+ resolver: zodResolver(StoreStepSchema),
335
+ defaultValues: {
336
+ name: "",
337
+ email: "",
338
+ currency_code: "",
339
+ description: "",
340
+ handle: ""
341
+ }
342
+ });
343
+ const handleSubmit = form.handleSubmit(async (data) => {
344
+ await onSubmit(data);
345
+ });
346
+ return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-y-8", children: [
347
+ /* @__PURE__ */ jsx4(Heading, { level: "h2", className: "text-ui-fg-base text-lg", children: t("onboarding.wizard.store.title") }),
348
+ /* @__PURE__ */ jsx4(Form, { ...form, children: /* @__PURE__ */ jsxs2("form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-6", children: [
349
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-y-4", children: [
350
+ /* @__PURE__ */ jsx4(
351
+ Form.Field,
352
+ {
353
+ control: form.control,
354
+ name: "name",
355
+ render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { children: [
356
+ /* @__PURE__ */ jsx4(Form.Label, { children: t("onboarding.wizard.store.name") }),
357
+ /* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(Input, { autoComplete: "organization", ...field }) }),
358
+ /* @__PURE__ */ jsx4(Form.ErrorMessage, {})
359
+ ] })
360
+ }
361
+ ),
362
+ /* @__PURE__ */ jsx4(
363
+ Form.Field,
364
+ {
365
+ control: form.control,
366
+ name: "email",
367
+ render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { children: [
368
+ /* @__PURE__ */ jsx4(Form.Label, { children: t("onboarding.wizard.store.email") }),
369
+ /* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(Input, { type: "email", autoComplete: "email", ...field }) }),
370
+ /* @__PURE__ */ jsx4(Form.ErrorMessage, {})
371
+ ] })
372
+ }
373
+ ),
374
+ /* @__PURE__ */ jsx4(
375
+ Form.Field,
376
+ {
377
+ control: form.control,
378
+ name: "description",
379
+ render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { children: [
380
+ /* @__PURE__ */ jsx4(Form.Label, { optional: true, children: t("fields.description") }),
381
+ /* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(Textarea, { ...field }) }),
382
+ /* @__PURE__ */ jsx4(Form.ErrorMessage, {})
383
+ ] })
384
+ }
385
+ ),
386
+ /* @__PURE__ */ jsx4(
387
+ Form.Field,
388
+ {
389
+ control: form.control,
390
+ name: "handle",
391
+ render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { children: [
392
+ /* @__PURE__ */ jsx4(Form.Label, { optional: true, children: t("onboarding.wizard.store.handle") }),
393
+ /* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(HandleInput, { ...field }) }),
394
+ /* @__PURE__ */ jsx4(Form.ErrorMessage, {})
395
+ ] })
396
+ }
397
+ ),
398
+ /* @__PURE__ */ jsx4(
399
+ Form.Field,
400
+ {
401
+ control: form.control,
402
+ name: "currency_code",
403
+ render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs2(Form.Item, { children: [
404
+ /* @__PURE__ */ jsx4(Form.Label, { children: t("onboarding.wizard.store.currency") }),
405
+ /* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsxs2(Select, { ...field, onValueChange: onChange, children: [
406
+ /* @__PURE__ */ jsx4(Select.Trigger, { ref, children: /* @__PURE__ */ jsx4(
407
+ Select.Value,
408
+ {
409
+ placeholder: t("onboarding.wizard.store.selectCurrency")
410
+ }
411
+ ) }),
412
+ /* @__PURE__ */ jsx4(Select.Content, { children: store?.supported_currencies?.map((sc) => /* @__PURE__ */ jsx4(
413
+ Select.Item,
414
+ {
415
+ value: sc.currency_code,
416
+ children: sc.currency_code.toUpperCase()
417
+ },
418
+ sc.currency_code
419
+ )) })
420
+ ] }) }),
421
+ /* @__PURE__ */ jsx4(Form.ErrorMessage, {})
422
+ ] })
423
+ }
424
+ )
425
+ ] }),
426
+ /* @__PURE__ */ jsx4(Button, { type: "submit", className: "w-full", isLoading: isPending, children: t("actions.continue") })
427
+ ] }) })
428
+ ] });
429
+ };
430
+
431
+ // src/components/onboarding-wizard/steps/address-step.tsx
432
+ import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
433
+ import { Button as Button2, Heading as Heading2, Input as Input2 } from "@medusajs/ui";
434
+ import i18n2 from "i18next";
435
+ import { useForm as useForm2 } from "react-hook-form";
436
+ import { useTranslation as useTranslation3 } from "react-i18next";
437
+ import * as z2 from "zod";
438
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
439
+ var AddressStepSchema = z2.object({
440
+ address_1: z2.string().optional(),
441
+ address_2: z2.string().optional(),
442
+ postal_code: z2.string().optional(),
443
+ city: z2.string().optional(),
444
+ country_code: z2.string().min(1, i18n2.t("onboarding.wizard.validation.countryRequired")),
445
+ province: z2.string().optional()
446
+ });
447
+ var AddressStep = ({ onSubmit, onSkip, isPending }) => {
448
+ const { t } = useTranslation3();
449
+ const form = useForm2({
450
+ resolver: zodResolver2(AddressStepSchema),
451
+ defaultValues: {
452
+ address_1: "",
453
+ address_2: "",
454
+ postal_code: "",
455
+ city: "",
456
+ country_code: "",
457
+ province: ""
458
+ }
459
+ });
460
+ const handleSubmit = form.handleSubmit(async (data) => {
461
+ await onSubmit(data);
462
+ });
463
+ return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-8", children: [
464
+ /* @__PURE__ */ jsx5(Heading2, { level: "h2", className: "text-ui-fg-base text-lg", children: t("onboarding.wizard.address.title") }),
465
+ /* @__PURE__ */ jsx5(Form, { ...form, children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-6", children: [
466
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-4", children: [
467
+ /* @__PURE__ */ jsx5(
468
+ Form.Field,
469
+ {
470
+ control: form.control,
471
+ name: "address_1",
472
+ render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { children: [
473
+ /* @__PURE__ */ jsx5(Form.Label, { optional: true, children: t("onboarding.wizard.address.address") }),
474
+ /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(Input2, { autoComplete: "address-line1", ...field }) }),
475
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
476
+ ] })
477
+ }
478
+ ),
479
+ /* @__PURE__ */ jsx5(
480
+ Form.Field,
481
+ {
482
+ control: form.control,
483
+ name: "address_2",
484
+ render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { children: [
485
+ /* @__PURE__ */ jsx5(Form.Label, { optional: true, children: t("onboarding.wizard.address.address2") }),
486
+ /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(Input2, { autoComplete: "address-line2", ...field }) }),
487
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
488
+ ] })
489
+ }
490
+ ),
491
+ /* @__PURE__ */ jsx5(
492
+ Form.Field,
493
+ {
494
+ control: form.control,
495
+ name: "postal_code",
496
+ render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { children: [
497
+ /* @__PURE__ */ jsx5(Form.Label, { optional: true, children: t("onboarding.wizard.address.postalCode") }),
498
+ /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(Input2, { autoComplete: "postal-code", ...field }) }),
499
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
500
+ ] })
501
+ }
502
+ ),
503
+ /* @__PURE__ */ jsx5(
504
+ Form.Field,
505
+ {
506
+ control: form.control,
507
+ name: "city",
508
+ render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { children: [
509
+ /* @__PURE__ */ jsx5(Form.Label, { optional: true, children: t("onboarding.wizard.address.city") }),
510
+ /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(Input2, { autoComplete: "address-level2", ...field }) }),
511
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
512
+ ] })
513
+ }
514
+ ),
515
+ /* @__PURE__ */ jsx5(
516
+ Form.Field,
517
+ {
518
+ control: form.control,
519
+ name: "country_code",
520
+ render: ({ field: { onChange, ref: _ref, ...field } }) => /* @__PURE__ */ jsxs3(Form.Item, { children: [
521
+ /* @__PURE__ */ jsx5(Form.Label, { children: t("onboarding.wizard.address.country") }),
522
+ /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(CountrySelect, { ...field, onChange }) }),
523
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
524
+ ] })
525
+ }
526
+ ),
527
+ /* @__PURE__ */ jsx5(
528
+ Form.Field,
529
+ {
530
+ control: form.control,
531
+ name: "province",
532
+ render: ({ field }) => /* @__PURE__ */ jsxs3(Form.Item, { children: [
533
+ /* @__PURE__ */ jsx5(Form.Label, { optional: true, children: t("onboarding.wizard.address.state") }),
534
+ /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(Input2, { autoComplete: "address-level1", ...field }) }),
535
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
536
+ ] })
537
+ }
538
+ )
539
+ ] }),
540
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-2", children: [
541
+ /* @__PURE__ */ jsx5(Button2, { type: "submit", className: "w-full", isLoading: isPending, children: t("actions.continue") }),
542
+ /* @__PURE__ */ jsx5(
543
+ Button2,
544
+ {
545
+ type: "button",
546
+ variant: "transparent",
547
+ className: "w-full",
548
+ onClick: onSkip,
549
+ children: t("onboarding.wizard.skip")
550
+ }
551
+ )
552
+ ] })
553
+ ] }) })
554
+ ] });
555
+ };
556
+
557
+ // src/components/onboarding-wizard/steps/company-step.tsx
558
+ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
559
+ import { Button as Button3, Heading as Heading3, Input as Input3 } from "@medusajs/ui";
560
+ import { useForm as useForm3 } from "react-hook-form";
561
+ import { useTranslation as useTranslation4 } from "react-i18next";
562
+ import * as z3 from "zod";
563
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
564
+ var CompanyStepSchema = z3.object({
565
+ corporate_name: z3.string().optional(),
566
+ registration_number: z3.string().optional(),
567
+ tax_id: z3.string().optional()
568
+ });
569
+ var CompanyStep = ({ onSubmit, onSkip, isPending }) => {
570
+ const { t } = useTranslation4();
571
+ const form = useForm3({
572
+ resolver: zodResolver3(CompanyStepSchema),
573
+ defaultValues: {
574
+ corporate_name: "",
575
+ registration_number: "",
576
+ tax_id: ""
577
+ }
578
+ });
579
+ const handleSubmit = form.handleSubmit(async (data) => {
580
+ await onSubmit(data);
581
+ });
582
+ return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-8", children: [
583
+ /* @__PURE__ */ jsx6(Heading3, { level: "h2", className: "text-ui-fg-base text-lg", children: t("onboarding.wizard.company.title") }),
584
+ /* @__PURE__ */ jsx6(Form, { ...form, children: /* @__PURE__ */ jsxs4("form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-6", children: [
585
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-4", children: [
586
+ /* @__PURE__ */ jsx6(
587
+ Form.Field,
588
+ {
589
+ control: form.control,
590
+ name: "corporate_name",
591
+ render: ({ field }) => /* @__PURE__ */ jsxs4(Form.Item, { children: [
592
+ /* @__PURE__ */ jsx6(Form.Label, { optional: true, children: t("onboarding.wizard.company.corporateName") }),
593
+ /* @__PURE__ */ jsx6(Form.Control, { children: /* @__PURE__ */ jsx6(Input3, { ...field }) }),
594
+ /* @__PURE__ */ jsx6(Form.ErrorMessage, {})
595
+ ] })
596
+ }
597
+ ),
598
+ /* @__PURE__ */ jsx6(
599
+ Form.Field,
600
+ {
601
+ control: form.control,
602
+ name: "registration_number",
603
+ render: ({ field }) => /* @__PURE__ */ jsxs4(Form.Item, { children: [
604
+ /* @__PURE__ */ jsx6(Form.Label, { optional: true, children: t("onboarding.wizard.company.registrationNumber") }),
605
+ /* @__PURE__ */ jsx6(Form.Control, { children: /* @__PURE__ */ jsx6(Input3, { ...field }) }),
606
+ /* @__PURE__ */ jsx6(Form.ErrorMessage, {})
607
+ ] })
608
+ }
609
+ ),
610
+ /* @__PURE__ */ jsx6(
611
+ Form.Field,
612
+ {
613
+ control: form.control,
614
+ name: "tax_id",
615
+ render: ({ field }) => /* @__PURE__ */ jsxs4(Form.Item, { children: [
616
+ /* @__PURE__ */ jsx6(Form.Label, { optional: true, children: t("onboarding.wizard.company.taxId") }),
617
+ /* @__PURE__ */ jsx6(Form.Control, { children: /* @__PURE__ */ jsx6(Input3, { ...field }) }),
618
+ /* @__PURE__ */ jsx6(Form.ErrorMessage, {})
619
+ ] })
620
+ }
621
+ )
622
+ ] }),
623
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-2", children: [
624
+ /* @__PURE__ */ jsx6(Button3, { type: "submit", className: "w-full", isLoading: isPending, children: t("actions.continue") }),
625
+ /* @__PURE__ */ jsx6(
626
+ Button3,
627
+ {
628
+ type: "button",
629
+ variant: "transparent",
630
+ className: "w-full",
631
+ onClick: onSkip,
632
+ children: t("onboarding.wizard.skip")
633
+ }
634
+ )
635
+ ] })
636
+ ] }) })
637
+ ] });
638
+ };
639
+
640
+ // src/components/onboarding-wizard/steps/payment-step.tsx
641
+ import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
642
+ import { Button as Button4, Heading as Heading4, Input as Input4 } from "@medusajs/ui";
643
+ import i18n3 from "i18next";
644
+ import { useForm as useForm4 } from "react-hook-form";
645
+ import { useTranslation as useTranslation5 } from "react-i18next";
646
+ import * as z4 from "zod";
647
+ import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
648
+ var PaymentStepSchema = z4.object({
649
+ country_code: z4.string().min(1, i18n3.t("onboarding.wizard.validation.countryRequired")),
650
+ holder_name: z4.string().min(1, i18n3.t("onboarding.wizard.validation.accountNameRequired")),
651
+ iban: z4.string().optional(),
652
+ bic: z4.string().optional(),
653
+ routing_number: z4.string().optional(),
654
+ account_number: z4.string().optional()
655
+ });
656
+ var PaymentStep = ({
657
+ onSubmit,
658
+ onSkip,
659
+ isPending
660
+ }) => {
661
+ const { t } = useTranslation5();
662
+ const form = useForm4({
663
+ resolver: zodResolver4(PaymentStepSchema),
664
+ defaultValues: {
665
+ country_code: "",
666
+ holder_name: "",
667
+ iban: "",
668
+ bic: "",
669
+ routing_number: "",
670
+ account_number: ""
671
+ }
672
+ });
673
+ const selectedCountry = form.watch("country_code");
674
+ const isUS = selectedCountry === "us";
675
+ const handleSubmit = form.handleSubmit(async (data) => {
676
+ await onSubmit(data);
677
+ });
678
+ return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-y-8", children: [
679
+ /* @__PURE__ */ jsx7(Heading4, { level: "h2", className: "text-ui-fg-base text-lg", children: t("onboarding.wizard.payment.title") }),
680
+ /* @__PURE__ */ jsx7(Form, { ...form, children: /* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-6", children: [
681
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-y-4", children: [
682
+ /* @__PURE__ */ jsx7(
683
+ Form.Field,
684
+ {
685
+ control: form.control,
686
+ name: "country_code",
687
+ render: ({ field: { onChange, ref: _ref, ...field } }) => /* @__PURE__ */ jsxs5(Form.Item, { children: [
688
+ /* @__PURE__ */ jsx7(Form.Label, { children: t("onboarding.wizard.address.country") }),
689
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(CountrySelect, { ...field, onChange }) }),
690
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
691
+ ] })
692
+ }
693
+ ),
694
+ selectedCountry && /* @__PURE__ */ jsxs5(Fragment, { children: [
695
+ /* @__PURE__ */ jsx7(
696
+ Form.Field,
697
+ {
698
+ control: form.control,
699
+ name: "holder_name",
700
+ render: ({ field }) => /* @__PURE__ */ jsxs5(Form.Item, { children: [
701
+ /* @__PURE__ */ jsx7(Form.Label, { children: t("onboarding.wizard.payment.accountName") }),
702
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(Input4, { ...field }) }),
703
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
704
+ ] })
705
+ }
706
+ ),
707
+ isUS ? /* @__PURE__ */ jsxs5(Fragment, { children: [
708
+ /* @__PURE__ */ jsx7(
709
+ Form.Field,
710
+ {
711
+ control: form.control,
712
+ name: "account_number",
713
+ render: ({ field }) => /* @__PURE__ */ jsxs5(Form.Item, { children: [
714
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("onboarding.wizard.payment.accountNumber") }),
715
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(Input4, { ...field }) }),
716
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
717
+ ] })
718
+ }
719
+ ),
720
+ /* @__PURE__ */ jsx7(
721
+ Form.Field,
722
+ {
723
+ control: form.control,
724
+ name: "routing_number",
725
+ render: ({ field }) => /* @__PURE__ */ jsxs5(Form.Item, { children: [
726
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("onboarding.wizard.payment.achRoutingNumber") }),
727
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(Input4, { ...field }) }),
728
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
729
+ ] })
730
+ }
731
+ )
732
+ ] }) : /* @__PURE__ */ jsxs5(Fragment, { children: [
733
+ /* @__PURE__ */ jsx7(
734
+ Form.Field,
735
+ {
736
+ control: form.control,
737
+ name: "iban",
738
+ render: ({ field }) => /* @__PURE__ */ jsxs5(Form.Item, { children: [
739
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("onboarding.wizard.payment.iban") }),
740
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(Input4, { ...field }) }),
741
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
742
+ ] })
743
+ }
744
+ ),
745
+ /* @__PURE__ */ jsx7(
746
+ Form.Field,
747
+ {
748
+ control: form.control,
749
+ name: "account_number",
750
+ render: ({ field }) => /* @__PURE__ */ jsxs5(Form.Item, { children: [
751
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("onboarding.wizard.payment.accountNumber") }),
752
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(Input4, { ...field }) }),
753
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
754
+ ] })
755
+ }
756
+ ),
757
+ /* @__PURE__ */ jsx7(
758
+ Form.Field,
759
+ {
760
+ control: form.control,
761
+ name: "bic",
762
+ render: ({ field }) => /* @__PURE__ */ jsxs5(Form.Item, { children: [
763
+ /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("onboarding.wizard.payment.swiftBic") }),
764
+ /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(Input4, { ...field }) }),
765
+ /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
766
+ ] })
767
+ }
768
+ )
769
+ ] })
770
+ ] })
771
+ ] }),
772
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-y-2", children: [
773
+ /* @__PURE__ */ jsx7(Button4, { type: "submit", className: "w-full", isLoading: isPending, children: t("actions.continue") }),
774
+ /* @__PURE__ */ jsx7(
775
+ Button4,
776
+ {
777
+ type: "button",
778
+ variant: "transparent",
779
+ className: "w-full",
780
+ onClick: onSkip,
781
+ children: t("onboarding.wizard.skip")
782
+ }
783
+ )
784
+ ] })
785
+ ] }) })
786
+ ] });
787
+ };
788
+
789
+ // src/components/onboarding-wizard/onboarding-wizard.tsx
790
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
791
+ var OnboardingWizard = ({ memberEmail }) => {
792
+ const navigate = useNavigate2();
793
+ const { mutateAsync: logoutMutation } = useLogout();
794
+ const { seller_members } = useSellers();
795
+ const hasStores = (seller_members?.length ?? 0) > 0;
796
+ const {
797
+ currentStep,
798
+ sellerId,
799
+ isPending,
800
+ goBack,
801
+ submitStoreStep,
802
+ submitAddressStep,
803
+ skipAddressStep,
804
+ submitCompanyStep,
805
+ skipCompanyStep,
806
+ submitPaymentStep,
807
+ skipPaymentStep
808
+ } = useOnboarding(memberEmail);
809
+ const handleBack = async () => {
810
+ if (currentStep === 0) {
811
+ if (hasStores) {
812
+ navigate("/store-select", { replace: true });
813
+ } else {
814
+ await logoutMutation(void 0, {
815
+ onSuccess: () => queryClient.clear(),
816
+ onSettled: () => navigate("/login")
817
+ });
818
+ }
819
+ } else {
820
+ goBack();
821
+ }
822
+ };
823
+ const renderStep = () => {
824
+ switch (currentStep) {
825
+ case 0:
826
+ return /* @__PURE__ */ jsx8(WizardStep, { children: /* @__PURE__ */ jsx8(StoreStep, { onSubmit: submitStoreStep, isPending }) }, "store");
827
+ case 1:
828
+ return /* @__PURE__ */ jsx8(WizardStep, { children: /* @__PURE__ */ jsx8(
829
+ AddressStep,
830
+ {
831
+ onSubmit: submitAddressStep,
832
+ onSkip: skipAddressStep,
833
+ isPending
834
+ }
835
+ ) }, "address");
836
+ case 2:
837
+ return /* @__PURE__ */ jsx8(WizardStep, { children: /* @__PURE__ */ jsx8(
838
+ CompanyStep,
839
+ {
840
+ onSubmit: submitCompanyStep,
841
+ onSkip: skipCompanyStep,
842
+ isPending
843
+ }
844
+ ) }, "company");
845
+ case 3:
846
+ return /* @__PURE__ */ jsx8(WizardStep, { children: /* @__PURE__ */ jsx8(
847
+ PaymentStep,
848
+ {
849
+ sellerId,
850
+ onSubmit: submitPaymentStep,
851
+ onSkip: skipPaymentStep,
852
+ isPending
853
+ }
854
+ ) }, "payment");
855
+ default:
856
+ return null;
857
+ }
858
+ };
859
+ return /* @__PURE__ */ jsxs6("div", { className: "flex h-dvh w-dvw overflow-hidden", children: [
860
+ /* @__PURE__ */ jsx8(
861
+ WizardSidebar,
862
+ {
863
+ currentStep,
864
+ onBack: handleBack,
865
+ showBack: true,
866
+ children: /* @__PURE__ */ jsx8(AnimatePresence, { mode: "wait", children: renderStep() })
867
+ }
868
+ ),
869
+ /* @__PURE__ */ jsx8(WizardPreview, { currentStep })
870
+ ] });
871
+ };
872
+
873
+ // src/pages/onboarding/onboarding.tsx
874
+ import { jsx as jsx9 } from "react/jsx-runtime";
875
+ var ONBOARDING_EMAIL_KEY = "mercur_onboarding_email";
876
+ var Onboarding = () => {
877
+ const location = useLocation();
878
+ const stateEmail = location.state?.email;
879
+ useEffect2(() => {
880
+ if (stateEmail) {
881
+ sessionStorage.setItem(ONBOARDING_EMAIL_KEY, stateEmail);
882
+ }
883
+ }, [stateEmail]);
884
+ const email = stateEmail || sessionStorage.getItem(ONBOARDING_EMAIL_KEY) || "";
885
+ if (!email) {
886
+ return /* @__PURE__ */ jsx9(Navigate, { to: "/login", replace: true });
887
+ }
888
+ return /* @__PURE__ */ jsx9(OnboardingWizard, { memberEmail: email });
889
+ };
890
+ export {
891
+ Onboarding as Component,
892
+ onboardingLoader as loader
893
+ };